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

[ie/Bild.de] fix extraction when HLS formats are available (fixes #7951) #8032

Merged
merged 3 commits into from
Sep 16, 2023

Conversation

barsnick
Copy link
Contributor

@barsnick barsnick commented Sep 5, 2023

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

Previously, only static download formats were supported. With the appearance of (additional) HLS formats, the extractor broke when they are available.

This PR adds the handling of those HLS formats in addition to the static one(s).

Fixes #7951

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:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)
  • I don't quite understand. I am not the original author of the code, I am only fixing it. I don't know if the original code is under Public Domain or Unlicense. I place my contribution under either, if desired.

What is the purpose of your pull request?

Copilot Summary

🤖 Generated by Copilot at 3f5fcd7

Summary

🛠️🆕🎞️

Improved the bild extractor to handle more video scenarios and formats. Added a test and extracted HLS and MP4 from videoData.

Sing, O Muse, of the skillful coder who improved the bild extractor
And made it work with various URLs and sources of video streams
He added a new test to verify his clever work and extracted
The formats of HLS and MP4 from the data, like Hermes stealing Apollo's herds

Walkthrough

  • Modify the URL regex and the test cases to support different video page formats and sources (link, link)
  • Extract and return multiple video formats from the video data, preferring HLS over MP4 (link)
  • Use the _extract_m3u8_formats method to parse the HLS manifest and add the formats to the list (link)
  • Assign the format IDs hls and http-mp4 to the HLS and MP4 sources respectively (link)

The site sometimes delivers both HLS and a static file. Previously, the
presence of HLS broke even the handling of the static file.

Fixes yt-dlp#7951
yt_dlp/extractor/bild.py Outdated Show resolved Hide resolved
@bashonly bashonly added site-bug Issue with a specific website pending-fixes PR has had changes requested labels Sep 8, 2023
Use `traverse_obj()`.

Provide a warning for possible as-yet unhandled formats.

Also revert the expansion of the URL regex (`.htm` in addtion to `.html`), it's
not really in use and messes up `split()`.
@bashonly bashonly removed the pending-fixes PR has had changes requested label Sep 11, 2023
@bashonly bashonly added pending-review PR needs a review and removed pending-review PR needs a review labels Sep 11, 2023
@bashonly bashonly merged commit b4c1c40 into yt-dlp:master Sep 16, 2023
13 checks passed
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this pull request Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-bug Issue with a specific website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bild.de Extractor not working
2 participants