You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2554 lines
103 KiB

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