]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/nick.py
1 from . mtv
import MTVServicesInfoExtractor
2 from .. utils
import update_url_query
5 class NickIE ( MTVServicesInfoExtractor
):
7 _VALID_URL
= r
'https?://(?P<domain>(?:www\.)?nick(?:jr)?\.com)/(?:[^/]+/)?(?P<type>videos/clip|[^/]+/videos|episodes/[^/]+)/(?P<id>[^/?#.]+)'
8 _FEED_URL
= 'http://udat.mtvnservices.com/service1/dispatch.htm'
9 _GEO_COUNTRIES
= [ 'US' ]
11 'url' : 'https://www.nick.com/episodes/sq47rw/spongebob-squarepants-a-place-for-pets-lockdown-for-love-season-13-ep-1' ,
13 'description' : 'md5:0650a9eb88955609d5c1d1c79292e234' ,
14 'title' : 'A Place for Pets/Lockdown for Love' ,
18 'md5' : 'cb8a2afeafb7ae154aca5a64815ec9d6' ,
20 'id' : '85ee8177-d6ce-48f8-9eee-a65364f8a6df' ,
22 'title' : 'SpongeBob SquarePants: "A Place for Pets/Lockdown for Love" S1' ,
23 '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.' ,
28 'md5' : '839a04f49900a1fcbf517020d94e0737' ,
30 'id' : '2e2a9960-8fd4-411d-868b-28eb1beb7fae' ,
32 'title' : 'SpongeBob SquarePants: "A Place for Pets/Lockdown for Love" S2' ,
33 '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.' ,
38 'md5' : 'f1145699f199770e2919ee8646955d46' ,
40 'id' : 'dc91c304-6876-40f7-84a6-7aece7baa9d0' ,
42 'title' : 'SpongeBob SquarePants: "A Place for Pets/Lockdown for Love" S3' ,
43 '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.' ,
48 'md5' : 'd463116875aee2585ee58de3b12caebd' ,
50 'id' : '5d929486-cf4c-42a1-889a-6e0d183a101a' ,
52 'title' : 'SpongeBob SquarePants: "A Place for Pets/Lockdown for Love" S4' ,
53 '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.' ,
59 'url' : 'http://www.nickjr.com/blues-clues-and-you/videos/blues-clues-and-you-original-209-imagination-station/' ,
61 'id' : '31631529-2fc5-430b-b2ef-6a74b4609abd' ,
63 'description' : 'md5:9d65a66df38e02254852794b2809d1cf' ,
64 'title' : 'Blue \' s Imagination Station' ,
66 'skip' : 'Not accessible?'
69 def _get_feed_query ( self
, uri
):
71 'feed' : 'nick_arc_player_prime' ,
75 def _real_extract ( self
, url
):
76 domain
, video_type
, display_id
= self
._ match
_ valid
_u rl
( url
). groups ()
77 if video_type
. startswith ( "episodes" ):
78 return super () ._ real
_ extract
( url
)
79 video_data
= self
._ download
_ json
(
80 'http:// %s /data/video.endLevel.json' % domain
,
84 return self
._ get
_ videos
_ info
( video_data
[ 'player' ] + video_data
[ 'id' ])
87 class NickBrIE ( MTVServicesInfoExtractor
):
88 IE_NAME
= 'nickelodeon:br'
92 (?P<domain>(?:www\.)?nickjr|mundonick\.uol)\.com\.br|
93 (?:www\.)?nickjr\.[a-z] {2} |
94 (?:www\.)?nickelodeonjunior\.fr
96 /(?:programas/)?[^/]+/videos/(?:episodios/)?(?P<id>[^/?\#.]+)
99 'url' : 'http://www.nickjr.com.br/patrulha-canina/videos/210-labirinto-de-pipoca/' ,
100 'only_matching' : True ,
102 'url' : 'http://mundonick.uol.com.br/programas/the-loud-house/videos/muitas-irmas/7ljo9j' ,
103 'only_matching' : True ,
105 'url' : 'http://www.nickjr.nl/paw-patrol/videos/311-ge-wol-dig-om-terug-te-zijn/' ,
106 'only_matching' : True ,
108 'url' : 'http://www.nickjr.de/blaze-und-die-monster-maschinen/videos/f6caaf8f-e4e8-4cc1-b489-9380d6dcd059/' ,
109 'only_matching' : True ,
111 'url' : 'http://www.nickelodeonjunior.fr/paw-patrol-la-pat-patrouille/videos/episode-401-entier-paw-patrol/' ,
112 'only_matching' : True ,
115 def _real_extract ( self
, url
):
116 domain
, display_id
= self
._ match
_ valid
_u rl
( url
). groups ()
117 webpage
= self
._ download
_ webpage
( url
, display_id
)
118 uri
= self
._ search
_ regex
(
119 r
'data-(?:contenturi|mgid)="([^"]+)' , webpage
, 'mgid' )
120 video_id
= self
._ id
_ from
_u ri
( uri
)
121 config
= self
._ download
_ json
(
122 'http://media.mtvnservices.com/pmt/e1/access/index.html' ,
125 'configtype' : 'edge' ,
129 info_url
= self
._ remove
_ template
_ parameter
( config
[ 'feedWithQueryParams' ])
130 if info_url
== 'None' :
131 if domain
. startswith ( 'www.' ):
134 'mundonick.uol' : 'mundonick.com.br' ,
135 'nickjr' : 'br.nickelodeonjunior.tv' ,
139 'imageEp' : content_domain
,
140 'arcEp' : content_domain
,
142 if domain
== 'nickjr.com.br' :
143 query
[ 'ep' ] = 'c4b16088'
144 info_url
= update_url_query (
145 'http://feeds.mtvnservices.com/od/feed/intl-mrss-player-feed' , query
)
146 return self
._ get
_ videos
_ info
_ from
_u rl
( info_url
, video_id
)
149 class NickDeIE ( MTVServicesInfoExtractor
):
151 _VALID_URL
= r
'https?://(?:www\.)?(?P<host>nick\.(?:de|com\.pl|ch)|nickelodeon\.(?:nl|be|at|dk|no|se))/[^/]+/(?:[^/]+/)*(?P<id>[^/?#&]+)'
153 'url' : 'http://www.nick.de/playlist/3773-top-videos/videos/episode/17306-zu-wasser-und-zu-land-rauchende-erdnusse' ,
154 'only_matching' : True ,
156 'url' : 'http://www.nick.de/shows/342-icarly' ,
157 'only_matching' : True ,
159 'url' : 'http://www.nickelodeon.nl/shows/474-spongebob/videos/17403-een-kijkje-in-de-keuken-met-sandy-van-binnenuit' ,
160 'only_matching' : True ,
162 'url' : 'http://www.nickelodeon.at/playlist/3773-top-videos/videos/episode/77993-das-letzte-gefecht' ,
163 'only_matching' : True ,
165 'url' : 'http://www.nick.com.pl/seriale/474-spongebob-kanciastoporty/wideo/17412-teatr-to-jest-to-rodeo-oszolom' ,
166 'only_matching' : True ,
168 'url' : 'http://www.nickelodeon.no/program/2626-bulderhuset/videoer/90947-femteklasse-veronica-vs-vanzilla' ,
169 'only_matching' : True ,
171 'url' : 'http://www.nickelodeon.dk/serier/2626-hojs-hus/videoer/761-tissepause' ,
172 'only_matching' : True ,
174 'url' : 'http://www.nickelodeon.se/serier/2626-lugn-i-stormen/videos/998-' ,
175 'only_matching' : True ,
177 'url' : 'http://www.nick.ch/shows/2304-adventure-time-abenteuerzeit-mit-finn-und-jake' ,
178 'only_matching' : True ,
180 'url' : 'http://www.nickelodeon.be/afspeellijst/4530-top-videos/videos/episode/73917-inval-broodschapper-lariekoek-arie' ,
181 'only_matching' : True ,
184 def _get_feed_url ( self
, uri
, url
= None ):
185 video_id
= self
._ id
_ from
_u ri
( uri
)
186 config
= self
._ download
_ json
(
187 'http://media.mtvnservices.com/pmt/e1/access/index.html?uri= %s &configtype=edge&ref= %s ' % ( uri
, url
), video_id
)
188 return self
._ remove
_ template
_ parameter
( config
[ 'feedWithQueryParams' ])
191 class NickNightIE ( NickDeIE
): # XXX: Do not subclass from concrete IE
192 IE_NAME
= 'nicknight'
193 _VALID_URL
= r
'https?://(?:www\.)(?P<host>nicknight\.(?:de|at|tv))/(?:playlist|shows)/(?:[^/]+/)*(?P<id>[^/?#&]+)'
195 'url' : 'http://www.nicknight.at/shows/977-awkward/videos/85987-nimmer-beste-freunde' ,
196 'only_matching' : True ,
198 'url' : 'http://www.nicknight.at/shows/977-awkward' ,
199 'only_matching' : True ,
201 'url' : 'http://www.nicknight.at/shows/1900-faking-it' ,
202 'only_matching' : True ,
205 def _extract_mrss_url ( self
, webpage
, * args
):
206 return self
._ search
_ regex
(
207 r
'mrss\s*:\s*(["\' ])( ?P
< url
> http
.+ ?
) \
1 ', webpage,
208 ' mrss url
', group=' url
')
211 class NickRuIE(MTVServicesInfoExtractor):
212 IE_NAME = ' nickelodeonru
'
213 _VALID_URL = r' https?
://( ?
: www\
.) nickelodeon\
.( ?
: ru|fr|es|pt|ro|hu|com\
. tr
)/[ ^
/]+/( ?
:[ ^
/]+/)*( ?P
< id >[ ^
/ ?
#&]+)'
215 'url' : 'http://www.nickelodeon.ru/shows/henrydanger/videos/episodes/3-sezon-15-seriya-licenziya-na-polyot/pmomfb#playlist/7airc6' ,
216 'only_matching' : True ,
218 'url' : 'http://www.nickelodeon.ru/videos/smotri-na-nickelodeon-v-iyule/g9hvh7' ,
219 'only_matching' : True ,
221 'url' : 'http://www.nickelodeon.fr/programmes/bob-l-eponge/videos/le-marathon-de-booh-kini-bottom-mardi-31-octobre/nfn7z0' ,
222 'only_matching' : True ,
224 'url' : 'http://www.nickelodeon.es/videos/nickelodeon-consejos-tortitas/f7w7xy' ,
225 'only_matching' : True ,
227 'url' : 'http://www.nickelodeon.pt/series/spongebob-squarepants/videos/a-bolha-de-tinta-gigante/xutq1b' ,
228 'only_matching' : True ,
230 'url' : 'http://www.nickelodeon.ro/emisiuni/shimmer-si-shine/video/nahal-din-bomboane/uw5u2k' ,
231 'only_matching' : True ,
233 'url' : 'http://www.nickelodeon.hu/musorok/spongyabob-kockanadrag/videok/episodes/buborekfujas-az-elszakadt-nadrag/q57iob#playlist/k6te4y' ,
234 'only_matching' : True ,
236 'url' : 'http://www.nickelodeon.com.tr/programlar/sunger-bob/videolar/kayip-yatak/mgqbjy' ,
237 'only_matching' : True ,
240 def _real_extract ( self
, url
):
241 video_id
= self
._ match
_ id
( url
)
242 webpage
= self
._ download
_ webpage
( url
, video_id
)
243 mgid
= self
._ extract
_ mgid
( webpage
, url
)
244 return self
. url_result ( 'http://media.mtvnservices.com/embed/ %s ' % mgid
)