generic.py 109 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719
  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. # Camtasia studio
  729. {
  730. 'url': 'http://www.ll.mit.edu/workshops/education/videocourses/antennas/lecture1/video/',
  731. 'playlist': [{
  732. 'md5': '0c5e352edabf715d762b0ad4e6d9ee67',
  733. 'info_dict': {
  734. 'id': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final',
  735. 'title': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final - video1',
  736. 'ext': 'flv',
  737. 'duration': 2235.90,
  738. }
  739. }, {
  740. 'md5': '10e4bb3aaca9fd630e273ff92d9f3c63',
  741. 'info_dict': {
  742. 'id': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final_PIP',
  743. 'title': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final - pip',
  744. 'ext': 'flv',
  745. 'duration': 2235.93,
  746. }
  747. }],
  748. 'info_dict': {
  749. 'title': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final',
  750. }
  751. },
  752. # Flowplayer
  753. {
  754. 'url': 'http://www.handjobhub.com/video/busty-blonde-siri-tit-fuck-while-wank-6313.html',
  755. 'md5': '9d65602bf31c6e20014319c7d07fba27',
  756. 'info_dict': {
  757. 'id': '5123ea6d5e5a7',
  758. 'ext': 'mp4',
  759. 'age_limit': 18,
  760. 'uploader': 'www.handjobhub.com',
  761. 'title': 'Busty Blonde Siri Tit Fuck While Wank at HandjobHub.com',
  762. }
  763. },
  764. # Multiple brightcove videos
  765. # https://github.com/rg3/youtube-dl/issues/2283
  766. {
  767. 'url': 'http://www.newyorker.com/online/blogs/newsdesk/2014/01/always-never-nuclear-command-and-control.html',
  768. 'info_dict': {
  769. 'id': 'always-never',
  770. 'title': 'Always / Never - The New Yorker',
  771. },
  772. 'playlist_count': 3,
  773. 'params': {
  774. 'extract_flat': False,
  775. 'skip_download': True,
  776. }
  777. },
  778. # MLB embed
  779. {
  780. 'url': 'http://umpire-empire.com/index.php/topic/58125-laz-decides-no-thats-low/',
  781. 'md5': '96f09a37e44da40dd083e12d9a683327',
  782. 'info_dict': {
  783. 'id': '33322633',
  784. 'ext': 'mp4',
  785. 'title': 'Ump changes call to ball',
  786. 'description': 'md5:71c11215384298a172a6dcb4c2e20685',
  787. 'duration': 48,
  788. 'timestamp': 1401537900,
  789. 'upload_date': '20140531',
  790. 'thumbnail': r're:^https?://.*\.jpg$',
  791. },
  792. },
  793. # Wistia embed
  794. {
  795. 'url': 'http://study.com/academy/lesson/north-american-exploration-failed-colonies-of-spain-france-england.html#lesson',
  796. 'md5': '1953f3a698ab51cfc948ed3992a0b7ff',
  797. 'info_dict': {
  798. 'id': '6e2wtrbdaf',
  799. 'ext': 'mov',
  800. 'title': 'paywall_north-american-exploration-failed-colonies-of-spain-france-england',
  801. 'description': 'a Paywall Videos video from Remilon',
  802. 'duration': 644.072,
  803. 'uploader': 'study.com',
  804. 'timestamp': 1459678540,
  805. 'upload_date': '20160403',
  806. 'filesize': 24687186,
  807. },
  808. },
  809. {
  810. 'url': 'http://thoughtworks.wistia.com/medias/uxjb0lwrcz',
  811. 'md5': 'baf49c2baa8a7de5f3fc145a8506dcd4',
  812. 'info_dict': {
  813. 'id': 'uxjb0lwrcz',
  814. 'ext': 'mp4',
  815. 'title': 'Conversation about Hexagonal Rails Part 1',
  816. 'description': 'a Martin Fowler video from ThoughtWorks',
  817. 'duration': 1715.0,
  818. 'uploader': 'thoughtworks.wistia.com',
  819. 'timestamp': 1401832161,
  820. 'upload_date': '20140603',
  821. },
  822. },
  823. # Wistia standard embed (async)
  824. {
  825. 'url': 'https://www.getdrip.com/university/brennan-dunn-drip-workshop/',
  826. 'info_dict': {
  827. 'id': '807fafadvk',
  828. 'ext': 'mp4',
  829. 'title': 'Drip Brennan Dunn Workshop',
  830. 'description': 'a JV Webinars video from getdrip-1',
  831. 'duration': 4986.95,
  832. 'timestamp': 1463607249,
  833. 'upload_date': '20160518',
  834. },
  835. 'params': {
  836. 'skip_download': True,
  837. }
  838. },
  839. # Soundcloud embed
  840. {
  841. 'url': 'http://nakedsecurity.sophos.com/2014/10/29/sscc-171-are-you-sure-that-1234-is-a-bad-password-podcast/',
  842. 'info_dict': {
  843. 'id': '174391317',
  844. 'ext': 'mp3',
  845. 'description': 'md5:ff867d6b555488ad3c52572bb33d432c',
  846. 'uploader': 'Sophos Security',
  847. 'title': 'Chet Chat 171 - Oct 29, 2014',
  848. 'upload_date': '20141029',
  849. }
  850. },
  851. # Soundcloud multiple embeds
  852. {
  853. 'url': 'http://www.guitarplayer.com/lessons/1014/legato-workout-one-hour-to-more-fluid-performance---tab/52809',
  854. 'info_dict': {
  855. 'id': '52809',
  856. 'title': 'Guitar Essentials: Legato Workout—One-Hour to Fluid Performance | TAB + AUDIO',
  857. },
  858. 'playlist_mincount': 7,
  859. },
  860. # TuneIn station embed
  861. {
  862. 'url': 'http://radiocnrv.com/promouvoir-radio-cnrv/',
  863. 'info_dict': {
  864. 'id': '204146',
  865. 'ext': 'mp3',
  866. 'title': 'CNRV',
  867. 'location': 'Paris, France',
  868. 'is_live': True,
  869. },
  870. 'params': {
  871. # Live stream
  872. 'skip_download': True,
  873. },
  874. },
  875. # Livestream embed
  876. {
  877. 'url': 'http://www.esa.int/Our_Activities/Space_Science/Rosetta/Philae_comet_touch-down_webcast',
  878. 'info_dict': {
  879. 'id': '67864563',
  880. 'ext': 'flv',
  881. 'upload_date': '20141112',
  882. 'title': 'Rosetta #CometLanding webcast HL 10',
  883. }
  884. },
  885. # Another Livestream embed, without 'new.' in URL
  886. {
  887. 'url': 'https://www.freespeech.org/',
  888. 'info_dict': {
  889. 'id': '123537347',
  890. 'ext': 'mp4',
  891. 'title': 're:^FSTV [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
  892. },
  893. 'params': {
  894. # Live stream
  895. 'skip_download': True,
  896. },
  897. },
  898. # LazyYT
  899. {
  900. 'url': 'http://discourse.ubuntu.com/t/unity-8-desktop-mode-windows-on-mir/1986',
  901. 'info_dict': {
  902. 'id': '1986',
  903. 'title': 'Unity 8 desktop-mode windows on Mir! - Ubuntu Discourse',
  904. },
  905. 'playlist_mincount': 2,
  906. },
  907. # Cinchcast embed
  908. {
  909. 'url': 'http://undergroundwellness.com/podcasts/306-5-steps-to-permanent-gut-healing/',
  910. 'info_dict': {
  911. 'id': '7141703',
  912. 'ext': 'mp3',
  913. 'upload_date': '20141126',
  914. 'title': 'Jack Tips: 5 Steps to Permanent Gut Healing',
  915. }
  916. },
  917. # Cinerama player
  918. {
  919. 'url': 'http://www.abc.net.au/7.30/content/2015/s4164797.htm',
  920. 'info_dict': {
  921. 'id': '730m_DandD_1901_512k',
  922. 'ext': 'mp4',
  923. 'uploader': 'www.abc.net.au',
  924. 'title': 'Game of Thrones with dice - Dungeons and Dragons fantasy role-playing game gets new life - 19/01/2015',
  925. }
  926. },
  927. # embedded viddler video
  928. {
  929. 'url': 'http://deadspin.com/i-cant-stop-watching-john-wall-chop-the-nuggets-with-th-1681801597',
  930. 'info_dict': {
  931. 'id': '4d03aad9',
  932. 'ext': 'mp4',
  933. 'uploader': 'deadspin',
  934. 'title': 'WALL-TO-GORTAT',
  935. 'timestamp': 1422285291,
  936. 'upload_date': '20150126',
  937. },
  938. 'add_ie': ['Viddler'],
  939. },
  940. # Libsyn embed
  941. {
  942. 'url': 'http://thedailyshow.cc.com/podcast/episodetwelve',
  943. 'info_dict': {
  944. 'id': '3377616',
  945. 'ext': 'mp3',
  946. 'title': "The Daily Show Podcast without Jon Stewart - Episode 12: Bassem Youssef: Egypt's Jon Stewart",
  947. 'description': 'md5:601cb790edd05908957dae8aaa866465',
  948. 'upload_date': '20150220',
  949. },
  950. 'skip': 'All The Daily Show URLs now redirect to http://www.cc.com/shows/',
  951. },
  952. # jwplayer YouTube
  953. {
  954. 'url': 'http://media.nationalarchives.gov.uk/index.php/webinar-using-discovery-national-archives-online-catalogue/',
  955. 'info_dict': {
  956. 'id': 'Mrj4DVp2zeA',
  957. 'ext': 'mp4',
  958. 'upload_date': '20150212',
  959. 'uploader': 'The National Archives UK',
  960. 'description': 'md5:a236581cd2449dd2df4f93412f3f01c6',
  961. 'uploader_id': 'NationalArchives08',
  962. 'title': 'Webinar: Using Discovery, The National Archives’ online catalogue',
  963. },
  964. },
  965. # jwplayer rtmp
  966. {
  967. 'url': 'http://www.suffolk.edu/sjc/',
  968. 'info_dict': {
  969. 'id': 'sjclive',
  970. 'ext': 'flv',
  971. 'title': 'Massachusetts Supreme Judicial Court Oral Arguments',
  972. 'uploader': 'www.suffolk.edu',
  973. },
  974. 'params': {
  975. 'skip_download': True,
  976. }
  977. },
  978. # Complex jwplayer
  979. {
  980. 'url': 'http://www.indiedb.com/games/king-machine/videos',
  981. 'info_dict': {
  982. 'id': 'videos',
  983. 'ext': 'mp4',
  984. 'title': 'king machine trailer 1',
  985. 'thumbnail': r're:^https?://.*\.jpg$',
  986. },
  987. },
  988. # rtl.nl embed
  989. {
  990. 'url': 'http://www.rtlnieuws.nl/nieuws/buitenland/aanslagen-kopenhagen',
  991. 'playlist_mincount': 5,
  992. 'info_dict': {
  993. 'id': 'aanslagen-kopenhagen',
  994. 'title': 'Aanslagen Kopenhagen | RTL Nieuws',
  995. }
  996. },
  997. # Zapiks embed
  998. {
  999. 'url': 'http://www.skipass.com/news/116090-bon-appetit-s5ep3-baqueira-mi-cor.html',
  1000. 'info_dict': {
  1001. 'id': '118046',
  1002. 'ext': 'mp4',
  1003. 'title': 'EP3S5 - Bon Appétit - Baqueira Mi Corazon !',
  1004. }
  1005. },
  1006. # Kaltura embed (different embed code)
  1007. {
  1008. 'url': 'http://www.premierchristianradio.com/Shows/Saturday/Unbelievable/Conference-Videos/Os-Guinness-Is-It-Fools-Talk-Unbelievable-Conference-2014',
  1009. 'info_dict': {
  1010. 'id': '1_a52wc67y',
  1011. 'ext': 'flv',
  1012. 'upload_date': '20150127',
  1013. 'uploader_id': 'PremierMedia',
  1014. 'timestamp': int,
  1015. 'title': 'Os Guinness // Is It Fools Talk? // Unbelievable? Conference 2014',
  1016. },
  1017. },
  1018. # Kaltura embed with single quotes
  1019. {
  1020. 'url': 'http://fod.infobase.com/p_ViewPlaylist.aspx?AssignmentID=NUN8ZY',
  1021. 'info_dict': {
  1022. 'id': '0_izeg5utt',
  1023. 'ext': 'mp4',
  1024. 'title': '35871',
  1025. 'timestamp': 1355743100,
  1026. 'upload_date': '20121217',
  1027. 'uploader_id': 'batchUser',
  1028. },
  1029. 'add_ie': ['Kaltura'],
  1030. },
  1031. {
  1032. # Kaltura embedded via quoted entry_id
  1033. 'url': 'https://www.oreilly.com/ideas/my-cloud-makes-pretty-pictures',
  1034. 'info_dict': {
  1035. 'id': '0_utuok90b',
  1036. 'ext': 'mp4',
  1037. 'title': '06_matthew_brender_raj_dutt',
  1038. 'timestamp': 1466638791,
  1039. 'upload_date': '20160622',
  1040. },
  1041. 'add_ie': ['Kaltura'],
  1042. 'expected_warnings': [
  1043. 'Could not send HEAD request'
  1044. ],
  1045. 'params': {
  1046. 'skip_download': True,
  1047. }
  1048. },
  1049. {
  1050. # Kaltura embedded, some fileExt broken (#11480)
  1051. 'url': 'http://www.cornell.edu/video/nima-arkani-hamed-standard-models-of-particle-physics',
  1052. 'info_dict': {
  1053. 'id': '1_sgtvehim',
  1054. 'ext': 'mp4',
  1055. 'title': 'Our "Standard Models" of particle physics and cosmology',
  1056. 'description': 'md5:67ea74807b8c4fea92a6f38d6d323861',
  1057. 'timestamp': 1321158993,
  1058. 'upload_date': '20111113',
  1059. 'uploader_id': 'kps1',
  1060. },
  1061. 'add_ie': ['Kaltura'],
  1062. },
  1063. # Eagle.Platform embed (generic URL)
  1064. {
  1065. 'url': 'http://lenta.ru/news/2015/03/06/navalny/',
  1066. # Not checking MD5 as sometimes the direct HTTP link results in 404 and HLS is used
  1067. 'info_dict': {
  1068. 'id': '227304',
  1069. 'ext': 'mp4',
  1070. 'title': 'Навальный вышел на свободу',
  1071. 'description': 'md5:d97861ac9ae77377f3f20eaf9d04b4f5',
  1072. 'thumbnail': r're:^https?://.*\.jpg$',
  1073. 'duration': 87,
  1074. 'view_count': int,
  1075. 'age_limit': 0,
  1076. },
  1077. },
  1078. # ClipYou (Eagle.Platform) embed (custom URL)
  1079. {
  1080. 'url': 'http://muz-tv.ru/play/7129/',
  1081. # Not checking MD5 as sometimes the direct HTTP link results in 404 and HLS is used
  1082. 'info_dict': {
  1083. 'id': '12820',
  1084. 'ext': 'mp4',
  1085. 'title': "'O Sole Mio",
  1086. 'thumbnail': r're:^https?://.*\.jpg$',
  1087. 'duration': 216,
  1088. 'view_count': int,
  1089. },
  1090. },
  1091. # Pladform embed
  1092. {
  1093. 'url': 'http://muz-tv.ru/kinozal/view/7400/',
  1094. 'info_dict': {
  1095. 'id': '100183293',
  1096. 'ext': 'mp4',
  1097. 'title': 'Тайны перевала Дятлова • 1 серия 2 часть',
  1098. 'description': 'Документальный сериал-расследование одной из самых жутких тайн ХХ века',
  1099. 'thumbnail': r're:^https?://.*\.jpg$',
  1100. 'duration': 694,
  1101. 'age_limit': 0,
  1102. },
  1103. },
  1104. # Playwire embed
  1105. {
  1106. 'url': 'http://www.cinemablend.com/new/First-Joe-Dirt-2-Trailer-Teaser-Stupid-Greatness-70874.html',
  1107. 'info_dict': {
  1108. 'id': '3519514',
  1109. 'ext': 'mp4',
  1110. 'title': 'Joe Dirt 2 Beautiful Loser Teaser Trailer',
  1111. 'thumbnail': r're:^https?://.*\.png$',
  1112. 'duration': 45.115,
  1113. },
  1114. },
  1115. # 5min embed
  1116. {
  1117. 'url': 'http://techcrunch.com/video/facebook-creates-on-this-day-crunch-report/518726732/',
  1118. 'md5': '4c6f127a30736b59b3e2c19234ee2bf7',
  1119. 'info_dict': {
  1120. 'id': '518726732',
  1121. 'ext': 'mp4',
  1122. 'title': 'Facebook Creates "On This Day" | Crunch Report',
  1123. },
  1124. },
  1125. # SVT embed
  1126. {
  1127. 'url': 'http://www.svt.se/sport/ishockey/jagr-tacklar-giroux-under-intervjun',
  1128. 'info_dict': {
  1129. 'id': '2900353',
  1130. 'ext': 'flv',
  1131. 'title': 'Här trycker Jagr till Giroux (under SVT-intervjun)',
  1132. 'duration': 27,
  1133. 'age_limit': 0,
  1134. },
  1135. },
  1136. # Crooks and Liars embed
  1137. {
  1138. 'url': 'http://crooksandliars.com/2015/04/fox-friends-says-protecting-atheists',
  1139. 'info_dict': {
  1140. 'id': '8RUoRhRi',
  1141. 'ext': 'mp4',
  1142. 'title': "Fox & Friends Says Protecting Atheists From Discrimination Is Anti-Christian!",
  1143. 'description': 'md5:e1a46ad1650e3a5ec7196d432799127f',
  1144. 'timestamp': 1428207000,
  1145. 'upload_date': '20150405',
  1146. 'uploader': 'Heather',
  1147. },
  1148. },
  1149. # Crooks and Liars external embed
  1150. {
  1151. 'url': 'http://theothermccain.com/2010/02/02/video-proves-that-bill-kristol-has-been-watching-glenn-beck/comment-page-1/',
  1152. 'info_dict': {
  1153. 'id': 'MTE3MjUtMzQ2MzA',
  1154. 'ext': 'mp4',
  1155. 'title': 'md5:5e3662a81a4014d24c250d76d41a08d5',
  1156. 'description': 'md5:9b8e9542d6c3c5de42d6451b7d780cec',
  1157. 'timestamp': 1265032391,
  1158. 'upload_date': '20100201',
  1159. 'uploader': 'Heather',
  1160. },
  1161. },
  1162. # NBC Sports vplayer embed
  1163. {
  1164. 'url': 'http://www.riderfans.com/forum/showthread.php?121827-Freeman&s=e98fa1ea6dc08e886b1678d35212494a',
  1165. 'info_dict': {
  1166. 'id': 'ln7x1qSThw4k',
  1167. 'ext': 'flv',
  1168. 'title': "PFT Live: New leader in the 'new-look' defense",
  1169. 'description': 'md5:65a19b4bbfb3b0c0c5768bed1dfad74e',
  1170. 'uploader': 'NBCU-SPORTS',
  1171. 'upload_date': '20140107',
  1172. 'timestamp': 1389118457,
  1173. },
  1174. },
  1175. # NBC News embed
  1176. {
  1177. 'url': 'http://www.vulture.com/2016/06/letterman-couldnt-care-less-about-late-night.html',
  1178. 'md5': '1aa589c675898ae6d37a17913cf68d66',
  1179. 'info_dict': {
  1180. 'id': '701714499682',
  1181. 'ext': 'mp4',
  1182. 'title': 'PREVIEW: On Assignment: David Letterman',
  1183. '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.',
  1184. },
  1185. },
  1186. # UDN embed
  1187. {
  1188. 'url': 'https://video.udn.com/news/300346',
  1189. 'md5': 'fd2060e988c326991037b9aff9df21a6',
  1190. 'info_dict': {
  1191. 'id': '300346',
  1192. 'ext': 'mp4',
  1193. 'title': '中一中男師變性 全校師生力挺',
  1194. 'thumbnail': r're:^https?://.*\.jpg$',
  1195. },
  1196. 'params': {
  1197. # m3u8 download
  1198. 'skip_download': True,
  1199. },
  1200. },
  1201. # Ooyala embed
  1202. {
  1203. 'url': 'http://www.businessinsider.com/excel-index-match-vlookup-video-how-to-2015-2?IR=T',
  1204. 'info_dict': {
  1205. 'id': '50YnY4czr4ms1vJ7yz3xzq0excz_pUMs',
  1206. 'ext': 'mp4',
  1207. 'description': 'VIDEO: INDEX/MATCH versus VLOOKUP.',
  1208. 'title': 'This is what separates the Excel masters from the wannabes',
  1209. 'duration': 191.933,
  1210. },
  1211. 'params': {
  1212. # m3u8 downloads
  1213. 'skip_download': True,
  1214. }
  1215. },
  1216. # Brightcove URL in single quotes
  1217. {
  1218. 'url': 'http://www.sportsnet.ca/baseball/mlb/sn-presents-russell-martin-world-citizen/',
  1219. 'md5': '4ae374f1f8b91c889c4b9203c8c752af',
  1220. 'info_dict': {
  1221. 'id': '4255764656001',
  1222. 'ext': 'mp4',
  1223. 'title': 'SN Presents: Russell Martin, World Citizen',
  1224. '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.',
  1225. 'uploader': 'Rogers Sportsnet',
  1226. 'uploader_id': '1704050871',
  1227. 'upload_date': '20150525',
  1228. 'timestamp': 1432570283,
  1229. },
  1230. },
  1231. # Dailymotion Cloud video
  1232. {
  1233. 'url': 'http://replay.publicsenat.fr/vod/le-debat/florent-kolandjian,dominique-cena,axel-decourtye,laurence-abeille,bruno-parmentier/175910',
  1234. 'md5': 'dcaf23ad0c67a256f4278bce6e0bae38',
  1235. 'info_dict': {
  1236. 'id': 'x2uy8t3',
  1237. 'ext': 'mp4',
  1238. 'title': 'Sauvons les abeilles ! - Le débat',
  1239. 'description': 'md5:d9082128b1c5277987825d684939ca26',
  1240. 'thumbnail': r're:^https?://.*\.jpe?g$',
  1241. 'timestamp': 1434970506,
  1242. 'upload_date': '20150622',
  1243. 'uploader': 'Public Sénat',
  1244. 'uploader_id': 'xa9gza',
  1245. }
  1246. },
  1247. # OnionStudios embed
  1248. {
  1249. 'url': 'http://www.clickhole.com/video/dont-understand-bitcoin-man-will-mumble-explanatio-2537',
  1250. 'info_dict': {
  1251. 'id': '2855',
  1252. 'ext': 'mp4',
  1253. 'title': 'Don’t Understand Bitcoin? This Man Will Mumble An Explanation At You',
  1254. 'thumbnail': r're:^https?://.*\.jpe?g$',
  1255. 'uploader': 'ClickHole',
  1256. 'uploader_id': 'clickhole',
  1257. }
  1258. },
  1259. # SnagFilms embed
  1260. {
  1261. 'url': 'http://whilewewatch.blogspot.ru/2012/06/whilewewatch-whilewewatch-gripping.html',
  1262. 'info_dict': {
  1263. 'id': '74849a00-85a9-11e1-9660-123139220831',
  1264. 'ext': 'mp4',
  1265. 'title': '#whilewewatch',
  1266. }
  1267. },
  1268. # AdobeTVVideo embed
  1269. {
  1270. 'url': 'https://helpx.adobe.com/acrobat/how-to/new-experience-acrobat-dc.html?set=acrobat--get-started--essential-beginners',
  1271. 'md5': '43662b577c018ad707a63766462b1e87',
  1272. 'info_dict': {
  1273. 'id': '2456',
  1274. 'ext': 'mp4',
  1275. 'title': 'New experience with Acrobat DC',
  1276. 'description': 'New experience with Acrobat DC',
  1277. 'duration': 248.667,
  1278. },
  1279. },
  1280. # BrightcoveInPageEmbed embed
  1281. {
  1282. 'url': 'http://www.geekandsundry.com/tabletop-bonus-wils-final-thoughts-on-dread/',
  1283. 'info_dict': {
  1284. 'id': '4238694884001',
  1285. 'ext': 'flv',
  1286. 'title': 'Tabletop: Dread, Last Thoughts',
  1287. 'description': 'Tabletop: Dread, Last Thoughts',
  1288. 'duration': 51690,
  1289. },
  1290. },
  1291. # Brightcove embed, with no valid 'renditions' but valid 'IOSRenditions'
  1292. # This video can't be played in browsers if Flash disabled and UA set to iPhone, which is actually a false alarm
  1293. {
  1294. 'url': 'https://dl.dropboxusercontent.com/u/29092637/interview.html',
  1295. 'info_dict': {
  1296. 'id': '4785848093001',
  1297. 'ext': 'mp4',
  1298. 'title': 'The Cardinal Pell Interview',
  1299. 'description': 'Sky News Contributor Andrew Bolt interviews George Pell in Rome, following the Cardinal\'s evidence before the Royal Commission into Child Abuse. ',
  1300. 'uploader': 'GlobeCast Australia - GlobeStream',
  1301. 'uploader_id': '2733773828001',
  1302. 'upload_date': '20160304',
  1303. 'timestamp': 1457083087,
  1304. },
  1305. 'params': {
  1306. # m3u8 downloads
  1307. 'skip_download': True,
  1308. },
  1309. },
  1310. # Another form of arte.tv embed
  1311. {
  1312. 'url': 'http://www.tv-replay.fr/redirection/09-04-16/arte-reportage-arte-11508975.html',
  1313. 'md5': '850bfe45417ddf221288c88a0cffe2e2',
  1314. 'info_dict': {
  1315. 'id': '030273-562_PLUS7-F',
  1316. 'ext': 'mp4',
  1317. 'title': 'ARTE Reportage - Nulle part, en France',
  1318. 'description': 'md5:e3a0e8868ed7303ed509b9e3af2b870d',
  1319. 'upload_date': '20160409',
  1320. },
  1321. },
  1322. # LiveLeak embed
  1323. {
  1324. 'url': 'http://www.wykop.pl/link/3088787/',
  1325. 'md5': 'ace83b9ed19b21f68e1b50e844fdf95d',
  1326. 'info_dict': {
  1327. 'id': '874_1459135191',
  1328. 'ext': 'mp4',
  1329. 'title': 'Man shows poor quality of new apartment building',
  1330. 'description': 'The wall is like a sand pile.',
  1331. 'uploader': 'Lake8737',
  1332. }
  1333. },
  1334. # Duplicated embedded video URLs
  1335. {
  1336. 'url': 'http://www.hudl.com/athlete/2538180/highlights/149298443',
  1337. 'info_dict': {
  1338. 'id': '149298443_480_16c25b74_2',
  1339. 'ext': 'mp4',
  1340. 'title': 'vs. Blue Orange Spring Game',
  1341. 'uploader': 'www.hudl.com',
  1342. },
  1343. },
  1344. # twitter:player:stream embed
  1345. {
  1346. 'url': 'http://www.rtl.be/info/video/589263.aspx?CategoryID=288',
  1347. 'info_dict': {
  1348. 'id': 'master',
  1349. 'ext': 'mp4',
  1350. 'title': 'Une nouvelle espèce de dinosaure découverte en Argentine',
  1351. 'uploader': 'www.rtl.be',
  1352. },
  1353. 'params': {
  1354. # m3u8 downloads
  1355. 'skip_download': True,
  1356. },
  1357. },
  1358. # twitter:player embed
  1359. {
  1360. 'url': 'http://www.theatlantic.com/video/index/484130/what-do-black-holes-sound-like/',
  1361. 'md5': 'a3e0df96369831de324f0778e126653c',
  1362. 'info_dict': {
  1363. 'id': '4909620399001',
  1364. 'ext': 'mp4',
  1365. 'title': 'What Do Black Holes Sound Like?',
  1366. 'description': 'what do black holes sound like',
  1367. 'upload_date': '20160524',
  1368. 'uploader_id': '29913724001',
  1369. 'timestamp': 1464107587,
  1370. 'uploader': 'TheAtlantic',
  1371. },
  1372. 'add_ie': ['BrightcoveLegacy'],
  1373. },
  1374. # Facebook <iframe> embed
  1375. {
  1376. 'url': 'https://www.hostblogger.de/blog/archives/6181-Auto-jagt-Betonmischer.html',
  1377. 'md5': 'fbcde74f534176ecb015849146dd3aee',
  1378. 'info_dict': {
  1379. 'id': '599637780109885',
  1380. 'ext': 'mp4',
  1381. 'title': 'Facebook video #599637780109885',
  1382. },
  1383. },
  1384. # Facebook API embed
  1385. {
  1386. 'url': 'http://www.lothype.com/blue-stars-2016-preview-standstill-full-show/',
  1387. 'md5': 'a47372ee61b39a7b90287094d447d94e',
  1388. 'info_dict': {
  1389. 'id': '10153467542406923',
  1390. 'ext': 'mp4',
  1391. 'title': 'Facebook video #10153467542406923',
  1392. },
  1393. },
  1394. # Wordpress "YouTube Video Importer" plugin
  1395. {
  1396. 'url': 'http://www.lothype.com/blue-devils-drumline-stanford-lot-2016/',
  1397. 'md5': 'd16797741b560b485194eddda8121b48',
  1398. 'info_dict': {
  1399. 'id': 'HNTXWDXV9Is',
  1400. 'ext': 'mp4',
  1401. 'title': 'Blue Devils Drumline Stanford lot 2016',
  1402. 'upload_date': '20160627',
  1403. 'uploader_id': 'GENOCIDE8GENERAL10',
  1404. 'uploader': 'cylus cyrus',
  1405. },
  1406. },
  1407. {
  1408. # video stored on custom kaltura server
  1409. 'url': 'http://www.expansion.com/multimedia/videos.html?media=EQcM30NHIPv',
  1410. 'md5': '537617d06e64dfed891fa1593c4b30cc',
  1411. 'info_dict': {
  1412. 'id': '0_1iotm5bh',
  1413. 'ext': 'mp4',
  1414. 'title': 'Elecciones británicas: 5 lecciones para Rajoy',
  1415. 'description': 'md5:435a89d68b9760b92ce67ed227055f16',
  1416. 'uploader_id': 'videos.expansion@el-mundo.net',
  1417. 'upload_date': '20150429',
  1418. 'timestamp': 1430303472,
  1419. },
  1420. 'add_ie': ['Kaltura'],
  1421. },
  1422. {
  1423. # Non-standard Vimeo embed
  1424. 'url': 'https://openclassrooms.com/courses/understanding-the-web',
  1425. 'md5': '64d86f1c7d369afd9a78b38cbb88d80a',
  1426. 'info_dict': {
  1427. 'id': '148867247',
  1428. 'ext': 'mp4',
  1429. 'title': 'Understanding the web - Teaser',
  1430. 'description': 'This is "Understanding the web - Teaser" by openclassrooms on Vimeo, the home for high quality videos and the people who love them.',
  1431. 'upload_date': '20151214',
  1432. 'uploader': 'OpenClassrooms',
  1433. 'uploader_id': 'openclassrooms',
  1434. },
  1435. 'add_ie': ['Vimeo'],
  1436. },
  1437. {
  1438. # generic vimeo embed that requires original URL passed as Referer
  1439. 'url': 'http://racing4everyone.eu/2016/07/30/formula-1-2016-round12-germany/',
  1440. 'only_matching': True,
  1441. },
  1442. {
  1443. 'url': 'https://support.arkena.com/display/PLAY/Ways+to+embed+your+video',
  1444. 'md5': 'b96f2f71b359a8ecd05ce4e1daa72365',
  1445. 'info_dict': {
  1446. 'id': 'b41dda37-d8e7-4d3f-b1b5-9a9db578bdfe',
  1447. 'ext': 'mp4',
  1448. 'title': 'Big Buck Bunny',
  1449. 'description': 'Royalty free test video',
  1450. 'timestamp': 1432816365,
  1451. 'upload_date': '20150528',
  1452. 'is_live': False,
  1453. },
  1454. 'params': {
  1455. 'skip_download': True,
  1456. },
  1457. 'add_ie': [ArkenaIE.ie_key()],
  1458. },
  1459. {
  1460. '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/',
  1461. 'info_dict': {
  1462. 'id': '1c7141f46c',
  1463. 'ext': 'mp4',
  1464. 'title': 'НА КОСЪМ ОТ ВЗРИВ: Изтичане на газ на бензиностанция в Пловдив',
  1465. },
  1466. 'params': {
  1467. 'skip_download': True,
  1468. },
  1469. 'add_ie': [Vbox7IE.ie_key()],
  1470. },
  1471. {
  1472. # DBTV embeds
  1473. 'url': 'http://www.dagbladet.no/2016/02/23/nyheter/nordlys/ski/troms/ver/43254897/',
  1474. 'info_dict': {
  1475. 'id': '43254897',
  1476. 'title': 'Etter ett års planlegging, klaffet endelig alt: - Jeg måtte ta en liten dans',
  1477. },
  1478. 'playlist_mincount': 3,
  1479. },
  1480. {
  1481. # Videa embeds
  1482. 'url': 'http://forum.dvdtalk.com/movie-talk/623756-deleted-magic-star-wars-ot-deleted-alt-scenes-docu-style.html',
  1483. 'info_dict': {
  1484. 'id': '623756-deleted-magic-star-wars-ot-deleted-alt-scenes-docu-style',
  1485. 'title': 'Deleted Magic - Star Wars: OT Deleted / Alt. Scenes Docu. Style - DVD Talk Forum',
  1486. },
  1487. 'playlist_mincount': 2,
  1488. },
  1489. {
  1490. # 20 minuten embed
  1491. 'url': 'http://www.20min.ch/schweiz/news/story/So-kommen-Sie-bei-Eis-und-Schnee-sicher-an-27032552',
  1492. 'info_dict': {
  1493. 'id': '523629',
  1494. 'ext': 'mp4',
  1495. 'title': 'So kommen Sie bei Eis und Schnee sicher an',
  1496. 'description': 'md5:117c212f64b25e3d95747e5276863f7d',
  1497. },
  1498. 'params': {
  1499. 'skip_download': True,
  1500. },
  1501. 'add_ie': [TwentyMinutenIE.ie_key()],
  1502. },
  1503. {
  1504. # VideoPress embed
  1505. 'url': 'https://en.support.wordpress.com/videopress/',
  1506. 'info_dict': {
  1507. 'id': 'OcobLTqC',
  1508. 'ext': 'm4v',
  1509. 'title': 'IMG_5786',
  1510. 'timestamp': 1435711927,
  1511. 'upload_date': '20150701',
  1512. },
  1513. 'params': {
  1514. 'skip_download': True,
  1515. },
  1516. 'add_ie': [VideoPressIE.ie_key()],
  1517. },
  1518. {
  1519. # Rutube embed
  1520. 'url': 'http://magazzino.friday.ru/videos/vipuski/kazan-2',
  1521. 'info_dict': {
  1522. 'id': '9b3d5bee0a8740bf70dfd29d3ea43541',
  1523. 'ext': 'flv',
  1524. 'title': 'Магаззино: Казань 2',
  1525. 'description': 'md5:99bccdfac2269f0e8fdbc4bbc9db184a',
  1526. 'uploader': 'Магаззино',
  1527. 'upload_date': '20170228',
  1528. 'uploader_id': '996642',
  1529. },
  1530. 'params': {
  1531. 'skip_download': True,
  1532. },
  1533. 'add_ie': [RutubeIE.ie_key()],
  1534. },
  1535. {
  1536. # ThePlatform embedded with whitespaces in URLs
  1537. 'url': 'http://www.golfchannel.com/topics/shows/golftalkcentral.htm',
  1538. 'only_matching': True,
  1539. },
  1540. # {
  1541. # # TODO: find another test
  1542. # # http://schema.org/VideoObject
  1543. # 'url': 'https://flipagram.com/f/nyvTSJMKId',
  1544. # 'md5': '888dcf08b7ea671381f00fab74692755',
  1545. # 'info_dict': {
  1546. # 'id': 'nyvTSJMKId',
  1547. # 'ext': 'mp4',
  1548. # 'title': 'Flipagram by sjuria101 featuring Midnight Memories by One Direction',
  1549. # 'description': '#love for cats.',
  1550. # 'timestamp': 1461244995,
  1551. # 'upload_date': '20160421',
  1552. # },
  1553. # 'params': {
  1554. # 'force_generic_extractor': True,
  1555. # },
  1556. # }
  1557. ]
  1558. def report_following_redirect(self, new_url):
  1559. """Report information extraction."""
  1560. self._downloader.to_screen('[redirect] Following redirect to %s' % new_url)
  1561. def _extract_rss(self, url, video_id, doc):
  1562. playlist_title = doc.find('./channel/title').text
  1563. playlist_desc_el = doc.find('./channel/description')
  1564. playlist_desc = None if playlist_desc_el is None else playlist_desc_el.text
  1565. entries = []
  1566. for it in doc.findall('./channel/item'):
  1567. next_url = xpath_text(it, 'link', fatal=False)
  1568. if not next_url:
  1569. enclosure_nodes = it.findall('./enclosure')
  1570. for e in enclosure_nodes:
  1571. next_url = e.attrib.get('url')
  1572. if next_url:
  1573. break
  1574. if not next_url:
  1575. continue
  1576. entries.append({
  1577. '_type': 'url',
  1578. 'url': next_url,
  1579. 'title': it.find('title').text,
  1580. })
  1581. return {
  1582. '_type': 'playlist',
  1583. 'id': url,
  1584. 'title': playlist_title,
  1585. 'description': playlist_desc,
  1586. 'entries': entries,
  1587. }
  1588. def _extract_camtasia(self, url, video_id, webpage):
  1589. """ Returns None if no camtasia video can be found. """
  1590. camtasia_cfg = self._search_regex(
  1591. r'fo\.addVariable\(\s*"csConfigFile",\s*"([^"]+)"\s*\);',
  1592. webpage, 'camtasia configuration file', default=None)
  1593. if camtasia_cfg is None:
  1594. return None
  1595. title = self._html_search_meta('DC.title', webpage, fatal=True)
  1596. camtasia_url = compat_urlparse.urljoin(url, camtasia_cfg)
  1597. camtasia_cfg = self._download_xml(
  1598. camtasia_url, video_id,
  1599. note='Downloading camtasia configuration',
  1600. errnote='Failed to download camtasia configuration')
  1601. fileset_node = camtasia_cfg.find('./playlist/array/fileset')
  1602. entries = []
  1603. for n in fileset_node.getchildren():
  1604. url_n = n.find('./uri')
  1605. if url_n is None:
  1606. continue
  1607. entries.append({
  1608. 'id': os.path.splitext(url_n.text.rpartition('/')[2])[0],
  1609. 'title': '%s - %s' % (title, n.tag),
  1610. 'url': compat_urlparse.urljoin(url, url_n.text),
  1611. 'duration': float_or_none(n.find('./duration').text),
  1612. })
  1613. return {
  1614. '_type': 'playlist',
  1615. 'entries': entries,
  1616. 'title': title,
  1617. }
  1618. def _real_extract(self, url):
  1619. if url.startswith('//'):
  1620. return {
  1621. '_type': 'url',
  1622. 'url': self.http_scheme() + url,
  1623. }
  1624. parsed_url = compat_urlparse.urlparse(url)
  1625. if not parsed_url.scheme:
  1626. default_search = self._downloader.params.get('default_search')
  1627. if default_search is None:
  1628. default_search = 'fixup_error'
  1629. if default_search in ('auto', 'auto_warning', 'fixup_error'):
  1630. if '/' in url:
  1631. self._downloader.report_warning('The url doesn\'t specify the protocol, trying with http')
  1632. return self.url_result('http://' + url)
  1633. elif default_search != 'fixup_error':
  1634. if default_search == 'auto_warning':
  1635. if re.match(r'^(?:url|URL)$', url):
  1636. raise ExtractorError(
  1637. 'Invalid URL: %r . Call youtube-dl like this: youtube-dl -v "https://www.youtube.com/watch?v=BaW_jenozKc" ' % url,
  1638. expected=True)
  1639. else:
  1640. self._downloader.report_warning(
  1641. 'Falling back to youtube search for %s . Set --default-search "auto" to suppress this warning.' % url)
  1642. return self.url_result('ytsearch:' + url)
  1643. if default_search in ('error', 'fixup_error'):
  1644. raise ExtractorError(
  1645. '%r is not a valid URL. '
  1646. 'Set --default-search "ytsearch" (or run youtube-dl "ytsearch:%s" ) to search YouTube'
  1647. % (url, url), expected=True)
  1648. else:
  1649. if ':' not in default_search:
  1650. default_search += ':'
  1651. return self.url_result(default_search + url)
  1652. url, smuggled_data = unsmuggle_url(url)
  1653. force_videoid = None
  1654. is_intentional = smuggled_data and smuggled_data.get('to_generic')
  1655. if smuggled_data and 'force_videoid' in smuggled_data:
  1656. force_videoid = smuggled_data['force_videoid']
  1657. video_id = force_videoid
  1658. else:
  1659. video_id = self._generic_id(url)
  1660. self.to_screen('%s: Requesting header' % video_id)
  1661. head_req = HEADRequest(url)
  1662. head_response = self._request_webpage(
  1663. head_req, video_id,
  1664. note=False, errnote='Could not send HEAD request to %s' % url,
  1665. fatal=False)
  1666. if head_response is not False:
  1667. # Check for redirect
  1668. new_url = head_response.geturl()
  1669. if url != new_url:
  1670. self.report_following_redirect(new_url)
  1671. if force_videoid:
  1672. new_url = smuggle_url(
  1673. new_url, {'force_videoid': force_videoid})
  1674. return self.url_result(new_url)
  1675. full_response = None
  1676. if head_response is False:
  1677. request = sanitized_Request(url)
  1678. request.add_header('Accept-Encoding', '*')
  1679. full_response = self._request_webpage(request, video_id)
  1680. head_response = full_response
  1681. info_dict = {
  1682. 'id': video_id,
  1683. 'title': self._generic_title(url),
  1684. 'upload_date': unified_strdate(head_response.headers.get('Last-Modified'))
  1685. }
  1686. # Check for direct link to a video
  1687. content_type = head_response.headers.get('Content-Type', '').lower()
  1688. m = re.match(r'^(?P<type>audio|video|application(?=/(?:ogg$|(?:vnd\.apple\.|x-)?mpegurl)))/(?P<format_id>[^;\s]+)', content_type)
  1689. if m:
  1690. format_id = m.group('format_id')
  1691. if format_id.endswith('mpegurl'):
  1692. formats = self._extract_m3u8_formats(url, video_id, 'mp4')
  1693. elif format_id == 'f4m':
  1694. formats = self._extract_f4m_formats(url, video_id)
  1695. else:
  1696. formats = [{
  1697. 'format_id': m.group('format_id'),
  1698. 'url': url,
  1699. 'vcodec': 'none' if m.group('type') == 'audio' else None
  1700. }]
  1701. info_dict['direct'] = True
  1702. self._sort_formats(formats)
  1703. info_dict['formats'] = formats
  1704. return info_dict
  1705. if not self._downloader.params.get('test', False) and not is_intentional:
  1706. force = self._downloader.params.get('force_generic_extractor', False)
  1707. self._downloader.report_warning(
  1708. '%s on generic information extractor.' % ('Forcing' if force else 'Falling back'))
  1709. if not full_response:
  1710. request = sanitized_Request(url)
  1711. # Some webservers may serve compressed content of rather big size (e.g. gzipped flac)
  1712. # making it impossible to download only chunk of the file (yet we need only 512kB to
  1713. # test whether it's HTML or not). According to youtube-dl default Accept-Encoding
  1714. # that will always result in downloading the whole file that is not desirable.
  1715. # Therefore for extraction pass we have to override Accept-Encoding to any in order
  1716. # to accept raw bytes and being able to download only a chunk.
  1717. # It may probably better to solve this by checking Content-Type for application/octet-stream
  1718. # after HEAD request finishes, but not sure if we can rely on this.
  1719. request.add_header('Accept-Encoding', '*')
  1720. full_response = self._request_webpage(request, video_id)
  1721. first_bytes = full_response.read(512)
  1722. # Is it an M3U playlist?
  1723. if first_bytes.startswith(b'#EXTM3U'):
  1724. info_dict['formats'] = self._extract_m3u8_formats(url, video_id, 'mp4')
  1725. self._sort_formats(info_dict['formats'])
  1726. return info_dict
  1727. # Maybe it's a direct link to a video?
  1728. # Be careful not to download the whole thing!
  1729. if not is_html(first_bytes):
  1730. self._downloader.report_warning(
  1731. 'URL could be a direct video link, returning it as such.')
  1732. info_dict.update({
  1733. 'direct': True,
  1734. 'url': url,
  1735. })
  1736. return info_dict
  1737. webpage = self._webpage_read_content(
  1738. full_response, url, video_id, prefix=first_bytes)
  1739. self.report_extraction(video_id)
  1740. # Is it an RSS feed, a SMIL file, an XSPF playlist or a MPD manifest?
  1741. try:
  1742. doc = compat_etree_fromstring(webpage.encode('utf-8'))
  1743. if doc.tag == 'rss':
  1744. return self._extract_rss(url, video_id, doc)
  1745. elif doc.tag == 'SmoothStreamingMedia':
  1746. info_dict['formats'] = self._parse_ism_formats(doc, url)
  1747. self._sort_formats(info_dict['formats'])
  1748. return info_dict
  1749. elif re.match(r'^(?:{[^}]+})?smil$', doc.tag):
  1750. smil = self._parse_smil(doc, url, video_id)
  1751. self._sort_formats(smil['formats'])
  1752. return smil
  1753. elif doc.tag == '{http://xspf.org/ns/0/}playlist':
  1754. return self.playlist_result(self._parse_xspf(doc, video_id), video_id)
  1755. elif re.match(r'(?i)^(?:{[^}]+})?MPD$', doc.tag):
  1756. info_dict['formats'] = self._parse_mpd_formats(
  1757. doc, video_id,
  1758. mpd_base_url=full_response.geturl().rpartition('/')[0],
  1759. mpd_url=url)
  1760. self._sort_formats(info_dict['formats'])
  1761. return info_dict
  1762. elif re.match(r'^{http://ns\.adobe\.com/f4m/[12]\.0}manifest$', doc.tag):
  1763. info_dict['formats'] = self._parse_f4m_formats(doc, url, video_id)
  1764. self._sort_formats(info_dict['formats'])
  1765. return info_dict
  1766. except compat_xml_parse_error:
  1767. pass
  1768. # Is it a Camtasia project?
  1769. camtasia_res = self._extract_camtasia(url, video_id, webpage)
  1770. if camtasia_res is not None:
  1771. return camtasia_res
  1772. # Sometimes embedded video player is hidden behind percent encoding
  1773. # (e.g. https://github.com/rg3/youtube-dl/issues/2448)
  1774. # Unescaping the whole page allows to handle those cases in a generic way
  1775. webpage = compat_urllib_parse_unquote(webpage)
  1776. # it's tempting to parse this further, but you would
  1777. # have to take into account all the variations like
  1778. # Video Title - Site Name
  1779. # Site Name | Video Title
  1780. # Video Title - Tagline | Site Name
  1781. # and so on and so forth; it's just not practical
  1782. video_title = self._og_search_title(
  1783. webpage, default=None) or self._html_search_regex(
  1784. r'(?s)<title>(.*?)</title>', webpage, 'video title',
  1785. default='video')
  1786. # Try to detect age limit automatically
  1787. age_limit = self._rta_search(webpage)
  1788. # And then there are the jokers who advertise that they use RTA,
  1789. # but actually don't.
  1790. AGE_LIMIT_MARKERS = [
  1791. r'Proudly Labeled <a href="http://www.rtalabel.org/" title="Restricted to Adults">RTA</a>',
  1792. ]
  1793. if any(re.search(marker, webpage) for marker in AGE_LIMIT_MARKERS):
  1794. age_limit = 18
  1795. # video uploader is domain name
  1796. video_uploader = self._search_regex(
  1797. r'^(?:https?://)?([^/]*)/.*', url, 'video uploader')
  1798. video_description = self._og_search_description(webpage, default=None)
  1799. video_thumbnail = self._og_search_thumbnail(webpage, default=None)
  1800. # Look for Brightcove Legacy Studio embeds
  1801. bc_urls = BrightcoveLegacyIE._extract_brightcove_urls(webpage)
  1802. if bc_urls:
  1803. self.to_screen('Brightcove video detected.')
  1804. entries = [{
  1805. '_type': 'url',
  1806. 'url': smuggle_url(bc_url, {'Referer': url}),
  1807. 'ie_key': 'BrightcoveLegacy'
  1808. } for bc_url in bc_urls]
  1809. return {
  1810. '_type': 'playlist',
  1811. 'title': video_title,
  1812. 'id': video_id,
  1813. 'entries': entries,
  1814. }
  1815. # Look for Brightcove New Studio embeds
  1816. bc_urls = BrightcoveNewIE._extract_urls(webpage)
  1817. if bc_urls:
  1818. return self.playlist_from_matches(bc_urls, video_id, video_title, ie='BrightcoveNew')
  1819. # Look for ThePlatform embeds
  1820. tp_urls = ThePlatformIE._extract_urls(webpage)
  1821. if tp_urls:
  1822. return self.playlist_from_matches(tp_urls, video_id, video_title, ie='ThePlatform')
  1823. # Look for Vessel embeds
  1824. vessel_urls = VesselIE._extract_urls(webpage)
  1825. if vessel_urls:
  1826. return self.playlist_from_matches(vessel_urls, video_id, video_title, ie=VesselIE.ie_key())
  1827. # Look for embedded rtl.nl player
  1828. matches = re.findall(
  1829. r'<iframe[^>]+?src="((?:https?:)?//(?:www\.)?rtl\.nl/system/videoplayer/[^"]+(?:video_)?embed[^"]+)"',
  1830. webpage)
  1831. if matches:
  1832. return self.playlist_from_matches(matches, video_id, video_title, ie='RtlNl')
  1833. vimeo_urls = VimeoIE._extract_urls(url, webpage)
  1834. if vimeo_urls:
  1835. return self.playlist_from_matches(vimeo_urls, video_id, video_title, ie=VimeoIE.ie_key())
  1836. vid_me_embed_url = self._search_regex(
  1837. r'src=[\'"](https?://vid\.me/[^\'"]+)[\'"]',
  1838. webpage, 'vid.me embed', default=None)
  1839. if vid_me_embed_url is not None:
  1840. return self.url_result(vid_me_embed_url, 'Vidme')
  1841. # Look for embedded YouTube player
  1842. matches = re.findall(r'''(?x)
  1843. (?:
  1844. <iframe[^>]+?src=|
  1845. data-video-url=|
  1846. <embed[^>]+?src=|
  1847. embedSWF\(?:\s*|
  1848. new\s+SWFObject\(
  1849. )
  1850. (["\'])
  1851. (?P<url>(?:https?:)?//(?:www\.)?youtube(?:-nocookie)?\.com/
  1852. (?:embed|v|p)/.+?)
  1853. \1''', webpage)
  1854. if matches:
  1855. return self.playlist_from_matches(
  1856. matches, video_id, video_title, lambda m: unescapeHTML(m[1]))
  1857. # Look for lazyYT YouTube embed
  1858. matches = re.findall(
  1859. r'class="lazyYT" data-youtube-id="([^"]+)"', webpage)
  1860. if matches:
  1861. return self.playlist_from_matches(matches, video_id, video_title, lambda m: unescapeHTML(m))
  1862. # Look for Wordpress "YouTube Video Importer" plugin
  1863. matches = re.findall(r'''(?x)<div[^>]+
  1864. class=(?P<q1>[\'"])[^\'"]*\byvii_single_video_player\b[^\'"]*(?P=q1)[^>]+
  1865. data-video_id=(?P<q2>[\'"])([^\'"]+)(?P=q2)''', webpage)
  1866. if matches:
  1867. return self.playlist_from_matches(matches, video_id, video_title, lambda m: m[-1])
  1868. matches = DailymotionIE._extract_urls(webpage)
  1869. if matches:
  1870. return self.playlist_from_matches(matches, video_id, video_title)
  1871. # Look for embedded Dailymotion playlist player (#3822)
  1872. m = re.search(
  1873. r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?dailymotion\.[a-z]{2,3}/widget/jukebox\?.+?)\1', webpage)
  1874. if m:
  1875. playlists = re.findall(
  1876. r'list\[\]=/playlist/([^/]+)/', unescapeHTML(m.group('url')))
  1877. if playlists:
  1878. return self.playlist_from_matches(
  1879. playlists, video_id, video_title, lambda p: '//dailymotion.com/playlist/%s' % p)
  1880. # Look for embedded Wistia player
  1881. match = re.search(
  1882. r'<(?:meta[^>]+?content|iframe[^>]+?src)=(["\'])(?P<url>(?:https?:)?//(?:fast\.)?wistia\.net/embed/iframe/.+?)\1', webpage)
  1883. if match:
  1884. embed_url = self._proto_relative_url(
  1885. unescapeHTML(match.group('url')))
  1886. return {
  1887. '_type': 'url_transparent',
  1888. 'url': embed_url,
  1889. 'ie_key': 'Wistia',
  1890. 'uploader': video_uploader,
  1891. }
  1892. match = re.search(r'(?:id=["\']wistia_|data-wistia-?id=["\']|Wistia\.embed\(["\'])(?P<id>[^"\']+)', webpage)
  1893. if match:
  1894. return {
  1895. '_type': 'url_transparent',
  1896. 'url': 'wistia:%s' % match.group('id'),
  1897. 'ie_key': 'Wistia',
  1898. 'uploader': video_uploader,
  1899. }
  1900. match = re.search(
  1901. r'''(?sx)
  1902. <script[^>]+src=(["'])(?:https?:)?//fast\.wistia\.com/assets/external/E-v1\.js\1[^>]*>.*?
  1903. <div[^>]+class=(["']).*?\bwistia_async_(?P<id>[a-z0-9]+)\b.*?\2
  1904. ''', webpage)
  1905. if match:
  1906. return self.url_result(self._proto_relative_url(
  1907. 'wistia:%s' % match.group('id')), 'Wistia')
  1908. # Look for SVT player
  1909. svt_url = SVTIE._extract_url(webpage)
  1910. if svt_url:
  1911. return self.url_result(svt_url, 'SVT')
  1912. # Look for embedded condenast player
  1913. matches = re.findall(
  1914. r'<iframe\s+(?:[a-zA-Z-]+="[^"]+"\s+)*?src="(https?://player\.cnevids\.com/embed/[^"]+")',
  1915. webpage)
  1916. if matches:
  1917. return {
  1918. '_type': 'playlist',
  1919. 'entries': [{
  1920. '_type': 'url',
  1921. 'ie_key': 'CondeNast',
  1922. 'url': ma,
  1923. } for ma in matches],
  1924. 'title': video_title,
  1925. 'id': video_id,
  1926. }
  1927. # Look for Bandcamp pages with custom domain
  1928. mobj = re.search(r'<meta property="og:url"[^>]*?content="(.*?bandcamp\.com.*?)"', webpage)
  1929. if mobj is not None:
  1930. burl = unescapeHTML(mobj.group(1))
  1931. # Don't set the extractor because it can be a track url or an album
  1932. return self.url_result(burl)
  1933. # Look for embedded Vevo player
  1934. mobj = re.search(
  1935. r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:cache\.)?vevo\.com/.+?)\1', webpage)
  1936. if mobj is not None:
  1937. return self.url_result(mobj.group('url'))
  1938. # Look for embedded Viddler player
  1939. mobj = re.search(
  1940. r'<(?:iframe[^>]+?src|param[^>]+?value)=(["\'])(?P<url>(?:https?:)?//(?:www\.)?viddler\.com/(?:embed|player)/.+?)\1',
  1941. webpage)
  1942. if mobj is not None:
  1943. return self.url_result(mobj.group('url'))
  1944. # Look for NYTimes player
  1945. mobj = re.search(
  1946. r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//graphics8\.nytimes\.com/bcvideo/[^/]+/iframe/embed\.html.+?)\1>',
  1947. webpage)
  1948. if mobj is not None:
  1949. return self.url_result(mobj.group('url'))
  1950. # Look for Libsyn player
  1951. mobj = re.search(
  1952. r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//html5-player\.libsyn\.com/embed/.+?)\1', webpage)
  1953. if mobj is not None:
  1954. return self.url_result(mobj.group('url'))
  1955. # Look for Ooyala videos
  1956. mobj = (re.search(r'player\.ooyala\.com/[^"?]+[?#][^"]*?(?:embedCode|ec)=(?P<ec>[^"&]+)', webpage) or
  1957. re.search(r'OO\.Player\.create\([\'"].*?[\'"],\s*[\'"](?P<ec>.{32})[\'"]', webpage) or
  1958. re.search(r'SBN\.VideoLinkset\.ooyala\([\'"](?P<ec>.{32})[\'"]\)', webpage) or
  1959. re.search(r'data-ooyala-video-id\s*=\s*[\'"](?P<ec>.{32})[\'"]', webpage))
  1960. if mobj is not None:
  1961. embed_token = self._search_regex(
  1962. r'embedToken[\'"]?\s*:\s*[\'"]([^\'"]+)',
  1963. webpage, 'ooyala embed token', default=None)
  1964. return OoyalaIE._build_url_result(smuggle_url(
  1965. mobj.group('ec'), {
  1966. 'domain': url,
  1967. 'embed_token': embed_token,
  1968. }))
  1969. # Look for multiple Ooyala embeds on SBN network websites
  1970. mobj = re.search(r'SBN\.VideoLinkset\.entryGroup\((\[.*?\])', webpage)
  1971. if mobj is not None:
  1972. embeds = self._parse_json(mobj.group(1), video_id, fatal=False)
  1973. if embeds:
  1974. return self.playlist_from_matches(
  1975. embeds, video_id, video_title,
  1976. getter=lambda v: OoyalaIE._url_for_embed_code(smuggle_url(v['provider_video_id'], {'domain': url})), ie='Ooyala')
  1977. # Look for Aparat videos
  1978. mobj = re.search(r'<iframe .*?src="(http://www\.aparat\.com/video/[^"]+)"', webpage)
  1979. if mobj is not None:
  1980. return self.url_result(mobj.group(1), 'Aparat')
  1981. # Look for MPORA videos
  1982. mobj = re.search(r'<iframe .*?src="(http://mpora\.(?:com|de)/videos/[^"]+)"', webpage)
  1983. if mobj is not None:
  1984. return self.url_result(mobj.group(1), 'Mpora')
  1985. # Look for embedded NovaMov-based player
  1986. mobj = re.search(
  1987. r'''(?x)<(?:pagespeed_)?iframe[^>]+?src=(["\'])
  1988. (?P<url>http://(?:(?:embed|www)\.)?
  1989. (?:novamov\.com|
  1990. nowvideo\.(?:ch|sx|eu|at|ag|co)|
  1991. videoweed\.(?:es|com)|
  1992. movshare\.(?:net|sx|ag)|
  1993. divxstage\.(?:eu|net|ch|co|at|ag))
  1994. /embed\.php.+?)\1''', webpage)
  1995. if mobj is not None:
  1996. return self.url_result(mobj.group('url'))
  1997. # Look for embedded Facebook player
  1998. facebook_url = FacebookIE._extract_url(webpage)
  1999. if facebook_url is not None:
  2000. return self.url_result(facebook_url, 'Facebook')
  2001. # Look for embedded VK player
  2002. mobj = re.search(r'<iframe[^>]+?src=(["\'])(?P<url>https?://vk\.com/video_ext\.php.+?)\1', webpage)
  2003. if mobj is not None:
  2004. return self.url_result(mobj.group('url'), 'VK')
  2005. # Look for embedded Odnoklassniki player
  2006. mobj = re.search(r'<iframe[^>]+?src=(["\'])(?P<url>https?://(?:odnoklassniki|ok)\.ru/videoembed/.+?)\1', webpage)
  2007. if mobj is not None:
  2008. return self.url_result(mobj.group('url'), 'Odnoklassniki')
  2009. # Look for embedded ivi player
  2010. mobj = re.search(r'<embed[^>]+?src=(["\'])(?P<url>https?://(?:www\.)?ivi\.ru/video/player.+?)\1', webpage)
  2011. if mobj is not None:
  2012. return self.url_result(mobj.group('url'), 'Ivi')
  2013. # Look for embedded Huffington Post player
  2014. mobj = re.search(
  2015. r'<iframe[^>]+?src=(["\'])(?P<url>https?://embed\.live\.huffingtonpost\.com/.+?)\1', webpage)
  2016. if mobj is not None:
  2017. return self.url_result(mobj.group('url'), 'HuffPost')
  2018. # Look for embed.ly
  2019. mobj = re.search(r'class=["\']embedly-card["\'][^>]href=["\'](?P<url>[^"\']+)', webpage)
  2020. if mobj is not None:
  2021. return self.url_result(mobj.group('url'))
  2022. mobj = re.search(r'class=["\']embedly-embed["\'][^>]src=["\'][^"\']*url=(?P<url>[^&]+)', webpage)
  2023. if mobj is not None:
  2024. return self.url_result(compat_urllib_parse_unquote(mobj.group('url')))
  2025. # Look for funnyordie embed
  2026. matches = re.findall(r'<iframe[^>]+?src="(https?://(?:www\.)?funnyordie\.com/embed/[^"]+)"', webpage)
  2027. if matches:
  2028. return self.playlist_from_matches(
  2029. matches, video_id, video_title, getter=unescapeHTML, ie='FunnyOrDie')
  2030. # Look for BBC iPlayer embed
  2031. matches = re.findall(r'setPlaylist\("(https?://www\.bbc\.co\.uk/iplayer/[^/]+/[\da-z]{8})"\)', webpage)
  2032. if matches:
  2033. return self.playlist_from_matches(matches, video_id, video_title, ie='BBCCoUk')
  2034. # Look for embedded RUTV player
  2035. rutv_url = RUTVIE._extract_url(webpage)
  2036. if rutv_url:
  2037. return self.url_result(rutv_url, 'RUTV')
  2038. # Look for embedded TVC player
  2039. tvc_url = TVCIE._extract_url(webpage)
  2040. if tvc_url:
  2041. return self.url_result(tvc_url, 'TVC')
  2042. # Look for embedded SportBox player
  2043. sportbox_urls = SportBoxEmbedIE._extract_urls(webpage)
  2044. if sportbox_urls:
  2045. return self.playlist_from_matches(sportbox_urls, video_id, video_title, ie='SportBoxEmbed')
  2046. # Look for embedded XHamster player
  2047. xhamster_urls = XHamsterEmbedIE._extract_urls(webpage)
  2048. if xhamster_urls:
  2049. return self.playlist_from_matches(xhamster_urls, video_id, video_title, ie='XHamsterEmbed')
  2050. # Look for embedded TNAFlixNetwork player
  2051. tnaflix_urls = TNAFlixNetworkEmbedIE._extract_urls(webpage)
  2052. if tnaflix_urls:
  2053. return self.playlist_from_matches(tnaflix_urls, video_id, video_title, ie=TNAFlixNetworkEmbedIE.ie_key())
  2054. # Look for embedded PornHub player
  2055. pornhub_urls = PornHubIE._extract_urls(webpage)
  2056. if pornhub_urls:
  2057. return self.playlist_from_matches(pornhub_urls, video_id, video_title, ie=PornHubIE.ie_key())
  2058. # Look for embedded DrTuber player
  2059. drtuber_urls = DrTuberIE._extract_urls(webpage)
  2060. if drtuber_urls:
  2061. return self.playlist_from_matches(drtuber_urls, video_id, video_title, ie=DrTuberIE.ie_key())
  2062. # Look for embedded RedTube player
  2063. redtube_urls = RedTubeIE._extract_urls(webpage)
  2064. if redtube_urls:
  2065. return self.playlist_from_matches(redtube_urls, video_id, video_title, ie=RedTubeIE.ie_key())
  2066. # Look for embedded Tvigle player
  2067. mobj = re.search(
  2068. r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//cloud\.tvigle\.ru/video/.+?)\1', webpage)
  2069. if mobj is not None:
  2070. return self.url_result(mobj.group('url'), 'Tvigle')
  2071. # Look for embedded TED player
  2072. mobj = re.search(
  2073. r'<iframe[^>]+?src=(["\'])(?P<url>https?://embed(?:-ssl)?\.ted\.com/.+?)\1', webpage)
  2074. if mobj is not None:
  2075. return self.url_result(mobj.group('url'), 'TED')
  2076. # Look for embedded Ustream videos
  2077. ustream_url = UstreamIE._extract_url(webpage)
  2078. if ustream_url:
  2079. return self.url_result(ustream_url, UstreamIE.ie_key())
  2080. # Look for embedded arte.tv player
  2081. mobj = re.search(
  2082. r'<(?:script|iframe) [^>]*?src="(?P<url>http://www\.arte\.tv/(?:playerv2/embed|arte_vp/index)[^"]+)"',
  2083. webpage)
  2084. if mobj is not None:
  2085. return self.url_result(mobj.group('url'), 'ArteTVEmbed')
  2086. # Look for embedded francetv player
  2087. mobj = re.search(
  2088. r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?://)?embed\.francetv\.fr/\?ue=.+?)\1',
  2089. webpage)
  2090. if mobj is not None:
  2091. return self.url_result(mobj.group('url'))
  2092. # Look for embedded smotri.com player
  2093. smotri_url = SmotriIE._extract_url(webpage)
  2094. if smotri_url:
  2095. return self.url_result(smotri_url, 'Smotri')
  2096. # Look for embedded Myvi.ru player
  2097. myvi_url = MyviIE._extract_url(webpage)
  2098. if myvi_url:
  2099. return self.url_result(myvi_url)
  2100. # Look for embedded soundcloud player
  2101. soundcloud_urls = SoundcloudIE._extract_urls(webpage)
  2102. if soundcloud_urls:
  2103. return self.playlist_from_matches(soundcloud_urls, video_id, video_title, getter=unescapeHTML, ie=SoundcloudIE.ie_key())
  2104. # Look for tunein player
  2105. tunein_urls = TuneInBaseIE._extract_urls(webpage)
  2106. if tunein_urls:
  2107. return self.playlist_from_matches(tunein_urls, video_id, video_title)
  2108. # Look for embedded mtvservices player
  2109. mtvservices_url = MTVServicesEmbeddedIE._extract_url(webpage)
  2110. if mtvservices_url:
  2111. return self.url_result(mtvservices_url, ie='MTVServicesEmbedded')
  2112. # Look for embedded yahoo player
  2113. mobj = re.search(
  2114. r'<iframe[^>]+?src=(["\'])(?P<url>https?://(?:screen|movies)\.yahoo\.com/.+?\.html\?format=embed)\1',
  2115. webpage)
  2116. if mobj is not None:
  2117. return self.url_result(mobj.group('url'), 'Yahoo')
  2118. # Look for embedded sbs.com.au player
  2119. mobj = re.search(
  2120. r'''(?x)
  2121. (?:
  2122. <meta\s+property="og:video"\s+content=|
  2123. <iframe[^>]+?src=
  2124. )
  2125. (["\'])(?P<url>https?://(?:www\.)?sbs\.com\.au/ondemand/video/.+?)\1''',
  2126. webpage)
  2127. if mobj is not None:
  2128. return self.url_result(mobj.group('url'), 'SBS')
  2129. # Look for embedded Cinchcast player
  2130. mobj = re.search(
  2131. r'<iframe[^>]+?src=(["\'])(?P<url>https?://player\.cinchcast\.com/.+?)\1',
  2132. webpage)
  2133. if mobj is not None:
  2134. return self.url_result(mobj.group('url'), 'Cinchcast')
  2135. mobj = re.search(
  2136. r'<iframe[^>]+?src=(["\'])(?P<url>https?://m(?:lb)?\.mlb\.com/shared/video/embed/embed\.html\?.+?)\1',
  2137. webpage)
  2138. if not mobj:
  2139. mobj = re.search(
  2140. r'data-video-link=["\'](?P<url>http://m.mlb.com/video/[^"\']+)',
  2141. webpage)
  2142. if mobj is not None:
  2143. return self.url_result(mobj.group('url'), 'MLB')
  2144. mobj = re.search(
  2145. r'<(?:iframe|script)[^>]+?src=(["\'])(?P<url>%s)\1' % CondeNastIE.EMBED_URL,
  2146. webpage)
  2147. if mobj is not None:
  2148. return self.url_result(self._proto_relative_url(mobj.group('url'), scheme='http:'), 'CondeNast')
  2149. mobj = re.search(
  2150. r'<iframe[^>]+src="(?P<url>https?://(?:new\.)?livestream\.com/[^"]+/player[^"]+)"',
  2151. webpage)
  2152. if mobj is not None:
  2153. return self.url_result(mobj.group('url'), 'Livestream')
  2154. # Look for Zapiks embed
  2155. mobj = re.search(
  2156. r'<iframe[^>]+src="(?P<url>https?://(?:www\.)?zapiks\.fr/index\.php\?.+?)"', webpage)
  2157. if mobj is not None:
  2158. return self.url_result(mobj.group('url'), 'Zapiks')
  2159. # Look for Kaltura embeds
  2160. kaltura_url = KalturaIE._extract_url(webpage)
  2161. if kaltura_url:
  2162. return self.url_result(smuggle_url(kaltura_url, {'source_url': url}), KalturaIE.ie_key())
  2163. # Look for Eagle.Platform embeds
  2164. eagleplatform_url = EaglePlatformIE._extract_url(webpage)
  2165. if eagleplatform_url:
  2166. return self.url_result(eagleplatform_url, EaglePlatformIE.ie_key())
  2167. # Look for ClipYou (uses Eagle.Platform) embeds
  2168. mobj = re.search(
  2169. r'<iframe[^>]+src="https?://(?P<host>media\.clipyou\.ru)/index/player\?.*\brecord_id=(?P<id>\d+).*"', webpage)
  2170. if mobj is not None:
  2171. return self.url_result('eagleplatform:%(host)s:%(id)s' % mobj.groupdict(), 'EaglePlatform')
  2172. # Look for Pladform embeds
  2173. pladform_url = PladformIE._extract_url(webpage)
  2174. if pladform_url:
  2175. return self.url_result(pladform_url)
  2176. # Look for Videomore embeds
  2177. videomore_url = VideomoreIE._extract_url(webpage)
  2178. if videomore_url:
  2179. return self.url_result(videomore_url)
  2180. # Look for Webcaster embeds
  2181. webcaster_url = WebcasterFeedIE._extract_url(self, webpage)
  2182. if webcaster_url:
  2183. return self.url_result(webcaster_url, ie=WebcasterFeedIE.ie_key())
  2184. # Look for Playwire embeds
  2185. mobj = re.search(
  2186. r'<script[^>]+data-config=(["\'])(?P<url>(?:https?:)?//config\.playwire\.com/.+?)\1', webpage)
  2187. if mobj is not None:
  2188. return self.url_result(mobj.group('url'))
  2189. # Look for 5min embeds
  2190. mobj = re.search(
  2191. r'<meta[^>]+property="og:video"[^>]+content="https?://embed\.5min\.com/(?P<id>[0-9]+)/?', webpage)
  2192. if mobj is not None:
  2193. return self.url_result('5min:%s' % mobj.group('id'), 'FiveMin')
  2194. # Look for Crooks and Liars embeds
  2195. mobj = re.search(
  2196. r'<(?:iframe[^>]+src|param[^>]+value)=(["\'])(?P<url>(?:https?:)?//embed\.crooksandliars\.com/(?:embed|v)/.+?)\1', webpage)
  2197. if mobj is not None:
  2198. return self.url_result(mobj.group('url'))
  2199. # Look for NBC Sports VPlayer embeds
  2200. nbc_sports_url = NBCSportsVPlayerIE._extract_url(webpage)
  2201. if nbc_sports_url:
  2202. return self.url_result(nbc_sports_url, 'NBCSportsVPlayer')
  2203. # Look for NBC News embeds
  2204. nbc_news_embed_url = re.search(
  2205. r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//www\.nbcnews\.com/widget/video-embed/[^"\']+)\1', webpage)
  2206. if nbc_news_embed_url:
  2207. return self.url_result(nbc_news_embed_url.group('url'), 'NBCNews')
  2208. # Look for Google Drive embeds
  2209. google_drive_url = GoogleDriveIE._extract_url(webpage)
  2210. if google_drive_url:
  2211. return self.url_result(google_drive_url, 'GoogleDrive')
  2212. # Look for UDN embeds
  2213. mobj = re.search(
  2214. r'<iframe[^>]+src="(?P<url>%s)"' % UDNEmbedIE._PROTOCOL_RELATIVE_VALID_URL, webpage)
  2215. if mobj is not None:
  2216. return self.url_result(
  2217. compat_urlparse.urljoin(url, mobj.group('url')), 'UDNEmbed')
  2218. # Look for Senate ISVP iframe
  2219. senate_isvp_url = SenateISVPIE._search_iframe_url(webpage)
  2220. if senate_isvp_url:
  2221. return self.url_result(senate_isvp_url, 'SenateISVP')
  2222. # Look for Dailymotion Cloud videos
  2223. dmcloud_url = DailymotionCloudIE._extract_dmcloud_url(webpage)
  2224. if dmcloud_url:
  2225. return self.url_result(dmcloud_url, 'DailymotionCloud')
  2226. # Look for OnionStudios embeds
  2227. onionstudios_url = OnionStudiosIE._extract_url(webpage)
  2228. if onionstudios_url:
  2229. return self.url_result(onionstudios_url)
  2230. # Look for ViewLift embeds
  2231. viewlift_url = ViewLiftEmbedIE._extract_url(webpage)
  2232. if viewlift_url:
  2233. return self.url_result(viewlift_url)
  2234. # Look for JWPlatform embeds
  2235. jwplatform_url = JWPlatformIE._extract_url(webpage)
  2236. if jwplatform_url:
  2237. return self.url_result(jwplatform_url, 'JWPlatform')
  2238. # Look for Digiteka embeds
  2239. digiteka_url = DigitekaIE._extract_url(webpage)
  2240. if digiteka_url:
  2241. return self.url_result(self._proto_relative_url(digiteka_url), DigitekaIE.ie_key())
  2242. # Look for Arkena embeds
  2243. arkena_url = ArkenaIE._extract_url(webpage)
  2244. if arkena_url:
  2245. return self.url_result(arkena_url, ArkenaIE.ie_key())
  2246. # Look for Piksel embeds
  2247. piksel_url = PikselIE._extract_url(webpage)
  2248. if piksel_url:
  2249. return self.url_result(piksel_url, PikselIE.ie_key())
  2250. # Look for Limelight embeds
  2251. mobj = re.search(r'LimelightPlayer\.doLoad(Media|Channel|ChannelList)\(["\'](?P<id>[a-z0-9]{32})', webpage)
  2252. if mobj:
  2253. lm = {
  2254. 'Media': 'media',
  2255. 'Channel': 'channel',
  2256. 'ChannelList': 'channel_list',
  2257. }
  2258. return self.url_result(smuggle_url('limelight:%s:%s' % (
  2259. lm[mobj.group(1)], mobj.group(2)), {'source_url': url}),
  2260. 'Limelight%s' % mobj.group(1), mobj.group(2))
  2261. mobj = re.search(
  2262. r'''(?sx)
  2263. <object[^>]+class=(["\'])LimelightEmbeddedPlayerFlash\1[^>]*>.*?
  2264. <param[^>]+
  2265. name=(["\'])flashVars\2[^>]+
  2266. value=(["\'])(?:(?!\3).)*mediaId=(?P<id>[a-z0-9]{32})
  2267. ''', webpage)
  2268. if mobj:
  2269. return self.url_result(smuggle_url(
  2270. 'limelight:media:%s' % mobj.group('id'),
  2271. {'source_url': url}), 'LimelightMedia', mobj.group('id'))
  2272. # Look for AdobeTVVideo embeds
  2273. mobj = re.search(
  2274. r'<iframe[^>]+src=[\'"]((?:https?:)?//video\.tv\.adobe\.com/v/\d+[^"]+)[\'"]',
  2275. webpage)
  2276. if mobj is not None:
  2277. return self.url_result(
  2278. self._proto_relative_url(unescapeHTML(mobj.group(1))),
  2279. 'AdobeTVVideo')
  2280. # Look for Vine embeds
  2281. mobj = re.search(
  2282. r'<iframe[^>]+src=[\'"]((?:https?:)?//(?:www\.)?vine\.co/v/[^/]+/embed/(?:simple|postcard))',
  2283. webpage)
  2284. if mobj is not None:
  2285. return self.url_result(
  2286. self._proto_relative_url(unescapeHTML(mobj.group(1))), 'Vine')
  2287. # Look for VODPlatform embeds
  2288. mobj = re.search(
  2289. r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?vod-platform\.net/[eE]mbed/.+?)\1',
  2290. webpage)
  2291. if mobj is not None:
  2292. return self.url_result(
  2293. self._proto_relative_url(unescapeHTML(mobj.group('url'))), 'VODPlatform')
  2294. # Look for Mangomolo embeds
  2295. mobj = re.search(
  2296. r'''(?x)<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?admin\.mangomolo\.com/analytics/index\.php/customers/embed/
  2297. (?:
  2298. video\?.*?\bid=(?P<video_id>\d+)|
  2299. index\?.*?\bchannelid=(?P<channel_id>(?:[A-Za-z0-9+/=]|%2B|%2F|%3D)+)
  2300. ).+?)\1''', webpage)
  2301. if mobj is not None:
  2302. info = {
  2303. '_type': 'url_transparent',
  2304. 'url': self._proto_relative_url(unescapeHTML(mobj.group('url'))),
  2305. 'title': video_title,
  2306. 'description': video_description,
  2307. 'thumbnail': video_thumbnail,
  2308. 'uploader': video_uploader,
  2309. }
  2310. video_id = mobj.group('video_id')
  2311. if video_id:
  2312. info.update({
  2313. 'ie_key': 'MangomoloVideo',
  2314. 'id': video_id,
  2315. })
  2316. else:
  2317. info.update({
  2318. 'ie_key': 'MangomoloLive',
  2319. 'id': mobj.group('channel_id'),
  2320. })
  2321. return info
  2322. # Look for Instagram embeds
  2323. instagram_embed_url = InstagramIE._extract_embed_url(webpage)
  2324. if instagram_embed_url is not None:
  2325. return self.url_result(
  2326. self._proto_relative_url(instagram_embed_url), InstagramIE.ie_key())
  2327. # Look for LiveLeak embeds
  2328. liveleak_url = LiveLeakIE._extract_url(webpage)
  2329. if liveleak_url:
  2330. return self.url_result(liveleak_url, 'LiveLeak')
  2331. # Look for 3Q SDN embeds
  2332. threeqsdn_url = ThreeQSDNIE._extract_url(webpage)
  2333. if threeqsdn_url:
  2334. return {
  2335. '_type': 'url_transparent',
  2336. 'ie_key': ThreeQSDNIE.ie_key(),
  2337. 'url': self._proto_relative_url(threeqsdn_url),
  2338. 'title': video_title,
  2339. 'description': video_description,
  2340. 'thumbnail': video_thumbnail,
  2341. 'uploader': video_uploader,
  2342. }
  2343. # Look for VBOX7 embeds
  2344. vbox7_url = Vbox7IE._extract_url(webpage)
  2345. if vbox7_url:
  2346. return self.url_result(vbox7_url, Vbox7IE.ie_key())
  2347. # Look for DBTV embeds
  2348. dbtv_urls = DBTVIE._extract_urls(webpage)
  2349. if dbtv_urls:
  2350. return self.playlist_from_matches(dbtv_urls, video_id, video_title, ie=DBTVIE.ie_key())
  2351. # Look for Videa embeds
  2352. videa_urls = VideaIE._extract_urls(webpage)
  2353. if videa_urls:
  2354. return self.playlist_from_matches(videa_urls, video_id, video_title, ie=VideaIE.ie_key())
  2355. # Look for 20 minuten embeds
  2356. twentymin_urls = TwentyMinutenIE._extract_urls(webpage)
  2357. if twentymin_urls:
  2358. return self.playlist_from_matches(
  2359. twentymin_urls, video_id, video_title, ie=TwentyMinutenIE.ie_key())
  2360. # Look for Openload embeds
  2361. openload_urls = OpenloadIE._extract_urls(webpage)
  2362. if openload_urls:
  2363. return self.playlist_from_matches(
  2364. openload_urls, video_id, video_title, ie=OpenloadIE.ie_key())
  2365. # Look for VideoPress embeds
  2366. videopress_urls = VideoPressIE._extract_urls(webpage)
  2367. if videopress_urls:
  2368. return self.playlist_from_matches(
  2369. videopress_urls, video_id, video_title, ie=VideoPressIE.ie_key())
  2370. # Look for Rutube embeds
  2371. rutube_urls = RutubeIE._extract_urls(webpage)
  2372. if rutube_urls:
  2373. return self.playlist_from_matches(
  2374. rutube_urls, ie=RutubeIE.ie_key())
  2375. # Looking for http://schema.org/VideoObject
  2376. json_ld = self._search_json_ld(
  2377. webpage, video_id, default={}, expected_type='VideoObject')
  2378. if json_ld.get('url'):
  2379. info_dict.update({
  2380. 'title': video_title or info_dict['title'],
  2381. 'description': video_description,
  2382. 'thumbnail': video_thumbnail,
  2383. 'age_limit': age_limit
  2384. })
  2385. info_dict.update(json_ld)
  2386. return info_dict
  2387. # Look for HTML5 media
  2388. entries = self._parse_html5_media_entries(url, webpage, video_id, m3u8_id='hls')
  2389. if entries:
  2390. for entry in entries:
  2391. entry.update({
  2392. 'id': video_id,
  2393. 'title': video_title,
  2394. })
  2395. self._sort_formats(entry['formats'])
  2396. return self.playlist_result(entries)
  2397. jwplayer_data_str = self._find_jwplayer_data(webpage)
  2398. if jwplayer_data_str:
  2399. try:
  2400. jwplayer_data = self._parse_json(
  2401. jwplayer_data_str, video_id, transform_source=js_to_json)
  2402. info = self._parse_jwplayer_data(
  2403. jwplayer_data, video_id, require_title=False)
  2404. if not info.get('title'):
  2405. info['title'] = video_title
  2406. return info
  2407. except ExtractorError:
  2408. pass
  2409. def check_video(vurl):
  2410. if YoutubeIE.suitable(vurl):
  2411. return True
  2412. if RtmpIE.suitable(vurl):
  2413. return True
  2414. vpath = compat_urlparse.urlparse(vurl).path
  2415. vext = determine_ext(vpath)
  2416. return '.' in vpath and vext not in ('swf', 'png', 'jpg', 'srt', 'sbv', 'sub', 'vtt', 'ttml', 'js')
  2417. def filter_video(urls):
  2418. return list(filter(check_video, urls))
  2419. # Start with something easy: JW Player in SWFObject
  2420. found = filter_video(re.findall(r'flashvars: [\'"](?:.*&)?file=(http[^\'"&]*)', webpage))
  2421. if not found:
  2422. # Look for gorilla-vid style embedding
  2423. found = filter_video(re.findall(r'''(?sx)
  2424. (?:
  2425. jw_plugins|
  2426. JWPlayerOptions|
  2427. jwplayer\s*\(\s*["'][^'"]+["']\s*\)\s*\.setup
  2428. )
  2429. .*?
  2430. ['"]?file['"]?\s*:\s*["\'](.*?)["\']''', webpage))
  2431. if not found:
  2432. # Broaden the search a little bit
  2433. found = filter_video(re.findall(r'[^A-Za-z0-9]?(?:file|source)=(http[^\'"&]*)', webpage))
  2434. if not found:
  2435. # Broaden the findall a little bit: JWPlayer JS loader
  2436. found = filter_video(re.findall(
  2437. r'[^A-Za-z0-9]?(?:file|video_url)["\']?:\s*["\'](http(?![^\'"]+\.[0-9]+[\'"])[^\'"]+)["\']', webpage))
  2438. if not found:
  2439. # Flow player
  2440. found = filter_video(re.findall(r'''(?xs)
  2441. flowplayer\("[^"]+",\s*
  2442. \{[^}]+?\}\s*,
  2443. \s*\{[^}]+? ["']?clip["']?\s*:\s*\{\s*
  2444. ["']?url["']?\s*:\s*["']([^"']+)["']
  2445. ''', webpage))
  2446. if not found:
  2447. # Cinerama player
  2448. found = re.findall(
  2449. r"cinerama\.embedPlayer\(\s*\'[^']+\',\s*'([^']+)'", webpage)
  2450. if not found:
  2451. # Try to find twitter cards info
  2452. # twitter:player:stream should be checked before twitter:player since
  2453. # it is expected to contain a raw stream (see
  2454. # https://dev.twitter.com/cards/types/player#On_twitter.com_via_desktop_browser)
  2455. found = filter_video(re.findall(
  2456. r'<meta (?:property|name)="twitter:player:stream" (?:content|value)="(.+?)"', webpage))
  2457. if not found:
  2458. # We look for Open Graph info:
  2459. # We have to match any number spaces between elements, some sites try to align them (eg.: statigr.am)
  2460. m_video_type = re.findall(r'<meta.*?property="og:video:type".*?content="video/(.*?)"', webpage)
  2461. # We only look in og:video if the MIME type is a video, don't try if it's a Flash player:
  2462. if m_video_type is not None:
  2463. found = filter_video(re.findall(r'<meta.*?property="og:video".*?content="(.*?)"', webpage))
  2464. if not found:
  2465. REDIRECT_REGEX = r'[0-9]{,2};\s*(?:URL|url)=\'?([^\'"]+)'
  2466. found = re.search(
  2467. r'(?i)<meta\s+(?=(?:[a-z-]+="[^"]+"\s+)*http-equiv="refresh")'
  2468. r'(?:[a-z-]+="[^"]+"\s+)*?content="%s' % REDIRECT_REGEX,
  2469. webpage)
  2470. if not found:
  2471. # Look also in Refresh HTTP header
  2472. refresh_header = head_response.headers.get('Refresh')
  2473. if refresh_header:
  2474. # In python 2 response HTTP headers are bytestrings
  2475. if sys.version_info < (3, 0) and isinstance(refresh_header, str):
  2476. refresh_header = refresh_header.decode('iso-8859-1')
  2477. found = re.search(REDIRECT_REGEX, refresh_header)
  2478. if found:
  2479. new_url = compat_urlparse.urljoin(url, unescapeHTML(found.group(1)))
  2480. self.report_following_redirect(new_url)
  2481. return {
  2482. '_type': 'url',
  2483. 'url': new_url,
  2484. }
  2485. if not found:
  2486. # twitter:player is a https URL to iframe player that may or may not
  2487. # be supported by youtube-dl thus this is checked the very last (see
  2488. # https://dev.twitter.com/cards/types/player#On_twitter.com_via_desktop_browser)
  2489. embed_url = self._html_search_meta('twitter:player', webpage, default=None)
  2490. if embed_url:
  2491. return self.url_result(embed_url)
  2492. if not found:
  2493. raise UnsupportedError(url)
  2494. entries = []
  2495. for video_url in orderedSet(found):
  2496. video_url = unescapeHTML(video_url)
  2497. video_url = video_url.replace('\\/', '/')
  2498. video_url = compat_urlparse.urljoin(url, video_url)
  2499. video_id = compat_urllib_parse_unquote(os.path.basename(video_url))
  2500. # Sometimes, jwplayer extraction will result in a YouTube URL
  2501. if YoutubeIE.suitable(video_url):
  2502. entries.append(self.url_result(video_url, 'Youtube'))
  2503. continue
  2504. # here's a fun little line of code for you:
  2505. video_id = os.path.splitext(video_id)[0]
  2506. entry_info_dict = {
  2507. 'id': video_id,
  2508. 'uploader': video_uploader,
  2509. 'title': video_title,
  2510. 'age_limit': age_limit,
  2511. }
  2512. if RtmpIE.suitable(video_url):
  2513. entry_info_dict.update({
  2514. '_type': 'url_transparent',
  2515. 'ie_key': RtmpIE.ie_key(),
  2516. 'url': video_url,
  2517. })
  2518. entries.append(entry_info_dict)
  2519. continue
  2520. ext = determine_ext(video_url)
  2521. if ext == 'smil':
  2522. entry_info_dict['formats'] = self._extract_smil_formats(video_url, video_id)
  2523. elif ext == 'xspf':
  2524. return self.playlist_result(self._extract_xspf_playlist(video_url, video_id), video_id)
  2525. elif ext == 'm3u8':
  2526. entry_info_dict['formats'] = self._extract_m3u8_formats(video_url, video_id, ext='mp4')
  2527. elif ext == 'mpd':
  2528. entry_info_dict['formats'] = self._extract_mpd_formats(video_url, video_id)
  2529. elif ext == 'f4m':
  2530. entry_info_dict['formats'] = self._extract_f4m_formats(video_url, video_id)
  2531. elif re.search(r'(?i)\.(?:ism|smil)/manifest', video_url) and video_url != url:
  2532. # Just matching .ism/manifest is not enough to be reliably sure
  2533. # whether it's actually an ISM manifest or some other streaming
  2534. # manifest since there are various streaming URL formats
  2535. # possible (see [1]) as well as some other shenanigans like
  2536. # .smil/manifest URLs that actually serve an ISM (see [2]) and
  2537. # so on.
  2538. # Thus the most reasonable way to solve this is to delegate
  2539. # to generic extractor in order to look into the contents of
  2540. # the manifest itself.
  2541. # 1. https://azure.microsoft.com/en-us/documentation/articles/media-services-deliver-content-overview/#streaming-url-formats
  2542. # 2. https://svs.itworkscdn.net/lbcivod/smil:itwfcdn/lbci/170976.smil/Manifest
  2543. entry_info_dict = self.url_result(
  2544. smuggle_url(video_url, {'to_generic': True}),
  2545. GenericIE.ie_key())
  2546. else:
  2547. entry_info_dict['url'] = video_url
  2548. if entry_info_dict.get('formats'):
  2549. self._sort_formats(entry_info_dict['formats'])
  2550. entries.append(entry_info_dict)
  2551. if len(entries) == 1:
  2552. return entries[0]
  2553. else:
  2554. for num, e in enumerate(entries, start=1):
  2555. # 'url' results don't have a title
  2556. if e.get('title') is not None:
  2557. e['title'] = '%s (%d)' % (e['title'], num)
  2558. return {
  2559. '_type': 'playlist',
  2560. 'entries': entries,
  2561. }