generic.py 117 KB

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