]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/nick.py
2 from __future__
import unicode_literals
6 from . mtv
import MTVServicesInfoExtractor
7 from .. utils
import update_url_query
10 class NickIE ( MTVServicesInfoExtractor
):
12 _VALID_URL
= r
'https?://(?P<domain>(?:www\.)?nick(?:jr)?\.com)/(?:[^/]+/)?(?P<type>videos/clip|[^/]+/videos|episodes/[^/]+)/(?P<id>[^/?#.]+)'
13 _FEED_URL
= 'http://udat.mtvnservices.com/service1/dispatch.htm'
14 _GEO_COUNTRIES
= [ 'US' ]
16 'url' : 'https://www.nick.com/episodes/sq47rw/spongebob-squarepants-a-place-for-pets-lockdown-for-love-season-13-ep-1' ,
18 'description' : 'md5:0650a9eb88955609d5c1d1c79292e234' ,
19 'title' : 'A Place for Pets/Lockdown for Love' ,
23 'md5' : 'cb8a2afeafb7ae154aca5a64815ec9d6' ,
25 'id' : '85ee8177-d6ce-48f8-9eee-a65364f8a6df' ,
27 'title' : 'SpongeBob SquarePants: "A Place for Pets/Lockdown for Love" S1' ,
28 'description' : 'A Place for Pets/Lockdown for Love: When customers bring pets into the Krusty Krab, Mr. Krabs realizes pets are more profitable than owners. Plankton ruins another date with Karen, so she puts the Chum Bucket on lockdown until he proves his affection.' ,
33 'md5' : '839a04f49900a1fcbf517020d94e0737' ,
35 'id' : '2e2a9960-8fd4-411d-868b-28eb1beb7fae' ,
37 'title' : 'SpongeBob SquarePants: "A Place for Pets/Lockdown for Love" S2' ,
38 'description' : 'A Place for Pets/Lockdown for Love: When customers bring pets into the Krusty Krab, Mr. Krabs realizes pets are more profitable than owners. Plankton ruins another date with Karen, so she puts the Chum Bucket on lockdown until he proves his affection.' ,
43 'md5' : 'f1145699f199770e2919ee8646955d46' ,
45 'id' : 'dc91c304-6876-40f7-84a6-7aece7baa9d0' ,
47 'title' : 'SpongeBob SquarePants: "A Place for Pets/Lockdown for Love" S3' ,
48 'description' : 'A Place for Pets/Lockdown for Love: When customers bring pets into the Krusty Krab, Mr. Krabs realizes pets are more profitable than owners. Plankton ruins another date with Karen, so she puts the Chum Bucket on lockdown until he proves his affection.' ,
53 'md5' : 'd463116875aee2585ee58de3b12caebd' ,
55 'id' : '5d929486-cf4c-42a1-889a-6e0d183a101a' ,
57 'title' : 'SpongeBob SquarePants: "A Place for Pets/Lockdown for Love" S4' ,
58 'description' : 'A Place for Pets/Lockdown for Love: When customers bring pets into the Krusty Krab, Mr. Krabs realizes pets are more profitable than owners. Plankton ruins another date with Karen, so she puts the Chum Bucket on lockdown until he proves his affection.' ,
64 'url' : 'http://www.nickjr.com/blues-clues-and-you/videos/blues-clues-and-you-original-209-imagination-station/' ,
66 'id' : '31631529-2fc5-430b-b2ef-6a74b4609abd' ,
68 'description' : 'md5:9d65a66df38e02254852794b2809d1cf' ,
69 'title' : 'Blue \' s Imagination Station' ,
73 def _get_feed_query ( self
, uri
):
75 'feed' : 'nick_arc_player_prime' ,
79 def _extract_mgid ( self
, webpage
):
80 mgid
= self
._ search
_ regex
( r
'"media":{"video":{"config":{"uri":"(mgid:.*?)"' , webpage
, 'mgid' , default
= None )
83 def _real_extract ( self
, url
):
84 domain
, video_type
, display_id
= re
. match ( self
._ VALID
_U RL
, url
). groups ()
85 if video_type
. startswith ( "episodes" ):
86 return super () ._ real
_ extract
( url
)
87 video_data
= self
._ download
_ json
(
88 'http:// %s /data/video.endLevel.json' % domain
,
92 return self
._ get
_ videos
_ info
( video_data
[ 'player' ] + video_data
[ 'id' ])
95 class NickBrIE ( MTVServicesInfoExtractor
):
96 IE_NAME
= 'nickelodeon:br'
100 (?P<domain>(?:www\.)?nickjr|mundonick\.uol)\.com\.br|
101 (?:www\.)?nickjr\.[a-z] {2} |
102 (?:www\.)?nickelodeonjunior\.fr
104 /(?:programas/)?[^/]+/videos/(?:episodios/)?(?P<id>[^/?\#.]+)
107 'url' : 'http://www.nickjr.com.br/patrulha-canina/videos/210-labirinto-de-pipoca/' ,
108 'only_matching' : True ,
110 'url' : 'http://mundonick.uol.com.br/programas/the-loud-house/videos/muitas-irmas/7ljo9j' ,
111 'only_matching' : True ,
113 'url' : 'http://www.nickjr.nl/paw-patrol/videos/311-ge-wol-dig-om-terug-te-zijn/' ,
114 'only_matching' : True ,
116 'url' : 'http://www.nickjr.de/blaze-und-die-monster-maschinen/videos/f6caaf8f-e4e8-4cc1-b489-9380d6dcd059/' ,
117 'only_matching' : True ,
119 'url' : 'http://www.nickelodeonjunior.fr/paw-patrol-la-pat-patrouille/videos/episode-401-entier-paw-patrol/' ,
120 'only_matching' : True ,
123 def _real_extract ( self
, url
):
124 domain
, display_id
= re
. match ( self
._ VALID
_U RL
, url
). groups ()
125 webpage
= self
._ download
_ webpage
( url
, display_id
)
126 uri
= self
._ search
_ regex
(
127 r
'data-(?:contenturi|mgid)="([^"]+)' , webpage
, 'mgid' )
128 video_id
= self
._ id
_ from
_u ri
( uri
)
129 config
= self
._ download
_ json
(
130 'http://media.mtvnservices.com/pmt/e1/access/index.html' ,
133 'configtype' : 'edge' ,
137 info_url
= self
._ remove
_ template
_ parameter
( config
[ 'feedWithQueryParams' ])
138 if info_url
== 'None' :
139 if domain
. startswith ( 'www.' ):
142 'mundonick.uol' : 'mundonick.com.br' ,
143 'nickjr' : 'br.nickelodeonjunior.tv' ,
147 'imageEp' : content_domain
,
148 'arcEp' : content_domain
,
150 if domain
== 'nickjr.com.br' :
151 query
[ 'ep' ] = 'c4b16088'
152 info_url
= update_url_query (
153 'http://feeds.mtvnservices.com/od/feed/intl-mrss-player-feed' , query
)
154 return self
._ get
_ videos
_ info
_ from
_u rl
( info_url
, video_id
)
157 class NickDeIE ( MTVServicesInfoExtractor
):
159 _VALID_URL
= r
'https?://(?:www\.)?(?P<host>nick\.(?:de|com\.pl|ch)|nickelodeon\.(?:nl|be|at|dk|no|se))/[^/]+/(?:[^/]+/)*(?P<id>[^/?#&]+)'
161 'url' : 'http://www.nick.de/playlist/3773-top-videos/videos/episode/17306-zu-wasser-und-zu-land-rauchende-erdnusse' ,
162 'only_matching' : True ,
164 'url' : 'http://www.nick.de/shows/342-icarly' ,
165 'only_matching' : True ,
167 'url' : 'http://www.nickelodeon.nl/shows/474-spongebob/videos/17403-een-kijkje-in-de-keuken-met-sandy-van-binnenuit' ,
168 'only_matching' : True ,
170 'url' : 'http://www.nickelodeon.at/playlist/3773-top-videos/videos/episode/77993-das-letzte-gefecht' ,
171 'only_matching' : True ,
173 'url' : 'http://www.nick.com.pl/seriale/474-spongebob-kanciastoporty/wideo/17412-teatr-to-jest-to-rodeo-oszolom' ,
174 'only_matching' : True ,
176 'url' : 'http://www.nickelodeon.no/program/2626-bulderhuset/videoer/90947-femteklasse-veronica-vs-vanzilla' ,
177 'only_matching' : True ,
179 'url' : 'http://www.nickelodeon.dk/serier/2626-hojs-hus/videoer/761-tissepause' ,
180 'only_matching' : True ,
182 'url' : 'http://www.nickelodeon.se/serier/2626-lugn-i-stormen/videos/998-' ,
183 'only_matching' : True ,
185 'url' : 'http://www.nick.ch/shows/2304-adventure-time-abenteuerzeit-mit-finn-und-jake' ,
186 'only_matching' : True ,
188 'url' : 'http://www.nickelodeon.be/afspeellijst/4530-top-videos/videos/episode/73917-inval-broodschapper-lariekoek-arie' ,
189 'only_matching' : True ,
192 def _get_feed_url ( self
, uri
, url
= None ):
193 video_id
= self
._ id
_ from
_u ri
( uri
)
194 config
= self
._ download
_ json
(
195 'http://media.mtvnservices.com/pmt/e1/access/index.html?uri= %s &configtype=edge&ref= %s ' % ( uri
, url
), video_id
)
196 return self
._ remove
_ template
_ parameter
( config
[ 'feedWithQueryParams' ])
199 class NickNightIE ( NickDeIE
):
200 IE_NAME
= 'nicknight'
201 _VALID_URL
= r
'https?://(?:www\.)(?P<host>nicknight\.(?:de|at|tv))/(?:playlist|shows)/(?:[^/]+/)*(?P<id>[^/?#&]+)'
203 'url' : 'http://www.nicknight.at/shows/977-awkward/videos/85987-nimmer-beste-freunde' ,
204 'only_matching' : True ,
206 'url' : 'http://www.nicknight.at/shows/977-awkward' ,
207 'only_matching' : True ,
209 'url' : 'http://www.nicknight.at/shows/1900-faking-it' ,
210 'only_matching' : True ,
213 def _extract_mrss_url ( self
, webpage
, * args
):
214 return self
._ search
_ regex
(
215 r
'mrss\s*:\s*(["\' ])( ?P
< url
> http
.+ ?
) \
1 ', webpage,
216 ' mrss url
', group=' url
')
219 class NickRuIE(MTVServicesInfoExtractor):
220 IE_NAME = ' nickelodeonru
'
221 _VALID_URL = r' https?
://( ?
: www\
.) nickelodeon\
.( ?
: ru|fr|es|pt|ro|hu|com\
. tr
)/[ ^
/]+/( ?
:[ ^
/]+/)*( ?P
< id >[ ^
/ ?
#&]+)'
223 'url' : 'http://www.nickelodeon.ru/shows/henrydanger/videos/episodes/3-sezon-15-seriya-licenziya-na-polyot/pmomfb#playlist/7airc6' ,
224 'only_matching' : True ,
226 'url' : 'http://www.nickelodeon.ru/videos/smotri-na-nickelodeon-v-iyule/g9hvh7' ,
227 'only_matching' : True ,
229 'url' : 'http://www.nickelodeon.fr/programmes/bob-l-eponge/videos/le-marathon-de-booh-kini-bottom-mardi-31-octobre/nfn7z0' ,
230 'only_matching' : True ,
232 'url' : 'http://www.nickelodeon.es/videos/nickelodeon-consejos-tortitas/f7w7xy' ,
233 'only_matching' : True ,
235 'url' : 'http://www.nickelodeon.pt/series/spongebob-squarepants/videos/a-bolha-de-tinta-gigante/xutq1b' ,
236 'only_matching' : True ,
238 'url' : 'http://www.nickelodeon.ro/emisiuni/shimmer-si-shine/video/nahal-din-bomboane/uw5u2k' ,
239 'only_matching' : True ,
241 'url' : 'http://www.nickelodeon.hu/musorok/spongyabob-kockanadrag/videok/episodes/buborekfujas-az-elszakadt-nadrag/q57iob#playlist/k6te4y' ,
242 'only_matching' : True ,
244 'url' : 'http://www.nickelodeon.com.tr/programlar/sunger-bob/videolar/kayip-yatak/mgqbjy' ,
245 'only_matching' : True ,
248 def _real_extract ( self
, url
):
249 video_id
= self
._ match
_ id
( url
)
250 webpage
= self
._ download
_ webpage
( url
, video_id
)
251 mgid
= self
._ extract
_ mgid
( webpage
, url
)
252 return self
. url_result ( 'http://media.mtvnservices.com/embed/ %s ' % mgid
)