-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
base: master
Are you sure you want to change the base?
Feature/issue 213 #219
Conversation
…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;
There was a problem hiding this 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
commit ilystsov's edits to remove redudant lines within get_playability_subreason error helper function. Co-authored-by: ilystsov <[email protected]>
""" | ||
reason = playability_json.get("status") | ||
if reason == 'LOGIN_REQUIRED': | ||
# error for age related playability |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOGIN_REQUIRED
also happens when you need to "Sign in to confirm you’re not a bot". This simpler pull request addresses this: #337
Updates
_extract_captions_json
method to do additional html splitting to attempt to extract out theplayabilityStatus
JSON object so we may match and raise a more specific error against the "status" field.Updates
CouldNotRetrieveTranscript
class to acceptplayabilityStatus
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
andLoginRequired