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/generic] Improve direct video link ext detection #8340

Merged
merged 1 commit into from
Oct 28, 2023

Conversation

bashonly
Copy link
Member

@bashonly bashonly commented Oct 12, 2023

Closes #8265

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)

What is the purpose of your pull request?

Copilot Summary

🤖 Generated by Copilot at fe274d3

Summary

📁🔎📝

Improved file extension detection for generic extractor by using a helper function and passing the detected extension to the format info. This affects the file yt_dlp/extractor/generic.py.

urlhandle_detect_ext is the key to our salvation
We pass the ext to the format and unleash the extraction
No more generic errors, no more false detections
We improved the file extension detection

Walkthrough

  • Import urlhandle_detect_ext function from utils.py to detect file extension from URL response (link)
  • Modify determine_ext function to accept default_ext argument and return None if URL has no clear extension (link)
  • Call urlhandle_detect_ext function with full_response object to get more accurate extension from response headers or content type (link)
  • Add ext variable to f dictionary to pass extension information to downloader (link)

@bashonly bashonly added the site-bug Issue with a specific website label Oct 12, 2023
@bashonly bashonly self-assigned this Oct 28, 2023
@bashonly bashonly merged commit 4ce2f29 into yt-dlp:master Oct 28, 2023
17 checks passed
@bashonly bashonly deleted the fix/generic-direct-ext branch December 7, 2023 15:10
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.

buzzsprout.com feed leads to .unknown_video file extensions (not .mp3)
2 participants