generic.py 105 KB

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