Repository navigation
Conversation
- new `media <chat> [id]` command: downloads the newest (or a given) voice note / media / image message. Media URLs are fetched with the ic3 token; the output extension is derived from the content type (webm/mp4/jpg/png). - new `file <chat> [match]` command: downloads file attachments by file-name substring or message id, riding the pre-authed tempauth link (with an explicit expired-link hint on 403). - `messages` no longer drops media/file/image-only messages: they now render marker rows (`[voice note 28s β media id β¦]`, `[file: β¦]`, `[image 800w β img id β¦]`), and captioned images get an inline `[image β¦]` marker appended. Previously a photo-only message was invisible in `messages` output entirely. - extractors (extractMedia / extractImage / extractFile) are exported and unit-tested against real message shapes. Validated against live Teams traffic: voice-note downloads are byte-identical to the browser blob, and image downloads are byte-identical to a manual object-URL fetch.
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds media/file/image downloads to the CLI, and stops
messagesfrom silently dropping media-only messages.teams media <chat> [id]β downloads the newest (or a given) voice note / media / image message. The playable/viewable object URL is fetched with the ic3 token; the output extension is derived from the response content type (webm/mp4/jpg/png).teams file <chat> [match]β downloads file attachments by file-name substring or message id, riding the pre-authed tempauth link (botFileProperties.url, SharePointobjectUrlfallback). A 403 gets an explicit hint that tempauth links expire shortly after sending and the file needs re-sharing.messagesmarker rows β media/file/image-only messages previously produced emptystripHtmlcontent and were dropped from the output entirely (an image-only message was invisible in the conversation read). They now render[voice note 28s β media id β¦],[file: report.pdf β file id β¦],[image 800w β img id β¦], and captioned images get an inline[image β¦]marker appended to the text.extractMedia/extractImage/extractFile) are exported fromformatting.tsand unit-tested against real message payloads.Where the URLs come from
properties.cardsJSON βcontent.media[0].url(β¦/v1/objects/<ref>/views/audio), duration parsed from thePT..Sstring.<img src="β¦/v1/objects/<ref>/views/imgo">inside the message content (with&unescaped, width captured when present).properties.filesJSON.Validation
Tested against live Teams traffic: voice-note downloads come back byte-identical to the browser blob, and image downloads come back byte-identical to a manual object-URL fetch with the same bearer token. 14 new unit tests (106 total, all green);
biome checkclean;tsupbuild clean.Notes
getToken("ic3")accessor.<img>tag carries one ([image 800w β¦], else?).