2
0

generic.py 127 KB

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