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.

2475 lines
99 KiB

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