Skip to content

fix: handle --youtube apify when HTML fetch fails#64

Open
entropyy0 wants to merge 1 commit intosteipete:mainfrom
entropyy0:fix/apify-skip-html-check
Open

fix: handle --youtube apify when HTML fetch fails#64
entropyy0 wants to merge 1 commit intosteipete:mainfrom
entropyy0:fix/apify-skip-html-check

Conversation

@entropyy0
Copy link
Contributor

Closes #51

Summary

When using --youtube apify, the Apify provider was never attempted if the initial HTML fetch failed. The if (!html) return early exit short-circuited the entire transcript flow before Apify was reached — even though Apify doesn't need HTML.

Fix

Move explicit apify mode handling before the HTML check so it runs regardless of HTML availability.

Changes

  • youtube.ts: Handle mode === 'apify' before the !html guard, calling Apify directly
  • Removed duplicate apify block that was unreachable after the fix
  • Added 3 regression tests: apify with null HTML (success + failure + missing token)

All 1122 tests pass. Build clean.

AI-assisted (Claude via Clawdbot), fully tested.

When using --youtube apify, the Apify provider was never attempted if
the initial HTML fetch failed or returned empty content. The early
`if (!html) return` exit on line 87 short-circuited the entire
transcript flow before Apify was reached, even though Apify doesn't
need HTML at all.

Move explicit apify mode handling before the HTML check so it runs
regardless of HTML availability.

Closes steipete#51
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.

YouTube transcript extraction skipped when HTML fetch fails, even with --youtube apify

1 participant