generic.py 111 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775
  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. import os
  4. import re
  5. import sys
  6. from .common import InfoExtractor
  7. from .youtube import YoutubeIE
  8. from ..compat import (
  9. compat_etree_fromstring,
  10. compat_urllib_parse_unquote,
  11. compat_urlparse,
  12. compat_xml_parse_error,
  13. )
  14. from ..utils import (
  15. determine_ext,
  16. ExtractorError,
  17. float_or_none,
  18. HEADRequest,
  19. is_html,
  20. js_to_json,
  21. orderedSet,
  22. sanitized_Request,
  23. smuggle_url,
  24. unescapeHTML,
  25. unified_strdate,
  26. unsmuggle_url,
  27. UnsupportedError,
  28. xpath_text,
  29. )
  30. from .commonprotocols import RtmpIE
  31. from .brightcove import (
  32. BrightcoveLegacyIE,
  33. BrightcoveNewIE,
  34. )
  35. from .nbc import NBCSportsVPlayerIE
  36. from .ooyala import OoyalaIE
  37. from .rutv import RUTVIE
  38. from .tvc import TVCIE
  39. from .sportbox import SportBoxEmbedIE
  40. from .smotri import SmotriIE
  41. from .myvi import MyviIE
  42. from .condenast import CondeNastIE
  43. from .udn import UDNEmbedIE
  44. from .senateisvp import SenateISVPIE
  45. from .svt import SVTIE
  46. from .pornhub import PornHubIE
  47. from .xhamster import XHamsterEmbedIE
  48. from .tnaflix import TNAFlixNetworkEmbedIE
  49. from .drtuber import DrTuberIE
  50. from .redtube import RedTubeIE
  51. from .vimeo import VimeoIE
  52. from .dailymotion import (
  53. DailymotionIE,
  54. DailymotionCloudIE,
  55. )
  56. from .onionstudios import OnionStudiosIE
  57. from .viewlift import ViewLiftEmbedIE
  58. from .mtv import MTVServicesEmbeddedIE
  59. from .pladform import PladformIE
  60. from .videomore import VideomoreIE
  61. from .webcaster import WebcasterFeedIE
  62. from .googledrive import GoogleDriveIE
  63. from .jwplatform import JWPlatformIE
  64. from .digiteka import DigitekaIE
  65. from .arkena import ArkenaIE
  66. from .instagram import InstagramIE
  67. from .liveleak import LiveLeakIE
  68. from .threeqsdn import ThreeQSDNIE
  69. from .theplatform import ThePlatformIE
  70. from .vessel import VesselIE
  71. from .kaltura import KalturaIE
  72. from .eagleplatform import EaglePlatformIE
  73. from .facebook import FacebookIE
  74. from .soundcloud import SoundcloudIE
  75. from .tunein import TuneInBaseIE
  76. from .vbox7 import Vbox7IE
  77. from .dbtv import DBTVIE
  78. from .piksel import PikselIE
  79. from .videa import VideaIE
  80. from .twentymin import TwentyMinutenIE
  81. from .ustream import UstreamIE
  82. from .openload import OpenloadIE
  83. from .videopress import VideoPressIE
  84. from .rutube import RutubeIE
  85. class GenericIE(InfoExtractor):
  86. IE_DESC = 'Generic downloader that works on some sites'
  87. _VALID_URL = r'.*'
  88. IE_NAME = 'generic'
  89. _TESTS = [
  90. # Direct link to a video
  91. {
  92. 'url': 'http://media.w3.org/2010/05/sintel/trailer.mp4',
  93. 'md5': '67d406c2bcb6af27fa886f31aa934bbe',
  94. 'info_dict': {
  95. 'id': 'trailer',
  96. 'ext': 'mp4',
  97. 'title': 'trailer',
  98. 'upload_date': '20100513',
  99. }
  100. },
  101. # Direct link to media delivered compressed (until Accept-Encoding is *)
  102. {
  103. 'url': 'http://calimero.tk/muzik/FictionJunction-Parallel_Hearts.flac',
  104. 'md5': '128c42e68b13950268b648275386fc74',
  105. 'info_dict': {
  106. 'id': 'FictionJunction-Parallel_Hearts',
  107. 'ext': 'flac',
  108. 'title': 'FictionJunction-Parallel_Hearts',
  109. 'upload_date': '20140522',
  110. },
  111. 'expected_warnings': [
  112. 'URL could be a direct video link, returning it as such.'
  113. ],
  114. 'skip': 'URL invalid',
  115. },
  116. # Direct download with broken HEAD
  117. {
  118. 'url': 'http://ai-radio.org:8000/radio.opus',
  119. 'info_dict': {
  120. 'id': 'radio',
  121. 'ext': 'opus',
  122. 'title': 'radio',
  123. },
  124. 'params': {
  125. 'skip_download': True, # infinite live stream
  126. },
  127. 'expected_warnings': [
  128. r'501.*Not Implemented',
  129. r'400.*Bad Request',
  130. ],
  131. },
  132. # Direct link with incorrect MIME type
  133. {
  134. 'url': 'http://ftp.nluug.nl/video/nluug/2014-11-20_nj14/zaal-2/5_Lennart_Poettering_-_Systemd.webm',
  135. 'md5': '4ccbebe5f36706d85221f204d7eb5913',
  136. 'info_dict': {
  137. 'url': 'http://ftp.nluug.nl/video/nluug/2014-11-20_nj14/zaal-2/5_Lennart_Poettering_-_Systemd.webm',
  138. 'id': '5_Lennart_Poettering_-_Systemd',
  139. 'ext': 'webm',
  140. 'title': '5_Lennart_Poettering_-_Systemd',
  141. 'upload_date': '20141120',
  142. },
  143. 'expected_warnings': [
  144. 'URL could be a direct video link, returning it as such.'
  145. ]
  146. },
  147. # RSS feed
  148. {
  149. 'url': 'http://phihag.de/2014/youtube-dl/rss2.xml',
  150. 'info_dict': {
  151. 'id': 'http://phihag.de/2014/youtube-dl/rss2.xml',
  152. 'title': 'Zero Punctuation',
  153. 'description': 're:.*groundbreaking video review series.*'
  154. },
  155. 'playlist_mincount': 11,
  156. },
  157. # RSS feed with enclosure
  158. {
  159. 'url': 'http://podcastfeeds.nbcnews.com/audio/podcast/MSNBC-MADDOW-NETCAST-M4V.xml',
  160. 'info_dict': {
  161. 'id': 'pdv_maddow_netcast_m4v-02-27-2015-201624',
  162. 'ext': 'm4v',
  163. 'upload_date': '20150228',
  164. 'title': 'pdv_maddow_netcast_m4v-02-27-2015-201624',
  165. }
  166. },
  167. # SMIL from http://videolectures.net/promogram_igor_mekjavic_eng
  168. {
  169. 'url': 'http://videolectures.net/promogram_igor_mekjavic_eng/video/1/smil.xml',
  170. 'info_dict': {
  171. 'id': 'smil',
  172. 'ext': 'mp4',
  173. 'title': 'Automatics, robotics and biocybernetics',
  174. 'description': 'md5:815fc1deb6b3a2bff99de2d5325be482',
  175. 'upload_date': '20130627',
  176. 'formats': 'mincount:16',
  177. 'subtitles': 'mincount:1',
  178. },
  179. 'params': {
  180. 'force_generic_extractor': True,
  181. 'skip_download': True,
  182. },
  183. },
  184. # SMIL from http://www1.wdr.de/mediathek/video/livestream/index.html
  185. {
  186. 'url': 'http://metafilegenerator.de/WDR/WDR_FS/hds/hds.smil',
  187. 'info_dict': {
  188. 'id': 'hds',
  189. 'ext': 'flv',
  190. 'title': 'hds',
  191. 'formats': 'mincount:1',
  192. },
  193. 'params': {
  194. 'skip_download': True,
  195. },
  196. },
  197. # SMIL from https://www.restudy.dk/video/play/id/1637
  198. {
  199. 'url': 'https://www.restudy.dk/awsmedia/SmilDirectory/video_1637.xml',
  200. 'info_dict': {
  201. 'id': 'video_1637',
  202. 'ext': 'flv',
  203. 'title': 'video_1637',
  204. 'formats': 'mincount:3',
  205. },
  206. 'params': {
  207. 'skip_download': True,
  208. },
  209. },
  210. # SMIL from http://adventure.howstuffworks.com/5266-cool-jobs-iditarod-musher-video.htm
  211. {
  212. 'url': 'http://services.media.howstuffworks.com/videos/450221/smil-service.smil',
  213. 'info_dict': {
  214. 'id': 'smil-service',
  215. 'ext': 'flv',
  216. 'title': 'smil-service',
  217. 'formats': 'mincount:1',
  218. },
  219. 'params': {
  220. 'skip_download': True,
  221. },
  222. },
  223. # SMIL from http://new.livestream.com/CoheedandCambria/WebsterHall/videos/4719370
  224. {
  225. 'url': 'http://api.new.livestream.com/accounts/1570303/events/1585861/videos/4719370.smil',
  226. 'info_dict': {
  227. 'id': '4719370',
  228. 'ext': 'mp4',
  229. 'title': '571de1fd-47bc-48db-abf9-238872a58d1f',
  230. 'formats': 'mincount:3',
  231. },
  232. 'params': {
  233. 'skip_download': True,
  234. },
  235. },
  236. # XSPF playlist from http://www.telegraaf.nl/tv/nieuws/binnenland/24353229/__Tikibad_ontruimd_wegens_brand__.html
  237. {
  238. 'url': 'http://www.telegraaf.nl/xml/playlist/2015/8/7/mZlp2ctYIUEB.xspf',
  239. 'info_dict': {
  240. 'id': 'mZlp2ctYIUEB',
  241. 'ext': 'mp4',
  242. 'title': 'Tikibad ontruimd wegens brand',
  243. 'description': 'md5:05ca046ff47b931f9b04855015e163a4',
  244. 'thumbnail': r're:^https?://.*\.jpg$',
  245. 'duration': 33,
  246. },
  247. 'params': {
  248. 'skip_download': True,
  249. },
  250. },
  251. # MPD from http://dash-mse-test.appspot.com/media.html
  252. {
  253. 'url': 'http://yt-dash-mse-test.commondatastorage.googleapis.com/media/car-20120827-manifest.mpd',
  254. 'md5': '4b57baab2e30d6eb3a6a09f0ba57ef53',
  255. 'info_dict': {
  256. 'id': 'car-20120827-manifest',
  257. 'ext': 'mp4',
  258. 'title': 'car-20120827-manifest',
  259. 'formats': 'mincount:9',
  260. 'upload_date': '20130904',
  261. },
  262. 'params': {
  263. 'format': 'bestvideo',
  264. },
  265. },
  266. # m3u8 served with Content-Type: audio/x-mpegURL; charset=utf-8
  267. {
  268. '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',
  269. 'info_dict': {
  270. 'id': 'content',
  271. 'ext': 'mp4',
  272. 'title': 'content',
  273. 'formats': 'mincount:8',
  274. },
  275. 'params': {
  276. # m3u8 downloads
  277. 'skip_download': True,
  278. },
  279. 'skip': 'video gone',
  280. },
  281. # m3u8 served with Content-Type: text/plain
  282. {
  283. 'url': 'http://www.nacentapps.com/m3u8/index.m3u8',
  284. 'info_dict': {
  285. 'id': 'index',
  286. 'ext': 'mp4',
  287. 'title': 'index',
  288. 'upload_date': '20140720',
  289. 'formats': 'mincount:11',
  290. },
  291. 'params': {
  292. # m3u8 downloads
  293. 'skip_download': True,
  294. },
  295. 'skip': 'video gone',
  296. },
  297. # google redirect
  298. {
  299. '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',
  300. 'info_dict': {
  301. 'id': 'cmQHVoWB5FY',
  302. 'ext': 'mp4',
  303. 'upload_date': '20130224',
  304. 'uploader_id': 'TheVerge',
  305. 'description': r're:^Chris Ziegler takes a look at the\.*',
  306. 'uploader': 'The Verge',
  307. 'title': 'First Firefox OS phones side-by-side',
  308. },
  309. 'params': {
  310. 'skip_download': False,
  311. }
  312. },
  313. {
  314. # redirect in Refresh HTTP header
  315. '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',
  316. 'info_dict': {
  317. 'id': 'pO8h3EaFRdo',
  318. 'ext': 'mp4',
  319. 'title': 'Tripeo Boiler Room x Dekmantel Festival DJ Set',
  320. 'description': 'md5:6294cc1af09c4049e0652b51a2df10d5',
  321. 'upload_date': '20150917',
  322. 'uploader_id': 'brtvofficial',
  323. 'uploader': 'Boiler Room',
  324. },
  325. 'params': {
  326. 'skip_download': False,
  327. },
  328. },
  329. {
  330. 'url': 'http://www.hodiho.fr/2013/02/regis-plante-sa-jeep.html',
  331. 'md5': '85b90ccc9d73b4acd9138d3af4c27f89',
  332. 'info_dict': {
  333. 'id': '13601338388002',
  334. 'ext': 'mp4',
  335. 'uploader': 'www.hodiho.fr',
  336. 'title': 'R\u00e9gis plante sa Jeep',
  337. }
  338. },
  339. # bandcamp page with custom domain
  340. {
  341. 'add_ie': ['Bandcamp'],
  342. 'url': 'http://bronyrock.com/track/the-pony-mash',
  343. 'info_dict': {
  344. 'id': '3235767654',
  345. 'ext': 'mp3',
  346. 'title': 'The Pony Mash',
  347. 'uploader': 'M_Pallante',
  348. },
  349. 'skip': 'There is a limit of 200 free downloads / month for the test song',
  350. },
  351. {
  352. # embedded brightcove video
  353. # it also tests brightcove videos that need to set the 'Referer'
  354. # in the http requests
  355. 'add_ie': ['BrightcoveLegacy'],
  356. 'url': 'http://www.bfmtv.com/video/bfmbusiness/cours-bourse/cours-bourse-l-analyse-technique-154522/',
  357. 'info_dict': {
  358. 'id': '2765128793001',
  359. 'ext': 'mp4',
  360. 'title': 'Le cours de bourse : l’analyse technique',
  361. 'description': 'md5:7e9ad046e968cb2d1114004aba466fd9',
  362. 'uploader': 'BFM BUSINESS',
  363. },
  364. 'params': {
  365. 'skip_download': True,
  366. },
  367. },
  368. {
  369. # embedded with itemprop embedURL and video id spelled as `idVideo`
  370. 'add_id': ['BrightcoveLegacy'],
  371. 'url': 'http://bfmbusiness.bfmtv.com/mediaplayer/chroniques/olivier-delamarche/',
  372. 'info_dict': {
  373. 'id': '5255628253001',
  374. 'ext': 'mp4',
  375. 'title': 'md5:37c519b1128915607601e75a87995fc0',
  376. 'description': 'md5:37f7f888b434bb8f8cc8dbd4f7a4cf26',
  377. 'uploader': 'BFM BUSINESS',
  378. 'uploader_id': '876450612001',
  379. 'timestamp': 1482255315,
  380. 'upload_date': '20161220',
  381. },
  382. 'params': {
  383. 'skip_download': True,
  384. },
  385. },
  386. {
  387. # https://github.com/rg3/youtube-dl/issues/2253
  388. 'url': 'http://bcove.me/i6nfkrc3',
  389. 'md5': '0ba9446db037002366bab3b3eb30c88c',
  390. 'info_dict': {
  391. 'id': '3101154703001',
  392. 'ext': 'mp4',
  393. 'title': 'Still no power',
  394. 'uploader': 'thestar.com',
  395. 'description': 'Mississauga resident David Farmer is still out of power as a result of the ice storm a month ago. To keep the house warm, Farmer cuts wood from his property for a wood burning stove downstairs.',
  396. },
  397. 'add_ie': ['BrightcoveLegacy'],
  398. 'skip': 'video gone',
  399. },
  400. {
  401. 'url': 'http://www.championat.com/video/football/v/87/87499.html',
  402. 'md5': 'fb973ecf6e4a78a67453647444222983',
  403. 'info_dict': {
  404. 'id': '3414141473001',
  405. 'ext': 'mp4',
  406. 'title': 'Видео. Удаление Дзагоева (ЦСКА)',
  407. 'description': 'Онлайн-трансляция матча ЦСКА - "Волга"',
  408. 'uploader': 'Championat',
  409. },
  410. },
  411. {
  412. # https://github.com/rg3/youtube-dl/issues/3541
  413. 'add_ie': ['BrightcoveLegacy'],
  414. 'url': 'http://www.kijk.nl/sbs6/leermijvrouwenkennen/videos/jqMiXKAYan2S/aflevering-1',
  415. 'info_dict': {
  416. 'id': '3866516442001',
  417. 'ext': 'mp4',
  418. 'title': 'Leer mij vrouwen kennen: Aflevering 1',
  419. 'description': 'Leer mij vrouwen kennen: Aflevering 1',
  420. 'uploader': 'SBS Broadcasting',
  421. },
  422. 'skip': 'Restricted to Netherlands',
  423. 'params': {
  424. 'skip_download': True, # m3u8 download
  425. },
  426. },
  427. {
  428. # Brightcove with alternative playerID key
  429. 'url': 'http://www.nature.com/nmeth/journal/v9/n7/fig_tab/nmeth.2062_SV1.html',
  430. 'info_dict': {
  431. 'id': 'nmeth.2062_SV1',
  432. 'title': 'Simultaneous multiview imaging of the Drosophila syncytial blastoderm : Quantitative high-speed imaging of entire developing embryos with simultaneous multiview light-sheet microscopy : Nature Methods : Nature Research',
  433. },
  434. 'playlist': [{
  435. 'info_dict': {
  436. 'id': '2228375078001',
  437. 'ext': 'mp4',
  438. 'title': 'nmeth.2062-sv1',
  439. 'description': 'nmeth.2062-sv1',
  440. 'timestamp': 1363357591,
  441. 'upload_date': '20130315',
  442. 'uploader': 'Nature Publishing Group',
  443. 'uploader_id': '1964492299001',
  444. },
  445. }],
  446. },
  447. {
  448. # Brightcove with UUID in videoPlayer
  449. 'url': 'http://www8.hp.com/cn/zh/home.html',
  450. 'info_dict': {
  451. 'id': '5255815316001',
  452. 'ext': 'mp4',
  453. 'title': 'Sprocket Video - China',
  454. 'description': 'Sprocket Video - China',
  455. 'uploader': 'HP-Video Gallery',
  456. 'timestamp': 1482263210,
  457. 'upload_date': '20161220',
  458. 'uploader_id': '1107601872001',
  459. },
  460. 'params': {
  461. 'skip_download': True, # m3u8 download
  462. },
  463. },
  464. # ooyala video
  465. {
  466. 'url': 'http://www.rollingstone.com/music/videos/norwegian-dj-cashmere-cat-goes-spartan-on-with-me-premiere-20131219',
  467. 'md5': '166dd577b433b4d4ebfee10b0824d8ff',
  468. 'info_dict': {
  469. 'id': 'BwY2RxaTrTkslxOfcan0UCf0YqyvWysJ',
  470. 'ext': 'mp4',
  471. 'title': '2cc213299525360.mov', # that's what we get
  472. 'duration': 238.231,
  473. },
  474. 'add_ie': ['Ooyala'],
  475. },
  476. {
  477. # ooyala video embedded with http://player.ooyala.com/iframe.js
  478. 'url': 'http://www.macrumors.com/2015/07/24/steve-jobs-the-man-in-the-machine-first-trailer/',
  479. 'info_dict': {
  480. 'id': 'p0MGJndjoG5SOKqO_hZJuZFPB-Tr5VgB',
  481. 'ext': 'mp4',
  482. 'title': '"Steve Jobs: Man in the Machine" trailer',
  483. 'description': 'The first trailer for the Alex Gibney documentary "Steve Jobs: Man in the Machine."',
  484. 'duration': 135.427,
  485. },
  486. 'params': {
  487. 'skip_download': True,
  488. },
  489. 'skip': 'movie expired',
  490. },
  491. # embed.ly video
  492. {
  493. 'url': 'http://www.tested.com/science/weird/460206-tested-grinding-coffee-2000-frames-second/',
  494. 'info_dict': {
  495. 'id': '9ODmcdjQcHQ',
  496. 'ext': 'mp4',
  497. 'title': 'Tested: Grinding Coffee at 2000 Frames Per Second',
  498. 'upload_date': '20140225',
  499. 'description': 'md5:06a40fbf30b220468f1e0957c0f558ff',
  500. 'uploader': 'Tested',
  501. 'uploader_id': 'testedcom',
  502. },
  503. # No need to test YoutubeIE here
  504. 'params': {
  505. 'skip_download': True,
  506. },
  507. },
  508. # funnyordie embed
  509. {
  510. 'url': 'http://www.theguardian.com/world/2014/mar/11/obama-zach-galifianakis-between-two-ferns',
  511. 'info_dict': {
  512. 'id': '18e820ec3f',
  513. 'ext': 'mp4',
  514. 'title': 'Between Two Ferns with Zach Galifianakis: President Barack Obama',
  515. 'description': 'Episode 18: President Barack Obama sits down with Zach Galifianakis for his most memorable interview yet.',
  516. },
  517. # HEAD requests lead to endless 301, while GET is OK
  518. 'expected_warnings': ['301'],
  519. },
  520. # RUTV embed
  521. {
  522. 'url': 'http://www.rg.ru/2014/03/15/reg-dfo/anklav-anons.html',
  523. 'info_dict': {
  524. 'id': '776940',
  525. 'ext': 'mp4',
  526. 'title': 'Охотское море стало целиком российским',
  527. 'description': 'md5:5ed62483b14663e2a95ebbe115eb8f43',
  528. },
  529. 'params': {
  530. # m3u8 download
  531. 'skip_download': True,
  532. },
  533. },
  534. # TVC embed
  535. {
  536. '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/',
  537. 'info_dict': {
  538. 'id': '55304',
  539. 'ext': 'mp4',
  540. 'title': 'Дошкольное воспитание',
  541. },
  542. },
  543. # SportBox embed
  544. {
  545. 'url': 'http://www.vestifinance.ru/articles/25753',
  546. 'info_dict': {
  547. 'id': '25753',
  548. 'title': 'Прямые трансляции с Форума-выставки "Госзаказ-2013"',
  549. },
  550. 'playlist': [{
  551. 'info_dict': {
  552. 'id': '370908',
  553. 'title': 'Госзаказ. День 3',
  554. 'ext': 'mp4',
  555. }
  556. }, {
  557. 'info_dict': {
  558. 'id': '370905',
  559. 'title': 'Госзаказ. День 2',
  560. 'ext': 'mp4',
  561. }
  562. }, {
  563. 'info_dict': {
  564. 'id': '370902',
  565. 'title': 'Госзаказ. День 1',
  566. 'ext': 'mp4',
  567. }
  568. }],
  569. 'params': {
  570. # m3u8 download
  571. 'skip_download': True,
  572. },
  573. },
  574. # Myvi.ru embed
  575. {
  576. 'url': 'http://www.kinomyvi.tv/news/detail/Pervij-dublirovannij-trejler--Uzhastikov-_nOw1',
  577. 'info_dict': {
  578. 'id': 'f4dafcad-ff21-423d-89b5-146cfd89fa1e',
  579. 'ext': 'mp4',
  580. 'title': 'Ужастики, русский трейлер (2015)',
  581. 'thumbnail': r're:^https?://.*\.jpg$',
  582. 'duration': 153,
  583. }
  584. },
  585. # XHamster embed
  586. {
  587. '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',
  588. 'info_dict': {
  589. 'id': 'showthread',
  590. 'title': '[NSFL] [FM15] which pumiscer was this ( vid ) ( alfa as fuck srx )',
  591. },
  592. 'playlist_mincount': 7,
  593. # This forum does not allow <iframe> syntaxes anymore
  594. # Now HTML tags are displayed as-is
  595. 'skip': 'No videos on this page',
  596. },
  597. # Embedded TED video
  598. {
  599. 'url': 'http://en.support.wordpress.com/videos/ted-talks/',
  600. 'md5': '65fdff94098e4a607385a60c5177c638',
  601. 'info_dict': {
  602. 'id': '1969',
  603. 'ext': 'mp4',
  604. 'title': 'Hidden miracles of the natural world',
  605. 'uploader': 'Louie Schwartzberg',
  606. 'description': 'md5:8145d19d320ff3e52f28401f4c4283b9',
  607. }
  608. },
  609. # nowvideo embed hidden behind percent encoding
  610. {
  611. 'url': 'http://www.waoanime.tv/the-super-dimension-fortress-macross-episode-1/',
  612. 'md5': '2baf4ddd70f697d94b1c18cf796d5107',
  613. 'info_dict': {
  614. 'id': '06e53103ca9aa',
  615. 'ext': 'flv',
  616. 'title': 'Macross Episode 001 Watch Macross Episode 001 onl',
  617. 'description': 'No description',
  618. },
  619. },
  620. # arte embed
  621. {
  622. 'url': 'http://www.tv-replay.fr/redirection/20-03-14/x-enius-arte-10753389.html',
  623. 'md5': '7653032cbb25bf6c80d80f217055fa43',
  624. 'info_dict': {
  625. 'id': '048195-004_PLUS7-F',
  626. 'ext': 'flv',
  627. 'title': 'X:enius',
  628. 'description': 'md5:d5fdf32ef6613cdbfd516ae658abf168',
  629. 'upload_date': '20140320',
  630. },
  631. 'params': {
  632. 'skip_download': 'Requires rtmpdump'
  633. },
  634. 'skip': 'video gone',
  635. },
  636. # francetv embed
  637. {
  638. 'url': 'http://www.tsprod.com/replay-du-concert-alcaline-de-calogero',
  639. 'info_dict': {
  640. 'id': 'EV_30231',
  641. 'ext': 'mp4',
  642. 'title': 'Alcaline, le concert avec Calogero',
  643. 'description': 'md5:61f08036dcc8f47e9cfc33aed08ffaff',
  644. 'upload_date': '20150226',
  645. 'timestamp': 1424989860,
  646. 'duration': 5400,
  647. },
  648. 'params': {
  649. # m3u8 downloads
  650. 'skip_download': True,
  651. },
  652. 'expected_warnings': [
  653. 'Forbidden'
  654. ]
  655. },
  656. # Condé Nast embed
  657. {
  658. 'url': 'http://www.wired.com/2014/04/honda-asimo/',
  659. 'md5': 'ba0dfe966fa007657bd1443ee672db0f',
  660. 'info_dict': {
  661. 'id': '53501be369702d3275860000',
  662. 'ext': 'mp4',
  663. 'title': 'Honda’s New Asimo Robot Is More Human Than Ever',
  664. }
  665. },
  666. # Dailymotion embed
  667. {
  668. 'url': 'http://www.spi0n.com/zap-spi0n-com-n216/',
  669. 'md5': '441aeeb82eb72c422c7f14ec533999cd',
  670. 'info_dict': {
  671. 'id': 'k2mm4bCdJ6CQ2i7c8o2',
  672. 'ext': 'mp4',
  673. 'title': 'Le Zap de Spi0n n°216 - Zapping du Web',
  674. 'description': 'md5:faf028e48a461b8b7fad38f1e104b119',
  675. 'uploader': 'Spi0n',
  676. 'uploader_id': 'xgditw',
  677. 'upload_date': '20140425',
  678. 'timestamp': 1398441542,
  679. },
  680. 'add_ie': ['Dailymotion'],
  681. },
  682. # YouTube embed
  683. {
  684. 'url': 'http://www.badzine.de/ansicht/datum/2014/06/09/so-funktioniert-die-neue-englische-badminton-liga.html',
  685. 'info_dict': {
  686. 'id': 'FXRb4ykk4S0',
  687. 'ext': 'mp4',
  688. 'title': 'The NBL Auction 2014',
  689. 'uploader': 'BADMINTON England',
  690. 'uploader_id': 'BADMINTONEvents',
  691. 'upload_date': '20140603',
  692. 'description': 'md5:9ef128a69f1e262a700ed83edb163a73',
  693. },
  694. 'add_ie': ['Youtube'],
  695. 'params': {
  696. 'skip_download': True,
  697. }
  698. },
  699. # MTVSercices embed
  700. {
  701. 'url': 'http://www.vulture.com/2016/06/new-key-peele-sketches-released.html',
  702. 'md5': 'ca1aef97695ef2c1d6973256a57e5252',
  703. 'info_dict': {
  704. 'id': '769f7ec0-0692-4d62-9b45-0d88074bffc1',
  705. 'ext': 'mp4',
  706. 'title': 'Key and Peele|October 10, 2012|2|203|Liam Neesons - Uncensored',
  707. 'description': 'Two valets share their love for movie star Liam Neesons.',
  708. 'timestamp': 1349922600,
  709. 'upload_date': '20121011',
  710. },
  711. },
  712. # YouTube embed via <data-embed-url="">
  713. {
  714. 'url': 'https://play.google.com/store/apps/details?id=com.gameloft.android.ANMP.GloftA8HM',
  715. 'info_dict': {
  716. 'id': '4vAffPZIT44',
  717. 'ext': 'mp4',
  718. 'title': 'Asphalt 8: Airborne - Update - Welcome to Dubai!',
  719. 'uploader': 'Gameloft',
  720. 'uploader_id': 'gameloft',
  721. 'upload_date': '20140828',
  722. 'description': 'md5:c80da9ed3d83ae6d1876c834de03e1c4',
  723. },
  724. 'params': {
  725. 'skip_download': True,
  726. }
  727. },
  728. # YouTube <object> embed
  729. {
  730. 'url': 'http://www.improbable.com/2017/04/03/untrained-modern-youths-and-ancient-masters-in-selfie-portraits/',
  731. 'md5': '516718101ec834f74318df76259fb3cc',
  732. 'info_dict': {
  733. 'id': 'msN87y-iEx0',
  734. 'ext': 'webm',
  735. 'title': 'Feynman: Mirrors FUN TO IMAGINE 6',
  736. 'upload_date': '20080526',
  737. 'description': 'md5:0ffc78ea3f01b2e2c247d5f8d1d3c18d',
  738. 'uploader': 'Christopher Sykes',
  739. 'uploader_id': 'ChristopherJSykes',
  740. },
  741. 'add_ie': ['Youtube'],
  742. },
  743. # Camtasia studio
  744. {
  745. 'url': 'http://www.ll.mit.edu/workshops/education/videocourses/antennas/lecture1/video/',
  746. 'playlist': [{
  747. 'md5': '0c5e352edabf715d762b0ad4e6d9ee67',
  748. 'info_dict': {
  749. 'id': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final',
  750. 'title': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final - video1',
  751. 'ext': 'flv',
  752. 'duration': 2235.90,
  753. }
  754. }, {
  755. 'md5': '10e4bb3aaca9fd630e273ff92d9f3c63',
  756. 'info_dict': {
  757. 'id': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final_PIP',
  758. 'title': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final - pip',
  759. 'ext': 'flv',
  760. 'duration': 2235.93,
  761. }
  762. }],
  763. 'info_dict': {
  764. 'title': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final',
  765. }
  766. },
  767. # Flowplayer
  768. {
  769. 'url': 'http://www.handjobhub.com/video/busty-blonde-siri-tit-fuck-while-wank-6313.html',
  770. 'md5': '9d65602bf31c6e20014319c7d07fba27',
  771. 'info_dict': {
  772. 'id': '5123ea6d5e5a7',
  773. 'ext': 'mp4',
  774. 'age_limit': 18,
  775. 'uploader': 'www.handjobhub.com',
  776. 'title': 'Busty Blonde Siri Tit Fuck While Wank at HandjobHub.com',
  777. }
  778. },
  779. # Multiple brightcove videos
  780. # https://github.com/rg3/youtube-dl/issues/2283
  781. {
  782. 'url': 'http://www.newyorker.com/online/blogs/newsdesk/2014/01/always-never-nuclear-command-and-control.html',
  783. 'info_dict': {
  784. 'id': 'always-never',
  785. 'title': 'Always / Never - The New Yorker',
  786. },
  787. 'playlist_count': 3,
  788. 'params': {
  789. 'extract_flat': False,
  790. 'skip_download': True,
  791. }
  792. },
  793. # MLB embed
  794. {
  795. 'url': 'http://umpire-empire.com/index.php/topic/58125-laz-decides-no-thats-low/',
  796. 'md5': '96f09a37e44da40dd083e12d9a683327',
  797. 'info_dict': {
  798. 'id': '33322633',
  799. 'ext': 'mp4',
  800. 'title': 'Ump changes call to ball',
  801. 'description': 'md5:71c11215384298a172a6dcb4c2e20685',
  802. 'duration': 48,
  803. 'timestamp': 1401537900,
  804. 'upload_date': '20140531',
  805. 'thumbnail': r're:^https?://.*\.jpg$',
  806. },
  807. },
  808. # Wistia embed
  809. {
  810. 'url': 'http://study.com/academy/lesson/north-american-exploration-failed-colonies-of-spain-france-england.html#lesson',
  811. 'md5': '1953f3a698ab51cfc948ed3992a0b7ff',
  812. 'info_dict': {
  813. 'id': '6e2wtrbdaf',
  814. 'ext': 'mov',
  815. 'title': 'paywall_north-american-exploration-failed-colonies-of-spain-france-england',
  816. 'description': 'a Paywall Videos video from Remilon',
  817. 'duration': 644.072,
  818. 'uploader': 'study.com',
  819. 'timestamp': 1459678540,
  820. 'upload_date': '20160403',
  821. 'filesize': 24687186,
  822. },
  823. },
  824. {
  825. 'url': 'http://thoughtworks.wistia.com/medias/uxjb0lwrcz',
  826. 'md5': 'baf49c2baa8a7de5f3fc145a8506dcd4',
  827. 'info_dict': {
  828. 'id': 'uxjb0lwrcz',
  829. 'ext': 'mp4',
  830. 'title': 'Conversation about Hexagonal Rails Part 1',
  831. 'description': 'a Martin Fowler video from ThoughtWorks',
  832. 'duration': 1715.0,
  833. 'uploader': 'thoughtworks.wistia.com',
  834. 'timestamp': 1401832161,
  835. 'upload_date': '20140603',
  836. },
  837. },
  838. # Wistia standard embed (async)
  839. {
  840. 'url': 'https://www.getdrip.com/university/brennan-dunn-drip-workshop/',
  841. 'info_dict': {
  842. 'id': '807fafadvk',
  843. 'ext': 'mp4',
  844. 'title': 'Drip Brennan Dunn Workshop',
  845. 'description': 'a JV Webinars video from getdrip-1',
  846. 'duration': 4986.95,
  847. 'timestamp': 1463607249,
  848. 'upload_date': '20160518',
  849. },
  850. 'params': {
  851. 'skip_download': True,
  852. }
  853. },
  854. # Soundcloud embed
  855. {
  856. 'url': 'http://nakedsecurity.sophos.com/2014/10/29/sscc-171-are-you-sure-that-1234-is-a-bad-password-podcast/',
  857. 'info_dict': {
  858. 'id': '174391317',
  859. 'ext': 'mp3',
  860. 'description': 'md5:ff867d6b555488ad3c52572bb33d432c',
  861. 'uploader': 'Sophos Security',
  862. 'title': 'Chet Chat 171 - Oct 29, 2014',
  863. 'upload_date': '20141029',
  864. }
  865. },
  866. # Soundcloud multiple embeds
  867. {
  868. 'url': 'http://www.guitarplayer.com/lessons/1014/legato-workout-one-hour-to-more-fluid-performance---tab/52809',
  869. 'info_dict': {
  870. 'id': '52809',
  871. 'title': 'Guitar Essentials: Legato Workout—One-Hour to Fluid Performance | TAB + AUDIO',
  872. },
  873. 'playlist_mincount': 7,
  874. },
  875. # TuneIn station embed
  876. {
  877. 'url': 'http://radiocnrv.com/promouvoir-radio-cnrv/',
  878. 'info_dict': {
  879. 'id': '204146',
  880. 'ext': 'mp3',
  881. 'title': 'CNRV',
  882. 'location': 'Paris, France',
  883. 'is_live': True,
  884. },
  885. 'params': {
  886. # Live stream
  887. 'skip_download': True,
  888. },
  889. },
  890. # Livestream embed
  891. {
  892. 'url': 'http://www.esa.int/Our_Activities/Space_Science/Rosetta/Philae_comet_touch-down_webcast',
  893. 'info_dict': {
  894. 'id': '67864563',
  895. 'ext': 'flv',
  896. 'upload_date': '20141112',
  897. 'title': 'Rosetta #CometLanding webcast HL 10',
  898. }
  899. },
  900. # Another Livestream embed, without 'new.' in URL
  901. {
  902. 'url': 'https://www.freespeech.org/',
  903. 'info_dict': {
  904. 'id': '123537347',
  905. 'ext': 'mp4',
  906. 'title': 're:^FSTV [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
  907. },
  908. 'params': {
  909. # Live stream
  910. 'skip_download': True,
  911. },
  912. },
  913. # LazyYT
  914. {
  915. 'url': 'https://skiplagged.com/',
  916. 'info_dict': {
  917. 'id': 'skiplagged',
  918. 'title': 'Skiplagged: The smart way to find cheap flights',
  919. },
  920. 'playlist_mincount': 1,
  921. 'add_ie': ['Youtube'],
  922. },
  923. # Cinchcast embed
  924. {
  925. 'url': 'http://undergroundwellness.com/podcasts/306-5-steps-to-permanent-gut-healing/',
  926. 'info_dict': {
  927. 'id': '7141703',
  928. 'ext': 'mp3',
  929. 'upload_date': '20141126',
  930. 'title': 'Jack Tips: 5 Steps to Permanent Gut Healing',
  931. }
  932. },
  933. # Cinerama player
  934. {
  935. 'url': 'http://www.abc.net.au/7.30/content/2015/s4164797.htm',
  936. 'info_dict': {
  937. 'id': '730m_DandD_1901_512k',
  938. 'ext': 'mp4',
  939. 'uploader': 'www.abc.net.au',
  940. 'title': 'Game of Thrones with dice - Dungeons and Dragons fantasy role-playing game gets new life - 19/01/2015',
  941. }
  942. },
  943. # embedded viddler video
  944. {
  945. 'url': 'http://deadspin.com/i-cant-stop-watching-john-wall-chop-the-nuggets-with-th-1681801597',
  946. 'info_dict': {
  947. 'id': '4d03aad9',
  948. 'ext': 'mp4',
  949. 'uploader': 'deadspin',
  950. 'title': 'WALL-TO-GORTAT',
  951. 'timestamp': 1422285291,
  952. 'upload_date': '20150126',
  953. },
  954. 'add_ie': ['Viddler'],
  955. },
  956. # Libsyn embed
  957. {
  958. 'url': 'http://thedailyshow.cc.com/podcast/episodetwelve',
  959. 'info_dict': {
  960. 'id': '3377616',
  961. 'ext': 'mp3',
  962. 'title': "The Daily Show Podcast without Jon Stewart - Episode 12: Bassem Youssef: Egypt's Jon Stewart",
  963. 'description': 'md5:601cb790edd05908957dae8aaa866465',
  964. 'upload_date': '20150220',
  965. },
  966. 'skip': 'All The Daily Show URLs now redirect to http://www.cc.com/shows/',
  967. },
  968. # jwplayer YouTube
  969. {
  970. 'url': 'http://media.nationalarchives.gov.uk/index.php/webinar-using-discovery-national-archives-online-catalogue/',
  971. 'info_dict': {
  972. 'id': 'Mrj4DVp2zeA',
  973. 'ext': 'mp4',
  974. 'upload_date': '20150212',
  975. 'uploader': 'The National Archives UK',
  976. 'description': 'md5:a236581cd2449dd2df4f93412f3f01c6',
  977. 'uploader_id': 'NationalArchives08',
  978. 'title': 'Webinar: Using Discovery, The National Archives’ online catalogue',
  979. },
  980. },
  981. # jwplayer rtmp
  982. {
  983. 'url': 'http://www.suffolk.edu/sjc/',
  984. 'info_dict': {
  985. 'id': 'sjclive',
  986. 'ext': 'flv',
  987. 'title': 'Massachusetts Supreme Judicial Court Oral Arguments',
  988. 'uploader': 'www.suffolk.edu',
  989. },
  990. 'params': {
  991. 'skip_download': True,
  992. }
  993. },
  994. # Complex jwplayer
  995. {
  996. 'url': 'http://www.indiedb.com/games/king-machine/videos',
  997. 'info_dict': {
  998. 'id': 'videos',
  999. 'ext': 'mp4',
  1000. 'title': 'king machine trailer 1',
  1001. 'thumbnail': r're:^https?://.*\.jpg$',
  1002. },
  1003. },
  1004. {
  1005. # JWPlayer config passed as variable
  1006. 'url': 'http://www.txxx.com/videos/3326530/ariele/',
  1007. 'info_dict': {
  1008. 'id': '3326530_hq',
  1009. 'ext': 'mp4',
  1010. 'title': 'ARIELE | Tube Cup',
  1011. 'uploader': 'www.txxx.com',
  1012. 'age_limit': 18,
  1013. },
  1014. 'params': {
  1015. 'skip_download': True,
  1016. }
  1017. },
  1018. # rtl.nl embed
  1019. {
  1020. 'url': 'http://www.rtlnieuws.nl/nieuws/buitenland/aanslagen-kopenhagen',
  1021. 'playlist_mincount': 5,
  1022. 'info_dict': {
  1023. 'id': 'aanslagen-kopenhagen',
  1024. 'title': 'Aanslagen Kopenhagen | RTL Nieuws',
  1025. }
  1026. },
  1027. # Zapiks embed
  1028. {
  1029. 'url': 'http://www.skipass.com/news/116090-bon-appetit-s5ep3-baqueira-mi-cor.html',
  1030. 'info_dict': {
  1031. 'id': '118046',
  1032. 'ext': 'mp4',
  1033. 'title': 'EP3S5 - Bon Appétit - Baqueira Mi Corazon !',
  1034. }
  1035. },
  1036. # Kaltura embed (different embed code)
  1037. {
  1038. 'url': 'http://www.premierchristianradio.com/Shows/Saturday/Unbelievable/Conference-Videos/Os-Guinness-Is-It-Fools-Talk-Unbelievable-Conference-2014',
  1039. 'info_dict': {
  1040. 'id': '1_a52wc67y',
  1041. 'ext': 'flv',
  1042. 'upload_date': '20150127',
  1043. 'uploader_id': 'PremierMedia',
  1044. 'timestamp': int,
  1045. 'title': 'Os Guinness // Is It Fools Talk? // Unbelievable? Conference 2014',
  1046. },
  1047. },
  1048. # Kaltura embed with single quotes
  1049. {
  1050. 'url': 'http://fod.infobase.com/p_ViewPlaylist.aspx?AssignmentID=NUN8ZY',
  1051. 'info_dict': {
  1052. 'id': '0_izeg5utt',
  1053. 'ext': 'mp4',
  1054. 'title': '35871',
  1055. 'timestamp': 1355743100,
  1056. 'upload_date': '20121217',
  1057. 'uploader_id': 'batchUser',
  1058. },
  1059. 'add_ie': ['Kaltura'],
  1060. },
  1061. {
  1062. # Kaltura embedded via quoted entry_id
  1063. 'url': 'https://www.oreilly.com/ideas/my-cloud-makes-pretty-pictures',
  1064. 'info_dict': {
  1065. 'id': '0_utuok90b',
  1066. 'ext': 'mp4',
  1067. 'title': '06_matthew_brender_raj_dutt',
  1068. 'timestamp': 1466638791,
  1069. 'upload_date': '20160622',
  1070. },
  1071. 'add_ie': ['Kaltura'],
  1072. 'expected_warnings': [
  1073. 'Could not send HEAD request'
  1074. ],
  1075. 'params': {
  1076. 'skip_download': True,
  1077. }
  1078. },
  1079. {
  1080. # Kaltura embedded, some fileExt broken (#11480)
  1081. 'url': 'http://www.cornell.edu/video/nima-arkani-hamed-standard-models-of-particle-physics',
  1082. 'info_dict': {
  1083. 'id': '1_sgtvehim',
  1084. 'ext': 'mp4',
  1085. 'title': 'Our "Standard Models" of particle physics and cosmology',
  1086. 'description': 'md5:67ea74807b8c4fea92a6f38d6d323861',
  1087. 'timestamp': 1321158993,
  1088. 'upload_date': '20111113',
  1089. 'uploader_id': 'kps1',
  1090. },
  1091. 'add_ie': ['Kaltura'],
  1092. },
  1093. {
  1094. # Kaltura iframe embed
  1095. 'url': 'http://www.gsd.harvard.edu/event/i-m-pei-a-centennial-celebration/',
  1096. 'md5': 'ae5ace8eb09dc1a35d03b579a9c2cc44',
  1097. 'info_dict': {
  1098. 'id': '0_f2cfbpwy',
  1099. 'ext': 'mp4',
  1100. 'title': 'I. M. Pei: A Centennial Celebration',
  1101. 'description': 'md5:1db8f40c69edc46ca180ba30c567f37c',
  1102. 'upload_date': '20170403',
  1103. 'uploader_id': 'batchUser',
  1104. 'timestamp': 1491232186,
  1105. },
  1106. 'add_ie': ['Kaltura'],
  1107. },
  1108. # Eagle.Platform embed (generic URL)
  1109. {
  1110. 'url': 'http://lenta.ru/news/2015/03/06/navalny/',
  1111. # Not checking MD5 as sometimes the direct HTTP link results in 404 and HLS is used
  1112. 'info_dict': {
  1113. 'id': '227304',
  1114. 'ext': 'mp4',
  1115. 'title': 'Навальный вышел на свободу',
  1116. 'description': 'md5:d97861ac9ae77377f3f20eaf9d04b4f5',
  1117. 'thumbnail': r're:^https?://.*\.jpg$',
  1118. 'duration': 87,
  1119. 'view_count': int,
  1120. 'age_limit': 0,
  1121. },
  1122. },
  1123. # ClipYou (Eagle.Platform) embed (custom URL)
  1124. {
  1125. 'url': 'http://muz-tv.ru/play/7129/',
  1126. # Not checking MD5 as sometimes the direct HTTP link results in 404 and HLS is used
  1127. 'info_dict': {
  1128. 'id': '12820',
  1129. 'ext': 'mp4',
  1130. 'title': "'O Sole Mio",
  1131. 'thumbnail': r're:^https?://.*\.jpg$',
  1132. 'duration': 216,
  1133. 'view_count': int,
  1134. },
  1135. },
  1136. # Pladform embed
  1137. {
  1138. 'url': 'http://muz-tv.ru/kinozal/view/7400/',
  1139. 'info_dict': {
  1140. 'id': '100183293',
  1141. 'ext': 'mp4',
  1142. 'title': 'Тайны перевала Дятлова • 1 серия 2 часть',
  1143. 'description': 'Документальный сериал-расследование одной из самых жутких тайн ХХ века',
  1144. 'thumbnail': r're:^https?://.*\.jpg$',
  1145. 'duration': 694,
  1146. 'age_limit': 0,
  1147. },
  1148. },
  1149. # Playwire embed
  1150. {
  1151. 'url': 'http://www.cinemablend.com/new/First-Joe-Dirt-2-Trailer-Teaser-Stupid-Greatness-70874.html',
  1152. 'info_dict': {
  1153. 'id': '3519514',
  1154. 'ext': 'mp4',
  1155. 'title': 'Joe Dirt 2 Beautiful Loser Teaser Trailer',
  1156. 'thumbnail': r're:^https?://.*\.png$',
  1157. 'duration': 45.115,
  1158. },
  1159. },
  1160. # 5min embed
  1161. {
  1162. 'url': 'http://techcrunch.com/video/facebook-creates-on-this-day-crunch-report/518726732/',
  1163. 'md5': '4c6f127a30736b59b3e2c19234ee2bf7',
  1164. 'info_dict': {
  1165. 'id': '518726732',
  1166. 'ext': 'mp4',
  1167. 'title': 'Facebook Creates "On This Day" | Crunch Report',
  1168. },
  1169. },
  1170. # SVT embed
  1171. {
  1172. 'url': 'http://www.svt.se/sport/ishockey/jagr-tacklar-giroux-under-intervjun',
  1173. 'info_dict': {
  1174. 'id': '2900353',
  1175. 'ext': 'flv',
  1176. 'title': 'Här trycker Jagr till Giroux (under SVT-intervjun)',
  1177. 'duration': 27,
  1178. 'age_limit': 0,
  1179. },
  1180. },
  1181. # Crooks and Liars embed
  1182. {
  1183. 'url': 'http://crooksandliars.com/2015/04/fox-friends-says-protecting-atheists',
  1184. 'info_dict': {
  1185. 'id': '8RUoRhRi',
  1186. 'ext': 'mp4',
  1187. 'title': "Fox & Friends Says Protecting Atheists From Discrimination Is Anti-Christian!",
  1188. 'description': 'md5:e1a46ad1650e3a5ec7196d432799127f',
  1189. 'timestamp': 1428207000,
  1190. 'upload_date': '20150405',
  1191. 'uploader': 'Heather',
  1192. },
  1193. },
  1194. # Crooks and Liars external embed
  1195. {
  1196. 'url': 'http://theothermccain.com/2010/02/02/video-proves-that-bill-kristol-has-been-watching-glenn-beck/comment-page-1/',
  1197. 'info_dict': {
  1198. 'id': 'MTE3MjUtMzQ2MzA',
  1199. 'ext': 'mp4',
  1200. 'title': 'md5:5e3662a81a4014d24c250d76d41a08d5',
  1201. 'description': 'md5:9b8e9542d6c3c5de42d6451b7d780cec',
  1202. 'timestamp': 1265032391,
  1203. 'upload_date': '20100201',
  1204. 'uploader': 'Heather',
  1205. },
  1206. },
  1207. # NBC Sports vplayer embed
  1208. {
  1209. 'url': 'http://www.riderfans.com/forum/showthread.php?121827-Freeman&s=e98fa1ea6dc08e886b1678d35212494a',
  1210. 'info_dict': {
  1211. 'id': 'ln7x1qSThw4k',
  1212. 'ext': 'flv',
  1213. 'title': "PFT Live: New leader in the 'new-look' defense",
  1214. 'description': 'md5:65a19b4bbfb3b0c0c5768bed1dfad74e',
  1215. 'uploader': 'NBCU-SPORTS',
  1216. 'upload_date': '20140107',
  1217. 'timestamp': 1389118457,
  1218. },
  1219. },
  1220. # NBC News embed
  1221. {
  1222. 'url': 'http://www.vulture.com/2016/06/letterman-couldnt-care-less-about-late-night.html',
  1223. 'md5': '1aa589c675898ae6d37a17913cf68d66',
  1224. 'info_dict': {
  1225. 'id': '701714499682',
  1226. 'ext': 'mp4',
  1227. 'title': 'PREVIEW: On Assignment: David Letterman',
  1228. '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.',
  1229. },
  1230. },
  1231. # UDN embed
  1232. {
  1233. 'url': 'https://video.udn.com/news/300346',
  1234. 'md5': 'fd2060e988c326991037b9aff9df21a6',
  1235. 'info_dict': {
  1236. 'id': '300346',
  1237. 'ext': 'mp4',
  1238. 'title': '中一中男師變性 全校師生力挺',
  1239. 'thumbnail': r're:^https?://.*\.jpg$',
  1240. },
  1241. 'params': {
  1242. # m3u8 download
  1243. 'skip_download': True,
  1244. },
  1245. },
  1246. # Ooyala embed
  1247. {
  1248. 'url': 'http://www.businessinsider.com/excel-index-match-vlookup-video-how-to-2015-2?IR=T',
  1249. 'info_dict': {
  1250. 'id': '50YnY4czr4ms1vJ7yz3xzq0excz_pUMs',
  1251. 'ext': 'mp4',
  1252. 'description': 'VIDEO: INDEX/MATCH versus VLOOKUP.',
  1253. 'title': 'This is what separates the Excel masters from the wannabes',
  1254. 'duration': 191.933,
  1255. },
  1256. 'params': {
  1257. # m3u8 downloads
  1258. 'skip_download': True,
  1259. }
  1260. },
  1261. # Brightcove URL in single quotes
  1262. {
  1263. 'url': 'http://www.sportsnet.ca/baseball/mlb/sn-presents-russell-martin-world-citizen/',
  1264. 'md5': '4ae374f1f8b91c889c4b9203c8c752af',
  1265. 'info_dict': {
  1266. 'id': '4255764656001',
  1267. 'ext': 'mp4',
  1268. 'title': 'SN Presents: Russell Martin, World Citizen',
  1269. 'description': 'To understand why he was the Toronto Blue Jays’ top off-season priority is to appreciate his background and upbringing in Montreal, where he first developed his baseball skills. Written and narrated by Stephen Brunt.',
  1270. 'uploader': 'Rogers Sportsnet',
  1271. 'uploader_id': '1704050871',
  1272. 'upload_date': '20150525',
  1273. 'timestamp': 1432570283,
  1274. },
  1275. },
  1276. # Dailymotion Cloud video
  1277. {
  1278. 'url': 'http://replay.publicsenat.fr/vod/le-debat/florent-kolandjian,dominique-cena,axel-decourtye,laurence-abeille,bruno-parmentier/175910',
  1279. 'md5': 'dcaf23ad0c67a256f4278bce6e0bae38',
  1280. 'info_dict': {
  1281. 'id': 'x2uy8t3',
  1282. 'ext': 'mp4',
  1283. 'title': 'Sauvons les abeilles ! - Le débat',
  1284. 'description': 'md5:d9082128b1c5277987825d684939ca26',
  1285. 'thumbnail': r're:^https?://.*\.jpe?g$',
  1286. 'timestamp': 1434970506,
  1287. 'upload_date': '20150622',
  1288. 'uploader': 'Public Sénat',
  1289. 'uploader_id': 'xa9gza',
  1290. }
  1291. },
  1292. # OnionStudios embed
  1293. {
  1294. 'url': 'http://www.clickhole.com/video/dont-understand-bitcoin-man-will-mumble-explanatio-2537',
  1295. 'info_dict': {
  1296. 'id': '2855',
  1297. 'ext': 'mp4',
  1298. 'title': 'Don’t Understand Bitcoin? This Man Will Mumble An Explanation At You',
  1299. 'thumbnail': r're:^https?://.*\.jpe?g$',
  1300. 'uploader': 'ClickHole',
  1301. 'uploader_id': 'clickhole',
  1302. }
  1303. },
  1304. # SnagFilms embed
  1305. {
  1306. 'url': 'http://whilewewatch.blogspot.ru/2012/06/whilewewatch-whilewewatch-gripping.html',
  1307. 'info_dict': {
  1308. 'id': '74849a00-85a9-11e1-9660-123139220831',
  1309. 'ext': 'mp4',
  1310. 'title': '#whilewewatch',
  1311. }
  1312. },
  1313. # AdobeTVVideo embed
  1314. {
  1315. 'url': 'https://helpx.adobe.com/acrobat/how-to/new-experience-acrobat-dc.html?set=acrobat--get-started--essential-beginners',
  1316. 'md5': '43662b577c018ad707a63766462b1e87',
  1317. 'info_dict': {
  1318. 'id': '2456',
  1319. 'ext': 'mp4',
  1320. 'title': 'New experience with Acrobat DC',
  1321. 'description': 'New experience with Acrobat DC',
  1322. 'duration': 248.667,
  1323. },
  1324. },
  1325. # BrightcoveInPageEmbed embed
  1326. {
  1327. 'url': 'http://www.geekandsundry.com/tabletop-bonus-wils-final-thoughts-on-dread/',
  1328. 'info_dict': {
  1329. 'id': '4238694884001',
  1330. 'ext': 'flv',
  1331. 'title': 'Tabletop: Dread, Last Thoughts',
  1332. 'description': 'Tabletop: Dread, Last Thoughts',
  1333. 'duration': 51690,
  1334. },
  1335. },
  1336. # Brightcove embed, with no valid 'renditions' but valid 'IOSRenditions'
  1337. # This video can't be played in browsers if Flash disabled and UA set to iPhone, which is actually a false alarm
  1338. {
  1339. 'url': 'https://dl.dropboxusercontent.com/u/29092637/interview.html',
  1340. 'info_dict': {
  1341. 'id': '4785848093001',
  1342. 'ext': 'mp4',
  1343. 'title': 'The Cardinal Pell Interview',
  1344. 'description': 'Sky News Contributor Andrew Bolt interviews George Pell in Rome, following the Cardinal\'s evidence before the Royal Commission into Child Abuse. ',
  1345. 'uploader': 'GlobeCast Australia - GlobeStream',
  1346. 'uploader_id': '2733773828001',
  1347. 'upload_date': '20160304',
  1348. 'timestamp': 1457083087,
  1349. },
  1350. 'params': {
  1351. # m3u8 downloads
  1352. 'skip_download': True,
  1353. },
  1354. },
  1355. # Another form of arte.tv embed
  1356. {
  1357. 'url': 'http://www.tv-replay.fr/redirection/09-04-16/arte-reportage-arte-11508975.html',
  1358. 'md5': '850bfe45417ddf221288c88a0cffe2e2',
  1359. 'info_dict': {
  1360. 'id': '030273-562_PLUS7-F',
  1361. 'ext': 'mp4',
  1362. 'title': 'ARTE Reportage - Nulle part, en France',
  1363. 'description': 'md5:e3a0e8868ed7303ed509b9e3af2b870d',
  1364. 'upload_date': '20160409',
  1365. },
  1366. },
  1367. # LiveLeak embed
  1368. {
  1369. 'url': 'http://www.wykop.pl/link/3088787/',
  1370. 'md5': 'ace83b9ed19b21f68e1b50e844fdf95d',
  1371. 'info_dict': {
  1372. 'id': '874_1459135191',
  1373. 'ext': 'mp4',
  1374. 'title': 'Man shows poor quality of new apartment building',
  1375. 'description': 'The wall is like a sand pile.',
  1376. 'uploader': 'Lake8737',
  1377. }
  1378. },
  1379. # Duplicated embedded video URLs
  1380. {
  1381. 'url': 'http://www.hudl.com/athlete/2538180/highlights/149298443',
  1382. 'info_dict': {
  1383. 'id': '149298443_480_16c25b74_2',
  1384. 'ext': 'mp4',
  1385. 'title': 'vs. Blue Orange Spring Game',
  1386. 'uploader': 'www.hudl.com',
  1387. },
  1388. },
  1389. # twitter:player:stream embed
  1390. {
  1391. 'url': 'http://www.rtl.be/info/video/589263.aspx?CategoryID=288',
  1392. 'info_dict': {
  1393. 'id': 'master',
  1394. 'ext': 'mp4',
  1395. 'title': 'Une nouvelle espèce de dinosaure découverte en Argentine',
  1396. 'uploader': 'www.rtl.be',
  1397. },
  1398. 'params': {
  1399. # m3u8 downloads
  1400. 'skip_download': True,
  1401. },
  1402. },
  1403. # twitter:player embed
  1404. {
  1405. 'url': 'http://www.theatlantic.com/video/index/484130/what-do-black-holes-sound-like/',
  1406. 'md5': 'a3e0df96369831de324f0778e126653c',
  1407. 'info_dict': {
  1408. 'id': '4909620399001',
  1409. 'ext': 'mp4',
  1410. 'title': 'What Do Black Holes Sound Like?',
  1411. 'description': 'what do black holes sound like',
  1412. 'upload_date': '20160524',
  1413. 'uploader_id': '29913724001',
  1414. 'timestamp': 1464107587,
  1415. 'uploader': 'TheAtlantic',
  1416. },
  1417. 'add_ie': ['BrightcoveLegacy'],
  1418. },
  1419. # Facebook <iframe> embed
  1420. {
  1421. 'url': 'https://www.hostblogger.de/blog/archives/6181-Auto-jagt-Betonmischer.html',
  1422. 'md5': 'fbcde74f534176ecb015849146dd3aee',
  1423. 'info_dict': {
  1424. 'id': '599637780109885',
  1425. 'ext': 'mp4',
  1426. 'title': 'Facebook video #599637780109885',
  1427. },
  1428. },
  1429. # Facebook API embed
  1430. {
  1431. 'url': 'http://www.lothype.com/blue-stars-2016-preview-standstill-full-show/',
  1432. 'md5': 'a47372ee61b39a7b90287094d447d94e',
  1433. 'info_dict': {
  1434. 'id': '10153467542406923',
  1435. 'ext': 'mp4',
  1436. 'title': 'Facebook video #10153467542406923',
  1437. },
  1438. },
  1439. # Wordpress "YouTube Video Importer" plugin
  1440. {
  1441. 'url': 'http://www.lothype.com/blue-devils-drumline-stanford-lot-2016/',
  1442. 'md5': 'd16797741b560b485194eddda8121b48',
  1443. 'info_dict': {
  1444. 'id': 'HNTXWDXV9Is',
  1445. 'ext': 'mp4',
  1446. 'title': 'Blue Devils Drumline Stanford lot 2016',
  1447. 'upload_date': '20160627',
  1448. 'uploader_id': 'GENOCIDE8GENERAL10',
  1449. 'uploader': 'cylus cyrus',
  1450. },
  1451. },
  1452. {
  1453. # video stored on custom kaltura server
  1454. 'url': 'http://www.expansion.com/multimedia/videos.html?media=EQcM30NHIPv',
  1455. 'md5': '537617d06e64dfed891fa1593c4b30cc',
  1456. 'info_dict': {
  1457. 'id': '0_1iotm5bh',
  1458. 'ext': 'mp4',
  1459. 'title': 'Elecciones británicas: 5 lecciones para Rajoy',
  1460. 'description': 'md5:435a89d68b9760b92ce67ed227055f16',
  1461. 'uploader_id': 'videos.expansion@el-mundo.net',
  1462. 'upload_date': '20150429',
  1463. 'timestamp': 1430303472,
  1464. },
  1465. 'add_ie': ['Kaltura'],
  1466. },
  1467. {
  1468. # Non-standard Vimeo embed
  1469. 'url': 'https://openclassrooms.com/courses/understanding-the-web',
  1470. 'md5': '64d86f1c7d369afd9a78b38cbb88d80a',
  1471. 'info_dict': {
  1472. 'id': '148867247',
  1473. 'ext': 'mp4',
  1474. 'title': 'Understanding the web - Teaser',
  1475. 'description': 'This is "Understanding the web - Teaser" by openclassrooms on Vimeo, the home for high quality videos and the people who love them.',
  1476. 'upload_date': '20151214',
  1477. 'uploader': 'OpenClassrooms',
  1478. 'uploader_id': 'openclassrooms',
  1479. },
  1480. 'add_ie': ['Vimeo'],
  1481. },
  1482. {
  1483. # generic vimeo embed that requires original URL passed as Referer
  1484. 'url': 'http://racing4everyone.eu/2016/07/30/formula-1-2016-round12-germany/',
  1485. 'only_matching': True,
  1486. },
  1487. {
  1488. 'url': 'https://support.arkena.com/display/PLAY/Ways+to+embed+your+video',
  1489. 'md5': 'b96f2f71b359a8ecd05ce4e1daa72365',
  1490. 'info_dict': {
  1491. 'id': 'b41dda37-d8e7-4d3f-b1b5-9a9db578bdfe',
  1492. 'ext': 'mp4',
  1493. 'title': 'Big Buck Bunny',
  1494. 'description': 'Royalty free test video',
  1495. 'timestamp': 1432816365,
  1496. 'upload_date': '20150528',
  1497. 'is_live': False,
  1498. },
  1499. 'params': {
  1500. 'skip_download': True,
  1501. },
  1502. 'add_ie': [ArkenaIE.ie_key()],
  1503. },
  1504. {
  1505. '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/',
  1506. 'info_dict': {
  1507. 'id': '1c7141f46c',
  1508. 'ext': 'mp4',
  1509. 'title': 'НА КОСЪМ ОТ ВЗРИВ: Изтичане на газ на бензиностанция в Пловдив',
  1510. },
  1511. 'params': {
  1512. 'skip_download': True,
  1513. },
  1514. 'add_ie': [Vbox7IE.ie_key()],
  1515. },
  1516. {
  1517. # DBTV embeds
  1518. 'url': 'http://www.dagbladet.no/2016/02/23/nyheter/nordlys/ski/troms/ver/43254897/',
  1519. 'info_dict': {
  1520. 'id': '43254897',
  1521. 'title': 'Etter ett års planlegging, klaffet endelig alt: - Jeg måtte ta en liten dans',
  1522. },
  1523. 'playlist_mincount': 3,
  1524. },
  1525. {
  1526. # Videa embeds
  1527. 'url': 'http://forum.dvdtalk.com/movie-talk/623756-deleted-magic-star-wars-ot-deleted-alt-scenes-docu-style.html',
  1528. 'info_dict': {
  1529. 'id': '623756-deleted-magic-star-wars-ot-deleted-alt-scenes-docu-style',
  1530. 'title': 'Deleted Magic - Star Wars: OT Deleted / Alt. Scenes Docu. Style - DVD Talk Forum',
  1531. },
  1532. 'playlist_mincount': 2,
  1533. },
  1534. {
  1535. # 20 minuten embed
  1536. 'url': 'http://www.20min.ch/schweiz/news/story/So-kommen-Sie-bei-Eis-und-Schnee-sicher-an-27032552',
  1537. 'info_dict': {
  1538. 'id': '523629',
  1539. 'ext': 'mp4',
  1540. 'title': 'So kommen Sie bei Eis und Schnee sicher an',
  1541. 'description': 'md5:117c212f64b25e3d95747e5276863f7d',
  1542. },
  1543. 'params': {
  1544. 'skip_download': True,
  1545. },
  1546. 'add_ie': [TwentyMinutenIE.ie_key()],
  1547. },
  1548. {
  1549. # VideoPress embed
  1550. 'url': 'https://en.support.wordpress.com/videopress/',
  1551. 'info_dict': {
  1552. 'id': 'OcobLTqC',
  1553. 'ext': 'm4v',
  1554. 'title': 'IMG_5786',
  1555. 'timestamp': 1435711927,
  1556. 'upload_date': '20150701',
  1557. },
  1558. 'params': {
  1559. 'skip_download': True,
  1560. },
  1561. 'add_ie': [VideoPressIE.ie_key()],
  1562. },
  1563. {
  1564. # Rutube embed
  1565. 'url': 'http://magazzino.friday.ru/videos/vipuski/kazan-2',
  1566. 'info_dict': {
  1567. 'id': '9b3d5bee0a8740bf70dfd29d3ea43541',
  1568. 'ext': 'flv',
  1569. 'title': 'Магаззино: Казань 2',
  1570. 'description': 'md5:99bccdfac2269f0e8fdbc4bbc9db184a',
  1571. 'uploader': 'Магаззино',
  1572. 'upload_date': '20170228',
  1573. 'uploader_id': '996642',
  1574. },
  1575. 'params': {
  1576. 'skip_download': True,
  1577. },
  1578. 'add_ie': [RutubeIE.ie_key()],
  1579. },
  1580. {
  1581. # ThePlatform embedded with whitespaces in URLs
  1582. 'url': 'http://www.golfchannel.com/topics/shows/golftalkcentral.htm',
  1583. 'only_matching': True,
  1584. },
  1585. {
  1586. # Senate ISVP iframe https
  1587. 'url': 'https://www.hsgac.senate.gov/hearings/canadas-fast-track-refugee-plan-unanswered-questions-and-implications-for-us-national-security',
  1588. 'md5': 'fb8c70b0b515e5037981a2492099aab8',
  1589. 'info_dict': {
  1590. 'id': 'govtaff020316',
  1591. 'ext': 'mp4',
  1592. 'title': 'Integrated Senate Video Player',
  1593. },
  1594. 'add_ie': [SenateISVPIE.ie_key()],
  1595. },
  1596. # {
  1597. # # TODO: find another test
  1598. # # http://schema.org/VideoObject
  1599. # 'url': 'https://flipagram.com/f/nyvTSJMKId',
  1600. # 'md5': '888dcf08b7ea671381f00fab74692755',
  1601. # 'info_dict': {
  1602. # 'id': 'nyvTSJMKId',
  1603. # 'ext': 'mp4',
  1604. # 'title': 'Flipagram by sjuria101 featuring Midnight Memories by One Direction',
  1605. # 'description': '#love for cats.',
  1606. # 'timestamp': 1461244995,
  1607. # 'upload_date': '20160421',
  1608. # },
  1609. # 'params': {
  1610. # 'force_generic_extractor': True,
  1611. # },
  1612. # }
  1613. ]
  1614. def report_following_redirect(self, new_url):
  1615. """Report information extraction."""
  1616. self._downloader.to_screen('[redirect] Following redirect to %s' % new_url)
  1617. def _extract_rss(self, url, video_id, doc):
  1618. playlist_title = doc.find('./channel/title').text
  1619. playlist_desc_el = doc.find('./channel/description')
  1620. playlist_desc = None if playlist_desc_el is None else playlist_desc_el.text
  1621. entries = []
  1622. for it in doc.findall('./channel/item'):
  1623. next_url = xpath_text(it, 'link', fatal=False)
  1624. if not next_url:
  1625. enclosure_nodes = it.findall('./enclosure')
  1626. for e in enclosure_nodes:
  1627. next_url = e.attrib.get('url')
  1628. if next_url:
  1629. break
  1630. if not next_url:
  1631. continue
  1632. entries.append({
  1633. '_type': 'url',
  1634. 'url': next_url,
  1635. 'title': it.find('title').text,
  1636. })
  1637. return {
  1638. '_type': 'playlist',
  1639. 'id': url,
  1640. 'title': playlist_title,
  1641. 'description': playlist_desc,
  1642. 'entries': entries,
  1643. }
  1644. def _extract_camtasia(self, url, video_id, webpage):
  1645. """ Returns None if no camtasia video can be found. """
  1646. camtasia_cfg = self._search_regex(
  1647. r'fo\.addVariable\(\s*"csConfigFile",\s*"([^"]+)"\s*\);',
  1648. webpage, 'camtasia configuration file', default=None)
  1649. if camtasia_cfg is None:
  1650. return None
  1651. title = self._html_search_meta('DC.title', webpage, fatal=True)
  1652. camtasia_url = compat_urlparse.urljoin(url, camtasia_cfg)
  1653. camtasia_cfg = self._download_xml(
  1654. camtasia_url, video_id,
  1655. note='Downloading camtasia configuration',
  1656. errnote='Failed to download camtasia configuration')
  1657. fileset_node = camtasia_cfg.find('./playlist/array/fileset')
  1658. entries = []
  1659. for n in fileset_node.getchildren():
  1660. url_n = n.find('./uri')
  1661. if url_n is None:
  1662. continue
  1663. entries.append({
  1664. 'id': os.path.splitext(url_n.text.rpartition('/')[2])[0],
  1665. 'title': '%s - %s' % (title, n.tag),
  1666. 'url': compat_urlparse.urljoin(url, url_n.text),
  1667. 'duration': float_or_none(n.find('./duration').text),
  1668. })
  1669. return {
  1670. '_type': 'playlist',
  1671. 'entries': entries,
  1672. 'title': title,
  1673. }
  1674. def _real_extract(self, url):
  1675. if url.startswith('//'):
  1676. return {
  1677. '_type': 'url',
  1678. 'url': self.http_scheme() + url,
  1679. }
  1680. parsed_url = compat_urlparse.urlparse(url)
  1681. if not parsed_url.scheme:
  1682. default_search = self._downloader.params.get('default_search')
  1683. if default_search is None:
  1684. default_search = 'fixup_error'
  1685. if default_search in ('auto', 'auto_warning', 'fixup_error'):
  1686. if '/' in url:
  1687. self._downloader.report_warning('The url doesn\'t specify the protocol, trying with http')
  1688. return self.url_result('http://' + url)
  1689. elif default_search != 'fixup_error':
  1690. if default_search == 'auto_warning':
  1691. if re.match(r'^(?:url|URL)$', url):
  1692. raise ExtractorError(
  1693. 'Invalid URL: %r . Call youtube-dl like this: youtube-dl -v "https://www.youtube.com/watch?v=BaW_jenozKc" ' % url,
  1694. expected=True)
  1695. else:
  1696. self._downloader.report_warning(
  1697. 'Falling back to youtube search for %s . Set --default-search "auto" to suppress this warning.' % url)
  1698. return self.url_result('ytsearch:' + url)
  1699. if default_search in ('error', 'fixup_error'):
  1700. raise ExtractorError(
  1701. '%r is not a valid URL. '
  1702. 'Set --default-search "ytsearch" (or run youtube-dl "ytsearch:%s" ) to search YouTube'
  1703. % (url, url), expected=True)
  1704. else:
  1705. if ':' not in default_search:
  1706. default_search += ':'
  1707. return self.url_result(default_search + url)
  1708. url, smuggled_data = unsmuggle_url(url)
  1709. force_videoid = None
  1710. is_intentional = smuggled_data and smuggled_data.get('to_generic')
  1711. if smuggled_data and 'force_videoid' in smuggled_data:
  1712. force_videoid = smuggled_data['force_videoid']
  1713. video_id = force_videoid
  1714. else:
  1715. video_id = self._generic_id(url)
  1716. self.to_screen('%s: Requesting header' % video_id)
  1717. head_req = HEADRequest(url)
  1718. head_response = self._request_webpage(
  1719. head_req, video_id,
  1720. note=False, errnote='Could not send HEAD request to %s' % url,
  1721. fatal=False)
  1722. if head_response is not False:
  1723. # Check for redirect
  1724. new_url = head_response.geturl()
  1725. if url != new_url:
  1726. self.report_following_redirect(new_url)
  1727. if force_videoid:
  1728. new_url = smuggle_url(
  1729. new_url, {'force_videoid': force_videoid})
  1730. return self.url_result(new_url)
  1731. full_response = None
  1732. if head_response is False:
  1733. request = sanitized_Request(url)
  1734. request.add_header('Accept-Encoding', '*')
  1735. full_response = self._request_webpage(request, video_id)
  1736. head_response = full_response
  1737. info_dict = {
  1738. 'id': video_id,
  1739. 'title': self._generic_title(url),
  1740. 'upload_date': unified_strdate(head_response.headers.get('Last-Modified'))
  1741. }
  1742. # Check for direct link to a video
  1743. content_type = head_response.headers.get('Content-Type', '').lower()
  1744. m = re.match(r'^(?P<type>audio|video|application(?=/(?:ogg$|(?:vnd\.apple\.|x-)?mpegurl)))/(?P<format_id>[^;\s]+)', content_type)
  1745. if m:
  1746. format_id = m.group('format_id')
  1747. if format_id.endswith('mpegurl'):
  1748. formats = self._extract_m3u8_formats(url, video_id, 'mp4')
  1749. elif format_id == 'f4m':
  1750. formats = self._extract_f4m_formats(url, video_id)
  1751. else:
  1752. formats = [{
  1753. 'format_id': m.group('format_id'),
  1754. 'url': url,
  1755. 'vcodec': 'none' if m.group('type') == 'audio' else None
  1756. }]
  1757. info_dict['direct'] = True
  1758. self._sort_formats(formats)
  1759. info_dict['formats'] = formats
  1760. return info_dict
  1761. if not self._downloader.params.get('test', False) and not is_intentional:
  1762. force = self._downloader.params.get('force_generic_extractor', False)
  1763. self._downloader.report_warning(
  1764. '%s on generic information extractor.' % ('Forcing' if force else 'Falling back'))
  1765. if not full_response:
  1766. request = sanitized_Request(url)
  1767. # Some webservers may serve compressed content of rather big size (e.g. gzipped flac)
  1768. # making it impossible to download only chunk of the file (yet we need only 512kB to
  1769. # test whether it's HTML or not). According to youtube-dl default Accept-Encoding
  1770. # that will always result in downloading the whole file that is not desirable.
  1771. # Therefore for extraction pass we have to override Accept-Encoding to any in order
  1772. # to accept raw bytes and being able to download only a chunk.
  1773. # It may probably better to solve this by checking Content-Type for application/octet-stream
  1774. # after HEAD request finishes, but not sure if we can rely on this.
  1775. request.add_header('Accept-Encoding', '*')
  1776. full_response = self._request_webpage(request, video_id)
  1777. first_bytes = full_response.read(512)
  1778. # Is it an M3U playlist?
  1779. if first_bytes.startswith(b'#EXTM3U'):
  1780. info_dict['formats'] = self._extract_m3u8_formats(url, video_id, 'mp4')
  1781. self._sort_formats(info_dict['formats'])
  1782. return info_dict
  1783. # Maybe it's a direct link to a video?
  1784. # Be careful not to download the whole thing!
  1785. if not is_html(first_bytes):
  1786. self._downloader.report_warning(
  1787. 'URL could be a direct video link, returning it as such.')
  1788. info_dict.update({
  1789. 'direct': True,
  1790. 'url': url,
  1791. })
  1792. return info_dict
  1793. webpage = self._webpage_read_content(
  1794. full_response, url, video_id, prefix=first_bytes)
  1795. self.report_extraction(video_id)
  1796. # Is it an RSS feed, a SMIL file, an XSPF playlist or a MPD manifest?
  1797. try:
  1798. doc = compat_etree_fromstring(webpage.encode('utf-8'))
  1799. if doc.tag == 'rss':
  1800. return self._extract_rss(url, video_id, doc)
  1801. elif doc.tag == 'SmoothStreamingMedia':
  1802. info_dict['formats'] = self._parse_ism_formats(doc, url)
  1803. self._sort_formats(info_dict['formats'])
  1804. return info_dict
  1805. elif re.match(r'^(?:{[^}]+})?smil$', doc.tag):
  1806. smil = self._parse_smil(doc, url, video_id)
  1807. self._sort_formats(smil['formats'])
  1808. return smil
  1809. elif doc.tag == '{http://xspf.org/ns/0/}playlist':
  1810. return self.playlist_result(self._parse_xspf(doc, video_id), video_id)
  1811. elif re.match(r'(?i)^(?:{[^}]+})?MPD$', doc.tag):
  1812. info_dict['formats'] = self._parse_mpd_formats(
  1813. doc, video_id,
  1814. mpd_base_url=full_response.geturl().rpartition('/')[0],
  1815. mpd_url=url)
  1816. self._sort_formats(info_dict['formats'])
  1817. return info_dict
  1818. elif re.match(r'^{http://ns\.adobe\.com/f4m/[12]\.0}manifest$', doc.tag):
  1819. info_dict['formats'] = self._parse_f4m_formats(doc, url, video_id)
  1820. self._sort_formats(info_dict['formats'])
  1821. return info_dict
  1822. except compat_xml_parse_error:
  1823. pass
  1824. # Is it a Camtasia project?
  1825. camtasia_res = self._extract_camtasia(url, video_id, webpage)
  1826. if camtasia_res is not None:
  1827. return camtasia_res
  1828. # Sometimes embedded video player is hidden behind percent encoding
  1829. # (e.g. https://github.com/rg3/youtube-dl/issues/2448)
  1830. # Unescaping the whole page allows to handle those cases in a generic way
  1831. webpage = compat_urllib_parse_unquote(webpage)
  1832. # it's tempting to parse this further, but you would
  1833. # have to take into account all the variations like
  1834. # Video Title - Site Name
  1835. # Site Name | Video Title
  1836. # Video Title - Tagline | Site Name
  1837. # and so on and so forth; it's just not practical
  1838. video_title = self._og_search_title(
  1839. webpage, default=None) or self._html_search_regex(
  1840. r'(?s)<title>(.*?)</title>', webpage, 'video title',
  1841. default='video')
  1842. # Try to detect age limit automatically
  1843. age_limit = self._rta_search(webpage)
  1844. # And then there are the jokers who advertise that they use RTA,
  1845. # but actually don't.
  1846. AGE_LIMIT_MARKERS = [
  1847. r'Proudly Labeled <a href="http://www.rtalabel.org/" title="Restricted to Adults">RTA</a>',
  1848. ]
  1849. if any(re.search(marker, webpage) for marker in AGE_LIMIT_MARKERS):
  1850. age_limit = 18
  1851. # video uploader is domain name
  1852. video_uploader = self._search_regex(
  1853. r'^(?:https?://)?([^/]*)/.*', url, 'video uploader')
  1854. video_description = self._og_search_description(webpage, default=None)
  1855. video_thumbnail = self._og_search_thumbnail(webpage, default=None)
  1856. # Look for Brightcove Legacy Studio embeds
  1857. bc_urls = BrightcoveLegacyIE._extract_brightcove_urls(webpage)
  1858. if bc_urls:
  1859. self.to_screen('Brightcove video detected.')
  1860. entries = [{
  1861. '_type': 'url',
  1862. 'url': smuggle_url(bc_url, {'Referer': url}),
  1863. 'ie_key': 'BrightcoveLegacy'
  1864. } for bc_url in bc_urls]
  1865. return {
  1866. '_type': 'playlist',
  1867. 'title': video_title,
  1868. 'id': video_id,
  1869. 'entries': entries,
  1870. }
  1871. # Look for Brightcove New Studio embeds
  1872. bc_urls = BrightcoveNewIE._extract_urls(webpage)
  1873. if bc_urls:
  1874. return self.playlist_from_matches(bc_urls, video_id, video_title, ie='BrightcoveNew')
  1875. # Look for ThePlatform embeds
  1876. tp_urls = ThePlatformIE._extract_urls(webpage)
  1877. if tp_urls:
  1878. return self.playlist_from_matches(tp_urls, video_id, video_title, ie='ThePlatform')
  1879. # Look for Vessel embeds
  1880. vessel_urls = VesselIE._extract_urls(webpage)
  1881. if vessel_urls:
  1882. return self.playlist_from_matches(vessel_urls, video_id, video_title, ie=VesselIE.ie_key())
  1883. # Look for embedded rtl.nl player
  1884. matches = re.findall(
  1885. r'<iframe[^>]+?src="((?:https?:)?//(?:www\.)?rtl\.nl/system/videoplayer/[^"]+(?:video_)?embed[^"]+)"',
  1886. webpage)
  1887. if matches:
  1888. return self.playlist_from_matches(matches, video_id, video_title, ie='RtlNl')
  1889. vimeo_urls = VimeoIE._extract_urls(url, webpage)
  1890. if vimeo_urls:
  1891. return self.playlist_from_matches(vimeo_urls, video_id, video_title, ie=VimeoIE.ie_key())
  1892. vid_me_embed_url = self._search_regex(
  1893. r'src=[\'"](https?://vid\.me/[^\'"]+)[\'"]',
  1894. webpage, 'vid.me embed', default=None)
  1895. if vid_me_embed_url is not None:
  1896. return self.url_result(vid_me_embed_url, 'Vidme')
  1897. # Look for embedded YouTube player
  1898. matches = re.findall(r'''(?x)
  1899. (?:
  1900. <iframe[^>]+?src=|
  1901. data-video-url=|
  1902. <embed[^>]+?src=|
  1903. embedSWF\(?:\s*|
  1904. <object[^>]+data=|
  1905. new\s+SWFObject\(
  1906. )
  1907. (["\'])
  1908. (?P<url>(?:https?:)?//(?:www\.)?youtube(?:-nocookie)?\.com/
  1909. (?:embed|v|p)/.+?)
  1910. \1''', webpage)
  1911. if matches:
  1912. return self.playlist_from_matches(
  1913. matches, video_id, video_title, lambda m: unescapeHTML(m[1]))
  1914. # Look for lazyYT YouTube embed
  1915. matches = re.findall(
  1916. r'class="lazyYT" data-youtube-id="([^"]+)"', webpage)
  1917. if matches:
  1918. return self.playlist_from_matches(matches, video_id, video_title, lambda m: unescapeHTML(m))
  1919. # Look for Wordpress "YouTube Video Importer" plugin
  1920. matches = re.findall(r'''(?x)<div[^>]+
  1921. class=(?P<q1>[\'"])[^\'"]*\byvii_single_video_player\b[^\'"]*(?P=q1)[^>]+
  1922. data-video_id=(?P<q2>[\'"])([^\'"]+)(?P=q2)''', webpage)
  1923. if matches:
  1924. return self.playlist_from_matches(matches, video_id, video_title, lambda m: m[-1])
  1925. matches = DailymotionIE._extract_urls(webpage)
  1926. if matches:
  1927. return self.playlist_from_matches(matches, video_id, video_title)
  1928. # Look for embedded Dailymotion playlist player (#3822)
  1929. m = re.search(
  1930. r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?dailymotion\.[a-z]{2,3}/widget/jukebox\?.+?)\1', webpage)
  1931. if m:
  1932. playlists = re.findall(
  1933. r'list\[\]=/playlist/([^/]+)/', unescapeHTML(m.group('url')))
  1934. if playlists:
  1935. return self.playlist_from_matches(
  1936. playlists, video_id, video_title, lambda p: '//dailymotion.com/playlist/%s' % p)
  1937. # Look for embedded Wistia player
  1938. match = re.search(
  1939. r'<(?:meta[^>]+?content|iframe[^>]+?src)=(["\'])(?P<url>(?:https?:)?//(?:fast\.)?wistia\.net/embed/iframe/.+?)\1', webpage)
  1940. if match:
  1941. embed_url = self._proto_relative_url(
  1942. unescapeHTML(match.group('url')))
  1943. return {
  1944. '_type': 'url_transparent',
  1945. 'url': embed_url,
  1946. 'ie_key': 'Wistia',
  1947. 'uploader': video_uploader,
  1948. }
  1949. match = re.search(r'(?:id=["\']wistia_|data-wistia-?id=["\']|Wistia\.embed\(["\'])(?P<id>[^"\']+)', webpage)
  1950. if match:
  1951. return {
  1952. '_type': 'url_transparent',
  1953. 'url': 'wistia:%s' % match.group('id'),
  1954. 'ie_key': 'Wistia',
  1955. 'uploader': video_uploader,
  1956. }
  1957. match = re.search(
  1958. r'''(?sx)
  1959. <script[^>]+src=(["'])(?:https?:)?//fast\.wistia\.com/assets/external/E-v1\.js\1[^>]*>.*?
  1960. <div[^>]+class=(["']).*?\bwistia_async_(?P<id>[a-z0-9]+)\b.*?\2
  1961. ''', webpage)
  1962. if match:
  1963. return self.url_result(self._proto_relative_url(
  1964. 'wistia:%s' % match.group('id')), 'Wistia')
  1965. # Look for SVT player
  1966. svt_url = SVTIE._extract_url(webpage)
  1967. if svt_url:
  1968. return self.url_result(svt_url, 'SVT')
  1969. # Look for embedded condenast player
  1970. matches = re.findall(
  1971. r'<iframe\s+(?:[a-zA-Z-]+="[^"]+"\s+)*?src="(https?://player\.cnevids\.com/embed/[^"]+")',
  1972. webpage)
  1973. if matches:
  1974. return {
  1975. '_type': 'playlist',
  1976. 'entries': [{
  1977. '_type': 'url',
  1978. 'ie_key': 'CondeNast',
  1979. 'url': ma,
  1980. } for ma in matches],
  1981. 'title': video_title,
  1982. 'id': video_id,
  1983. }
  1984. # Look for Bandcamp pages with custom domain
  1985. mobj = re.search(r'<meta property="og:url"[^>]*?content="(.*?bandcamp\.com.*?)"', webpage)
  1986. if mobj is not None:
  1987. burl = unescapeHTML(mobj.group(1))
  1988. # Don't set the extractor because it can be a track url or an album
  1989. return self.url_result(burl)
  1990. # Look for embedded Vevo player
  1991. mobj = re.search(
  1992. r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:cache\.)?vevo\.com/.+?)\1', webpage)
  1993. if mobj is not None:
  1994. return self.url_result(mobj.group('url'))
  1995. # Look for embedded Viddler player
  1996. mobj = re.search(
  1997. r'<(?:iframe[^>]+?src|param[^>]+?value)=(["\'])(?P<url>(?:https?:)?//(?:www\.)?viddler\.com/(?:embed|player)/.+?)\1',
  1998. webpage)
  1999. if mobj is not None:
  2000. return self.url_result(mobj.group('url'))
  2001. # Look for NYTimes player
  2002. mobj = re.search(
  2003. r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//graphics8\.nytimes\.com/bcvideo/[^/]+/iframe/embed\.html.+?)\1>',
  2004. webpage)
  2005. if mobj is not None:
  2006. return self.url_result(mobj.group('url'))
  2007. # Look for Libsyn player
  2008. mobj = re.search(
  2009. r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//html5-player\.libsyn\.com/embed/.+?)\1', webpage)
  2010. if mobj is not None:
  2011. return self.url_result(mobj.group('url'))
  2012. # Look for Ooyala videos
  2013. mobj = (re.search(r'player\.ooyala\.com/[^"?]+[?#][^"]*?(?:embedCode|ec)=(?P<ec>[^"&]+)', webpage) or
  2014. re.search(r'OO\.Player\.create\([\'"].*?[\'"],\s*[\'"](?P<ec>.{32})[\'"]', webpage) or
  2015. re.search(r'SBN\.VideoLinkset\.ooyala\([\'"](?P<ec>.{32})[\'"]\)', webpage) or
  2016. re.search(r'data-ooyala-video-id\s*=\s*[\'"](?P<ec>.{32})[\'"]', webpage))
  2017. if mobj is not None:
  2018. embed_token = self._search_regex(
  2019. r'embedToken[\'"]?\s*:\s*[\'"]([^\'"]+)',
  2020. webpage, 'ooyala embed token', default=None)
  2021. return OoyalaIE._build_url_result(smuggle_url(
  2022. mobj.group('ec'), {
  2023. 'domain': url,
  2024. 'embed_token': embed_token,
  2025. }))
  2026. # Look for multiple Ooyala embeds on SBN network websites
  2027. mobj = re.search(r'SBN\.VideoLinkset\.entryGroup\((\[.*?\])', webpage)
  2028. if mobj is not None:
  2029. embeds = self._parse_json(mobj.group(1), video_id, fatal=False)
  2030. if embeds:
  2031. return self.playlist_from_matches(
  2032. embeds, video_id, video_title,
  2033. getter=lambda v: OoyalaIE._url_for_embed_code(smuggle_url(v['provider_video_id'], {'domain': url})), ie='Ooyala')
  2034. # Look for Aparat videos
  2035. mobj = re.search(r'<iframe .*?src="(http://www\.aparat\.com/video/[^"]+)"', webpage)
  2036. if mobj is not None:
  2037. return self.url_result(mobj.group(1), 'Aparat')
  2038. # Look for MPORA videos
  2039. mobj = re.search(r'<iframe .*?src="(http://mpora\.(?:com|de)/videos/[^"]+)"', webpage)
  2040. if mobj is not None:
  2041. return self.url_result(mobj.group(1), 'Mpora')
  2042. # Look for embedded NovaMov-based player
  2043. mobj = re.search(
  2044. r'''(?x)<(?:pagespeed_)?iframe[^>]+?src=(["\'])
  2045. (?P<url>http://(?:(?:embed|www)\.)?
  2046. (?:novamov\.com|
  2047. nowvideo\.(?:ch|sx|eu|at|ag|co)|
  2048. videoweed\.(?:es|com)|
  2049. movshare\.(?:net|sx|ag)|
  2050. divxstage\.(?:eu|net|ch|co|at|ag))
  2051. /embed\.php.+?)\1''', webpage)
  2052. if mobj is not None:
  2053. return self.url_result(mobj.group('url'))
  2054. # Look for embedded Facebook player
  2055. facebook_url = FacebookIE._extract_url(webpage)
  2056. if facebook_url is not None:
  2057. return self.url_result(facebook_url, 'Facebook')
  2058. # Look for embedded VK player
  2059. mobj = re.search(r'<iframe[^>]+?src=(["\'])(?P<url>https?://vk\.com/video_ext\.php.+?)\1', webpage)
  2060. if mobj is not None:
  2061. return self.url_result(mobj.group('url'), 'VK')
  2062. # Look for embedded Odnoklassniki player
  2063. mobj = re.search(r'<iframe[^>]+?src=(["\'])(?P<url>https?://(?:odnoklassniki|ok)\.ru/videoembed/.+?)\1', webpage)
  2064. if mobj is not None:
  2065. return self.url_result(mobj.group('url'), 'Odnoklassniki')
  2066. # Look for embedded ivi player
  2067. mobj = re.search(r'<embed[^>]+?src=(["\'])(?P<url>https?://(?:www\.)?ivi\.ru/video/player.+?)\1', webpage)
  2068. if mobj is not None:
  2069. return self.url_result(mobj.group('url'), 'Ivi')
  2070. # Look for embedded Huffington Post player
  2071. mobj = re.search(
  2072. r'<iframe[^>]+?src=(["\'])(?P<url>https?://embed\.live\.huffingtonpost\.com/.+?)\1', webpage)
  2073. if mobj is not None:
  2074. return self.url_result(mobj.group('url'), 'HuffPost')
  2075. # Look for embed.ly
  2076. mobj = re.search(r'class=["\']embedly-card["\'][^>]href=["\'](?P<url>[^"\']+)', webpage)
  2077. if mobj is not None:
  2078. return self.url_result(mobj.group('url'))
  2079. mobj = re.search(r'class=["\']embedly-embed["\'][^>]src=["\'][^"\']*url=(?P<url>[^&]+)', webpage)
  2080. if mobj is not None:
  2081. return self.url_result(compat_urllib_parse_unquote(mobj.group('url')))
  2082. # Look for funnyordie embed
  2083. matches = re.findall(r'<iframe[^>]+?src="(https?://(?:www\.)?funnyordie\.com/embed/[^"]+)"', webpage)
  2084. if matches:
  2085. return self.playlist_from_matches(
  2086. matches, video_id, video_title, getter=unescapeHTML, ie='FunnyOrDie')
  2087. # Look for BBC iPlayer embed
  2088. matches = re.findall(r'setPlaylist\("(https?://www\.bbc\.co\.uk/iplayer/[^/]+/[\da-z]{8})"\)', webpage)
  2089. if matches:
  2090. return self.playlist_from_matches(matches, video_id, video_title, ie='BBCCoUk')
  2091. # Look for embedded RUTV player
  2092. rutv_url = RUTVIE._extract_url(webpage)
  2093. if rutv_url:
  2094. return self.url_result(rutv_url, 'RUTV')
  2095. # Look for embedded TVC player
  2096. tvc_url = TVCIE._extract_url(webpage)
  2097. if tvc_url:
  2098. return self.url_result(tvc_url, 'TVC')
  2099. # Look for embedded SportBox player
  2100. sportbox_urls = SportBoxEmbedIE._extract_urls(webpage)
  2101. if sportbox_urls:
  2102. return self.playlist_from_matches(sportbox_urls, video_id, video_title, ie='SportBoxEmbed')
  2103. # Look for embedded XHamster player
  2104. xhamster_urls = XHamsterEmbedIE._extract_urls(webpage)
  2105. if xhamster_urls:
  2106. return self.playlist_from_matches(xhamster_urls, video_id, video_title, ie='XHamsterEmbed')
  2107. # Look for embedded TNAFlixNetwork player
  2108. tnaflix_urls = TNAFlixNetworkEmbedIE._extract_urls(webpage)
  2109. if tnaflix_urls:
  2110. return self.playlist_from_matches(tnaflix_urls, video_id, video_title, ie=TNAFlixNetworkEmbedIE.ie_key())
  2111. # Look for embedded PornHub player
  2112. pornhub_urls = PornHubIE._extract_urls(webpage)
  2113. if pornhub_urls:
  2114. return self.playlist_from_matches(pornhub_urls, video_id, video_title, ie=PornHubIE.ie_key())
  2115. # Look for embedded DrTuber player
  2116. drtuber_urls = DrTuberIE._extract_urls(webpage)
  2117. if drtuber_urls:
  2118. return self.playlist_from_matches(drtuber_urls, video_id, video_title, ie=DrTuberIE.ie_key())
  2119. # Look for embedded RedTube player
  2120. redtube_urls = RedTubeIE._extract_urls(webpage)
  2121. if redtube_urls:
  2122. return self.playlist_from_matches(redtube_urls, video_id, video_title, ie=RedTubeIE.ie_key())
  2123. # Look for embedded Tvigle player
  2124. mobj = re.search(
  2125. r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//cloud\.tvigle\.ru/video/.+?)\1', webpage)
  2126. if mobj is not None:
  2127. return self.url_result(mobj.group('url'), 'Tvigle')
  2128. # Look for embedded TED player
  2129. mobj = re.search(
  2130. r'<iframe[^>]+?src=(["\'])(?P<url>https?://embed(?:-ssl)?\.ted\.com/.+?)\1', webpage)
  2131. if mobj is not None:
  2132. return self.url_result(mobj.group('url'), 'TED')
  2133. # Look for embedded Ustream videos
  2134. ustream_url = UstreamIE._extract_url(webpage)
  2135. if ustream_url:
  2136. return self.url_result(ustream_url, UstreamIE.ie_key())
  2137. # Look for embedded arte.tv player
  2138. mobj = re.search(
  2139. r'<(?:script|iframe) [^>]*?src="(?P<url>http://www\.arte\.tv/(?:playerv2/embed|arte_vp/index)[^"]+)"',
  2140. webpage)
  2141. if mobj is not None:
  2142. return self.url_result(mobj.group('url'), 'ArteTVEmbed')
  2143. # Look for embedded francetv player
  2144. mobj = re.search(
  2145. r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?://)?embed\.francetv\.fr/\?ue=.+?)\1',
  2146. webpage)
  2147. if mobj is not None:
  2148. return self.url_result(mobj.group('url'))
  2149. # Look for embedded smotri.com player
  2150. smotri_url = SmotriIE._extract_url(webpage)
  2151. if smotri_url:
  2152. return self.url_result(smotri_url, 'Smotri')
  2153. # Look for embedded Myvi.ru player
  2154. myvi_url = MyviIE._extract_url(webpage)
  2155. if myvi_url:
  2156. return self.url_result(myvi_url)
  2157. # Look for embedded soundcloud player
  2158. soundcloud_urls = SoundcloudIE._extract_urls(webpage)
  2159. if soundcloud_urls:
  2160. return self.playlist_from_matches(soundcloud_urls, video_id, video_title, getter=unescapeHTML, ie=SoundcloudIE.ie_key())
  2161. # Look for tunein player
  2162. tunein_urls = TuneInBaseIE._extract_urls(webpage)
  2163. if tunein_urls:
  2164. return self.playlist_from_matches(tunein_urls, video_id, video_title)
  2165. # Look for embedded mtvservices player
  2166. mtvservices_url = MTVServicesEmbeddedIE._extract_url(webpage)
  2167. if mtvservices_url:
  2168. return self.url_result(mtvservices_url, ie='MTVServicesEmbedded')
  2169. # Look for embedded yahoo player
  2170. mobj = re.search(
  2171. r'<iframe[^>]+?src=(["\'])(?P<url>https?://(?:screen|movies)\.yahoo\.com/.+?\.html\?format=embed)\1',
  2172. webpage)
  2173. if mobj is not None:
  2174. return self.url_result(mobj.group('url'), 'Yahoo')
  2175. # Look for embedded sbs.com.au player
  2176. mobj = re.search(
  2177. r'''(?x)
  2178. (?:
  2179. <meta\s+property="og:video"\s+content=|
  2180. <iframe[^>]+?src=
  2181. )
  2182. (["\'])(?P<url>https?://(?:www\.)?sbs\.com\.au/ondemand/video/.+?)\1''',
  2183. webpage)
  2184. if mobj is not None:
  2185. return self.url_result(mobj.group('url'), 'SBS')
  2186. # Look for embedded Cinchcast player
  2187. mobj = re.search(
  2188. r'<iframe[^>]+?src=(["\'])(?P<url>https?://player\.cinchcast\.com/.+?)\1',
  2189. webpage)
  2190. if mobj is not None:
  2191. return self.url_result(mobj.group('url'), 'Cinchcast')
  2192. mobj = re.search(
  2193. r'<iframe[^>]+?src=(["\'])(?P<url>https?://m(?:lb)?\.mlb\.com/shared/video/embed/embed\.html\?.+?)\1',
  2194. webpage)
  2195. if not mobj:
  2196. mobj = re.search(
  2197. r'data-video-link=["\'](?P<url>http://m.mlb.com/video/[^"\']+)',
  2198. webpage)
  2199. if mobj is not None:
  2200. return self.url_result(mobj.group('url'), 'MLB')
  2201. mobj = re.search(
  2202. r'<(?:iframe|script)[^>]+?src=(["\'])(?P<url>%s)\1' % CondeNastIE.EMBED_URL,
  2203. webpage)
  2204. if mobj is not None:
  2205. return self.url_result(self._proto_relative_url(mobj.group('url'), scheme='http:'), 'CondeNast')
  2206. mobj = re.search(
  2207. r'<iframe[^>]+src="(?P<url>https?://(?:new\.)?livestream\.com/[^"]+/player[^"]+)"',
  2208. webpage)
  2209. if mobj is not None:
  2210. return self.url_result(mobj.group('url'), 'Livestream')
  2211. # Look for Zapiks embed
  2212. mobj = re.search(
  2213. r'<iframe[^>]+src="(?P<url>https?://(?:www\.)?zapiks\.fr/index\.php\?.+?)"', webpage)
  2214. if mobj is not None:
  2215. return self.url_result(mobj.group('url'), 'Zapiks')
  2216. # Look for Kaltura embeds
  2217. kaltura_url = KalturaIE._extract_url(webpage)
  2218. if kaltura_url:
  2219. return self.url_result(smuggle_url(kaltura_url, {'source_url': url}), KalturaIE.ie_key())
  2220. # Look for Eagle.Platform embeds
  2221. eagleplatform_url = EaglePlatformIE._extract_url(webpage)
  2222. if eagleplatform_url:
  2223. return self.url_result(eagleplatform_url, EaglePlatformIE.ie_key())
  2224. # Look for ClipYou (uses Eagle.Platform) embeds
  2225. mobj = re.search(
  2226. r'<iframe[^>]+src="https?://(?P<host>media\.clipyou\.ru)/index/player\?.*\brecord_id=(?P<id>\d+).*"', webpage)
  2227. if mobj is not None:
  2228. return self.url_result('eagleplatform:%(host)s:%(id)s' % mobj.groupdict(), 'EaglePlatform')
  2229. # Look for Pladform embeds
  2230. pladform_url = PladformIE._extract_url(webpage)
  2231. if pladform_url:
  2232. return self.url_result(pladform_url)
  2233. # Look for Videomore embeds
  2234. videomore_url = VideomoreIE._extract_url(webpage)
  2235. if videomore_url:
  2236. return self.url_result(videomore_url)
  2237. # Look for Webcaster embeds
  2238. webcaster_url = WebcasterFeedIE._extract_url(self, webpage)
  2239. if webcaster_url:
  2240. return self.url_result(webcaster_url, ie=WebcasterFeedIE.ie_key())
  2241. # Look for Playwire embeds
  2242. mobj = re.search(
  2243. r'<script[^>]+data-config=(["\'])(?P<url>(?:https?:)?//config\.playwire\.com/.+?)\1', webpage)
  2244. if mobj is not None:
  2245. return self.url_result(mobj.group('url'))
  2246. # Look for 5min embeds
  2247. mobj = re.search(
  2248. r'<meta[^>]+property="og:video"[^>]+content="https?://embed\.5min\.com/(?P<id>[0-9]+)/?', webpage)
  2249. if mobj is not None:
  2250. return self.url_result('5min:%s' % mobj.group('id'), 'FiveMin')
  2251. # Look for Crooks and Liars embeds
  2252. mobj = re.search(
  2253. r'<(?:iframe[^>]+src|param[^>]+value)=(["\'])(?P<url>(?:https?:)?//embed\.crooksandliars\.com/(?:embed|v)/.+?)\1', webpage)
  2254. if mobj is not None:
  2255. return self.url_result(mobj.group('url'))
  2256. # Look for NBC Sports VPlayer embeds
  2257. nbc_sports_url = NBCSportsVPlayerIE._extract_url(webpage)
  2258. if nbc_sports_url:
  2259. return self.url_result(nbc_sports_url, 'NBCSportsVPlayer')
  2260. # Look for NBC News embeds
  2261. nbc_news_embed_url = re.search(
  2262. r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//www\.nbcnews\.com/widget/video-embed/[^"\']+)\1', webpage)
  2263. if nbc_news_embed_url:
  2264. return self.url_result(nbc_news_embed_url.group('url'), 'NBCNews')
  2265. # Look for Google Drive embeds
  2266. google_drive_url = GoogleDriveIE._extract_url(webpage)
  2267. if google_drive_url:
  2268. return self.url_result(google_drive_url, 'GoogleDrive')
  2269. # Look for UDN embeds
  2270. mobj = re.search(
  2271. r'<iframe[^>]+src="(?P<url>%s)"' % UDNEmbedIE._PROTOCOL_RELATIVE_VALID_URL, webpage)
  2272. if mobj is not None:
  2273. return self.url_result(
  2274. compat_urlparse.urljoin(url, mobj.group('url')), 'UDNEmbed')
  2275. # Look for Senate ISVP iframe
  2276. senate_isvp_url = SenateISVPIE._search_iframe_url(webpage)
  2277. if senate_isvp_url:
  2278. return self.url_result(senate_isvp_url, 'SenateISVP')
  2279. # Look for Dailymotion Cloud videos
  2280. dmcloud_url = DailymotionCloudIE._extract_dmcloud_url(webpage)
  2281. if dmcloud_url:
  2282. return self.url_result(dmcloud_url, 'DailymotionCloud')
  2283. # Look for OnionStudios embeds
  2284. onionstudios_url = OnionStudiosIE._extract_url(webpage)
  2285. if onionstudios_url:
  2286. return self.url_result(onionstudios_url)
  2287. # Look for ViewLift embeds
  2288. viewlift_url = ViewLiftEmbedIE._extract_url(webpage)
  2289. if viewlift_url:
  2290. return self.url_result(viewlift_url)
  2291. # Look for JWPlatform embeds
  2292. jwplatform_url = JWPlatformIE._extract_url(webpage)
  2293. if jwplatform_url:
  2294. return self.url_result(jwplatform_url, 'JWPlatform')
  2295. # Look for Digiteka embeds
  2296. digiteka_url = DigitekaIE._extract_url(webpage)
  2297. if digiteka_url:
  2298. return self.url_result(self._proto_relative_url(digiteka_url), DigitekaIE.ie_key())
  2299. # Look for Arkena embeds
  2300. arkena_url = ArkenaIE._extract_url(webpage)
  2301. if arkena_url:
  2302. return self.url_result(arkena_url, ArkenaIE.ie_key())
  2303. # Look for Piksel embeds
  2304. piksel_url = PikselIE._extract_url(webpage)
  2305. if piksel_url:
  2306. return self.url_result(piksel_url, PikselIE.ie_key())
  2307. # Look for Limelight embeds
  2308. mobj = re.search(r'LimelightPlayer\.doLoad(Media|Channel|ChannelList)\(["\'](?P<id>[a-z0-9]{32})', webpage)
  2309. if mobj:
  2310. lm = {
  2311. 'Media': 'media',
  2312. 'Channel': 'channel',
  2313. 'ChannelList': 'channel_list',
  2314. }
  2315. return self.url_result(smuggle_url('limelight:%s:%s' % (
  2316. lm[mobj.group(1)], mobj.group(2)), {'source_url': url}),
  2317. 'Limelight%s' % mobj.group(1), mobj.group(2))
  2318. mobj = re.search(
  2319. r'''(?sx)
  2320. <object[^>]+class=(["\'])LimelightEmbeddedPlayerFlash\1[^>]*>.*?
  2321. <param[^>]+
  2322. name=(["\'])flashVars\2[^>]+
  2323. value=(["\'])(?:(?!\3).)*mediaId=(?P<id>[a-z0-9]{32})
  2324. ''', webpage)
  2325. if mobj:
  2326. return self.url_result(smuggle_url(
  2327. 'limelight:media:%s' % mobj.group('id'),
  2328. {'source_url': url}), 'LimelightMedia', mobj.group('id'))
  2329. # Look for AdobeTVVideo embeds
  2330. mobj = re.search(
  2331. r'<iframe[^>]+src=[\'"]((?:https?:)?//video\.tv\.adobe\.com/v/\d+[^"]+)[\'"]',
  2332. webpage)
  2333. if mobj is not None:
  2334. return self.url_result(
  2335. self._proto_relative_url(unescapeHTML(mobj.group(1))),
  2336. 'AdobeTVVideo')
  2337. # Look for Vine embeds
  2338. mobj = re.search(
  2339. r'<iframe[^>]+src=[\'"]((?:https?:)?//(?:www\.)?vine\.co/v/[^/]+/embed/(?:simple|postcard))',
  2340. webpage)
  2341. if mobj is not None:
  2342. return self.url_result(
  2343. self._proto_relative_url(unescapeHTML(mobj.group(1))), 'Vine')
  2344. # Look for VODPlatform embeds
  2345. mobj = re.search(
  2346. r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?vod-platform\.net/[eE]mbed/.+?)\1',
  2347. webpage)
  2348. if mobj is not None:
  2349. return self.url_result(
  2350. self._proto_relative_url(unescapeHTML(mobj.group('url'))), 'VODPlatform')
  2351. # Look for Mangomolo embeds
  2352. mobj = re.search(
  2353. r'''(?x)<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?admin\.mangomolo\.com/analytics/index\.php/customers/embed/
  2354. (?:
  2355. video\?.*?\bid=(?P<video_id>\d+)|
  2356. index\?.*?\bchannelid=(?P<channel_id>(?:[A-Za-z0-9+/=]|%2B|%2F|%3D)+)
  2357. ).+?)\1''', webpage)
  2358. if mobj is not None:
  2359. info = {
  2360. '_type': 'url_transparent',
  2361. 'url': self._proto_relative_url(unescapeHTML(mobj.group('url'))),
  2362. 'title': video_title,
  2363. 'description': video_description,
  2364. 'thumbnail': video_thumbnail,
  2365. 'uploader': video_uploader,
  2366. }
  2367. video_id = mobj.group('video_id')
  2368. if video_id:
  2369. info.update({
  2370. 'ie_key': 'MangomoloVideo',
  2371. 'id': video_id,
  2372. })
  2373. else:
  2374. info.update({
  2375. 'ie_key': 'MangomoloLive',
  2376. 'id': mobj.group('channel_id'),
  2377. })
  2378. return info
  2379. # Look for Instagram embeds
  2380. instagram_embed_url = InstagramIE._extract_embed_url(webpage)
  2381. if instagram_embed_url is not None:
  2382. return self.url_result(
  2383. self._proto_relative_url(instagram_embed_url), InstagramIE.ie_key())
  2384. # Look for LiveLeak embeds
  2385. liveleak_url = LiveLeakIE._extract_url(webpage)
  2386. if liveleak_url:
  2387. return self.url_result(liveleak_url, 'LiveLeak')
  2388. # Look for 3Q SDN embeds
  2389. threeqsdn_url = ThreeQSDNIE._extract_url(webpage)
  2390. if threeqsdn_url:
  2391. return {
  2392. '_type': 'url_transparent',
  2393. 'ie_key': ThreeQSDNIE.ie_key(),
  2394. 'url': self._proto_relative_url(threeqsdn_url),
  2395. 'title': video_title,
  2396. 'description': video_description,
  2397. 'thumbnail': video_thumbnail,
  2398. 'uploader': video_uploader,
  2399. }
  2400. # Look for VBOX7 embeds
  2401. vbox7_url = Vbox7IE._extract_url(webpage)
  2402. if vbox7_url:
  2403. return self.url_result(vbox7_url, Vbox7IE.ie_key())
  2404. # Look for DBTV embeds
  2405. dbtv_urls = DBTVIE._extract_urls(webpage)
  2406. if dbtv_urls:
  2407. return self.playlist_from_matches(dbtv_urls, video_id, video_title, ie=DBTVIE.ie_key())
  2408. # Look for Videa embeds
  2409. videa_urls = VideaIE._extract_urls(webpage)
  2410. if videa_urls:
  2411. return self.playlist_from_matches(videa_urls, video_id, video_title, ie=VideaIE.ie_key())
  2412. # Look for 20 minuten embeds
  2413. twentymin_urls = TwentyMinutenIE._extract_urls(webpage)
  2414. if twentymin_urls:
  2415. return self.playlist_from_matches(
  2416. twentymin_urls, video_id, video_title, ie=TwentyMinutenIE.ie_key())
  2417. # Look for Openload embeds
  2418. openload_urls = OpenloadIE._extract_urls(webpage)
  2419. if openload_urls:
  2420. return self.playlist_from_matches(
  2421. openload_urls, video_id, video_title, ie=OpenloadIE.ie_key())
  2422. # Look for VideoPress embeds
  2423. videopress_urls = VideoPressIE._extract_urls(webpage)
  2424. if videopress_urls:
  2425. return self.playlist_from_matches(
  2426. videopress_urls, video_id, video_title, ie=VideoPressIE.ie_key())
  2427. # Look for Rutube embeds
  2428. rutube_urls = RutubeIE._extract_urls(webpage)
  2429. if rutube_urls:
  2430. return self.playlist_from_matches(
  2431. rutube_urls, ie=RutubeIE.ie_key())
  2432. # Looking for http://schema.org/VideoObject
  2433. json_ld = self._search_json_ld(
  2434. webpage, video_id, default={}, expected_type='VideoObject')
  2435. if json_ld.get('url'):
  2436. info_dict.update({
  2437. 'title': video_title or info_dict['title'],
  2438. 'description': video_description,
  2439. 'thumbnail': video_thumbnail,
  2440. 'age_limit': age_limit
  2441. })
  2442. info_dict.update(json_ld)
  2443. return info_dict
  2444. # Look for HTML5 media
  2445. entries = self._parse_html5_media_entries(url, webpage, video_id, m3u8_id='hls')
  2446. if entries:
  2447. for entry in entries:
  2448. entry.update({
  2449. 'id': video_id,
  2450. 'title': video_title,
  2451. })
  2452. self._sort_formats(entry['formats'])
  2453. return self.playlist_result(entries)
  2454. jwplayer_data = self._find_jwplayer_data(
  2455. webpage, video_id, transform_source=js_to_json)
  2456. if jwplayer_data:
  2457. info = self._parse_jwplayer_data(
  2458. jwplayer_data, video_id, require_title=False, base_url=url)
  2459. if not info.get('title'):
  2460. info['title'] = video_title
  2461. return info
  2462. def check_video(vurl):
  2463. if YoutubeIE.suitable(vurl):
  2464. return True
  2465. if RtmpIE.suitable(vurl):
  2466. return True
  2467. vpath = compat_urlparse.urlparse(vurl).path
  2468. vext = determine_ext(vpath)
  2469. return '.' in vpath and vext not in ('swf', 'png', 'jpg', 'srt', 'sbv', 'sub', 'vtt', 'ttml', 'js', 'xml')
  2470. def filter_video(urls):
  2471. return list(filter(check_video, urls))
  2472. # Start with something easy: JW Player in SWFObject
  2473. found = filter_video(re.findall(r'flashvars: [\'"](?:.*&)?file=(http[^\'"&]*)', webpage))
  2474. if not found:
  2475. # Look for gorilla-vid style embedding
  2476. found = filter_video(re.findall(r'''(?sx)
  2477. (?:
  2478. jw_plugins|
  2479. JWPlayerOptions|
  2480. jwplayer\s*\(\s*["'][^'"]+["']\s*\)\s*\.setup
  2481. )
  2482. .*?
  2483. ['"]?file['"]?\s*:\s*["\'](.*?)["\']''', webpage))
  2484. if not found:
  2485. # Broaden the search a little bit
  2486. found = filter_video(re.findall(r'[^A-Za-z0-9]?(?:file|source)=(http[^\'"&]*)', webpage))
  2487. if not found:
  2488. # Broaden the findall a little bit: JWPlayer JS loader
  2489. found = filter_video(re.findall(
  2490. r'[^A-Za-z0-9]?(?:file|video_url)["\']?:\s*["\'](http(?![^\'"]+\.[0-9]+[\'"])[^\'"]+)["\']', webpage))
  2491. if not found:
  2492. # Flow player
  2493. found = filter_video(re.findall(r'''(?xs)
  2494. flowplayer\("[^"]+",\s*
  2495. \{[^}]+?\}\s*,
  2496. \s*\{[^}]+? ["']?clip["']?\s*:\s*\{\s*
  2497. ["']?url["']?\s*:\s*["']([^"']+)["']
  2498. ''', webpage))
  2499. if not found:
  2500. # Cinerama player
  2501. found = re.findall(
  2502. r"cinerama\.embedPlayer\(\s*\'[^']+\',\s*'([^']+)'", webpage)
  2503. if not found:
  2504. # Try to find twitter cards info
  2505. # twitter:player:stream should be checked before twitter:player since
  2506. # it is expected to contain a raw stream (see
  2507. # https://dev.twitter.com/cards/types/player#On_twitter.com_via_desktop_browser)
  2508. found = filter_video(re.findall(
  2509. r'<meta (?:property|name)="twitter:player:stream" (?:content|value)="(.+?)"', webpage))
  2510. if not found:
  2511. # We look for Open Graph info:
  2512. # We have to match any number spaces between elements, some sites try to align them (eg.: statigr.am)
  2513. m_video_type = re.findall(r'<meta.*?property="og:video:type".*?content="video/(.*?)"', webpage)
  2514. # We only look in og:video if the MIME type is a video, don't try if it's a Flash player:
  2515. if m_video_type is not None:
  2516. found = filter_video(re.findall(r'<meta.*?property="og:video".*?content="(.*?)"', webpage))
  2517. if not found:
  2518. REDIRECT_REGEX = r'[0-9]{,2};\s*(?:URL|url)=\'?([^\'"]+)'
  2519. found = re.search(
  2520. r'(?i)<meta\s+(?=(?:[a-z-]+="[^"]+"\s+)*http-equiv="refresh")'
  2521. r'(?:[a-z-]+="[^"]+"\s+)*?content="%s' % REDIRECT_REGEX,
  2522. webpage)
  2523. if not found:
  2524. # Look also in Refresh HTTP header
  2525. refresh_header = head_response.headers.get('Refresh')
  2526. if refresh_header:
  2527. # In python 2 response HTTP headers are bytestrings
  2528. if sys.version_info < (3, 0) and isinstance(refresh_header, str):
  2529. refresh_header = refresh_header.decode('iso-8859-1')
  2530. found = re.search(REDIRECT_REGEX, refresh_header)
  2531. if found:
  2532. new_url = compat_urlparse.urljoin(url, unescapeHTML(found.group(1)))
  2533. if new_url != url:
  2534. self.report_following_redirect(new_url)
  2535. return {
  2536. '_type': 'url',
  2537. 'url': new_url,
  2538. }
  2539. else:
  2540. found = None
  2541. if not found:
  2542. # twitter:player is a https URL to iframe player that may or may not
  2543. # be supported by youtube-dl thus this is checked the very last (see
  2544. # https://dev.twitter.com/cards/types/player#On_twitter.com_via_desktop_browser)
  2545. embed_url = self._html_search_meta('twitter:player', webpage, default=None)
  2546. if embed_url:
  2547. return self.url_result(embed_url)
  2548. if not found:
  2549. raise UnsupportedError(url)
  2550. entries = []
  2551. for video_url in orderedSet(found):
  2552. video_url = unescapeHTML(video_url)
  2553. video_url = video_url.replace('\\/', '/')
  2554. video_url = compat_urlparse.urljoin(url, video_url)
  2555. video_id = compat_urllib_parse_unquote(os.path.basename(video_url))
  2556. # Sometimes, jwplayer extraction will result in a YouTube URL
  2557. if YoutubeIE.suitable(video_url):
  2558. entries.append(self.url_result(video_url, 'Youtube'))
  2559. continue
  2560. # here's a fun little line of code for you:
  2561. video_id = os.path.splitext(video_id)[0]
  2562. entry_info_dict = {
  2563. 'id': video_id,
  2564. 'uploader': video_uploader,
  2565. 'title': video_title,
  2566. 'age_limit': age_limit,
  2567. }
  2568. if RtmpIE.suitable(video_url):
  2569. entry_info_dict.update({
  2570. '_type': 'url_transparent',
  2571. 'ie_key': RtmpIE.ie_key(),
  2572. 'url': video_url,
  2573. })
  2574. entries.append(entry_info_dict)
  2575. continue
  2576. ext = determine_ext(video_url)
  2577. if ext == 'smil':
  2578. entry_info_dict['formats'] = self._extract_smil_formats(video_url, video_id)
  2579. elif ext == 'xspf':
  2580. return self.playlist_result(self._extract_xspf_playlist(video_url, video_id), video_id)
  2581. elif ext == 'm3u8':
  2582. entry_info_dict['formats'] = self._extract_m3u8_formats(video_url, video_id, ext='mp4')
  2583. elif ext == 'mpd':
  2584. entry_info_dict['formats'] = self._extract_mpd_formats(video_url, video_id)
  2585. elif ext == 'f4m':
  2586. entry_info_dict['formats'] = self._extract_f4m_formats(video_url, video_id)
  2587. elif re.search(r'(?i)\.(?:ism|smil)/manifest', video_url) and video_url != url:
  2588. # Just matching .ism/manifest is not enough to be reliably sure
  2589. # whether it's actually an ISM manifest or some other streaming
  2590. # manifest since there are various streaming URL formats
  2591. # possible (see [1]) as well as some other shenanigans like
  2592. # .smil/manifest URLs that actually serve an ISM (see [2]) and
  2593. # so on.
  2594. # Thus the most reasonable way to solve this is to delegate
  2595. # to generic extractor in order to look into the contents of
  2596. # the manifest itself.
  2597. # 1. https://azure.microsoft.com/en-us/documentation/articles/media-services-deliver-content-overview/#streaming-url-formats
  2598. # 2. https://svs.itworkscdn.net/lbcivod/smil:itwfcdn/lbci/170976.smil/Manifest
  2599. entry_info_dict = self.url_result(
  2600. smuggle_url(video_url, {'to_generic': True}),
  2601. GenericIE.ie_key())
  2602. else:
  2603. entry_info_dict['url'] = video_url
  2604. if entry_info_dict.get('formats'):
  2605. self._sort_formats(entry_info_dict['formats'])
  2606. entries.append(entry_info_dict)
  2607. if len(entries) == 1:
  2608. return entries[0]
  2609. else:
  2610. for num, e in enumerate(entries, start=1):
  2611. # 'url' results don't have a title
  2612. if e.get('title') is not None:
  2613. e['title'] = '%s (%d)' % (e['title'], num)
  2614. return {
  2615. '_type': 'playlist',
  2616. 'entries': entries,
  2617. }