-
Notifications
You must be signed in to change notification settings - Fork 10k
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
[Esquire] Add new extractor #12978
base: master
Are you sure you want to change the base?
[Esquire] Add new extractor #12978
Conversation
|
||
|
||
class EsquireIE(AdobePassIE): | ||
_VALID_URL = r'https?://tv\.esquire\.com/now/(?:[^/]+)/?(?:full-episode)?/(?P<title>[^/?#]+)/(?P<id>[^/?#]+)' |
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 not catch groups that you're not using.
something like:
_VALID_URL = r'https?://tv\.esquire\.com/now/(?:[^/]+/)?full-episode/[^/]+/(?P<id>\d+)'
'uploader': 'NBCU-MPAT', | ||
} | ||
}, { | ||
'url': 'http://tv.esquire.com/now/full-episode/ninja-warrior-402/759415363504', |
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.
for test case related only to changes in _VALID_URL
, just use only_matching
.
'uploader': 'NBCU-MPAT', | ||
} | ||
}, { | ||
'url': 'http://tv.esquire.com/now/friday-night-tykes/full-episode/if-you-wanna-show…/903098435679', |
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.
if the test case has the same flow as the previous one then there is no need for another test.
info.update({ | ||
'_type': 'url_transparent', | ||
'url': smuggle_url(update_url_query( | ||
'http://link.theplatform.com/s/%s/%s' % (account_pid, path), |
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.
can be extracted directly from data-release-url
in the webpage.
class EsquireIE(AdobePassIE): | ||
_VALID_URL = r'https?://tv\.esquire\.com/now/(?:[^/]+)/?(?:full-episode)?/(?P<title>[^/?#]+)/(?P<id>[^/?#]+)' | ||
_TESTS = [{ | ||
'url': 'http://tv.esquire.com/now/team-ninja-warrior/full-episode/finals-week-1/631550531649', |
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.
as the test require authentication to pass, it should be skipped(otherwise it will fail in Travis CI).
query['auth'] = self._extract_mvpd_auth( | ||
url, video_id, adobe_pass.get('adobePassRequestorId', 'esquire'), resource) | ||
|
||
info = self._search_json_ld(webpage, video_id, default={}) |
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.
if the site does not offer JSON-LD
data then there is no need to extract them.
adobe_pass.get('adobePassResourceId', 'esquire'), | ||
title, video_id, player_params.get('data-episode-rating', 'TV-14')) | ||
query['auth'] = self._extract_mvpd_auth( | ||
url, video_id, adobe_pass.get('adobePassRequestorId', 'esquire'), resource) |
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.
esquire
is not a valid adobe pass requestor id, the fallback value should be style
(the value that is actually used now), the same apply to adobe pass resource id.
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
Adding support for tv.esquire.com with a new extractor.