Skip to content

fix: resolve episode audio from the podcast feed - #8

Open
ofa1 wants to merge 1 commit into
mainfrom
fix/feed-based-audio-lookup
Open

fix: resolve episode audio from the podcast feed#8
ofa1 wants to merge 1 commit into
mainfrom
fix/feed-based-audio-lookup

Conversation

@ofa1

@ofa1 ofa1 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

The cron has thrown on every run for ~24h (114 consecutive exceptions,
none before that). The latest episode was published as a .wav, so
PowerPress rendered a link-only player instead of an HTML5 one, and the
audio source selector in getAudioUrl matched nothing.

Reading the media URL out of theme output meant any rendering change
could break the pipeline. The podcast feed carries the same URL in its
tag, which is a stable contract, so getEnclosure replaces
getHTML/getAudioUrl and src/audio.ts goes away along with the cheerio
dependency.

The feed also declares the file size, which fixes a second latent bug:
sendTelegramAudio buffered the whole file via arrayBuffer(), so the
current 104 MB episode would exhaust the 128 MB isolate long before the
50 MB guard fired. Files at or under 20 MB are now handed to Telegram as
a URL and never pass through the worker; larger ones still buffer. The
Blob content type is derived from the file extension rather than being
hardcoded to audio/mpeg.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_014pdQQY5i3n8hCfmmRV93Gy

The cron has thrown on every run for ~24h (114 consecutive exceptions,
none before that). The latest episode was published as a .wav, so
PowerPress rendered a link-only player instead of an HTML5 one, and the
`audio source` selector in getAudioUrl matched nothing.

Reading the media URL out of theme output meant any rendering change
could break the pipeline. The podcast feed carries the same URL in its
<enclosure> tag, which is a stable contract, so getEnclosure replaces
getHTML/getAudioUrl and src/audio.ts goes away along with the cheerio
dependency.

The feed also declares the file size, which fixes a second latent bug:
sendTelegramAudio buffered the whole file via arrayBuffer(), so the
current 104 MB episode would exhaust the 128 MB isolate long before the
50 MB guard fired. Files at or under 20 MB are now handed to Telegram as
a URL and never pass through the worker; larger ones still buffer. The
Blob content type is derived from the file extension rather than being
hardcoded to audio/mpeg.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pdQQY5i3n8hCfmmRV93Gy
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 6, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
mhmic-telegram-cron 98509d1 Sep 06 2026, 02:51 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant