-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[wwe] Add extractor #17450
[wwe] Add extractor #17450
Conversation
Nice! Should resolve issue #14781. |
youtube_dl/extractor/wwe.py
Outdated
player = drupal_settings['WWEVideoLanding']['initialVideo'] | ||
metadata = player['playlist'][0] | ||
|
||
title = metadata.get('title') |
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 on mandatory and optional meta fields.
youtube_dl/extractor/wwe.py
Outdated
metadata = player['playlist'][0] | ||
|
||
title = metadata.get('title') | ||
video_url = 'https:' + metadata.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.
Same.
youtube_dl/extractor/wwe.py
Outdated
|
||
title = metadata.get('title') | ||
video_url = 'https:' + metadata.get('file') | ||
thumbnail = 'https://www.wwe.com' + metadata.get('image') |
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 on None
.
youtube_dl/extractor/wwe.py
Outdated
thumbnail = 'https://www.wwe.com' + metadata.get('image') | ||
description = metadata.get('description') | ||
|
||
id = re.split('[/.]', video_url)[-2] |
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 shadow built-ins.
Added a commit resolving the issues. |
youtube_dl/extractor/wwe.py
Outdated
metadata = player['playlist'][0] | ||
|
||
if metadata.get('file') is None: | ||
raise ExtractorError('Unable to extract video 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.
No. metadata['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.
video_url = 'https:' + metadata['file']
?
youtube_dl/extractor/wwe.py
Outdated
video_url = 'https:' + metadata.get('file') | ||
thumbnail = None | ||
if metadata.get('image') is not None: | ||
thumbnail = 'https://www.wwe.com' + metadata.get('image') |
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.
urljoin
.
youtube_dl/extractor/wwe.py
Outdated
thumbnail = 'https://www.wwe.com' + metadata.get('image') | ||
description = metadata.get('description') | ||
|
||
id = self._generic_id(video_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.
Nothing changed. Also there is a video id available in JSON.
youtube_dl/extractor/wwe.py
Outdated
'ext': 'mp4', | ||
'title': 'Daniel Bryan vs. Andrade "Cien" Almas: SmackDown LIVE, Sept. 4, 2018', | ||
'description': 'Still fuming after he and his wife Brie Bella were attacked by The Miz and Maryse last week, Daniel Bryan takes care of some unfinished business with Andrade "Cien" Almas.', | ||
'thumbnail': 'https://www.wwe.com/f/styles/wwe_16_9_s/public/2018/09/20180904_sd_danielalmas--d97661dd31eea8a99837a3dbc7121f8f.jpg', |
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 exact URLs here.
'id': 'sd994_bryan_almas_090418', | ||
'ext': 'mp4', | ||
'title': 'Daniel Bryan vs. Andrade "Cien" Almas: SmackDown LIVE, Sept. 4, 2018', | ||
'description': 'Still fuming after he and his wife Brie Bella were attacked by The Miz and Maryse last week, Daniel Bryan takes care of some unfinished business with Andrade "Cien" Almas.', |
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.
md5:
.
I addressed the requested changes in the latest commit from 2 weeks ago. |
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 extractor adds support for wwe.com videos