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
[ccma] fix extractor. A list of urls is now being sent from the server. #15931
Conversation
youtube_dl/extractor/ccma.py
Outdated
formats.append({ | ||
'format_id': profile, | ||
'url': _url['file'], | ||
'quality': q, |
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.
No, parse height from label.
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.
I'm sorry, but i don't understand what do you mean by height and label, could you elaborate?
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.
_url['label']
.
youtube_dl/extractor/ccma.py
Outdated
for _url in media_url: | ||
formats.append({ | ||
'format_id': profile, | ||
'url': _url['file'], |
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.
Must not break extraction if missing.
youtube_dl/extractor/ccma.py
Outdated
'quality': q, | ||
}) | ||
q += 1 | ||
elif media_url and isinstance(media_url, str): |
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.
compat_str
.
The last commit should address the changes requested. |
youtube_dl/extractor/ccma.py
Outdated
if media_url and isinstance(media_url, list): | ||
for _url in media_url: | ||
if 'label' in _url: | ||
height = int_or_none(_url.get('label').replace('p', '')) |
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.
utils.parse_resolution
.
youtube_dl/extractor/ccma.py
Outdated
if media_url: | ||
ext = media_data.get('media', {}).get('format') | ||
if ext: | ||
ext = ext.lower() |
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.
It's already contained in video URL. Remove.
youtube_dl/extractor/ccma.py
Outdated
'url': sub_url, | ||
}) | ||
'url': sub_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.
Don't touch this.
youtube_dl/extractor/ccma.py
Outdated
|
||
formats.append({ | ||
'format_id': profile, | ||
'url': _url.get('file'), |
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.
URL must not be None
.
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.
Do I default to an empty string then? Or do not append if _url.get('file')
returns None
?
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.
The latter.
@dstftw I've made the changes you requested, please take a look |
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
Explanation of your pull request in arbitrary form goes here. Please make sure the description explains the purpose and effect of your pull request and is worded well enough to be understood. Provide as much context and examples as possible.