Fix captions: use player API instead of broken get_transcript endpoint - #261
Open
powellnorma wants to merge 4 commits into
Open
Fix captions: use player API instead of broken get_transcript endpoint#261powellnorma wants to merge 4 commits into
powellnorma wants to merge 4 commits into
Conversation
YouTube's get_transcript innertube API now requires PO tokens, returning FAILED_PRECONDITION (400). Switch to fetching captions via the android player API (baseUrl from captionTracks), which still works without PO tokens. - Add get_working_caption_url() to fetch caption URLs via android player API - Default use_innertube_for_captions to False - Auto-fallback from innertube to player API if innertube fails - Update android client to 19.29.37, web client to 2.20260114.08.00 - Fix call_youtube_api to handle optional API key, use prettyPrint=false - Fix innertube_caption.py protobuf encoding and error handling
- Use android client instead of web for get_transcript API calls - Add multi_deep_get fallback paths for both web and android response formats (updateEngagementPanelAction vs elementsCommand, runs vs elementsAttributedString)
Author
YouTube has blocked the android client (400 Bad Request). yt-dlp has also confirmed this and removed android from their defaults. - Switch player API fallback from android to android_vr (Oculus Quest 3) - Update android_vr client version from 1.60.19 to 1.71.26 - Default use_innertube_for_captions to False (get_transcript is dead on all clients) - Add try/except around player API call in get_working_caption_url
Owner
|
This looks very similar to #240. I had some comments there that would also apply to this one |
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.
YouTube's get_transcript innertube API now requires PO tokens, returning FAILED_PRECONDITION (400). Switch to fetching captions via the android player API (baseUrl from captionTracks), which still works without PO tokens.
Fixes #257