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.

2641 lines
106 KiB

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