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
[extractor/twitch] Update thumbnail size #6629
Merged
Merged
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
Return both as |
Reference from yt-dlp@487c5b3
pukkandan
reviewed
Mar 25, 2023
Return the original thumbnail and `0x0`, and add preference for `0x0`.
bashonly
approved these changes
Mar 28, 2023
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
mauritzn
suggested changes
Apr 12, 2023
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.
Request change of overly static RegEx for thumbnail URL modification, to a more flexible RegEx.
Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
bashonly
reviewed
Apr 22, 2023
aalsuwaidi
pushed a commit
to aalsuwaidi/yt-dlp
that referenced
this pull request
Apr 21, 2024
Authored by: JC-Chung
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
Currently, using
--write-thumbnail
when downloading vod will only give you a90*60
size thumbnail.like https://www.twitch.tv/videos/1773257171
https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/3afded6c325c0f62cc4e_dashducks_41995346187_1679578217//thumb/thumb0-90x60.jpg
> https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/3afded6c325c0f62cc4e_dashducks_41995346187_1679578217//thumb/thumb0-0x0.jpg
Use
thumbnail = re.sub(r"(\d+)x(\d+)\.jpg", "0x0.jpg", thumbnail)
to replace the thumbnail with size0*0
(original size?)And Live even though the highest picture quality is
1920*1080
, currently only get1280*720
thumbnail, using the same code modified to0*0
like https://www.twitch.tv/dashducks
https://static-cdn.jtvnw.net/previews-ttv/live_user_dashducks-1280x720.jpg
> https://static-cdn.jtvnw.net/previews-ttv/live_user_dashducks-0x0.jpg
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?
🤖 Generated by Copilot at bc2e1f9
Summary
🛠️📺🆗
Refactor
twitch.py
to use a new method for thumbnail extraction that handles fallbacks better.Walkthrough
_get_thumbnails
to theTwitchBaseIE
class that returns a list of two thumbnails with different resolutions for a given URL (link)thumbnail
field with athumbnails
field in the info dictionary of theTwitchVodIE
andTwitchStreamIE
classes that use the_get_thumbnails
method to provide a fallback thumbnail option (link, link)TwitchVodIE
class, as it is no longer needed (link)