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

[wwe] Add extractor #17450

Closed
wants to merge 3 commits into from
Closed

[wwe] Add extractor #17450

wants to merge 3 commits into from

Conversation

mrtnmtth
Copy link
Contributor

@mrtnmtth mrtnmtth commented Sep 6, 2018

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)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

The extractor adds support for wwe.com videos

@parmjitv parmjitv mentioned this pull request Sep 6, 2018
8 tasks
@parmjitv
Copy link
Contributor

parmjitv commented Sep 6, 2018

Nice! Should resolve issue #14781.

player = drupal_settings['WWEVideoLanding']['initialVideo']
metadata = player['playlist'][0]

title = metadata.get('title')
Copy link
Collaborator

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.

metadata = player['playlist'][0]

title = metadata.get('title')
video_url = 'https:' + metadata.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.

Same.


title = metadata.get('title')
video_url = 'https:' + metadata.get('file')
thumbnail = 'https://www.wwe.com' + metadata.get('image')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Breaks on None.

thumbnail = 'https://www.wwe.com' + metadata.get('image')
description = metadata.get('description')

id = re.split('[/.]', video_url)[-2]
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 shadow built-ins.

@mrtnmtth
Copy link
Contributor Author

mrtnmtth commented Sep 8, 2018

Added a commit resolving the issues.
I did not amend for the changes to be more visible but can squash and rebase if necessary.

metadata = player['playlist'][0]

if metadata.get('file') is None:
raise ExtractorError('Unable to extract video url')
Copy link
Collaborator

Choose a reason for hiding this comment

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

No. metadata['file'].

Copy link
Contributor Author

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'] ?

video_url = 'https:' + metadata.get('file')
thumbnail = None
if metadata.get('image') is not None:
thumbnail = 'https://www.wwe.com' + metadata.get('image')
Copy link
Collaborator

Choose a reason for hiding this comment

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

urljoin.

thumbnail = 'https://www.wwe.com' + metadata.get('image')
description = metadata.get('description')

id = self._generic_id(video_url)
Copy link
Collaborator

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.

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

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

Choose a reason for hiding this comment

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

md5:.

@mrtnmtth
Copy link
Contributor Author

I addressed the requested changes in the latest commit from 2 weeks ago.
Seems like you did not notice my update. Can you please review again?

@dstftw dstftw closed this in 006374e Nov 17, 2018
lkho referenced this pull request in lkho/youtube-dl Dec 24, 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

3 participants