projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b6f78d7
)
[nick.com] improve extraction(fixes #14876)
author
Remita Amine
<remitamine@gmail.com>
Mon, 11 Dec 2017 13:37:03 +0000
(14:37 +0100)
committer
Remita Amine
<remitamine@gmail.com>
Mon, 11 Dec 2017 13:37:03 +0000
(14:37 +0100)
youtube_dl/extractor/nick.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/nick.py
b/youtube_dl/extractor/nick.py
index 310eea2cf054248260868515469962232b8562c2..cae8faf3e0db58664640f9c0e4f2d0ecec47585b 100644
(file)
--- a/
youtube_dl/extractor/nick.py
+++ b/
youtube_dl/extractor/nick.py
@@
-10,7
+10,7
@@
from ..utils import update_url_query
class NickIE(MTVServicesInfoExtractor):
# None of videos on the website are still alive?
IE_NAME = 'nick.com'
class NickIE(MTVServicesInfoExtractor):
# None of videos on the website are still alive?
IE_NAME = 'nick.com'
- _VALID_URL = r'https?://(?
:(?:www|beta)\.)?nick(?:jr)?\.com
/(?:[^/]+/)?(?:videos/clip|[^/]+/videos)/(?P<id>[^/?#.]+)'
+ _VALID_URL = r'https?://(?
P<domain>(?:(?:www|beta)\.)?nick(?:jr)?\.com)
/(?:[^/]+/)?(?:videos/clip|[^/]+/videos)/(?P<id>[^/?#.]+)'
_FEED_URL = 'http://udat.mtvnservices.com/service1/dispatch.htm'
_GEO_COUNTRIES = ['US']
_TESTS = [{
_FEED_URL = 'http://udat.mtvnservices.com/service1/dispatch.htm'
_GEO_COUNTRIES = ['US']
_TESTS = [{
@@
-69,8
+69,14
@@
class NickIE(MTVServicesInfoExtractor):
'mgid': uri,
}
'mgid': uri,
}
- def _extract_mgid(self, webpage):
- return self._search_regex(r'data-contenturi="([^"]+)', webpage, 'mgid')
+ def _real_extract(self, url):
+ domain, display_id = re.match(self._VALID_URL, url).groups()
+ video_data = self._download_json(
+ 'http://%s/data/video.endLevel.json' % domain,
+ display_id, query={
+ 'urlKey': display_id,
+ })
+ return self._get_videos_info(video_data['player'] + video_data['id'])
class NickDeIE(MTVServicesInfoExtractor):
class NickDeIE(MTVServicesInfoExtractor):