-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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/banbye] Fix extractor #10332
Merged
Merged
[ie/banbye] Fix extractor #10332
Conversation
This file contains 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
e90d4e0
to
0fe80a6
Compare
Signed-off-by: Patryk Miś <[email protected]>
0fe80a6
to
9ff6279
Compare
bashonly
approved these changes
Jul 2, 2024
seproDev
reviewed
Jul 2, 2024
formats = [] | ||
url_data = self._download_json(f'{self._API_BASE}/videos/{video_id}/url', video_id, data=b'') | ||
if master_url := traverse_obj(url_data, ('src', 'hls', 'masterPlaylist', {url_or_none})): | ||
formats = self._extract_m3u8_formats(master_url, video_id, 'mp4', m3u8_id='hls', fatal=False) |
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.
Just as a note: this will throw a 404 warning for some videos.
This is expected, the browser makes an additional head request, which also 404s.
I think it is fine to leave as is and not suppress the warning.
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.
IMPORTANT: PRs without the template will be CLOSED
Description of your pull request and other information
Fix BanBye extractor by not hardcoding video URLs.
The updated logic in the extractor now handles HLS videos by attempting to retrieve formats from both reachable and unreachable m3u8 playlists. If the master playlist is unreachable (e.g., returns a 404 error), it falls back to using the JSON data provided by the API.
This change ensures robustness in fetching video formats from BanBye, accommodating different scenarios where the master playlist might not be accessible.
Fixes #8584
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?