]> jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/generic.py
[extractor/generic] Detect manifest links via extension
[yt-dlp.git] / yt_dlp / extractor / generic.py
1 import os
2 import re
3 import types
4 import urllib.parse
5 import xml.etree.ElementTree
6
7 from .common import InfoExtractor # isort: split
8 from .commonprotocols import RtmpIE
9 from .youtube import YoutubeIE
10 from ..compat import compat_etree_fromstring
11 from ..utils import (
12 KNOWN_EXTENSIONS,
13 MEDIA_EXTENSIONS,
14 ExtractorError,
15 UnsupportedError,
16 determine_ext,
17 dict_get,
18 extract_basic_auth,
19 format_field,
20 int_or_none,
21 is_html,
22 js_to_json,
23 merge_dicts,
24 mimetype2ext,
25 orderedSet,
26 parse_duration,
27 parse_resolution,
28 smuggle_url,
29 str_or_none,
30 traverse_obj,
31 try_call,
32 unescapeHTML,
33 unified_timestamp,
34 unsmuggle_url,
35 url_or_none,
36 urljoin,
37 variadic,
38 xpath_attr,
39 xpath_text,
40 xpath_with_ns,
41 )
42
43
44 class GenericIE(InfoExtractor):
45 IE_DESC = 'Generic downloader that works on some sites'
46 _VALID_URL = r'.*'
47 IE_NAME = 'generic'
48 _NETRC_MACHINE = False # Suppress username warning
49 _TESTS = [
50 # Direct link to a video
51 {
52 'url': 'http://media.w3.org/2010/05/sintel/trailer.mp4',
53 'md5': '67d406c2bcb6af27fa886f31aa934bbe',
54 'info_dict': {
55 'id': 'trailer',
56 'ext': 'mp4',
57 'title': 'trailer',
58 'upload_date': '20100513',
59 }
60 },
61 # Direct link to media delivered compressed (until Accept-Encoding is *)
62 {
63 'url': 'http://calimero.tk/muzik/FictionJunction-Parallel_Hearts.flac',
64 'md5': '128c42e68b13950268b648275386fc74',
65 'info_dict': {
66 'id': 'FictionJunction-Parallel_Hearts',
67 'ext': 'flac',
68 'title': 'FictionJunction-Parallel_Hearts',
69 'upload_date': '20140522',
70 },
71 'expected_warnings': [
72 'URL could be a direct video link, returning it as such.'
73 ],
74 'skip': 'URL invalid',
75 },
76 # Direct download with broken HEAD
77 {
78 'url': 'http://ai-radio.org:8000/radio.opus',
79 'info_dict': {
80 'id': 'radio',
81 'ext': 'opus',
82 'title': 'radio',
83 },
84 'params': {
85 'skip_download': True, # infinite live stream
86 },
87 'expected_warnings': [
88 r'501.*Not Implemented',
89 r'400.*Bad Request',
90 ],
91 },
92 # Direct link with incorrect MIME type
93 {
94 'url': 'http://ftp.nluug.nl/video/nluug/2014-11-20_nj14/zaal-2/5_Lennart_Poettering_-_Systemd.webm',
95 'md5': '4ccbebe5f36706d85221f204d7eb5913',
96 'info_dict': {
97 'url': 'http://ftp.nluug.nl/video/nluug/2014-11-20_nj14/zaal-2/5_Lennart_Poettering_-_Systemd.webm',
98 'id': '5_Lennart_Poettering_-_Systemd',
99 'ext': 'webm',
100 'title': '5_Lennart_Poettering_-_Systemd',
101 'upload_date': '20141120',
102 },
103 'expected_warnings': [
104 'URL could be a direct video link, returning it as such.'
105 ]
106 },
107 # RSS feed
108 {
109 'url': 'http://phihag.de/2014/youtube-dl/rss2.xml',
110 'info_dict': {
111 'id': 'https://phihag.de/2014/youtube-dl/rss2.xml',
112 'title': 'Zero Punctuation',
113 'description': 're:.*groundbreaking video review series.*'
114 },
115 'playlist_mincount': 11,
116 },
117 # RSS feed with enclosure
118 {
119 'url': 'http://podcastfeeds.nbcnews.com/audio/podcast/MSNBC-MADDOW-NETCAST-M4V.xml',
120 'info_dict': {
121 'id': 'http://podcastfeeds.nbcnews.com/nbcnews/video/podcast/MSNBC-MADDOW-NETCAST-M4V.xml',
122 'title': 'MSNBC Rachel Maddow (video)',
123 'description': 're:.*her unique approach to storytelling.*',
124 },
125 'playlist': [{
126 'info_dict': {
127 'ext': 'mov',
128 'id': 'pdv_maddow_netcast_mov-12-03-2020-223726',
129 'title': 'MSNBC Rachel Maddow (video) - 12-03-2020-223726',
130 'description': 're:.*her unique approach to storytelling.*',
131 'upload_date': '20201204',
132 },
133 }],
134 },
135 # RSS feed with item with description and thumbnails
136 {
137 'url': 'https://anchor.fm/s/dd00e14/podcast/rss',
138 'info_dict': {
139 'id': 'https://anchor.fm/s/dd00e14/podcast/rss',
140 'title': 're:.*100% Hydrogen.*',
141 'description': 're:.*In this episode.*',
142 },
143 'playlist': [{
144 'info_dict': {
145 'ext': 'm4a',
146 'id': 'c1c879525ce2cb640b344507e682c36d',
147 'title': 're:Hydrogen!',
148 'description': 're:.*In this episode we are going.*',
149 'timestamp': 1567977776,
150 'upload_date': '20190908',
151 'duration': 459,
152 'thumbnail': r're:^https?://.*\.jpg$',
153 'episode_number': 1,
154 'season_number': 1,
155 'age_limit': 0,
156 'season': 'Season 1',
157 'direct': True,
158 'episode': 'Episode 1',
159 },
160 }],
161 'params': {
162 'skip_download': True,
163 },
164 },
165 # RSS feed with enclosures and unsupported link URLs
166 {
167 'url': 'http://www.hellointernet.fm/podcast?format=rss',
168 'info_dict': {
169 'id': 'http://www.hellointernet.fm/podcast?format=rss',
170 'description': 'CGP Grey and Brady Haran talk about YouTube, life, work, whatever.',
171 'title': 'Hello Internet',
172 },
173 'playlist_mincount': 100,
174 },
175 # RSS feed with guid
176 {
177 'url': 'https://www.omnycontent.com/d/playlist/a7b4f8fe-59d9-4afc-a79a-a90101378abf/bf2c1d80-3656-4449-9d00-a903004e8f84/efbff746-e7c1-463a-9d80-a903004e8f8f/podcast.rss',
178 'info_dict': {
179 'id': 'https://www.omnycontent.com/d/playlist/a7b4f8fe-59d9-4afc-a79a-a90101378abf/bf2c1d80-3656-4449-9d00-a903004e8f84/efbff746-e7c1-463a-9d80-a903004e8f8f/podcast.rss',
180 'description': 'md5:be809a44b63b0c56fb485caf68685520',
181 'title': 'The Little Red Podcast',
182 },
183 'playlist_mincount': 76,
184 },
185 # SMIL from http://videolectures.net/promogram_igor_mekjavic_eng
186 {
187 'url': 'http://videolectures.net/promogram_igor_mekjavic_eng/video/1/smil.xml',
188 'info_dict': {
189 'id': 'smil',
190 'ext': 'mp4',
191 'title': 'Automatics, robotics and biocybernetics',
192 'description': 'md5:815fc1deb6b3a2bff99de2d5325be482',
193 'upload_date': '20130627',
194 'formats': 'mincount:16',
195 'subtitles': 'mincount:1',
196 },
197 'params': {
198 'force_generic_extractor': True,
199 'skip_download': True,
200 },
201 },
202 # SMIL from http://www1.wdr.de/mediathek/video/livestream/index.html
203 {
204 'url': 'http://metafilegenerator.de/WDR/WDR_FS/hds/hds.smil',
205 'info_dict': {
206 'id': 'hds',
207 'ext': 'flv',
208 'title': 'hds',
209 'formats': 'mincount:1',
210 },
211 'params': {
212 'skip_download': True,
213 },
214 },
215 # SMIL from https://www.restudy.dk/video/play/id/1637
216 {
217 'url': 'https://www.restudy.dk/awsmedia/SmilDirectory/video_1637.xml',
218 'info_dict': {
219 'id': 'video_1637',
220 'ext': 'flv',
221 'title': 'video_1637',
222 'formats': 'mincount:3',
223 },
224 'params': {
225 'skip_download': True,
226 },
227 },
228 # SMIL from http://adventure.howstuffworks.com/5266-cool-jobs-iditarod-musher-video.htm
229 {
230 'url': 'http://services.media.howstuffworks.com/videos/450221/smil-service.smil',
231 'info_dict': {
232 'id': 'smil-service',
233 'ext': 'flv',
234 'title': 'smil-service',
235 'formats': 'mincount:1',
236 },
237 'params': {
238 'skip_download': True,
239 },
240 },
241 # SMIL from http://new.livestream.com/CoheedandCambria/WebsterHall/videos/4719370
242 {
243 'url': 'http://api.new.livestream.com/accounts/1570303/events/1585861/videos/4719370.smil',
244 'info_dict': {
245 'id': '4719370',
246 'ext': 'mp4',
247 'title': '571de1fd-47bc-48db-abf9-238872a58d1f',
248 'formats': 'mincount:3',
249 },
250 'params': {
251 'skip_download': True,
252 },
253 },
254 # XSPF playlist from http://www.telegraaf.nl/tv/nieuws/binnenland/24353229/__Tikibad_ontruimd_wegens_brand__.html
255 {
256 'url': 'http://www.telegraaf.nl/xml/playlist/2015/8/7/mZlp2ctYIUEB.xspf',
257 'info_dict': {
258 'id': 'mZlp2ctYIUEB',
259 'ext': 'mp4',
260 'title': 'Tikibad ontruimd wegens brand',
261 'description': 'md5:05ca046ff47b931f9b04855015e163a4',
262 'thumbnail': r're:^https?://.*\.jpg$',
263 'duration': 33,
264 },
265 'params': {
266 'skip_download': True,
267 },
268 },
269 # MPD from http://dash-mse-test.appspot.com/media.html
270 {
271 'url': 'http://yt-dash-mse-test.commondatastorage.googleapis.com/media/car-20120827-manifest.mpd',
272 'md5': '4b57baab2e30d6eb3a6a09f0ba57ef53',
273 'info_dict': {
274 'id': 'car-20120827-manifest',
275 'ext': 'mp4',
276 'title': 'car-20120827-manifest',
277 'formats': 'mincount:9',
278 'upload_date': '20130904',
279 },
280 },
281 # m3u8 served with Content-Type: audio/x-mpegURL; charset=utf-8
282 {
283 'url': 'http://once.unicornmedia.com/now/master/playlist/bb0b18ba-64f5-4b1b-a29f-0ac252f06b68/77a785f3-5188-4806-b788-0893a61634ed/93677179-2d99-4ef4-9e17-fe70d49abfbf/content.m3u8',
284 'info_dict': {
285 'id': 'content',
286 'ext': 'mp4',
287 'title': 'content',
288 'formats': 'mincount:8',
289 },
290 'params': {
291 # m3u8 downloads
292 'skip_download': True,
293 },
294 'skip': 'video gone',
295 },
296 # m3u8 served with Content-Type: text/plain
297 {
298 'url': 'http://www.nacentapps.com/m3u8/index.m3u8',
299 'info_dict': {
300 'id': 'index',
301 'ext': 'mp4',
302 'title': 'index',
303 'upload_date': '20140720',
304 'formats': 'mincount:11',
305 },
306 'params': {
307 # m3u8 downloads
308 'skip_download': True,
309 },
310 'skip': 'video gone',
311 },
312 # google redirect
313 {
314 'url': 'http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCUQtwIwAA&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DcmQHVoWB5FY&ei=F-sNU-LLCaXk4QT52ICQBQ&usg=AFQjCNEw4hL29zgOohLXvpJ-Bdh2bils1Q&bvm=bv.61965928,d.bGE',
315 'info_dict': {
316 'id': 'cmQHVoWB5FY',
317 'ext': 'mp4',
318 'upload_date': '20130224',
319 'uploader_id': 'TheVerge',
320 'description': r're:^Chris Ziegler takes a look at the\.*',
321 'uploader': 'The Verge',
322 'title': 'First Firefox OS phones side-by-side',
323 },
324 'params': {
325 'skip_download': False,
326 }
327 },
328 {
329 # redirect in Refresh HTTP header
330 'url': 'https://www.facebook.com/l.php?u=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DpO8h3EaFRdo&h=TAQHsoToz&enc=AZN16h-b6o4Zq9pZkCCdOLNKMN96BbGMNtcFwHSaazus4JHT_MFYkAA-WARTX2kvsCIdlAIyHZjl6d33ILIJU7Jzwk_K3mcenAXoAzBNoZDI_Q7EXGDJnIhrGkLXo_LJ_pAa2Jzbx17UHMd3jAs--6j2zaeto5w9RTn8T_1kKg3fdC5WPX9Dbb18vzH7YFX0eSJmoa6SP114rvlkw6pkS1-T&s=1',
331 'info_dict': {
332 'id': 'pO8h3EaFRdo',
333 'ext': 'mp4',
334 'title': 'Tripeo Boiler Room x Dekmantel Festival DJ Set',
335 'description': 'md5:6294cc1af09c4049e0652b51a2df10d5',
336 'upload_date': '20150917',
337 'uploader_id': 'brtvofficial',
338 'uploader': 'Boiler Room',
339 },
340 'params': {
341 'skip_download': False,
342 },
343 },
344 {
345 'url': 'http://www.hodiho.fr/2013/02/regis-plante-sa-jeep.html',
346 'md5': '85b90ccc9d73b4acd9138d3af4c27f89',
347 'info_dict': {
348 'id': '13601338388002',
349 'ext': 'mp4',
350 'uploader': 'www.hodiho.fr',
351 'title': 'R\u00e9gis plante sa Jeep',
352 }
353 },
354 # bandcamp page with custom domain
355 {
356 'add_ie': ['Bandcamp'],
357 'url': 'http://bronyrock.com/track/the-pony-mash',
358 'info_dict': {
359 'id': '3235767654',
360 'ext': 'mp3',
361 'title': 'The Pony Mash',
362 'uploader': 'M_Pallante',
363 },
364 'skip': 'There is a limit of 200 free downloads / month for the test song',
365 },
366 # ooyala video
367 {
368 'url': 'http://www.rollingstone.com/music/videos/norwegian-dj-cashmere-cat-goes-spartan-on-with-me-premiere-20131219',
369 'md5': '166dd577b433b4d4ebfee10b0824d8ff',
370 'info_dict': {
371 'id': 'BwY2RxaTrTkslxOfcan0UCf0YqyvWysJ',
372 'ext': 'mp4',
373 'title': '2cc213299525360.mov', # that's what we get
374 'duration': 238.231,
375 },
376 'add_ie': ['Ooyala'],
377 },
378 {
379 # ooyala video embedded with http://player.ooyala.com/iframe.js
380 'url': 'http://www.macrumors.com/2015/07/24/steve-jobs-the-man-in-the-machine-first-trailer/',
381 'info_dict': {
382 'id': 'p0MGJndjoG5SOKqO_hZJuZFPB-Tr5VgB',
383 'ext': 'mp4',
384 'title': '"Steve Jobs: Man in the Machine" trailer',
385 'description': 'The first trailer for the Alex Gibney documentary "Steve Jobs: Man in the Machine."',
386 'duration': 135.427,
387 },
388 'params': {
389 'skip_download': True,
390 },
391 'skip': 'movie expired',
392 },
393 # ooyala video embedded with http://player.ooyala.com/static/v4/production/latest/core.min.js
394 {
395 'url': 'http://wnep.com/2017/07/22/steampunk-fest-comes-to-honesdale/',
396 'info_dict': {
397 'id': 'lwYWYxYzE6V5uJMjNGyKtwwiw9ZJD7t2',
398 'ext': 'mp4',
399 'title': 'Steampunk Fest Comes to Honesdale',
400 'duration': 43.276,
401 },
402 'params': {
403 'skip_download': True,
404 }
405 },
406 # embed.ly video
407 {
408 'url': 'http://www.tested.com/science/weird/460206-tested-grinding-coffee-2000-frames-second/',
409 'info_dict': {
410 'id': '9ODmcdjQcHQ',
411 'ext': 'mp4',
412 'title': 'Tested: Grinding Coffee at 2000 Frames Per Second',
413 'upload_date': '20140225',
414 'description': 'md5:06a40fbf30b220468f1e0957c0f558ff',
415 'uploader': 'Tested',
416 'uploader_id': 'testedcom',
417 },
418 # No need to test YoutubeIE here
419 'params': {
420 'skip_download': True,
421 },
422 },
423 # funnyordie embed
424 {
425 'url': 'http://www.theguardian.com/world/2014/mar/11/obama-zach-galifianakis-between-two-ferns',
426 'info_dict': {
427 'id': '18e820ec3f',
428 'ext': 'mp4',
429 'title': 'Between Two Ferns with Zach Galifianakis: President Barack Obama',
430 'description': 'Episode 18: President Barack Obama sits down with Zach Galifianakis for his most memorable interview yet.',
431 },
432 # HEAD requests lead to endless 301, while GET is OK
433 'expected_warnings': ['301'],
434 },
435 # RUTV embed
436 {
437 'url': 'http://www.rg.ru/2014/03/15/reg-dfo/anklav-anons.html',
438 'info_dict': {
439 'id': '776940',
440 'ext': 'mp4',
441 'title': 'Охотское море стало целиком российским',
442 'description': 'md5:5ed62483b14663e2a95ebbe115eb8f43',
443 },
444 'params': {
445 # m3u8 download
446 'skip_download': True,
447 },
448 },
449 # TVC embed
450 {
451 'url': 'http://sch1298sz.mskobr.ru/dou_edu/karamel_ki/filial_galleries/video/iframe_src_http_tvc_ru_video_iframe_id_55304_isplay_false_acc_video_id_channel_brand_id_11_show_episodes_episode_id_32307_frameb/',
452 'info_dict': {
453 'id': '55304',
454 'ext': 'mp4',
455 'title': 'Дошкольное воспитание',
456 },
457 },
458 # SportBox embed
459 {
460 'url': 'http://www.vestifinance.ru/articles/25753',
461 'info_dict': {
462 'id': '25753',
463 'title': 'Прямые трансляции с Форума-выставки "Госзаказ-2013"',
464 },
465 'playlist': [{
466 'info_dict': {
467 'id': '370908',
468 'title': 'Госзаказ. День 3',
469 'ext': 'mp4',
470 }
471 }, {
472 'info_dict': {
473 'id': '370905',
474 'title': 'Госзаказ. День 2',
475 'ext': 'mp4',
476 }
477 }, {
478 'info_dict': {
479 'id': '370902',
480 'title': 'Госзаказ. День 1',
481 'ext': 'mp4',
482 }
483 }],
484 'params': {
485 # m3u8 download
486 'skip_download': True,
487 },
488 },
489 # Myvi.ru embed
490 {
491 'url': 'http://www.kinomyvi.tv/news/detail/Pervij-dublirovannij-trejler--Uzhastikov-_nOw1',
492 'info_dict': {
493 'id': 'f4dafcad-ff21-423d-89b5-146cfd89fa1e',
494 'ext': 'mp4',
495 'title': 'Ужастики, русский трейлер (2015)',
496 'thumbnail': r're:^https?://.*\.jpg$',
497 'duration': 153,
498 }
499 },
500 # XHamster embed
501 {
502 'url': 'http://www.numisc.com/forum/showthread.php?11696-FM15-which-pumiscer-was-this-%28-vid-%29-%28-alfa-as-fuck-srx-%29&s=711f5db534502e22260dec8c5e2d66d8',
503 'info_dict': {
504 'id': 'showthread',
505 'title': '[NSFL] [FM15] which pumiscer was this ( vid ) ( alfa as fuck srx )',
506 },
507 'playlist_mincount': 7,
508 # This forum does not allow <iframe> syntaxes anymore
509 # Now HTML tags are displayed as-is
510 'skip': 'No videos on this page',
511 },
512 # Embedded TED video
513 {
514 'url': 'http://en.support.wordpress.com/videos/ted-talks/',
515 'md5': '65fdff94098e4a607385a60c5177c638',
516 'info_dict': {
517 'id': '1969',
518 'ext': 'mp4',
519 'title': 'Hidden miracles of the natural world',
520 'uploader': 'Louie Schwartzberg',
521 'description': 'md5:8145d19d320ff3e52f28401f4c4283b9',
522 }
523 },
524 # nowvideo embed hidden behind percent encoding
525 {
526 'url': 'http://www.waoanime.tv/the-super-dimension-fortress-macross-episode-1/',
527 'md5': '2baf4ddd70f697d94b1c18cf796d5107',
528 'info_dict': {
529 'id': '06e53103ca9aa',
530 'ext': 'flv',
531 'title': 'Macross Episode 001 Watch Macross Episode 001 onl',
532 'description': 'No description',
533 },
534 },
535 # arte embed
536 {
537 'url': 'http://www.tv-replay.fr/redirection/20-03-14/x-enius-arte-10753389.html',
538 'md5': '7653032cbb25bf6c80d80f217055fa43',
539 'info_dict': {
540 'id': '048195-004_PLUS7-F',
541 'ext': 'flv',
542 'title': 'X:enius',
543 'description': 'md5:d5fdf32ef6613cdbfd516ae658abf168',
544 'upload_date': '20140320',
545 },
546 'params': {
547 'skip_download': 'Requires rtmpdump'
548 },
549 'skip': 'video gone',
550 },
551 # francetv embed
552 {
553 'url': 'http://www.tsprod.com/replay-du-concert-alcaline-de-calogero',
554 'info_dict': {
555 'id': 'EV_30231',
556 'ext': 'mp4',
557 'title': 'Alcaline, le concert avec Calogero',
558 'description': 'md5:61f08036dcc8f47e9cfc33aed08ffaff',
559 'upload_date': '20150226',
560 'timestamp': 1424989860,
561 'duration': 5400,
562 },
563 'params': {
564 # m3u8 downloads
565 'skip_download': True,
566 },
567 'expected_warnings': [
568 'Forbidden'
569 ]
570 },
571 # Condé Nast embed
572 {
573 'url': 'http://www.wired.com/2014/04/honda-asimo/',
574 'md5': 'ba0dfe966fa007657bd1443ee672db0f',
575 'info_dict': {
576 'id': '53501be369702d3275860000',
577 'ext': 'mp4',
578 'title': 'Honda’s New Asimo Robot Is More Human Than Ever',
579 }
580 },
581 # Dailymotion embed
582 {
583 'url': 'http://www.spi0n.com/zap-spi0n-com-n216/',
584 'md5': '441aeeb82eb72c422c7f14ec533999cd',
585 'info_dict': {
586 'id': 'k2mm4bCdJ6CQ2i7c8o2',
587 'ext': 'mp4',
588 'title': 'Le Zap de Spi0n n°216 - Zapping du Web',
589 'description': 'md5:faf028e48a461b8b7fad38f1e104b119',
590 'uploader': 'Spi0n',
591 'uploader_id': 'xgditw',
592 'upload_date': '20140425',
593 'timestamp': 1398441542,
594 },
595 'add_ie': ['Dailymotion'],
596 },
597 # DailyMail embed
598 {
599 'url': 'http://www.bumm.sk/krimi/2017/07/05/biztonsagi-kamera-buktatta-le-az-agg-ferfit-utlegelo-apolot',
600 'info_dict': {
601 'id': '1495629',
602 'ext': 'mp4',
603 'title': 'Care worker punches elderly dementia patient in head 11 times',
604 'description': 'md5:3a743dee84e57e48ec68bf67113199a5',
605 },
606 'add_ie': ['DailyMail'],
607 'params': {
608 'skip_download': True,
609 },
610 },
611 # YouTube embed
612 {
613 'url': 'http://www.badzine.de/ansicht/datum/2014/06/09/so-funktioniert-die-neue-englische-badminton-liga.html',
614 'info_dict': {
615 'id': 'FXRb4ykk4S0',
616 'ext': 'mp4',
617 'title': 'The NBL Auction 2014',
618 'uploader': 'BADMINTON England',
619 'uploader_id': 'BADMINTONEvents',
620 'upload_date': '20140603',
621 'description': 'md5:9ef128a69f1e262a700ed83edb163a73',
622 },
623 'add_ie': ['Youtube'],
624 'params': {
625 'skip_download': True,
626 }
627 },
628 # MTVServices embed
629 {
630 'url': 'http://www.vulture.com/2016/06/new-key-peele-sketches-released.html',
631 'md5': 'ca1aef97695ef2c1d6973256a57e5252',
632 'info_dict': {
633 'id': '769f7ec0-0692-4d62-9b45-0d88074bffc1',
634 'ext': 'mp4',
635 'title': 'Key and Peele|October 10, 2012|2|203|Liam Neesons - Uncensored',
636 'description': 'Two valets share their love for movie star Liam Neesons.',
637 'timestamp': 1349922600,
638 'upload_date': '20121011',
639 },
640 },
641 # YouTube embed via <data-embed-url="">
642 {
643 'url': 'https://play.google.com/store/apps/details?id=com.gameloft.android.ANMP.GloftA8HM',
644 'info_dict': {
645 'id': '4vAffPZIT44',
646 'ext': 'mp4',
647 'title': 'Asphalt 8: Airborne - Update - Welcome to Dubai!',
648 'uploader': 'Gameloft',
649 'uploader_id': 'gameloft',
650 'upload_date': '20140828',
651 'description': 'md5:c80da9ed3d83ae6d1876c834de03e1c4',
652 },
653 'params': {
654 'skip_download': True,
655 }
656 },
657 # Flowplayer
658 {
659 'url': 'http://www.handjobhub.com/video/busty-blonde-siri-tit-fuck-while-wank-6313.html',
660 'md5': '9d65602bf31c6e20014319c7d07fba27',
661 'info_dict': {
662 'id': '5123ea6d5e5a7',
663 'ext': 'mp4',
664 'age_limit': 18,
665 'uploader': 'www.handjobhub.com',
666 'title': 'Busty Blonde Siri Tit Fuck While Wank at HandjobHub.com',
667 }
668 },
669 # MLB embed
670 {
671 'url': 'http://umpire-empire.com/index.php/topic/58125-laz-decides-no-thats-low/',
672 'md5': '96f09a37e44da40dd083e12d9a683327',
673 'info_dict': {
674 'id': '33322633',
675 'ext': 'mp4',
676 'title': 'Ump changes call to ball',
677 'description': 'md5:71c11215384298a172a6dcb4c2e20685',
678 'duration': 48,
679 'timestamp': 1401537900,
680 'upload_date': '20140531',
681 'thumbnail': r're:^https?://.*\.jpg$',
682 },
683 },
684 # Wistia standard embed (async)
685 {
686 'url': 'https://www.getdrip.com/university/brennan-dunn-drip-workshop/',
687 'info_dict': {
688 'id': '807fafadvk',
689 'ext': 'mp4',
690 'title': 'Drip Brennan Dunn Workshop',
691 'description': 'a JV Webinars video from getdrip-1',
692 'duration': 4986.95,
693 'timestamp': 1463607249,
694 'upload_date': '20160518',
695 },
696 'params': {
697 'skip_download': True,
698 },
699 'skip': 'webpage 404 not found',
700 },
701 # Soundcloud embed
702 {
703 'url': 'http://nakedsecurity.sophos.com/2014/10/29/sscc-171-are-you-sure-that-1234-is-a-bad-password-podcast/',
704 'info_dict': {
705 'id': '174391317',
706 'ext': 'mp3',
707 'description': 'md5:ff867d6b555488ad3c52572bb33d432c',
708 'uploader': 'Sophos Security',
709 'title': 'Chet Chat 171 - Oct 29, 2014',
710 'upload_date': '20141029',
711 }
712 },
713 # Soundcloud multiple embeds
714 {
715 'url': 'http://www.guitarplayer.com/lessons/1014/legato-workout-one-hour-to-more-fluid-performance---tab/52809',
716 'info_dict': {
717 'id': '52809',
718 'title': 'Guitar Essentials: Legato Workout—One-Hour to Fluid Performance | TAB + AUDIO',
719 },
720 'playlist_mincount': 7,
721 },
722 # TuneIn station embed
723 {
724 'url': 'http://radiocnrv.com/promouvoir-radio-cnrv/',
725 'info_dict': {
726 'id': '204146',
727 'ext': 'mp3',
728 'title': 'CNRV',
729 'location': 'Paris, France',
730 'is_live': True,
731 },
732 'params': {
733 # Live stream
734 'skip_download': True,
735 },
736 },
737 # Livestream embed
738 {
739 'url': 'http://www.esa.int/Our_Activities/Space_Science/Rosetta/Philae_comet_touch-down_webcast',
740 'info_dict': {
741 'id': '67864563',
742 'ext': 'flv',
743 'upload_date': '20141112',
744 'title': 'Rosetta #CometLanding webcast HL 10',
745 }
746 },
747 # Another Livestream embed, without 'new.' in URL
748 {
749 'url': 'https://www.freespeech.org/',
750 'info_dict': {
751 'id': '123537347',
752 'ext': 'mp4',
753 'title': 're:^FSTV [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
754 },
755 'params': {
756 # Live stream
757 'skip_download': True,
758 },
759 },
760 # LazyYT
761 {
762 'url': 'https://skiplagged.com/',
763 'info_dict': {
764 'id': 'skiplagged',
765 'title': 'Skiplagged: The smart way to find cheap flights',
766 },
767 'playlist_mincount': 1,
768 'add_ie': ['Youtube'],
769 },
770 # Cinchcast embed
771 {
772 'url': 'http://undergroundwellness.com/podcasts/306-5-steps-to-permanent-gut-healing/',
773 'info_dict': {
774 'id': '7141703',
775 'ext': 'mp3',
776 'upload_date': '20141126',
777 'title': 'Jack Tips: 5 Steps to Permanent Gut Healing',
778 }
779 },
780 # Cinerama player
781 {
782 'url': 'http://www.abc.net.au/7.30/content/2015/s4164797.htm',
783 'info_dict': {
784 'id': '730m_DandD_1901_512k',
785 'ext': 'mp4',
786 'uploader': 'www.abc.net.au',
787 'title': 'Game of Thrones with dice - Dungeons and Dragons fantasy role-playing game gets new life - 19/01/2015',
788 }
789 },
790 # embedded viddler video
791 {
792 'url': 'http://deadspin.com/i-cant-stop-watching-john-wall-chop-the-nuggets-with-th-1681801597',
793 'info_dict': {
794 'id': '4d03aad9',
795 'ext': 'mp4',
796 'uploader': 'deadspin',
797 'title': 'WALL-TO-GORTAT',
798 'timestamp': 1422285291,
799 'upload_date': '20150126',
800 },
801 'add_ie': ['Viddler'],
802 },
803 # Libsyn embed
804 {
805 'url': 'http://thedailyshow.cc.com/podcast/episodetwelve',
806 'info_dict': {
807 'id': '3377616',
808 'ext': 'mp3',
809 'title': "The Daily Show Podcast without Jon Stewart - Episode 12: Bassem Youssef: Egypt's Jon Stewart",
810 'description': 'md5:601cb790edd05908957dae8aaa866465',
811 'upload_date': '20150220',
812 },
813 'skip': 'All The Daily Show URLs now redirect to http://www.cc.com/shows/',
814 },
815 # jwplayer YouTube
816 {
817 'url': 'http://media.nationalarchives.gov.uk/index.php/webinar-using-discovery-national-archives-online-catalogue/',
818 'info_dict': {
819 'id': 'Mrj4DVp2zeA',
820 'ext': 'mp4',
821 'upload_date': '20150212',
822 'uploader': 'The National Archives UK',
823 'description': 'md5:8078af856dca76edc42910b61273dbbf',
824 'uploader_id': 'NationalArchives08',
825 'title': 'Webinar: Using Discovery, The National Archives’ online catalogue',
826 },
827 },
828 # jwplayer rtmp
829 {
830 'url': 'http://www.suffolk.edu/sjc/live.php',
831 'info_dict': {
832 'id': 'live',
833 'ext': 'flv',
834 'title': 'Massachusetts Supreme Judicial Court Oral Arguments',
835 'uploader': 'www.suffolk.edu',
836 },
837 'params': {
838 'skip_download': True,
839 },
840 'skip': 'Only has video a few mornings per month, see http://www.suffolk.edu/sjc/',
841 },
842 # jwplayer with only the json URL
843 {
844 'url': 'https://www.hollywoodreporter.com/news/general-news/dunkirk-team-reveals-what-christopher-nolan-said-oscar-win-meet-your-oscar-winner-1092454',
845 'info_dict': {
846 'id': 'TljWkvWH',
847 'ext': 'mp4',
848 'upload_date': '20180306',
849 'title': 'md5:91eb1862f6526415214f62c00b453936',
850 'description': 'md5:73048ae50ae953da10549d1d2fe9b3aa',
851 'timestamp': 1520367225,
852 },
853 'params': {
854 'skip_download': True,
855 },
856 },
857 # Complex jwplayer
858 {
859 'url': 'http://www.indiedb.com/games/king-machine/videos',
860 'info_dict': {
861 'id': 'videos',
862 'ext': 'mp4',
863 'title': 'king machine trailer 1',
864 'description': 'Browse King Machine videos & audio for sweet media. Your eyes will thank you.',
865 'thumbnail': r're:^https?://.*\.jpg$',
866 },
867 },
868 {
869 # Video.js embed, multiple formats
870 'url': 'http://ortcam.com/solidworks-урок-6-настройка-чертежа_33f9b7351.html',
871 'info_dict': {
872 'id': 'yygqldloqIk',
873 'ext': 'mp4',
874 'title': 'SolidWorks. Урок 6 Настройка чертежа',
875 'description': 'md5:baf95267792646afdbf030e4d06b2ab3',
876 'upload_date': '20130314',
877 'uploader': 'PROстое3D',
878 'uploader_id': 'PROstoe3D',
879 },
880 'params': {
881 'skip_download': True,
882 },
883 },
884 {
885 # Video.js embed, single format
886 'url': 'https://www.vooplayer.com/v3/watch/watch.php?v=NzgwNTg=',
887 'info_dict': {
888 'id': 'watch',
889 'ext': 'mp4',
890 'title': 'Step 1 - Good Foundation',
891 'description': 'md5:d1e7ff33a29fc3eb1673d6c270d344f4',
892 },
893 'params': {
894 'skip_download': True,
895 },
896 },
897 # rtl.nl embed
898 {
899 'url': 'http://www.rtlnieuws.nl/nieuws/buitenland/aanslagen-kopenhagen',
900 'playlist_mincount': 5,
901 'info_dict': {
902 'id': 'aanslagen-kopenhagen',
903 'title': 'Aanslagen Kopenhagen',
904 }
905 },
906 # Zapiks embed
907 {
908 'url': 'http://www.skipass.com/news/116090-bon-appetit-s5ep3-baqueira-mi-cor.html',
909 'info_dict': {
910 'id': '118046',
911 'ext': 'mp4',
912 'title': 'EP3S5 - Bon Appétit - Baqueira Mi Corazon !',
913 }
914 },
915 # Kaltura embed (different embed code)
916 {
917 'url': 'http://www.premierchristianradio.com/Shows/Saturday/Unbelievable/Conference-Videos/Os-Guinness-Is-It-Fools-Talk-Unbelievable-Conference-2014',
918 'info_dict': {
919 'id': '1_a52wc67y',
920 'ext': 'flv',
921 'upload_date': '20150127',
922 'uploader_id': 'PremierMedia',
923 'timestamp': int,
924 'title': 'Os Guinness // Is It Fools Talk? // Unbelievable? Conference 2014',
925 },
926 },
927 # Kaltura embed with single quotes
928 {
929 'url': 'http://fod.infobase.com/p_ViewPlaylist.aspx?AssignmentID=NUN8ZY',
930 'info_dict': {
931 'id': '0_izeg5utt',
932 'ext': 'mp4',
933 'title': '35871',
934 'timestamp': 1355743100,
935 'upload_date': '20121217',
936 'uploader_id': 'cplapp@learn360.com',
937 },
938 'add_ie': ['Kaltura'],
939 },
940 {
941 # Kaltura embedded via quoted entry_id
942 'url': 'https://www.oreilly.com/ideas/my-cloud-makes-pretty-pictures',
943 'info_dict': {
944 'id': '0_utuok90b',
945 'ext': 'mp4',
946 'title': '06_matthew_brender_raj_dutt',
947 'timestamp': 1466638791,
948 'upload_date': '20160622',
949 },
950 'add_ie': ['Kaltura'],
951 'expected_warnings': [
952 'Could not send HEAD request'
953 ],
954 'params': {
955 'skip_download': True,
956 }
957 },
958 {
959 # Kaltura embedded, some fileExt broken (#11480)
960 'url': 'http://www.cornell.edu/video/nima-arkani-hamed-standard-models-of-particle-physics',
961 'info_dict': {
962 'id': '1_sgtvehim',
963 'ext': 'mp4',
964 'title': 'Our "Standard Models" of particle physics and cosmology',
965 'description': 'md5:67ea74807b8c4fea92a6f38d6d323861',
966 'timestamp': 1321158993,
967 'upload_date': '20111113',
968 'uploader_id': 'kps1',
969 },
970 'add_ie': ['Kaltura'],
971 },
972 {
973 # Kaltura iframe embed
974 'url': 'http://www.gsd.harvard.edu/event/i-m-pei-a-centennial-celebration/',
975 'md5': 'ae5ace8eb09dc1a35d03b579a9c2cc44',
976 'info_dict': {
977 'id': '0_f2cfbpwy',
978 'ext': 'mp4',
979 'title': 'I. M. Pei: A Centennial Celebration',
980 'description': 'md5:1db8f40c69edc46ca180ba30c567f37c',
981 'upload_date': '20170403',
982 'uploader_id': 'batchUser',
983 'timestamp': 1491232186,
984 },
985 'add_ie': ['Kaltura'],
986 },
987 {
988 # Kaltura iframe embed, more sophisticated
989 'url': 'http://www.cns.nyu.edu/~eero/math-tools/Videos/lecture-05sep2017.html',
990 'info_dict': {
991 'id': '1_9gzouybz',
992 'ext': 'mp4',
993 'title': 'lecture-05sep2017',
994 'description': 'md5:40f347d91fd4ba047e511c5321064b49',
995 'upload_date': '20170913',
996 'uploader_id': 'eps2',
997 'timestamp': 1505340777,
998 },
999 'params': {
1000 'skip_download': True,
1001 },
1002 'add_ie': ['Kaltura'],
1003 },
1004 {
1005 # meta twitter:player
1006 'url': 'http://thechive.com/2017/12/08/all-i-want-for-christmas-is-more-twerk/',
1007 'info_dict': {
1008 'id': '0_01b42zps',
1009 'ext': 'mp4',
1010 'title': 'Main Twerk (Video)',
1011 'upload_date': '20171208',
1012 'uploader_id': 'sebastian.salinas@thechive.com',
1013 'timestamp': 1512713057,
1014 },
1015 'params': {
1016 'skip_download': True,
1017 },
1018 'add_ie': ['Kaltura'],
1019 },
1020 # referrer protected EaglePlatform embed
1021 {
1022 'url': 'https://tvrain.ru/lite/teleshow/kak_vse_nachinalos/namin-418921/',
1023 'info_dict': {
1024 'id': '582306',
1025 'ext': 'mp4',
1026 'title': 'Стас Намин: «Мы нарушили девственность Кремля»',
1027 'thumbnail': r're:^https?://.*\.jpg$',
1028 'duration': 3382,
1029 'view_count': int,
1030 },
1031 'params': {
1032 'skip_download': True,
1033 },
1034 },
1035 # ClipYou (EaglePlatform) embed (custom URL)
1036 {
1037 'url': 'http://muz-tv.ru/play/7129/',
1038 # Not checking MD5 as sometimes the direct HTTP link results in 404 and HLS is used
1039 'info_dict': {
1040 'id': '12820',
1041 'ext': 'mp4',
1042 'title': "'O Sole Mio",
1043 'thumbnail': r're:^https?://.*\.jpg$',
1044 'duration': 216,
1045 'view_count': int,
1046 },
1047 'params': {
1048 'skip_download': True,
1049 },
1050 'skip': 'This video is unavailable.',
1051 },
1052 # Pladform embed
1053 {
1054 'url': 'http://muz-tv.ru/kinozal/view/7400/',
1055 'info_dict': {
1056 'id': '100183293',
1057 'ext': 'mp4',
1058 'title': 'Тайны перевала Дятлова • 1 серия 2 часть',
1059 'description': 'Документальный сериал-расследование одной из самых жутких тайн ХХ века',
1060 'thumbnail': r're:^https?://.*\.jpg$',
1061 'duration': 694,
1062 'age_limit': 0,
1063 },
1064 'skip': 'HTTP Error 404: Not Found',
1065 },
1066 # Playwire embed
1067 {
1068 'url': 'http://www.cinemablend.com/new/First-Joe-Dirt-2-Trailer-Teaser-Stupid-Greatness-70874.html',
1069 'info_dict': {
1070 'id': '3519514',
1071 'ext': 'mp4',
1072 'title': 'Joe Dirt 2 Beautiful Loser Teaser Trailer',
1073 'thumbnail': r're:^https?://.*\.png$',
1074 'duration': 45.115,
1075 },
1076 },
1077 # Crooks and Liars embed
1078 {
1079 'url': 'http://crooksandliars.com/2015/04/fox-friends-says-protecting-atheists',
1080 'info_dict': {
1081 'id': '8RUoRhRi',
1082 'ext': 'mp4',
1083 'title': "Fox & Friends Says Protecting Atheists From Discrimination Is Anti-Christian!",
1084 'description': 'md5:e1a46ad1650e3a5ec7196d432799127f',
1085 'timestamp': 1428207000,
1086 'upload_date': '20150405',
1087 'uploader': 'Heather',
1088 },
1089 },
1090 # Crooks and Liars external embed
1091 {
1092 'url': 'http://theothermccain.com/2010/02/02/video-proves-that-bill-kristol-has-been-watching-glenn-beck/comment-page-1/',
1093 'info_dict': {
1094 'id': 'MTE3MjUtMzQ2MzA',
1095 'ext': 'mp4',
1096 'title': 'md5:5e3662a81a4014d24c250d76d41a08d5',
1097 'description': 'md5:9b8e9542d6c3c5de42d6451b7d780cec',
1098 'timestamp': 1265032391,
1099 'upload_date': '20100201',
1100 'uploader': 'Heather',
1101 },
1102 },
1103 # NBC Sports vplayer embed
1104 {
1105 'url': 'http://www.riderfans.com/forum/showthread.php?121827-Freeman&s=e98fa1ea6dc08e886b1678d35212494a',
1106 'info_dict': {
1107 'id': 'ln7x1qSThw4k',
1108 'ext': 'flv',
1109 'title': "PFT Live: New leader in the 'new-look' defense",
1110 'description': 'md5:65a19b4bbfb3b0c0c5768bed1dfad74e',
1111 'uploader': 'NBCU-SPORTS',
1112 'upload_date': '20140107',
1113 'timestamp': 1389118457,
1114 },
1115 'skip': 'Invalid Page URL',
1116 },
1117 # NBC News embed
1118 {
1119 'url': 'http://www.vulture.com/2016/06/letterman-couldnt-care-less-about-late-night.html',
1120 'md5': '1aa589c675898ae6d37a17913cf68d66',
1121 'info_dict': {
1122 'id': 'x_dtl_oa_LettermanliftPR_160608',
1123 'ext': 'mp4',
1124 'title': 'David Letterman: A Preview',
1125 'description': 'A preview of Tom Brokaw\'s interview with David Letterman as part of the On Assignment series powered by Dateline. Airs Sunday June 12 at 7/6c.',
1126 'upload_date': '20160609',
1127 'timestamp': 1465431544,
1128 'uploader': 'NBCU-NEWS',
1129 },
1130 },
1131 # UDN embed
1132 {
1133 'url': 'https://video.udn.com/news/300346',
1134 'md5': 'fd2060e988c326991037b9aff9df21a6',
1135 'info_dict': {
1136 'id': '300346',
1137 'ext': 'mp4',
1138 'title': '中一中男師變性 全校師生力挺',
1139 'thumbnail': r're:^https?://.*\.jpg$',
1140 },
1141 'params': {
1142 # m3u8 download
1143 'skip_download': True,
1144 },
1145 'expected_warnings': ['Failed to parse JSON Expecting value'],
1146 },
1147 # Kinja embed
1148 {
1149 'url': 'http://www.clickhole.com/video/dont-understand-bitcoin-man-will-mumble-explanatio-2537',
1150 'info_dict': {
1151 'id': '106351',
1152 'ext': 'mp4',
1153 'title': 'Don’t Understand Bitcoin? This Man Will Mumble An Explanation At You',
1154 'description': 'Migrated from OnionStudios',
1155 'thumbnail': r're:^https?://.*\.jpe?g$',
1156 'uploader': 'clickhole',
1157 'upload_date': '20150527',
1158 'timestamp': 1432744860,
1159 }
1160 },
1161 # SnagFilms embed
1162 {
1163 'url': 'http://whilewewatch.blogspot.ru/2012/06/whilewewatch-whilewewatch-gripping.html',
1164 'info_dict': {
1165 'id': '74849a00-85a9-11e1-9660-123139220831',
1166 'ext': 'mp4',
1167 'title': '#whilewewatch',
1168 }
1169 },
1170 # AdobeTVVideo embed
1171 {
1172 'url': 'https://helpx.adobe.com/acrobat/how-to/new-experience-acrobat-dc.html?set=acrobat--get-started--essential-beginners',
1173 'md5': '43662b577c018ad707a63766462b1e87',
1174 'info_dict': {
1175 'id': '2456',
1176 'ext': 'mp4',
1177 'title': 'New experience with Acrobat DC',
1178 'description': 'New experience with Acrobat DC',
1179 'duration': 248.667,
1180 },
1181 },
1182 # Another form of arte.tv embed
1183 {
1184 'url': 'http://www.tv-replay.fr/redirection/09-04-16/arte-reportage-arte-11508975.html',
1185 'md5': '850bfe45417ddf221288c88a0cffe2e2',
1186 'info_dict': {
1187 'id': '030273-562_PLUS7-F',
1188 'ext': 'mp4',
1189 'title': 'ARTE Reportage - Nulle part, en France',
1190 'description': 'md5:e3a0e8868ed7303ed509b9e3af2b870d',
1191 'upload_date': '20160409',
1192 },
1193 },
1194 # Duplicated embedded video URLs
1195 {
1196 'url': 'http://www.hudl.com/athlete/2538180/highlights/149298443',
1197 'info_dict': {
1198 'id': '149298443_480_16c25b74_2',
1199 'ext': 'mp4',
1200 'title': 'vs. Blue Orange Spring Game',
1201 'uploader': 'www.hudl.com',
1202 },
1203 },
1204 # twitter:player:stream embed
1205 {
1206 'url': 'http://www.rtl.be/info/video/589263.aspx?CategoryID=288',
1207 'info_dict': {
1208 'id': 'master',
1209 'ext': 'mp4',
1210 'title': 'Une nouvelle espèce de dinosaure découverte en Argentine',
1211 'uploader': 'www.rtl.be',
1212 },
1213 'params': {
1214 # m3u8 downloads
1215 'skip_download': True,
1216 },
1217 },
1218 # twitter:player embed
1219 {
1220 'url': 'http://www.theatlantic.com/video/index/484130/what-do-black-holes-sound-like/',
1221 'md5': 'a3e0df96369831de324f0778e126653c',
1222 'info_dict': {
1223 'id': '4909620399001',
1224 'ext': 'mp4',
1225 'title': 'What Do Black Holes Sound Like?',
1226 'description': 'what do black holes sound like',
1227 'upload_date': '20160524',
1228 'uploader_id': '29913724001',
1229 'timestamp': 1464107587,
1230 'uploader': 'TheAtlantic',
1231 },
1232 'skip': 'Private Youtube video',
1233 },
1234 # Facebook <iframe> embed
1235 {
1236 'url': 'https://www.hostblogger.de/blog/archives/6181-Auto-jagt-Betonmischer.html',
1237 'md5': 'fbcde74f534176ecb015849146dd3aee',
1238 'info_dict': {
1239 'id': '599637780109885',
1240 'ext': 'mp4',
1241 'title': 'Facebook video #599637780109885',
1242 },
1243 },
1244 # Facebook <iframe> embed, plugin video
1245 {
1246 'url': 'http://5pillarsuk.com/2017/06/07/tariq-ramadan-disagrees-with-pr-exercise-by-imams-refusing-funeral-prayers-for-london-attackers/',
1247 'info_dict': {
1248 'id': '1754168231264132',
1249 'ext': 'mp4',
1250 'title': 'About the Imams and Religious leaders refusing to perform funeral prayers for...',
1251 'uploader': 'Tariq Ramadan (official)',
1252 'timestamp': 1496758379,
1253 'upload_date': '20170606',
1254 },
1255 'params': {
1256 'skip_download': True,
1257 },
1258 },
1259 # Facebook API embed
1260 {
1261 'url': 'http://www.lothype.com/blue-stars-2016-preview-standstill-full-show/',
1262 'md5': 'a47372ee61b39a7b90287094d447d94e',
1263 'info_dict': {
1264 'id': '10153467542406923',
1265 'ext': 'mp4',
1266 'title': 'Facebook video #10153467542406923',
1267 },
1268 },
1269 # Wordpress "YouTube Video Importer" plugin
1270 {
1271 'url': 'http://www.lothype.com/blue-devils-drumline-stanford-lot-2016/',
1272 'md5': 'd16797741b560b485194eddda8121b48',
1273 'info_dict': {
1274 'id': 'HNTXWDXV9Is',
1275 'ext': 'mp4',
1276 'title': 'Blue Devils Drumline Stanford lot 2016',
1277 'upload_date': '20160627',
1278 'uploader_id': 'GENOCIDE8GENERAL10',
1279 'uploader': 'cylus cyrus',
1280 },
1281 },
1282 {
1283 # video stored on custom kaltura server
1284 'url': 'http://www.expansion.com/multimedia/videos.html?media=EQcM30NHIPv',
1285 'md5': '537617d06e64dfed891fa1593c4b30cc',
1286 'info_dict': {
1287 'id': '0_1iotm5bh',
1288 'ext': 'mp4',
1289 'title': 'Elecciones británicas: 5 lecciones para Rajoy',
1290 'description': 'md5:435a89d68b9760b92ce67ed227055f16',
1291 'uploader_id': 'videos.expansion@el-mundo.net',
1292 'upload_date': '20150429',
1293 'timestamp': 1430303472,
1294 },
1295 'add_ie': ['Kaltura'],
1296 },
1297 {
1298 # multiple kaltura embeds, nsfw
1299 'url': 'https://www.quartier-rouge.be/prive/femmes/kamila-avec-video-jaime-sadomie.html',
1300 'info_dict': {
1301 'id': 'kamila-avec-video-jaime-sadomie',
1302 'title': "Kamila avec vídeo “J'aime sadomie”",
1303 },
1304 'playlist_count': 8,
1305 },
1306 {
1307 # Non-standard Vimeo embed
1308 'url': 'https://openclassrooms.com/courses/understanding-the-web',
1309 'md5': '64d86f1c7d369afd9a78b38cbb88d80a',
1310 'info_dict': {
1311 'id': '148867247',
1312 'ext': 'mp4',
1313 'title': 'Understanding the web - Teaser',
1314 'description': 'This is "Understanding the web - Teaser" by openclassrooms on Vimeo, the home for high quality videos and the people who love them.',
1315 'upload_date': '20151214',
1316 'uploader': 'OpenClassrooms',
1317 'uploader_id': 'openclassrooms',
1318 },
1319 'add_ie': ['Vimeo'],
1320 },
1321 {
1322 # generic vimeo embed that requires original URL passed as Referer
1323 'url': 'http://racing4everyone.eu/2016/07/30/formula-1-2016-round12-germany/',
1324 'only_matching': True,
1325 },
1326 {
1327 'url': 'https://support.arkena.com/display/PLAY/Ways+to+embed+your+video',
1328 'md5': 'b96f2f71b359a8ecd05ce4e1daa72365',
1329 'info_dict': {
1330 'id': 'b41dda37-d8e7-4d3f-b1b5-9a9db578bdfe',
1331 'ext': 'mp4',
1332 'title': 'Big Buck Bunny',
1333 'description': 'Royalty free test video',
1334 'timestamp': 1432816365,
1335 'upload_date': '20150528',
1336 'is_live': False,
1337 },
1338 'params': {
1339 'skip_download': True,
1340 },
1341 'add_ie': ['Arkena'],
1342 },
1343 {
1344 'url': 'http://nova.bg/news/view/2016/08/16/156543/%D0%BD%D0%B0-%D0%BA%D0%BE%D1%81%D1%8A%D0%BC-%D0%BE%D1%82-%D0%B2%D0%B7%D1%80%D0%B8%D0%B2-%D0%BE%D1%82%D1%86%D0%B5%D0%BF%D0%B8%D1%85%D0%B0-%D1%86%D1%8F%D0%BB-%D0%BA%D0%B2%D0%B0%D1%80%D1%82%D0%B0%D0%BB-%D0%B7%D0%B0%D1%80%D0%B0%D0%B4%D0%B8-%D0%B8%D0%B7%D1%82%D0%B8%D1%87%D0%B0%D0%BD%D0%B5-%D0%BD%D0%B0-%D0%B3%D0%B0%D0%B7-%D0%B2-%D0%BF%D0%BB%D0%BE%D0%B2%D0%B4%D0%B8%D0%B2/',
1345 'info_dict': {
1346 'id': '1c7141f46c',
1347 'ext': 'mp4',
1348 'title': 'НА КОСЪМ ОТ ВЗРИВ: Изтичане на газ на бензиностанция в Пловдив',
1349 },
1350 'params': {
1351 'skip_download': True,
1352 },
1353 'add_ie': ['Vbox7'],
1354 },
1355 {
1356 # DBTV embeds
1357 'url': 'http://www.dagbladet.no/2016/02/23/nyheter/nordlys/ski/troms/ver/43254897/',
1358 'info_dict': {
1359 'id': '43254897',
1360 'title': 'Etter ett års planlegging, klaffet endelig alt: - Jeg måtte ta en liten dans',
1361 },
1362 'playlist_mincount': 3,
1363 },
1364 {
1365 # Videa embeds
1366 'url': 'http://forum.dvdtalk.com/movie-talk/623756-deleted-magic-star-wars-ot-deleted-alt-scenes-docu-style.html',
1367 'info_dict': {
1368 'id': '623756-deleted-magic-star-wars-ot-deleted-alt-scenes-docu-style',
1369 'title': 'Deleted Magic - Star Wars: OT Deleted / Alt. Scenes Docu. Style - DVD Talk Forum',
1370 },
1371 'playlist_mincount': 2,
1372 },
1373 {
1374 # 20 minuten embed
1375 'url': 'http://www.20min.ch/schweiz/news/story/So-kommen-Sie-bei-Eis-und-Schnee-sicher-an-27032552',
1376 'info_dict': {
1377 'id': '523629',
1378 'ext': 'mp4',
1379 'title': 'So kommen Sie bei Eis und Schnee sicher an',
1380 'description': 'md5:117c212f64b25e3d95747e5276863f7d',
1381 },
1382 'params': {
1383 'skip_download': True,
1384 },
1385 'add_ie': ['TwentyMinuten'],
1386 },
1387 {
1388 # VideoPress embed
1389 'url': 'https://en.support.wordpress.com/videopress/',
1390 'info_dict': {
1391 'id': 'OcobLTqC',
1392 'ext': 'm4v',
1393 'title': 'IMG_5786',
1394 'timestamp': 1435711927,
1395 'upload_date': '20150701',
1396 },
1397 'params': {
1398 'skip_download': True,
1399 },
1400 'add_ie': ['VideoPress'],
1401 },
1402 {
1403 # Rutube embed
1404 'url': 'http://magazzino.friday.ru/videos/vipuski/kazan-2',
1405 'info_dict': {
1406 'id': '9b3d5bee0a8740bf70dfd29d3ea43541',
1407 'ext': 'flv',
1408 'title': 'Магаззино: Казань 2',
1409 'description': 'md5:99bccdfac2269f0e8fdbc4bbc9db184a',
1410 'uploader': 'Магаззино',
1411 'upload_date': '20170228',
1412 'uploader_id': '996642',
1413 },
1414 'params': {
1415 'skip_download': True,
1416 },
1417 'add_ie': ['Rutube'],
1418 },
1419 {
1420 # glomex:embed
1421 'url': 'https://www.skai.gr/news/world/iatrikos-syllogos-tourkias-to-turkovac-aplo-dialyma-erntogan-eiste-apateones-kai-pseytes',
1422 'info_dict': {
1423 'id': 'v-ch2nkhcirwc9-sf',
1424 'ext': 'mp4',
1425 'title': 'md5:786e1e24e06c55993cee965ef853a0c1',
1426 'description': 'md5:8b517a61d577efe7e36fde72fd535995',
1427 'timestamp': 1641885019,
1428 'upload_date': '20220111',
1429 'duration': 460000,
1430 'thumbnail': 'https://i3thumbs.glomex.com/dC1idjJwdndiMjRzeGwvMjAyMi8wMS8xMS8wNy8xMF8zNV82MWRkMmQ2YmU5ZTgyLmpwZw==/profile:player-960x540',
1431 },
1432 },
1433 {
1434 # megatvcom:embed
1435 'url': 'https://www.in.gr/2021/12/18/greece/apokalypsi-mega-poios-parelave-tin-ereyna-tsiodra-ek-merous-tis-kyvernisis-o-prothypourgos-telika-gnorize/',
1436 'info_dict': {
1437 'id': 'apokalypsi-mega-poios-parelave-tin-ereyna-tsiodra-ek-merous-tis-kyvernisis-o-prothypourgos-telika-gnorize',
1438 'title': 'md5:5e569cf996ec111057c2764ec272848f',
1439 },
1440 'playlist': [{
1441 'md5': '1afa26064ff00ccb91617957dbc73dc1',
1442 'info_dict': {
1443 'ext': 'mp4',
1444 'id': '564916',
1445 'display_id': 'md5:6cdf22d3a2e7bacb274b7295089a1770',
1446 'title': 'md5:33b9dd39584685b62873043670eb52a6',
1447 'description': 'md5:c1db7310f390518ac36dd69d947ef1a1',
1448 'timestamp': 1639753145,
1449 'upload_date': '20211217',
1450 'thumbnail': 'https://www.megatv.com/wp-content/uploads/2021/12/prezerakos-1024x597.jpg',
1451 },
1452 }, {
1453 'md5': '4a1c220695f1ef865a8b7966a53e2474',
1454 'info_dict': {
1455 'ext': 'mp4',
1456 'id': '564905',
1457 'display_id': 'md5:ead15695e485e649aed2b81ebd699b88',
1458 'title': 'md5:2b71fd54249a3ca34609fe39ae31c47b',
1459 'description': 'md5:c42e12f638d0a97d6de4508e2c4df982',
1460 'timestamp': 1639753047,
1461 'upload_date': '20211217',
1462 'thumbnail': 'https://www.megatv.com/wp-content/uploads/2021/12/tsiodras-mitsotakis-1024x545.jpg',
1463 },
1464 }]
1465 },
1466 {
1467 'url': 'https://www.ertnews.gr/video/manolis-goyalles-o-anthropos-piso-apo-ti-diadiktyaki-vasilopita/',
1468 'info_dict': {
1469 'id': '2022/tv/news-themata-ianouarios/20220114-apotis6-gouales-pita.mp4',
1470 'ext': 'mp4',
1471 'title': 'md5:df64f5b61c06d0e9556c0cdd5cf14464',
1472 'thumbnail': 'https://www.ert.gr/themata/photos/2021/20220114-apotis6-gouales-pita.jpg',
1473 },
1474 },
1475 {
1476 # ThePlatform embedded with whitespaces in URLs
1477 'url': 'http://www.golfchannel.com/topics/shows/golftalkcentral.htm',
1478 'only_matching': True,
1479 },
1480 {
1481 # Senate ISVP iframe https
1482 'url': 'https://www.hsgac.senate.gov/hearings/canadas-fast-track-refugee-plan-unanswered-questions-and-implications-for-us-national-security',
1483 'md5': 'fb8c70b0b515e5037981a2492099aab8',
1484 'info_dict': {
1485 'id': 'govtaff020316',
1486 'ext': 'mp4',
1487 'title': 'Integrated Senate Video Player',
1488 },
1489 'add_ie': ['SenateISVP'],
1490 },
1491 {
1492 # Limelight embeds (1 channel embed + 4 media embeds)
1493 'url': 'http://www.sedona.com/FacilitatorTraining2017',
1494 'info_dict': {
1495 'id': 'FacilitatorTraining2017',
1496 'title': 'Facilitator Training 2017',
1497 },
1498 'playlist_mincount': 5,
1499 },
1500 {
1501 # Limelight embed (LimelightPlayerUtil.embed)
1502 'url': 'https://tv5.ca/videos?v=xuu8qowr291ri',
1503 'info_dict': {
1504 'id': '95d035dc5c8a401588e9c0e6bd1e9c92',
1505 'ext': 'mp4',
1506 'title': '07448641',
1507 'timestamp': 1499890639,
1508 'upload_date': '20170712',
1509 },
1510 'params': {
1511 'skip_download': True,
1512 },
1513 'add_ie': ['LimelightMedia'],
1514 },
1515 {
1516 'url': 'http://kron4.com/2017/04/28/standoff-with-walnut-creek-murder-suspect-ends-with-arrest/',
1517 'info_dict': {
1518 'id': 'standoff-with-walnut-creek-murder-suspect-ends-with-arrest',
1519 'title': 'Standoff with Walnut Creek murder suspect ends',
1520 'description': 'md5:3ccc48a60fc9441eeccfc9c469ebf788',
1521 },
1522 'playlist_mincount': 4,
1523 },
1524 {
1525 # WashingtonPost embed
1526 'url': 'http://www.vanityfair.com/hollywood/2017/04/donald-trump-tv-pitches',
1527 'info_dict': {
1528 'id': '8caf6e88-d0ec-11e5-90d3-34c2c42653ac',
1529 'ext': 'mp4',
1530 'title': "No one has seen the drama series based on Trump's life \u2014 until now",
1531 'description': 'Donald Trump wanted a weekly TV drama based on his life. It never aired. But The Washington Post recently obtained a scene from the pilot script — and enlisted actors.',
1532 'timestamp': 1455216756,
1533 'uploader': 'The Washington Post',
1534 'upload_date': '20160211',
1535 },
1536 'add_ie': ['WashingtonPost'],
1537 },
1538 {
1539 # JOJ.sk embeds
1540 'url': 'https://www.noviny.sk/slovensko/238543-slovenskom-sa-prehnala-vlna-silnych-burok',
1541 'info_dict': {
1542 'id': '238543-slovenskom-sa-prehnala-vlna-silnych-burok',
1543 'title': 'Slovenskom sa prehnala vlna silných búrok',
1544 },
1545 'playlist_mincount': 5,
1546 'add_ie': ['Joj'],
1547 },
1548 {
1549 # AMP embed (see https://www.ampproject.org/docs/reference/components/amp-video)
1550 'url': 'https://tvrain.ru/amp/418921/',
1551 'md5': 'cc00413936695987e8de148b67d14f1d',
1552 'info_dict': {
1553 'id': '418921',
1554 'ext': 'mp4',
1555 'title': 'Стас Намин: «Мы нарушили девственность Кремля»',
1556 },
1557 },
1558 {
1559 # vzaar embed
1560 'url': 'http://help.vzaar.com/article/165-embedding-video',
1561 'md5': '7e3919d9d2620b89e3e00bec7fe8c9d4',
1562 'info_dict': {
1563 'id': '8707641',
1564 'ext': 'mp4',
1565 'title': 'Building A Business Online: Principal Chairs Q & A',
1566 },
1567 },
1568 {
1569 # multiple HTML5 videos on one page
1570 'url': 'https://www.paragon-software.com/home/rk-free/keyscenarios.html',
1571 'info_dict': {
1572 'id': 'keyscenarios',
1573 'title': 'Rescue Kit 14 Free Edition - Getting started',
1574 },
1575 'playlist_count': 4,
1576 },
1577 {
1578 # vshare embed
1579 'url': 'https://youtube-dl-demo.neocities.org/vshare.html',
1580 'md5': '17b39f55b5497ae8b59f5fbce8e35886',
1581 'info_dict': {
1582 'id': '0f64ce6',
1583 'title': 'vl14062007715967',
1584 'ext': 'mp4',
1585 }
1586 },
1587 {
1588 'url': 'http://www.heidelberg-laureate-forum.org/blog/video/lecture-friday-september-23-2016-sir-c-antony-r-hoare/',
1589 'md5': 'aecd089f55b1cb5a59032cb049d3a356',
1590 'info_dict': {
1591 'id': '90227f51a80c4d8f86c345a7fa62bd9a1d',
1592 'ext': 'mp4',
1593 'title': 'Lecture: Friday, September 23, 2016 - Sir Tony Hoare',
1594 'description': 'md5:5a51db84a62def7b7054df2ade403c6c',
1595 'timestamp': 1474354800,
1596 'upload_date': '20160920',
1597 }
1598 },
1599 {
1600 'url': 'http://www.kidzworld.com/article/30935-trolls-the-beat-goes-on-interview-skylar-astin-and-amanda-leighton',
1601 'info_dict': {
1602 'id': '1731611',
1603 'ext': 'mp4',
1604 'title': 'Official Trailer | TROLLS: THE BEAT GOES ON!',
1605 'description': 'md5:eb5f23826a027ba95277d105f248b825',
1606 'timestamp': 1516100691,
1607 'upload_date': '20180116',
1608 },
1609 'params': {
1610 'skip_download': True,
1611 },
1612 'add_ie': ['SpringboardPlatform'],
1613 },
1614 {
1615 'url': 'https://www.yapfiles.ru/show/1872528/690b05d3054d2dbe1e69523aa21bb3b1.mp4.html',
1616 'info_dict': {
1617 'id': 'vMDE4NzI1Mjgt690b',
1618 'ext': 'mp4',
1619 'title': 'Котята',
1620 },
1621 'add_ie': ['YapFiles'],
1622 'params': {
1623 'skip_download': True,
1624 },
1625 },
1626 {
1627 # CloudflareStream embed
1628 'url': 'https://www.cloudflare.com/products/cloudflare-stream/',
1629 'info_dict': {
1630 'id': '31c9291ab41fac05471db4e73aa11717',
1631 'ext': 'mp4',
1632 'title': '31c9291ab41fac05471db4e73aa11717',
1633 },
1634 'add_ie': ['CloudflareStream'],
1635 'params': {
1636 'skip_download': True,
1637 },
1638 },
1639 {
1640 # PeerTube embed
1641 'url': 'https://joinpeertube.org/fr/home/',
1642 'info_dict': {
1643 'id': 'home',
1644 'title': 'Reprenez le contrôle de vos vidéos ! #JoinPeertube',
1645 },
1646 'playlist_count': 2,
1647 },
1648 {
1649 # Indavideo embed
1650 'url': 'https://streetkitchen.hu/receptek/igy_kell_otthon_hamburgert_sutni/',
1651 'info_dict': {
1652 'id': '1693903',
1653 'ext': 'mp4',
1654 'title': 'Így kell otthon hamburgert sütni',
1655 'description': 'md5:f5a730ecf900a5c852e1e00540bbb0f7',
1656 'timestamp': 1426330212,
1657 'upload_date': '20150314',
1658 'uploader': 'StreetKitchen',
1659 'uploader_id': '546363',
1660 },
1661 'add_ie': ['IndavideoEmbed'],
1662 'params': {
1663 'skip_download': True,
1664 },
1665 },
1666 {
1667 # APA embed via JWPlatform embed
1668 'url': 'http://www.vol.at/blue-man-group/5593454',
1669 'info_dict': {
1670 'id': 'jjv85FdZ',
1671 'ext': 'mp4',
1672 'title': '"Blau ist mysteriös": Die Blue Man Group im Interview',
1673 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
1674 'thumbnail': r're:^https?://.*\.jpg$',
1675 'duration': 254,
1676 'timestamp': 1519211149,
1677 'upload_date': '20180221',
1678 },
1679 'params': {
1680 'skip_download': True,
1681 },
1682 },
1683 {
1684 'url': 'http://share-videos.se/auto/video/83645793?uid=13',
1685 'md5': 'b68d276de422ab07ee1d49388103f457',
1686 'info_dict': {
1687 'id': '83645793',
1688 'title': 'Lock up and get excited',
1689 'ext': 'mp4'
1690 },
1691 'skip': 'TODO: fix nested playlists processing in tests',
1692 },
1693 {
1694 # Viqeo embeds
1695 'url': 'https://viqeo.tv/',
1696 'info_dict': {
1697 'id': 'viqeo',
1698 'title': 'All-new video platform',
1699 },
1700 'playlist_count': 6,
1701 },
1702 # {
1703 # # Zype embed
1704 # 'url': 'https://www.cookscountry.com/episode/554-smoky-barbecue-favorites',
1705 # 'info_dict': {
1706 # 'id': '5b400b834b32992a310622b9',
1707 # 'ext': 'mp4',
1708 # 'title': 'Smoky Barbecue Favorites',
1709 # 'thumbnail': r're:^https?://.*\.jpe?g',
1710 # 'description': 'md5:5ff01e76316bd8d46508af26dc86023b',
1711 # 'upload_date': '20170909',
1712 # 'timestamp': 1504915200,
1713 # },
1714 # 'add_ie': [ZypeIE.ie_key()],
1715 # 'params': {
1716 # 'skip_download': True,
1717 # },
1718 # },
1719 {
1720 # videojs embed
1721 'url': 'https://video.sibnet.ru/shell.php?videoid=3422904',
1722 'info_dict': {
1723 'id': 'shell',
1724 'ext': 'mp4',
1725 'title': 'Доставщик пиццы спросил разрешения сыграть на фортепиано',
1726 'description': 'md5:89209cdc587dab1e4a090453dbaa2cb1',
1727 'thumbnail': r're:^https?://.*\.jpg$',
1728 },
1729 'params': {
1730 'skip_download': True,
1731 },
1732 'expected_warnings': ['Failed to download MPD manifest'],
1733 },
1734 {
1735 # DailyMotion embed with DM.player
1736 'url': 'https://www.beinsports.com/us/copa-del-rey/video/the-locker-room-valencia-beat-barca-in-copa/1203804',
1737 'info_dict': {
1738 'id': 'k6aKkGHd9FJs4mtJN39',
1739 'ext': 'mp4',
1740 'title': 'The Locker Room: Valencia Beat Barca In Copa del Rey Final',
1741 'description': 'This video is private.',
1742 'uploader_id': 'x1jf30l',
1743 'uploader': 'beIN SPORTS USA',
1744 'upload_date': '20190528',
1745 'timestamp': 1559062971,
1746 },
1747 'params': {
1748 'skip_download': True,
1749 },
1750 },
1751 {
1752 # tvopengr:embed
1753 'url': 'https://www.ethnos.gr/World/article/190604/hparosiaxekinoynoisynomiliessthgeneyhmethskiatoypolemoypanoapothnoykrania',
1754 'md5': 'eb0c3995d0a6f18f6538c8e057865d7d',
1755 'info_dict': {
1756 'id': '101119',
1757 'ext': 'mp4',
1758 'display_id': 'oikarpoitondiapragmateyseonhparosias',
1759 'title': 'md5:b979f4d640c568617d6547035528a149',
1760 'description': 'md5:e54fc1977c7159b01cc11cd7d9d85550',
1761 'timestamp': 1641772800,
1762 'upload_date': '20220110',
1763 'thumbnail': 'https://opentv-static.siliconweb.com/imgHandler/1920/70bc39fa-895b-4918-a364-c39d2135fc6d.jpg',
1764
1765 }
1766 },
1767 {
1768 # blogger embed
1769 'url': 'https://blog.tomeuvizoso.net/2019/01/a-panfrost-milestone.html',
1770 'md5': 'f1bc19b6ea1b0fd1d81e84ca9ec467ac',
1771 'info_dict': {
1772 'id': 'BLOGGER-video-3c740e3a49197e16-796',
1773 'ext': 'mp4',
1774 'title': 'Blogger',
1775 'thumbnail': r're:^https?://.*',
1776 },
1777 },
1778 # {
1779 # # TODO: find another test
1780 # # http://schema.org/VideoObject
1781 # 'url': 'https://flipagram.com/f/nyvTSJMKId',
1782 # 'md5': '888dcf08b7ea671381f00fab74692755',
1783 # 'info_dict': {
1784 # 'id': 'nyvTSJMKId',
1785 # 'ext': 'mp4',
1786 # 'title': 'Flipagram by sjuria101 featuring Midnight Memories by One Direction',
1787 # 'description': '#love for cats.',
1788 # 'timestamp': 1461244995,
1789 # 'upload_date': '20160421',
1790 # },
1791 # 'params': {
1792 # 'force_generic_extractor': True,
1793 # },
1794 # },
1795 {
1796 # VHX Embed
1797 'url': 'https://demo.vhx.tv/category-c/videos/file-example-mp4-480-1-5mg-copy',
1798 'info_dict': {
1799 'id': '858208',
1800 'ext': 'mp4',
1801 'title': 'Untitled',
1802 'uploader_id': 'user80538407',
1803 'uploader': 'OTT Videos',
1804 },
1805 },
1806 {
1807 # ArcPublishing PoWa video player
1808 'url': 'https://www.adn.com/politics/2020/11/02/video-senate-candidates-campaign-in-anchorage-on-eve-of-election-day/',
1809 'md5': 'b03b2fac8680e1e5a7cc81a5c27e71b3',
1810 'info_dict': {
1811 'id': '8c99cb6e-b29c-4bc9-9173-7bf9979225ab',
1812 'ext': 'mp4',
1813 'title': 'Senate candidates wave to voters on Anchorage streets',
1814 'description': 'md5:91f51a6511f090617353dc720318b20e',
1815 'timestamp': 1604378735,
1816 'upload_date': '20201103',
1817 'duration': 1581,
1818 },
1819 },
1820 {
1821 # MyChannels SDK embed
1822 # https://www.24kitchen.nl/populair/deskundige-dit-waarom-sommigen-gevoelig-zijn-voor-voedselallergieen
1823 'url': 'https://www.demorgen.be/nieuws/burgemeester-rotterdam-richt-zich-in-videoboodschap-tot-relschoppers-voelt-het-goed~b0bcfd741/',
1824 'md5': '90c0699c37006ef18e198c032d81739c',
1825 'info_dict': {
1826 'id': '194165',
1827 'ext': 'mp4',
1828 'title': 'Burgemeester Aboutaleb spreekt relschoppers toe',
1829 'timestamp': 1611740340,
1830 'upload_date': '20210127',
1831 'duration': 159,
1832 },
1833 },
1834 {
1835 # Simplecast player embed
1836 'url': 'https://www.bio.org/podcast',
1837 'info_dict': {
1838 'id': 'podcast',
1839 'title': 'I AM BIO Podcast | BIO',
1840 },
1841 'playlist_mincount': 52,
1842 }, {
1843 # WimTv embed player
1844 'url': 'http://www.msmotor.tv/wearefmi-pt-2-2021/',
1845 'info_dict': {
1846 'id': 'wearefmi-pt-2-2021',
1847 'title': '#WEAREFMI – PT.2 – 2021 – MsMotorTV',
1848 },
1849 'playlist_count': 1,
1850 }, {
1851 # KVS Player
1852 'url': 'https://www.kvs-demo.com/videos/105/kelis-4th-of-july/',
1853 'info_dict': {
1854 'id': '105',
1855 'display_id': 'kelis-4th-of-july',
1856 'ext': 'mp4',
1857 'title': 'Kelis - 4th Of July',
1858 'description': 'Kelis - 4th Of July',
1859 'thumbnail': r're:https://(?:www\.)?kvs-demo.com/contents/videos_screenshots/0/105/preview.jpg',
1860 },
1861 'params': {
1862 'skip_download': True,
1863 },
1864 'expected_warnings': ['Untested major version'],
1865 }, {
1866 # KVS Player
1867 'url': 'https://www.kvs-demo.com/embed/105/',
1868 'info_dict': {
1869 'id': '105',
1870 'display_id': 'kelis-4th-of-july',
1871 'ext': 'mp4',
1872 'title': 'Kelis - 4th Of July / Embed Player',
1873 'thumbnail': r're:https://(?:www\.)?kvs-demo.com/contents/videos_screenshots/0/105/preview.jpg',
1874 },
1875 'params': {
1876 'skip_download': True,
1877 },
1878 }, {
1879 'url': 'https://youix.com/video/leningrad-zoj/',
1880 'md5': '94f96ba95706dc3880812b27b7d8a2b8',
1881 'info_dict': {
1882 'id': '18485',
1883 'display_id': 'leningrad-zoj',
1884 'ext': 'mp4',
1885 'title': 'Клип: Ленинград - ЗОЖ скачать, смотреть онлайн | Youix.com',
1886 'thumbnail': r're:https://youix.com/contents/videos_screenshots/18000/18485/preview(?:_480x320_youix_com.mp4)?\.jpg',
1887 },
1888 }, {
1889 # KVS Player
1890 'url': 'https://youix.com/embed/18485',
1891 'md5': '94f96ba95706dc3880812b27b7d8a2b8',
1892 'info_dict': {
1893 'id': '18485',
1894 'display_id': 'leningrad-zoj',
1895 'ext': 'mp4',
1896 'title': 'Ленинград - ЗОЖ',
1897 'thumbnail': r're:https://youix.com/contents/videos_screenshots/18000/18485/preview(?:_480x320_youix_com.mp4)?\.jpg',
1898 },
1899 }, {
1900 # KVS Player
1901 'url': 'https://bogmedia.org/videos/21217/40-nochey-40-nights-2016/',
1902 'md5': '94166bdb26b4cb1fb9214319a629fc51',
1903 'info_dict': {
1904 'id': '21217',
1905 'display_id': '40-nochey-2016',
1906 'ext': 'mp4',
1907 'title': '40 ночей (2016) - BogMedia.org',
1908 'description': 'md5:4e6d7d622636eb7948275432eb256dc3',
1909 'thumbnail': 'https://bogmedia.org/contents/videos_screenshots/21000/21217/preview_480p.mp4.jpg',
1910 },
1911 },
1912 {
1913 # KVS Player (for sites that serve kt_player.js via non-https urls)
1914 'url': 'http://www.camhub.world/embed/389508',
1915 'md5': 'fbe89af4cfb59c8fd9f34a202bb03e32',
1916 'info_dict': {
1917 'id': '389508',
1918 'display_id': 'syren-de-mer-onlyfans-05-07-2020have-a-happy-safe-holiday5f014e68a220979bdb8cd-source',
1919 'ext': 'mp4',
1920 'title': 'Syren De Mer onlyfans_05-07-2020Have_a_happy_safe_holiday5f014e68a220979bdb8cd_source / Embed плеер',
1921 'thumbnail': r're:https?://www\.camhub\.world/contents/videos_screenshots/389000/389508/preview\.mp4\.jpg',
1922 },
1923 },
1924 {
1925 # Reddit-hosted video that will redirect and be processed by RedditIE
1926 # Redirects to https://www.reddit.com/r/videos/comments/6rrwyj/that_small_heart_attack/
1927 'url': 'https://v.redd.it/zv89llsvexdz',
1928 'md5': '87f5f02f6c1582654146f830f21f8662',
1929 'info_dict': {
1930 'id': 'zv89llsvexdz',
1931 'ext': 'mp4',
1932 'timestamp': 1501941939.0,
1933 'title': 'That small heart attack.',
1934 'upload_date': '20170805',
1935 'uploader': 'Antw87'
1936 }
1937 },
1938 {
1939 # 1080p Reddit-hosted video that will redirect and be processed by RedditIE
1940 'url': 'https://v.redd.it/33hgok7dfbz71/',
1941 'md5': '7a1d587940242c9bb3bd6eb320b39258',
1942 'info_dict': {
1943 'id': '33hgok7dfbz71',
1944 'ext': 'mp4',
1945 'title': "The game Didn't want me to Knife that Guy I guess",
1946 'uploader': 'paraf1ve',
1947 'timestamp': 1636788683.0,
1948 'upload_date': '20211113'
1949 }
1950 },
1951 {
1952 # MainStreaming player
1953 'url': 'https://www.lactv.it/2021/10/03/lac-news24-la-settimana-03-10-2021/',
1954 'info_dict': {
1955 'id': 'EUlZfGWkGpOd',
1956 'title': 'La Settimana ',
1957 'description': '03 Ottobre ore 02:00',
1958 'ext': 'mp4',
1959 'live_status': 'not_live',
1960 'thumbnail': r're:https?://[A-Za-z0-9-]*\.msvdn.net/image/\w+/poster',
1961 'duration': 1512
1962 }
1963 },
1964 {
1965 # Multiple gfycat iframe embeds
1966 'url': 'https://www.gezip.net/bbs/board.php?bo_table=entertaine&wr_id=613422',
1967 'info_dict': {
1968 'title': '재이, 윤, 세은 황금 드레스를 입고 빛난다',
1969 'id': 'board'
1970 },
1971 'playlist_count': 8,
1972 },
1973 {
1974 # Multiple gfycat gifs (direct links)
1975 'url': 'https://www.gezip.net/bbs/board.php?bo_table=entertaine&wr_id=612199',
1976 'info_dict': {
1977 'title': '옳게 된 크롭 니트 스테이씨 아이사',
1978 'id': 'board'
1979 },
1980 'playlist_count': 6
1981 },
1982 {
1983 # Multiple gfycat embeds, with uppercase "IFR" in urls
1984 'url': 'https://kkzz.kr/?vid=2295',
1985 'info_dict': {
1986 'title': '지방시 앰버서더 에스파 카리나 움짤',
1987 'id': '?vid=2295'
1988 },
1989 'playlist_count': 9
1990 },
1991 {
1992 # Panopto embeds
1993 'url': 'https://www.monash.edu/learning-teaching/teachhq/learning-technologies/panopto/how-to/insert-a-quiz-into-a-panopto-video',
1994 'info_dict': {
1995 'ext': 'mp4',
1996 'id': '0bd3f16c-824a-436a-8486-ac5900693aef',
1997 'title': 'Quizzes in Panopto',
1998 },
1999 },
2000 {
2001 # Ruutu embed
2002 'url': 'https://www.nelonen.fi/ohjelmat/madventures-suomi/2160731-riku-ja-tunna-lahtevat-peurajahtiin-tv-sta-tutun-biologin-kanssa---metsastysreissu-huipentuu-kasvissyojan-painajaiseen',
2003 'md5': 'a2513a98d3496099e6eced40f7e6a14b',
2004 'info_dict': {
2005 'id': '4044426',
2006 'ext': 'mp4',
2007 'title': 'Riku ja Tunna lähtevät peurajahtiin tv:stä tutun biologin kanssa – metsästysreissu huipentuu kasvissyöjän painajaiseen!',
2008 'thumbnail': r're:^https?://.+\.jpg$',
2009 'duration': 108,
2010 'series': 'Madventures Suomi',
2011 'description': 'md5:aa55b44bd06a1e337a6f1d0b46507381',
2012 'categories': ['Matkailu', 'Elämäntyyli'],
2013 'age_limit': 0,
2014 'upload_date': '20220308',
2015 },
2016 },
2017 {
2018 # Multiple Ruutu embeds
2019 'url': 'https://www.hs.fi/kotimaa/art-2000008762560.html',
2020 'info_dict': {
2021 'title': 'Koronavirus | Epidemiahuippu voi olla Suomessa ohi, mutta koronaviruksen poistamista yleisvaarallisten tautien joukosta harkitaan vasta syksyllä',
2022 'id': 'art-2000008762560'
2023 },
2024 'playlist_count': 3
2025 },
2026 {
2027 # Ruutu embed in hs.fi with a single video
2028 'url': 'https://www.hs.fi/kotimaa/art-2000008793421.html',
2029 'md5': 'f8964e65d8fada6e8a562389bf366bb4',
2030 'info_dict': {
2031 'id': '4081841',
2032 'ext': 'mp4',
2033 'title': 'Puolustusvoimat siirsi panssariajoneuvoja harjoituksiin Niinisaloon 2.5.2022',
2034 'thumbnail': r're:^https?://.+\.jpg$',
2035 'duration': 138,
2036 'age_limit': 0,
2037 'upload_date': '20220504',
2038 },
2039 },
2040 {
2041 # Webpage contains double BOM
2042 'url': 'https://www.filmarkivet.se/movies/paris-d-moll/',
2043 'md5': 'df02cadc719dcc63d43288366f037754',
2044 'info_dict': {
2045 'id': 'paris-d-moll',
2046 'ext': 'mp4',
2047 'upload_date': '20220518',
2048 'title': 'Paris d-moll',
2049 'description': 'md5:319e37ea5542293db37e1e13072fe330',
2050 'thumbnail': 'https://www.filmarkivet.se/wp-content/uploads/parisdmoll2.jpg',
2051 'timestamp': 1652833414,
2052 'age_limit': 0,
2053 }
2054 },
2055 {
2056 'url': 'https://www.mollymovieclub.com/p/interstellar?s=r#details',
2057 'md5': '198bde8bed23d0b23c70725c83c9b6d9',
2058 'info_dict': {
2059 'id': '53602801',
2060 'ext': 'mpga',
2061 'title': 'Interstellar',
2062 'description': 'Listen now | Episode One',
2063 'thumbnail': 'md5:c30d9c83f738e16d8551d7219d321538',
2064 'uploader': 'Molly Movie Club',
2065 'uploader_id': '839621',
2066 },
2067 },
2068 {
2069 'url': 'https://www.blockedandreported.org/p/episode-117-lets-talk-about-depp?s=r',
2070 'md5': 'c0cc44ee7415daeed13c26e5b56d6aa0',
2071 'info_dict': {
2072 'id': '57962052',
2073 'ext': 'mpga',
2074 'title': 'md5:855b2756f0ee10f6723fa00b16266f8d',
2075 'description': 'md5:fe512a5e94136ad260c80bde00ea4eef',
2076 'thumbnail': 'md5:2218f27dfe517bb5ac16c47d0aebac59',
2077 'uploader': 'Blocked and Reported',
2078 'uploader_id': '500230',
2079 },
2080 },
2081 {
2082 'url': 'https://www.skimag.com/video/ski-people-1980/',
2083 'md5': '022a7e31c70620ebec18deeab376ee03',
2084 'info_dict': {
2085 'id': 'YTmgRiNU',
2086 'ext': 'mp4',
2087 'title': '1980 Ski People',
2088 'timestamp': 1610407738,
2089 'description': 'md5:cf9c3d101452c91e141f292b19fe4843',
2090 'thumbnail': 'https://cdn.jwplayer.com/v2/media/YTmgRiNU/poster.jpg?width=720',
2091 'duration': 5688.0,
2092 'upload_date': '20210111',
2093 }
2094 },
2095 {
2096 'note': 'JSON LD with multiple @type',
2097 'url': 'https://www.nu.nl/280161/video/hoe-een-bladvlo-dit-verwoestende-japanse-onkruid-moet-vernietigen.html',
2098 'md5': 'c7949f34f57273013fb7ccb1156393db',
2099 'info_dict': {
2100 'id': 'ipy2AcGL',
2101 'ext': 'mp4',
2102 'description': 'md5:6a9d644bab0dc2dc06849c2505d8383d',
2103 'thumbnail': r're:https://media\.nu\.nl/m/.+\.jpg',
2104 'title': 'Hoe een bladvlo dit verwoestende Japanse onkruid moet vernietigen',
2105 'timestamp': 1586577474,
2106 'upload_date': '20200411',
2107 'age_limit': 0,
2108 'duration': 111.0,
2109 }
2110 },
2111 {
2112 'note': 'JSON LD with unexpected data type',
2113 'url': 'https://www.autoweek.nl/autotests/artikel/porsche-911-gt3-rs-rij-impressie-2/',
2114 'info_dict': {
2115 'id': 'porsche-911-gt3-rs-rij-impressie-2',
2116 'ext': 'mp4',
2117 'title': 'Test: Porsche 911 GT3 RS',
2118 'description': 'Je ziet het niet, maar het is er wel. Downforce, hebben we het dan over. En in de nieuwe Porsche 911 GT3 RS is er zelfs heel veel downforce.',
2119 'timestamp': 1664920902,
2120 'upload_date': '20221004',
2121 'thumbnail': r're:^https://media.autoweek.nl/m/.+\.jpg$',
2122 'age_limit': 0,
2123 'direct': True,
2124 }
2125 },
2126 {
2127 'note': 'server returns data in brotli compression by default if `accept-encoding: *` is specified.',
2128 'url': 'https://www.extra.cz/cauky-lidi-70-dil-babis-predstavil-pohadky-prymulanek-nebo-andrejovy-nove-saty-ac867',
2129 'info_dict': {
2130 'id': 'cauky-lidi-70-dil-babis-predstavil-pohadky-prymulanek-nebo-andrejovy-nove-saty-ac867',
2131 'ext': 'mp4',
2132 'title': 'čauky lidi 70 finall',
2133 'description': 'čauky lidi 70 finall',
2134 'thumbnail': 'h',
2135 'upload_date': '20220606',
2136 'timestamp': 1654513791,
2137 'duration': 318.0,
2138 'direct': True,
2139 'age_limit': 0,
2140 },
2141 },
2142 {
2143 'note': 'JW Player embed with unicode-escape sequences in URL',
2144 'url': 'https://www.medici.tv/en/concerts/lahav-shani-mozart-mahler-israel-philharmonic-abu-dhabi-classics',
2145 'info_dict': {
2146 'id': 'm',
2147 'ext': 'mp4',
2148 'title': 'Lahav Shani conducts the Israel Philharmonic\'s first-ever concert in Abu Dhabi',
2149 'description': 'Mahler\'s ',
2150 'uploader': 'www.medici.tv',
2151 'age_limit': 0,
2152 'thumbnail': r're:^https?://.+\.jpg',
2153 },
2154 'params': {
2155 'skip_download': True,
2156 },
2157 },
2158 {
2159 'url': 'https://shooshtime.com/videos/284002/just-out-of-the-shower-joi/',
2160 'md5': 'e2f0a4c329f7986280b7328e24036d60',
2161 'info_dict': {
2162 'id': '284002',
2163 'display_id': 'just-out-of-the-shower-joi',
2164 'ext': 'mp4',
2165 'title': 'Just Out Of The Shower JOI - Shooshtime',
2166 'thumbnail': 'https://i.shoosh.co/contents/videos_screenshots/284000/284002/preview.mp4.jpg',
2167 'height': 720,
2168 'age_limit': 18,
2169 },
2170 },
2171 ]
2172
2173 def report_following_redirect(self, new_url):
2174 """Report information extraction."""
2175 self._downloader.to_screen('[redirect] Following redirect to %s' % new_url)
2176
2177 def report_detected(self, name, num=1, note=None):
2178 if num > 1:
2179 name += 's'
2180 elif not num:
2181 return
2182 else:
2183 num = 'a'
2184
2185 self._downloader.write_debug(f'Identified {num} {name}{format_field(note, None, "; %s")}')
2186
2187 def _fragment_query(self, url):
2188 if self._configuration_arg('fragment_query'):
2189 query_string = urllib.parse.urlparse(url).query
2190 if query_string:
2191 return {'extra_param_to_segment_url': query_string}
2192 return {}
2193
2194 def _extract_rss(self, url, video_id, doc):
2195 NS_MAP = {
2196 'itunes': 'http://www.itunes.com/dtds/podcast-1.0.dtd',
2197 }
2198
2199 entries = []
2200 for it in doc.findall('./channel/item'):
2201 next_url = next(
2202 (e.attrib.get('url') for e in it.findall('./enclosure')),
2203 xpath_text(it, 'link', fatal=False))
2204 if not next_url:
2205 continue
2206
2207 guid = try_call(lambda: it.find('guid').text)
2208 if guid:
2209 next_url = smuggle_url(next_url, {'force_videoid': guid})
2210
2211 def itunes(key):
2212 return xpath_text(it, xpath_with_ns(f'./itunes:{key}', NS_MAP), default=None)
2213
2214 entries.append({
2215 '_type': 'url_transparent',
2216 'url': next_url,
2217 'title': try_call(lambda: it.find('title').text),
2218 'description': xpath_text(it, 'description', default=None),
2219 'timestamp': unified_timestamp(xpath_text(it, 'pubDate', default=None)),
2220 'duration': parse_duration(itunes('duration')),
2221 'thumbnail': url_or_none(xpath_attr(it, xpath_with_ns('./itunes:image', NS_MAP), 'href')),
2222 'episode': itunes('title'),
2223 'episode_number': int_or_none(itunes('episode')),
2224 'season_number': int_or_none(itunes('season')),
2225 'age_limit': {'true': 18, 'yes': 18, 'false': 0, 'no': 0}.get((itunes('explicit') or '').lower()),
2226 })
2227
2228 return {
2229 '_type': 'playlist',
2230 'id': url,
2231 'title': try_call(lambda: doc.find('./channel/title').text),
2232 'description': try_call(lambda: doc.find('./channel/description').text),
2233 'entries': entries,
2234 }
2235
2236 @classmethod
2237 def _kvs_get_real_url(cls, video_url, license_code):
2238 if not video_url.startswith('function/0/'):
2239 return video_url # not obfuscated
2240
2241 parsed = urllib.parse.urlparse(video_url[len('function/0/'):])
2242 license = cls._kvs_get_license_token(license_code)
2243 urlparts = parsed.path.split('/')
2244
2245 HASH_LENGTH = 32
2246 hash = urlparts[3][:HASH_LENGTH]
2247 indices = list(range(HASH_LENGTH))
2248
2249 # Swap indices of hash according to the destination calculated from the license token
2250 accum = 0
2251 for src in reversed(range(HASH_LENGTH)):
2252 accum += license[src]
2253 dest = (src + accum) % HASH_LENGTH
2254 indices[src], indices[dest] = indices[dest], indices[src]
2255
2256 urlparts[3] = ''.join(hash[index] for index in indices) + urlparts[3][HASH_LENGTH:]
2257 return urllib.parse.urlunparse(parsed._replace(path='/'.join(urlparts)))
2258
2259 @staticmethod
2260 def _kvs_get_license_token(license):
2261 license = license.replace('$', '')
2262 license_values = [int(char) for char in license]
2263
2264 modlicense = license.replace('0', '1')
2265 center = len(modlicense) // 2
2266 fronthalf = int(modlicense[:center + 1])
2267 backhalf = int(modlicense[center:])
2268 modlicense = str(4 * abs(fronthalf - backhalf))[:center + 1]
2269
2270 return [
2271 (license_values[index + offset] + current) % 10
2272 for index, current in enumerate(map(int, modlicense))
2273 for offset in range(4)
2274 ]
2275
2276 def _extract_kvs(self, url, webpage, video_id):
2277 flashvars = self._search_json(
2278 r'(?s:<script\b[^>]*>.*?var\s+flashvars\s*=)',
2279 webpage, 'flashvars', video_id, transform_source=js_to_json)
2280
2281 # extract the part after the last / as the display_id from the
2282 # canonical URL.
2283 display_id = self._search_regex(
2284 r'(?:<link href="https?://[^"]+/(.+?)/?" rel="canonical"\s*/?>'
2285 r'|<link rel="canonical" href="https?://[^"]+/(.+?)/?"\s*/?>)',
2286 webpage, 'display_id', fatal=False)
2287 title = self._html_search_regex(r'<(?:h1|title)>(?:Video: )?(.+?)</(?:h1|title)>', webpage, 'title')
2288
2289 thumbnail = flashvars['preview_url']
2290 if thumbnail.startswith('//'):
2291 protocol, _, _ = url.partition('/')
2292 thumbnail = protocol + thumbnail
2293
2294 url_keys = list(filter(re.compile(r'^video_(?:url|alt_url\d*)$').match, flashvars.keys()))
2295 formats = []
2296 for key in url_keys:
2297 if '/get_file/' not in flashvars[key]:
2298 continue
2299 format_id = flashvars.get(f'{key}_text', key)
2300 formats.append({
2301 'url': urljoin(url, self._kvs_get_real_url(flashvars[key], flashvars['license_code'])),
2302 'format_id': format_id,
2303 'ext': 'mp4',
2304 **(parse_resolution(format_id) or parse_resolution(flashvars[key])),
2305 'http_headers': {'Referer': url},
2306 })
2307 if not formats[-1].get('height'):
2308 formats[-1]['quality'] = 1
2309
2310 return {
2311 'id': flashvars['video_id'],
2312 'display_id': display_id,
2313 'title': title,
2314 'thumbnail': thumbnail,
2315 'formats': formats,
2316 }
2317
2318 def _real_extract(self, url):
2319 if url.startswith('//'):
2320 return self.url_result(self.http_scheme() + url)
2321
2322 parsed_url = urllib.parse.urlparse(url)
2323 if not parsed_url.scheme:
2324 default_search = self.get_param('default_search')
2325 if default_search is None:
2326 default_search = 'fixup_error'
2327
2328 if default_search in ('auto', 'auto_warning', 'fixup_error'):
2329 if re.match(r'^[^\s/]+\.[^\s/]+/', url):
2330 self.report_warning('The url doesn\'t specify the protocol, trying with http')
2331 return self.url_result('http://' + url)
2332 elif default_search != 'fixup_error':
2333 if default_search == 'auto_warning':
2334 if re.match(r'^(?:url|URL)$', url):
2335 raise ExtractorError(
2336 'Invalid URL: %r . Call yt-dlp like this: yt-dlp -v "https://www.youtube.com/watch?v=BaW_jenozKc" ' % url,
2337 expected=True)
2338 else:
2339 self.report_warning(
2340 'Falling back to youtube search for %s . Set --default-search "auto" to suppress this warning.' % url)
2341 return self.url_result('ytsearch:' + url)
2342
2343 if default_search in ('error', 'fixup_error'):
2344 raise ExtractorError(
2345 '%r is not a valid URL. '
2346 'Set --default-search "ytsearch" (or run yt-dlp "ytsearch:%s" ) to search YouTube'
2347 % (url, url), expected=True)
2348 else:
2349 if ':' not in default_search:
2350 default_search += ':'
2351 return self.url_result(default_search + url)
2352
2353 original_url = url
2354 url, smuggled_data = unsmuggle_url(url, {})
2355 force_videoid = None
2356 is_intentional = smuggled_data.get('to_generic')
2357 if 'force_videoid' in smuggled_data:
2358 force_videoid = smuggled_data['force_videoid']
2359 video_id = force_videoid
2360 else:
2361 video_id = self._generic_id(url)
2362
2363 # Some webservers may serve compressed content of rather big size (e.g. gzipped flac)
2364 # making it impossible to download only chunk of the file (yet we need only 512kB to
2365 # test whether it's HTML or not). According to yt-dlp default Accept-Encoding
2366 # that will always result in downloading the whole file that is not desirable.
2367 # Therefore for extraction pass we have to override Accept-Encoding to any in order
2368 # to accept raw bytes and being able to download only a chunk.
2369 # It may probably better to solve this by checking Content-Type for application/octet-stream
2370 # after a HEAD request, but not sure if we can rely on this.
2371 full_response = self._request_webpage(url, video_id, headers={
2372 'Accept-Encoding': 'identity',
2373 **smuggled_data.get('http_headers', {})
2374 })
2375 new_url = full_response.geturl()
2376 url = urllib.parse.urlparse(url)._replace(scheme=urllib.parse.urlparse(new_url).scheme).geturl()
2377 if new_url != extract_basic_auth(url)[0]:
2378 self.report_following_redirect(new_url)
2379 if force_videoid:
2380 new_url = smuggle_url(new_url, {'force_videoid': force_videoid})
2381 return self.url_result(new_url)
2382
2383 info_dict = {
2384 'id': video_id,
2385 'title': self._generic_title(url),
2386 'timestamp': unified_timestamp(full_response.headers.get('Last-Modified'))
2387 }
2388
2389 # Check for direct link to a video
2390 content_type = full_response.headers.get('Content-Type', '').lower()
2391 m = re.match(r'^(?P<type>audio|video|application(?=/(?:ogg$|(?:vnd\.apple\.|x-)?mpegurl)))/(?P<format_id>[^;\s]+)', content_type)
2392 if m:
2393 self.report_detected('direct video link')
2394 headers = smuggled_data.get('http_headers', {})
2395 format_id = str(m.group('format_id'))
2396 ext = determine_ext(url)
2397 subtitles = {}
2398 if format_id.endswith('mpegurl') or ext == 'm3u8':
2399 formats, subtitles = self._extract_m3u8_formats_and_subtitles(url, video_id, 'mp4', headers=headers)
2400 info_dict.update(self._fragment_query(url))
2401 elif format_id.endswith('mpd') or format_id.endswith('dash+xml') or ext == 'mpd':
2402 formats, subtitles = self._extract_mpd_formats_and_subtitles(url, video_id, headers=headers)
2403 info_dict.update(self._fragment_query(url))
2404 elif format_id == 'f4m' or ext == 'f4m':
2405 formats = self._extract_f4m_formats(url, video_id, headers=headers)
2406 else:
2407 formats = [{
2408 'format_id': format_id,
2409 'url': url,
2410 'vcodec': 'none' if m.group('type') == 'audio' else None
2411 }]
2412 info_dict['direct'] = True
2413 info_dict.update({
2414 'formats': formats,
2415 'subtitles': subtitles,
2416 'http_headers': headers or None,
2417 })
2418 return info_dict
2419
2420 if not self.get_param('test', False) and not is_intentional:
2421 force = self.get_param('force_generic_extractor', False)
2422 self.report_warning('%s generic information extractor' % ('Forcing' if force else 'Falling back on'))
2423
2424 first_bytes = full_response.read(512)
2425
2426 # Is it an M3U playlist?
2427 if first_bytes.startswith(b'#EXTM3U'):
2428 self.report_detected('M3U playlist')
2429 info_dict['formats'], info_dict['subtitles'] = self._extract_m3u8_formats_and_subtitles(url, video_id, 'mp4')
2430 info_dict.update(self._fragment_query(url))
2431 return info_dict
2432
2433 # Maybe it's a direct link to a video?
2434 # Be careful not to download the whole thing!
2435 if not is_html(first_bytes):
2436 self.report_warning(
2437 'URL could be a direct video link, returning it as such.')
2438 info_dict.update({
2439 'direct': True,
2440 'url': url,
2441 })
2442 return info_dict
2443
2444 webpage = self._webpage_read_content(
2445 full_response, url, video_id, prefix=first_bytes)
2446
2447 if '<title>DPG Media Privacy Gate</title>' in webpage:
2448 webpage = self._download_webpage(url, video_id)
2449
2450 self.report_extraction(video_id)
2451
2452 # Is it an RSS feed, a SMIL file, an XSPF playlist or a MPD manifest?
2453 try:
2454 try:
2455 doc = compat_etree_fromstring(webpage)
2456 except xml.etree.ElementTree.ParseError:
2457 doc = compat_etree_fromstring(webpage.encode('utf-8'))
2458 if doc.tag == 'rss':
2459 self.report_detected('RSS feed')
2460 return self._extract_rss(url, video_id, doc)
2461 elif doc.tag == 'SmoothStreamingMedia':
2462 info_dict['formats'], info_dict['subtitles'] = self._parse_ism_formats_and_subtitles(doc, url)
2463 self.report_detected('ISM manifest')
2464 return info_dict
2465 elif re.match(r'^(?:{[^}]+})?smil$', doc.tag):
2466 smil = self._parse_smil(doc, url, video_id)
2467 self.report_detected('SMIL file')
2468 return smil
2469 elif doc.tag == '{http://xspf.org/ns/0/}playlist':
2470 self.report_detected('XSPF playlist')
2471 return self.playlist_result(
2472 self._parse_xspf(
2473 doc, video_id, xspf_url=url,
2474 xspf_base_url=full_response.geturl()),
2475 video_id)
2476 elif re.match(r'(?i)^(?:{[^}]+})?MPD$', doc.tag):
2477 info_dict['formats'], info_dict['subtitles'] = self._parse_mpd_formats_and_subtitles(
2478 doc,
2479 mpd_base_url=full_response.geturl().rpartition('/')[0],
2480 mpd_url=url)
2481 info_dict.update(self._fragment_query(url))
2482 self.report_detected('DASH manifest')
2483 return info_dict
2484 elif re.match(r'^{http://ns\.adobe\.com/f4m/[12]\.0}manifest$', doc.tag):
2485 info_dict['formats'] = self._parse_f4m_formats(doc, url, video_id)
2486 self.report_detected('F4M manifest')
2487 return info_dict
2488 except xml.etree.ElementTree.ParseError:
2489 pass
2490
2491 info_dict.update({
2492 # it's tempting to parse this further, but you would
2493 # have to take into account all the variations like
2494 # Video Title - Site Name
2495 # Site Name | Video Title
2496 # Video Title - Tagline | Site Name
2497 # and so on and so forth; it's just not practical
2498 'title': self._generic_title('', webpage, default='video'),
2499 'description': self._og_search_description(webpage, default=None),
2500 'thumbnail': self._og_search_thumbnail(webpage, default=None),
2501 'age_limit': self._rta_search(webpage),
2502 })
2503
2504 self._downloader.write_debug('Looking for embeds')
2505 embeds = list(self._extract_embeds(original_url, webpage, urlh=full_response, info_dict=info_dict))
2506 if len(embeds) == 1:
2507 return {**info_dict, **embeds[0]}
2508 elif embeds:
2509 return self.playlist_result(embeds, **info_dict)
2510 raise UnsupportedError(url)
2511
2512 def _extract_embeds(self, url, webpage, *, urlh=None, info_dict={}):
2513 """Returns an iterator of video entries"""
2514 info_dict = types.MappingProxyType(info_dict) # Prevents accidental mutation
2515 video_id = traverse_obj(info_dict, 'display_id', 'id') or self._generic_id(url)
2516 url, smuggled_data = unsmuggle_url(url, {})
2517 actual_url = urlh.geturl() if urlh else url
2518
2519 # Sometimes embedded video player is hidden behind percent encoding
2520 # (e.g. https://github.com/ytdl-org/youtube-dl/issues/2448)
2521 # Unescaping the whole page allows to handle those cases in a generic way
2522 # FIXME: unescaping the whole page may break URLs, commenting out for now.
2523 # There probably should be a second run of generic extractor on unescaped webpage.
2524 # webpage = urllib.parse.unquote(webpage)
2525
2526 embeds = []
2527 for ie in self._downloader._ies.values():
2528 if ie.ie_key() in smuggled_data.get('block_ies', []):
2529 continue
2530 gen = ie.extract_from_webpage(self._downloader, url, webpage)
2531 current_embeds = []
2532 try:
2533 while True:
2534 current_embeds.append(next(gen))
2535 except self.StopExtraction:
2536 self.report_detected(f'{ie.IE_NAME} exclusive embed', len(current_embeds),
2537 embeds and 'discarding other embeds')
2538 return current_embeds
2539 except StopIteration:
2540 self.report_detected(f'{ie.IE_NAME} embed', len(current_embeds))
2541 embeds.extend(current_embeds)
2542
2543 if embeds:
2544 return embeds
2545
2546 jwplayer_data = self._find_jwplayer_data(
2547 webpage, video_id, transform_source=js_to_json)
2548 if jwplayer_data:
2549 if isinstance(jwplayer_data.get('playlist'), str):
2550 self.report_detected('JW Player playlist')
2551 return [self.url_result(jwplayer_data['playlist'], 'JWPlatform')]
2552 try:
2553 info = self._parse_jwplayer_data(
2554 jwplayer_data, video_id, require_title=False, base_url=url)
2555 if traverse_obj(info, 'formats', ('entries', ..., 'formats')):
2556 self.report_detected('JW Player data')
2557 return [info]
2558 except ExtractorError:
2559 # See https://github.com/ytdl-org/youtube-dl/pull/16735
2560 pass
2561
2562 # Video.js embed
2563 mobj = re.search(
2564 r'(?s)\bvideojs\s*\(.+?([a-zA-Z0-9_$]+)\.src\s*\(\s*((?:\[.+?\]|{.+?}))\s*\)\s*;',
2565 webpage)
2566 if mobj is not None:
2567 varname = mobj.group(1)
2568 sources = variadic(self._parse_json(
2569 mobj.group(2), video_id, transform_source=js_to_json, fatal=False) or [])
2570 formats = []
2571 subtitles = {}
2572 for source in sources:
2573 src = source.get('src')
2574 if not src or not isinstance(src, str):
2575 continue
2576 src = urllib.parse.urljoin(url, src)
2577 src_type = source.get('type')
2578 if isinstance(src_type, str):
2579 src_type = src_type.lower()
2580 ext = determine_ext(src).lower()
2581 if src_type == 'video/youtube':
2582 return [self.url_result(src, YoutubeIE.ie_key())]
2583 if src_type == 'application/dash+xml' or ext == 'mpd':
2584 fmts, subs = self._extract_mpd_formats_and_subtitles(
2585 src, video_id, mpd_id='dash', fatal=False)
2586 formats.extend(fmts)
2587 self._merge_subtitles(subs, target=subtitles)
2588 elif src_type == 'application/x-mpegurl' or ext == 'm3u8':
2589 fmts, subs = self._extract_m3u8_formats_and_subtitles(
2590 src, video_id, 'mp4', entry_protocol='m3u8_native',
2591 m3u8_id='hls', fatal=False)
2592 formats.extend(fmts)
2593 self._merge_subtitles(subs, target=subtitles)
2594 for fmt in formats:
2595 fmt.update(self._fragment_query(src))
2596
2597 if not formats:
2598 formats.append({
2599 'url': src,
2600 'ext': (mimetype2ext(src_type)
2601 or ext if ext in KNOWN_EXTENSIONS else 'mp4'),
2602 'http_headers': {
2603 'Referer': actual_url,
2604 },
2605 })
2606 # https://docs.videojs.com/player#addRemoteTextTrack
2607 # https://html.spec.whatwg.org/multipage/media.html#htmltrackelement
2608 for sub_match in re.finditer(rf'(?s){re.escape(varname)}' r'\.addRemoteTextTrack\(({.+?})\s*,\s*(?:true|false)\)', webpage):
2609 sub = self._parse_json(
2610 sub_match.group(1), video_id, transform_source=js_to_json, fatal=False) or {}
2611 src = str_or_none(sub.get('src'))
2612 if not src:
2613 continue
2614 subtitles.setdefault(dict_get(sub, ('language', 'srclang')) or 'und', []).append({
2615 'url': urllib.parse.urljoin(url, src),
2616 'name': sub.get('label'),
2617 'http_headers': {
2618 'Referer': actual_url,
2619 },
2620 })
2621 if formats or subtitles:
2622 self.report_detected('video.js embed')
2623 return [{'formats': formats, 'subtitles': subtitles}]
2624
2625 # Look for generic KVS player (before json-ld bc of some urls that break otherwise)
2626 found = self._search_regex((
2627 r'<script\b[^>]+?\bsrc\s*=\s*(["\'])https?://(?:(?!\1)[^?#])+/kt_player\.js\?v=(?P<ver>\d+(?:\.\d+)+)\1[^>]*>',
2628 r'kt_player\s*\(\s*(["\'])(?:(?!\1)[\w\W])+\1\s*,\s*(["\'])https?://(?:(?!\2)[^?#])+/kt_player\.swf\?v=(?P<ver>\d+(?:\.\d+)+)\2\s*,',
2629 ), webpage, 'KVS player', group='ver', default=False)
2630 if found:
2631 self.report_detected('KVS Player')
2632 if found.split('.')[0] not in ('4', '5', '6'):
2633 self.report_warning(f'Untested major version ({found}) in player engine - download may fail.')
2634 return [self._extract_kvs(url, webpage, video_id)]
2635
2636 # Looking for http://schema.org/VideoObject
2637 json_ld = self._search_json_ld(webpage, video_id, default={})
2638 if json_ld.get('url') not in (url, None):
2639 self.report_detected('JSON LD')
2640 is_direct = json_ld.get('ext') not in (None, *MEDIA_EXTENSIONS.manifests)
2641 return [merge_dicts({
2642 '_type': 'video' if is_direct else 'url_transparent',
2643 'url': smuggle_url(json_ld['url'], {
2644 'force_videoid': video_id,
2645 'to_generic': True,
2646 'http_headers': {'Referer': url},
2647 }),
2648 }, json_ld)]
2649
2650 def check_video(vurl):
2651 if YoutubeIE.suitable(vurl):
2652 return True
2653 if RtmpIE.suitable(vurl):
2654 return True
2655 vpath = urllib.parse.urlparse(vurl).path
2656 vext = determine_ext(vpath, None)
2657 return vext not in (None, 'swf', 'png', 'jpg', 'srt', 'sbv', 'sub', 'vtt', 'ttml', 'js', 'xml')
2658
2659 def filter_video(urls):
2660 return list(filter(check_video, urls))
2661
2662 # Start with something easy: JW Player in SWFObject
2663 found = filter_video(re.findall(r'flashvars: [\'"](?:.*&)?file=(http[^\'"&]*)', webpage))
2664 if found:
2665 self.report_detected('JW Player in SFWObject')
2666 else:
2667 # Look for gorilla-vid style embedding
2668 found = filter_video(re.findall(r'''(?sx)
2669 (?:
2670 jw_plugins|
2671 JWPlayerOptions|
2672 jwplayer\s*\(\s*["'][^'"]+["']\s*\)\s*\.setup
2673 )
2674 .*?
2675 ['"]?file['"]?\s*:\s*["\'](.*?)["\']''', webpage))
2676 if found:
2677 self.report_detected('JW Player embed')
2678 if not found:
2679 # Broaden the search a little bit
2680 found = filter_video(re.findall(r'[^A-Za-z0-9]?(?:file|source)=(http[^\'"&]*)', webpage))
2681 if found:
2682 self.report_detected('video file')
2683 if not found:
2684 # Broaden the findall a little bit: JWPlayer JS loader
2685 found = filter_video(re.findall(
2686 r'[^A-Za-z0-9]?(?:file|video_url)["\']?:\s*["\'](http(?![^\'"]+\.[0-9]+[\'"])[^\'"]+)["\']', webpage))
2687 if found:
2688 self.report_detected('JW Player JS loader')
2689 if not found:
2690 # Flow player
2691 found = filter_video(re.findall(r'''(?xs)
2692 flowplayer\("[^"]+",\s*
2693 \{[^}]+?\}\s*,
2694 \s*\{[^}]+? ["']?clip["']?\s*:\s*\{\s*
2695 ["']?url["']?\s*:\s*["']([^"']+)["']
2696 ''', webpage))
2697 if found:
2698 self.report_detected('Flow Player')
2699 if not found:
2700 # Cinerama player
2701 found = re.findall(
2702 r"cinerama\.embedPlayer\(\s*\'[^']+\',\s*'([^']+)'", webpage)
2703 if found:
2704 self.report_detected('Cinerama player')
2705 if not found:
2706 # Try to find twitter cards info
2707 # twitter:player:stream should be checked before twitter:player since
2708 # it is expected to contain a raw stream (see
2709 # https://dev.twitter.com/cards/types/player#On_twitter.com_via_desktop_browser)
2710 found = filter_video(re.findall(
2711 r'<meta (?:property|name)="twitter:player:stream" (?:content|value)="(.+?)"', webpage))
2712 if found:
2713 self.report_detected('Twitter card')
2714 if not found:
2715 # We look for Open Graph info:
2716 # We have to match any number spaces between elements, some sites try to align them, e.g.: statigr.am
2717 m_video_type = re.findall(r'<meta.*?property="og:video:type".*?content="video/(.*?)"', webpage)
2718 # We only look in og:video if the MIME type is a video, don't try if it's a Flash player:
2719 if m_video_type is not None:
2720 found = filter_video(re.findall(r'<meta.*?property="og:(?:video|audio)".*?content="(.*?)"', webpage))
2721 if found:
2722 self.report_detected('Open Graph video info')
2723 if not found:
2724 REDIRECT_REGEX = r'[0-9]{,2};\s*(?:URL|url)=\'?([^\'"]+)'
2725 found = re.search(
2726 r'(?i)<meta\s+(?=(?:[a-z-]+="[^"]+"\s+)*http-equiv="refresh")'
2727 r'(?:[a-z-]+="[^"]+"\s+)*?content="%s' % REDIRECT_REGEX,
2728 webpage)
2729 if not found:
2730 # Look also in Refresh HTTP header
2731 refresh_header = urlh and urlh.headers.get('Refresh')
2732 if refresh_header:
2733 found = re.search(REDIRECT_REGEX, refresh_header)
2734 if found:
2735 new_url = urllib.parse.urljoin(url, unescapeHTML(found.group(1)))
2736 if new_url != url:
2737 self.report_following_redirect(new_url)
2738 return [self.url_result(new_url)]
2739 else:
2740 found = None
2741
2742 if not found:
2743 # twitter:player is a https URL to iframe player that may or may not
2744 # be supported by yt-dlp thus this is checked the very last (see
2745 # https://dev.twitter.com/cards/types/player#On_twitter.com_via_desktop_browser)
2746 embed_url = self._html_search_meta('twitter:player', webpage, default=None)
2747 if embed_url and embed_url != url:
2748 self.report_detected('twitter:player iframe')
2749 return [self.url_result(embed_url)]
2750
2751 if not found:
2752 return []
2753
2754 domain_name = self._search_regex(r'^(?:https?://)?([^/]*)/.*', url, 'video uploader', default=None)
2755
2756 entries = []
2757 for video_url in orderedSet(found):
2758 video_url = video_url.encode().decode('unicode-escape')
2759 video_url = unescapeHTML(video_url)
2760 video_url = video_url.replace('\\/', '/')
2761 video_url = urllib.parse.urljoin(url, video_url)
2762 video_id = urllib.parse.unquote(os.path.basename(video_url))
2763
2764 # Sometimes, jwplayer extraction will result in a YouTube URL
2765 if YoutubeIE.suitable(video_url):
2766 entries.append(self.url_result(video_url, 'Youtube'))
2767 continue
2768
2769 video_id = os.path.splitext(video_id)[0]
2770 headers = {
2771 'referer': actual_url
2772 }
2773
2774 entry_info_dict = {
2775 'id': video_id,
2776 'uploader': domain_name,
2777 'title': info_dict['title'],
2778 'age_limit': info_dict['age_limit'],
2779 'http_headers': headers,
2780 }
2781
2782 if RtmpIE.suitable(video_url):
2783 entry_info_dict.update({
2784 '_type': 'url_transparent',
2785 'ie_key': RtmpIE.ie_key(),
2786 'url': video_url,
2787 })
2788 entries.append(entry_info_dict)
2789 continue
2790
2791 ext = determine_ext(video_url)
2792 if ext == 'smil':
2793 entry_info_dict = {**self._extract_smil_info(video_url, video_id), **entry_info_dict}
2794 elif ext == 'xspf':
2795 return [self._extract_xspf_playlist(video_url, video_id)]
2796 elif ext == 'm3u8':
2797 entry_info_dict['formats'], entry_info_dict['subtitles'] = self._extract_m3u8_formats_and_subtitles(video_url, video_id, ext='mp4', headers=headers)
2798 entry_info_dict.update(self._fragment_query(video_url))
2799 elif ext == 'mpd':
2800 entry_info_dict['formats'], entry_info_dict['subtitles'] = self._extract_mpd_formats_and_subtitles(video_url, video_id, headers=headers)
2801 entry_info_dict.update(self._fragment_query(video_url))
2802 elif ext == 'f4m':
2803 entry_info_dict['formats'] = self._extract_f4m_formats(video_url, video_id, headers=headers)
2804 elif re.search(r'(?i)\.(?:ism|smil)/manifest', video_url) and video_url != url:
2805 # Just matching .ism/manifest is not enough to be reliably sure
2806 # whether it's actually an ISM manifest or some other streaming
2807 # manifest since there are various streaming URL formats
2808 # possible (see [1]) as well as some other shenanigans like
2809 # .smil/manifest URLs that actually serve an ISM (see [2]) and
2810 # so on.
2811 # Thus the most reasonable way to solve this is to delegate
2812 # to generic extractor in order to look into the contents of
2813 # the manifest itself.
2814 # 1. https://azure.microsoft.com/en-us/documentation/articles/media-services-deliver-content-overview/#streaming-url-formats
2815 # 2. https://svs.itworkscdn.net/lbcivod/smil:itwfcdn/lbci/170976.smil/Manifest
2816 entry_info_dict = self.url_result(
2817 smuggle_url(video_url, {'to_generic': True}),
2818 GenericIE.ie_key())
2819 else:
2820 entry_info_dict['url'] = video_url
2821
2822 entries.append(entry_info_dict)
2823
2824 if len(entries) > 1:
2825 for num, e in enumerate(entries, start=1):
2826 # 'url' results don't have a title
2827 if e.get('title') is not None:
2828 e['title'] = '%s (%d)' % (e['title'], num)
2829 return entries