-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
[reddit] try_get larger thumbnail images with fallback #27503
Conversation
Extract all resolutions. |
You mean extract all the available images into a |
Yes, much nicer xD |
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.
Read coding conventions.
images = try_get( | ||
data, lambda x: x['preview']['images'][0]['resolutions']) or [] | ||
for image in images: | ||
url = url_or_none(unescapeHTML(image['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.
Breaks.
'width': int_or_none(image['width']), | ||
'height': int_or_none(image['height']), |
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.
Breaks.
thumbnails = [] | ||
images = try_get( | ||
data, lambda x: x['preview']['images'][0]['resolutions']) or [] | ||
for image in images: |
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.
Breaks if ...['resolutions']
is not a list
.
@@ -9,6 +9,7 @@ | |||
float_or_none, | |||
try_get, | |||
url_or_none, | |||
unescapeHTML, |
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.
Alphabetic.
Please follow the guide below
x
into all the boxes [ ] relevant to your pull request (like that [x])Before submitting a pull request make sure you have:
In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of your pull request?
Description of your pull request and other information
The current RedditRIE extractor simply returns the root thumb url for thumbnails, which is very small. This improvement checks for a larger version and returns that instead.