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.

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