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.

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