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

[ccma] fix extractor. A list of urls is now being sent from the server. #15931

Closed
wants to merge 3 commits into from
Closed

Conversation

andrescarrasco
Copy link

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

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:

  • 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: it is part of youtube-dl)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

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.

formats.append({
'format_id': profile,
'url': _url['file'],
'quality': q,
Copy link
Collaborator

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.

Copy link
Author

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_url['label'].

for _url in media_url:
formats.append({
'format_id': profile,
'url': _url['file'],
Copy link
Collaborator

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.

'quality': q,
})
q += 1
elif media_url and isinstance(media_url, str):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compat_str.

@andrescarrasco
Copy link
Author

andrescarrasco commented Mar 29, 2018

The last commit should address the changes requested.

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', ''))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utils.parse_resolution.

if media_url:
ext = media_data.get('media', {}).get('format')
if ext:
ext = ext.lower()
Copy link
Collaborator

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.

'url': sub_url,
})
'url': sub_url,
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't touch this.


formats.append({
'format_id': profile,
'url': _url.get('file'),
Copy link
Collaborator

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.

Copy link
Author

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latter.

@andrescarrasco
Copy link
Author

@dstftw I've made the changes you requested, please take a look

@dstftw dstftw closed this in 040c629 Apr 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants