You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
assets download: let API clients ask the phone for expired WhatsApp media #65
I run Beeper Server 4.3.284 headless with CLI 0.6.4 and a WhatsApp on-device account. A small service of mine downloads voice notes through the API and transcribes them. Recent notes work. Anything older than a few weeks fails, every time:
502 Failed to download asset: Transfer failed for localmxc://local-whatsapp/<id>:
downloadFileWithParams failed: Media is no longer available on WhatsApp servers and must be re-requested from your phone
I get the same error from POST /v1/assets/download and from beeper media download. Retrying minutes later changes nothing, and the phone stays online the whole time.
The bridge can already fix this. In mautrix-whatsapp, pkg/connector/directmedia.go sends a media retry request to the phone on a 403/404/410, but only when the download params carry com.beeper.interactive_download_request: "true" (or when direct_media_auto_request is on). Beeper's media manager sets that param from an interactive argument. The app UI passes true through downloadMediaInteractive. The /v1/assets/download handler calls getAsset(url, fileInfo) without it, so API clients always send "false". Appending ?com.beeper.interactive_download_request=true to the URL gets ignored.
How I ran into it: I paged a long WhatsApp chat back with GET /v1/chats/{chatID}/messages, which asks the phone for older history, and the text came back as far as March. That range held 222 voice notes. The 4 from the last few days downloaded. The other 218 all failed with the error above.
What I'd like is an opt-in field that passes the flag through:
POST /v1/assets/download
{ "url": "localmxc://...", "interactive": true }
The same option on /v1/assets/serve and a --interactive flag on beeper media download would cover the CLI. I'd keep it opt-in, since every call makes the phone re-upload a file. My script would call it once per note with a pause in between.
Related: beeper/desktop-api-mcp#3 asks for on-demand history. For WhatsApp text, paging back already gets you there. Media is the part API clients can't reach yet.
Activity