-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[ie/zaiko] Add support jwt-protected video urls #10130
base: master
Are you sure you want to change the base?
Conversation
stream_url = self._download_json(traverse_obj( | ||
initial_event_info, ('jwt_token_url', {url_or_none})), video_id, | ||
note='Downloading jwt-protected stream url', | ||
errnote='Failed to download jwt-protected stream url')['playback_url'] |
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.
don't need the traversal here if it's otherwise fatal
stream_url = self._download_json(traverse_obj( | |
initial_event_info, ('jwt_token_url', {url_or_none})), video_id, | |
note='Downloading jwt-protected stream url', | |
errnote='Failed to download jwt-protected stream url')['playback_url'] | |
stream_url = self._download_json( | |
initial_event_info['jwt_token_url'], video_id, 'Downloading JWT-protected stream URL', | |
'Failed to download JWT-protected stream URL')['playback_url'] |
@@ -66,7 +66,9 @@ def _real_extract(self, url): | |||
stream_meta['stream-access']['video_source'], video_id, | |||
'Downloading player page', headers={'referer': 'https://zaiko.io/'}) | |||
player_meta = self._parse_vue_element_attr('player', player_page, video_id) | |||
status = traverse_obj(player_meta, ('initial_event_info', 'status', {str})) | |||
initial_event_info = player_meta['initial_event_info'] |
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.
The rest of the extractor seemed to be written to be non-fatal all the way down to the expected raise_no_formats
call. Will making this line fatal have any ill effect? (I'm just asking a question, not requesting a change here)
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.
Will making this line fatal have any ill effect?
Well, I didn't check it carefully. Not all information is extracted from the "initial_event_info" object (we also have "player_meta"), so making it fatal is not ideal.
The design of "fatal vs. non-fatal" always confuses me, btw.
IMPORTANT: PRs without the template will be CLOSED
Description of your pull request and other information
Credit goes to @vschule (see #9798 (comment)). I wrote this PR based on their informative suggestion.
This PR fixes #9798 .
Template
Before submitting a pull request make sure you have:
In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:
What is the purpose of your pull request?