]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/nick.py
510b1c41fd42dd3f77214fd804e9962a78e075af
2 from __future__
import unicode_literals
6 from . mtv
import MTVServicesInfoExtractor
7 from .. utils
import update_url_query
10 class NickIE ( MTVServicesInfoExtractor
):
11 # None of videos on the website are still alive?
13 _VALID_URL
= r
'https?://(?:(?:www|beta)\.)?nick(?:jr)?\.com/(?:[^/]+/)?(?:videos/clip|[^/]+/videos)/(?P<id>[^/?#.]+)'
14 _FEED_URL
= 'http://udat.mtvnservices.com/service1/dispatch.htm'
15 _GEO_COUNTRIES
= [ 'US' ]
17 'url' : 'http://www.nick.com/videos/clip/alvinnn-and-the-chipmunks-112-full-episode.html' ,
20 'md5' : '6e5adc1e28253bbb1b28ab05403dd4d4' ,
22 'id' : 'be6a17b0-412d-11e5-8ff7-0026b9414f30' ,
24 'title' : 'ALVINNN!!! and The Chipmunks: "Mojo Missing/Who \' s The Animal" S1' ,
25 'description' : 'Alvin is convinced his mojo was in a cap he gave to a fan, and must find a way to get his hat back before the Chipmunks’ big concert. \n During a costume visit to the zoo, Alvin finds himself mistaken for the real Tasmanian devil.' ,
30 'md5' : 'd7be441fc53a1d4882fa9508a1e5b3ce' ,
32 'id' : 'be6b8f96-412d-11e5-8ff7-0026b9414f30' ,
34 'title' : 'ALVINNN!!! and The Chipmunks: "Mojo Missing/Who \' s The Animal" S2' ,
35 'description' : 'Alvin is convinced his mojo was in a cap he gave to a fan, and must find a way to get his hat back before the Chipmunks’ big concert. \n During a costume visit to the zoo, Alvin finds himself mistaken for the real Tasmanian devil.' ,
40 'md5' : 'efffe1728a234b2b0d2f2b343dd1946f' ,
42 'id' : 'be6cf7e6-412d-11e5-8ff7-0026b9414f30' ,
44 'title' : 'ALVINNN!!! and The Chipmunks: "Mojo Missing/Who \' s The Animal" S3' ,
45 'description' : 'Alvin is convinced his mojo was in a cap he gave to a fan, and must find a way to get his hat back before the Chipmunks’ big concert. \n During a costume visit to the zoo, Alvin finds himself mistaken for the real Tasmanian devil.' ,
49 'md5' : '1ec6690733ab9f41709e274a1d5c7556' ,
51 'id' : 'be6e3354-412d-11e5-8ff7-0026b9414f30' ,
53 'title' : 'ALVINNN!!! and The Chipmunks: "Mojo Missing/Who \' s The Animal" S4' ,
54 'description' : 'Alvin is convinced his mojo was in a cap he gave to a fan, and must find a way to get his hat back before the Chipmunks’ big concert. \n During a costume visit to the zoo, Alvin finds himself mistaken for the real Tasmanian devil.' ,
59 'url' : 'http://www.nickjr.com/paw-patrol/videos/pups-save-a-goldrush-s3-ep302-full-episode/' ,
60 'only_matching' : True ,
62 'url' : 'http://beta.nick.com/nicky-ricky-dicky-and-dawn/videos/nicky-ricky-dicky-dawn-301-full-episode/' ,
63 'only_matching' : True ,
66 def _get_feed_query ( self
, uri
):
68 'feed' : 'nick_arc_player_prime' ,
72 def _extract_mgid ( self
, webpage
):
73 return self
._ search
_ regex
( r
'data-contenturi="([^"]+)' , webpage
, 'mgid' )
76 class NickDeIE ( MTVServicesInfoExtractor
):
78 _VALID_URL
= r
'https?://(?:www\.)?(?P<host>nick\.(?:de|com\.pl)|nickelodeon\.(?:nl|at))/[^/]+/(?:[^/]+/)*(?P<id>[^/?#&]+)'
80 'url' : 'http://www.nick.de/playlist/3773-top-videos/videos/episode/17306-zu-wasser-und-zu-land-rauchende-erdnusse' ,
81 'only_matching' : True ,
83 'url' : 'http://www.nick.de/shows/342-icarly' ,
84 'only_matching' : True ,
86 'url' : 'http://www.nickelodeon.nl/shows/474-spongebob/videos/17403-een-kijkje-in-de-keuken-met-sandy-van-binnenuit' ,
87 'only_matching' : True ,
89 'url' : 'http://www.nickelodeon.at/playlist/3773-top-videos/videos/episode/77993-das-letzte-gefecht' ,
90 'only_matching' : True ,
92 'url' : 'http://www.nick.com.pl/seriale/474-spongebob-kanciastoporty/wideo/17412-teatr-to-jest-to-rodeo-oszolom' ,
93 'only_matching' : True ,
96 def _extract_mrss_url ( self
, webpage
, host
):
97 return update_url_query ( self
._ search
_ regex
(
98 r
'data-mrss=(["\' ])( ?P
< url
> http
.+ ?
) \
1 ', webpage, ' mrss url
', group=' url
'),
101 def _real_extract(self, url):
102 mobj = re.match(self._VALID_URL, url)
103 video_id = mobj.group(' id ')
104 host = mobj.group(' host
')
106 webpage = self._download_webpage(url, video_id)
108 mrss_url = self._extract_mrss_url(webpage, host)
110 return self._get_videos_info_from_url(mrss_url, video_id)
113 class NickNightIE(NickDeIE):
114 IE_NAME = ' nicknight
'
115 _VALID_URL = r' https?
://( ?
: www\
.)( ?P
< host
> nicknight\
.( ?
: de|at|tv
))/( ?
: playlist|shows
)/( ?
:[ ^
/]+/)*( ?P
< id >[ ^
/ ?
#&]+)'
117 'url' : 'http://www.nicknight.at/shows/977-awkward/videos/85987-nimmer-beste-freunde' ,
118 'only_matching' : True ,
120 'url' : 'http://www.nicknight.at/shows/977-awkward' ,
121 'only_matching' : True ,
123 'url' : 'http://www.nicknight.at/shows/1900-faking-it' ,
124 'only_matching' : True ,
127 def _extract_mrss_url ( self
, webpage
, * args
):
128 return self
._ search
_ regex
(
129 r
'mrss\s*:\s*(["\' ])( ?P
< url
> http
.+ ?
) \
1 ', webpage,
130 ' mrss url
', group=' url
')
133 class NickRuIE(MTVServicesInfoExtractor):
134 IE_NAME = ' nickelodeonru
'
135 _VALID_URL = r' https?
://( ?
: www\
.) nickelodeon\
. ru
/( ?
: playlist|shows|videos
)/( ?
:[ ^
/]+/)*( ?P
< id >[ ^
/ ?
#&]+)'
137 'url' : 'http://www.nickelodeon.ru/shows/henrydanger/videos/episodes/3-sezon-15-seriya-licenziya-na-polyot/pmomfb#playlist/7airc6' ,
138 'only_matching' : True ,
140 'url' : 'http://www.nickelodeon.ru/videos/smotri-na-nickelodeon-v-iyule/g9hvh7' ,
141 'only_matching' : True ,
144 def _real_extract ( self
, url
):
145 video_id
= self
._ match
_ id
( url
)
146 webpage
= self
._ download
_ webpage
( url
, video_id
)
147 mgid
= self
._ extract
_ mgid
( webpage
)
148 return self
. url_result ( 'http://media.mtvnservices.com/embed/ %s ' % mgid
)