Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/issue 213 #219

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

crhowell
Copy link
Contributor

@crhowell crhowell commented Jul 27, 2023

Updates _extract_captions_json method to do additional html splitting to attempt to extract out the playabilityStatus JSON object so we may match and raise a more specific error against the "status" field.

Updates CouldNotRetrieveTranscript class to accept playabilityStatus JSON object so we can generate more informative errors with cause, reason, subreason attached.

Adds two playability error helper methods: get_playability_subreason, get_playability_error

Adds tests to cover the 2 new error classes: VideoUnplayable and LoginRequired

…use property on CouldNotRetrieveTranscript class to account for dynamic reason in playability json given;
…tempt to extract playability json for better error handling with dynamic reasons; add tests for LoginRequired, VideoUnplayable errors; fix TranscriptDisabled test static html so it uses proper playabilityStatus JSON object;
Copy link

@ilystsov ilystsov left a comment

Choose a reason for hiding this comment

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

Remove redundant checks, simplify the code

youtube_transcript_api/_errors.py Outdated Show resolved Hide resolved
commit ilystsov's edits to remove redudant lines within get_playability_subreason error helper function.

Co-authored-by: ilystsov <[email protected]>
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.

None yet

2 participants