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.

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