Skip to content

fix(transcribe): env pass-through for yt-dlp cookies and JS runtimes - #3050

Open
Azeem1985 wants to merge 1 commit into
Graphify-Labs:v8from
TelB-io:upstream/ytdlp-env-opts
Open

fix(transcribe): env pass-through for yt-dlp cookies and JS runtimes#3050
Azeem1985 wants to merge 1 commit into
Graphify-Labs:v8from
TelB-io:upstream/ytdlp-env-opts

Conversation

@Azeem1985

Copy link
Copy Markdown
Contributor

Fixes #3049.

download_audio() hardcodes its embedded YoutubeDL options, so on server IPs where YouTube answers Sign in to confirm you're not a bot (yt-dlp's FAQ prescribes browser cookies for this), the user's exported cookies file has no way in — and neither does --js-runtimes node, which yt-dlp's YouTube extractor wants for full format coverage.

This mirrors the module's existing env convention (GRAPHIFY_WHISPER_MODEL, GRAPHIFY_WHISPER_PROMPT):

  • GRAPHIFY_YTDLP_COOKIEScookiefile (same as yt-dlp --cookies)
  • GRAPHIFY_YTDLP_JS_RUNTIMESjs_runtimes (same as yt-dlp --js-runtimes), e.g. node

With neither set, the options dict is byte-identical to before. 4 new tests; tests/test_transcribe.py passes (15). Applies clean on v8 (0.9.49).

🤖 Generated with Claude Code

…om the environment

YouTube answers datacenter IPs with 'Sign in to confirm you're not a bot';
yt-dlp's FAQ prescribes browser cookies, and its YouTube extractor wants a
JS runtime for full format coverage. Both are CLI-reachable but the embedded
YoutubeDL call in download_audio() hardcoded its options, so a cookies file
the user exported had no way in.

Mirror the transcriber's existing env convention (GRAPHIFY_WHISPER_MODEL):
- GRAPHIFY_YTDLP_COOKIES       -> cookiefile   (yt-dlp --cookies)
- GRAPHIFY_YTDLP_JS_RUNTIMES   -> js_runtimes  (yt-dlp --js-runtimes), e.g. 'node'

No env vars set -> options unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).

Formal verification. No changes could be formally verified in this run.


Graphify review — findings

Adds _ytdlp_env_opts so download_audio reads GRAPHIFY_YTDLP_COOKIES and GRAPHIFY_YTDLP_JS_RUNTIMES from the environment and forwards them to yt-dlp as cookiefile and js_runtimes, letting the embedded API supply browser cookies and a JS runtime to get past YouTube's bot check. With neither var set the options stay empty, so existing behaviour is unchanged.

No blocking issues surfaced. 1 lower-confidence candidate did not survive cross-model review.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 205 functions depend on the 48 functions this change touches.

Health — this change adds coupling hotspots:

  • new: dispatch_command() — 2 callers, 122 callees
  • new: transcribe() — 5 callers, 5 callees
  • new: ingest() — 3 callers, 8 callees
  • new: download_audio() — 4 callers, 3 callees
  • new: test_poisoned_manifest_is_healed() — 0 callers, 6 callees

Verification — 205 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 51 function(s) in the blast radius were not formally verified this run

Formal verification

Could not verify: Could not verify download\_audio.

The verifier did not have enough to check download\_audio, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `output_dir` is annotated `Path` — outside the synthesizable primitive/collection set

· 1 grounded finding(s) anchored inline below; 4 more finding(s) on lines outside this diff (see the check run).

Comment thread graphify/transcribe.py
return opts


def download_audio(url: str, output_dir: Path) -> Path:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regressiondownload_audio()

high coupling complexity (Ca·Ce = 12).

Grounded coupling-delta finding (deterministic), not an LLM guess.

@Azeem1985

Copy link
Copy Markdown
Contributor Author

Thanks for the review — glad to see the gate come back clean. For what it's worth, our fork (TelB-io/graphify) has been running this change in production: with the env vars unset it's a no-op as described, and with them set it gets yt-dlp past YouTube's bot check reliably. Happy to adjust anything if the maintainers want changes before merge.

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.

transcribe: download_audio cannot receive yt-dlp cookies or a JS runtime — YouTube's bot wall is unfixable from graphify on server IPs

1 participant