InfoExtractors.py 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151
  1. import base64
  2. import datetime
  3. import itertools
  4. import netrc
  5. import os
  6. import re
  7. import socket
  8. import time
  9. import email.utils
  10. import xml.etree.ElementTree
  11. import random
  12. import math
  13. import operator
  14. import hashlib
  15. import binascii
  16. import urllib
  17. from .utils import *
  18. from .extractor.common import InfoExtractor, SearchInfoExtractor
  19. from .extractor.ard import ARDIE
  20. from .extractor.arte import ArteTvIE
  21. from .extractor.bliptv import BlipTVIE, BlipTVUserIE
  22. from .extractor.comedycentral import ComedyCentralIE
  23. from .extractor.collegehumor import CollegeHumorIE
  24. from .extractor.dailymotion import DailymotionIE
  25. from .extractor.depositfiles import DepositFilesIE
  26. from .extractor.escapist import EscapistIE
  27. from .extractor.facebook import FacebookIE
  28. from .extractor.funnyordie import FunnyOrDieIE
  29. from .extractor.gametrailers import GametrailersIE
  30. from .extractor.generic import GenericIE
  31. from .extractor.googleplus import GooglePlusIE
  32. from .extractor.googlesearch import GoogleSearchIE
  33. from .extractor.infoq import InfoQIE
  34. from .extractor.metacafe import MetacafeIE
  35. from .extractor.mixcloud import MixcloudIE
  36. from .extractor.mtv import MTVIE
  37. from .extractor.myvideo import MyVideoIE
  38. from .extractor.nba import NBAIE
  39. from .extractor.statigram import StatigramIE
  40. from .extractor.photobucket import PhotobucketIE
  41. from .extractor.soundcloud import SoundcloudIE, SoundcloudSetIE
  42. from .extractor.stanfordoc import StanfordOpenClassroomIE
  43. from .extractor.steam import SteamIE
  44. from .extractor.ted import TEDIE
  45. from .extractor.vimeo import VimeoIE
  46. from .extractor.worldstarhiphop import WorldStarHipHopIE
  47. from .extractor.xnxx import XNXXIE
  48. from .extractor.xvideos import XVideosIE
  49. from .extractor.yahoo import YahooIE, YahooSearchIE
  50. from .extractor.youku import YoukuIE
  51. from .extractor.youtube import YoutubeIE, YoutubePlaylistIE, YoutubeSearchIE, YoutubeUserIE, YoutubeChannelIE
  52. from .extractor.zdf import ZDFIE
  53. class JustinTVIE(InfoExtractor):
  54. """Information extractor for justin.tv and twitch.tv"""
  55. # TODO: One broadcast may be split into multiple videos. The key
  56. # 'broadcast_id' is the same for all parts, and 'broadcast_part'
  57. # starts at 1 and increases. Can we treat all parts as one video?
  58. _VALID_URL = r"""(?x)^(?:http://)?(?:www\.)?(?:twitch|justin)\.tv/
  59. (?:
  60. (?P<channelid>[^/]+)|
  61. (?:(?:[^/]+)/b/(?P<videoid>[^/]+))|
  62. (?:(?:[^/]+)/c/(?P<chapterid>[^/]+))
  63. )
  64. /?(?:\#.*)?$
  65. """
  66. _JUSTIN_PAGE_LIMIT = 100
  67. IE_NAME = u'justin.tv'
  68. def report_download_page(self, channel, offset):
  69. """Report attempt to download a single page of videos."""
  70. self.to_screen(u'%s: Downloading video information from %d to %d' %
  71. (channel, offset, offset + self._JUSTIN_PAGE_LIMIT))
  72. # Return count of items, list of *valid* items
  73. def _parse_page(self, url, video_id):
  74. webpage = self._download_webpage(url, video_id,
  75. u'Downloading video info JSON',
  76. u'unable to download video info JSON')
  77. response = json.loads(webpage)
  78. if type(response) != list:
  79. error_text = response.get('error', 'unknown error')
  80. raise ExtractorError(u'Justin.tv API: %s' % error_text)
  81. info = []
  82. for clip in response:
  83. video_url = clip['video_file_url']
  84. if video_url:
  85. video_extension = os.path.splitext(video_url)[1][1:]
  86. video_date = re.sub('-', '', clip['start_time'][:10])
  87. video_uploader_id = clip.get('user_id', clip.get('channel_id'))
  88. video_id = clip['id']
  89. video_title = clip.get('title', video_id)
  90. info.append({
  91. 'id': video_id,
  92. 'url': video_url,
  93. 'title': video_title,
  94. 'uploader': clip.get('channel_name', video_uploader_id),
  95. 'uploader_id': video_uploader_id,
  96. 'upload_date': video_date,
  97. 'ext': video_extension,
  98. })
  99. return (len(response), info)
  100. def _real_extract(self, url):
  101. mobj = re.match(self._VALID_URL, url)
  102. if mobj is None:
  103. raise ExtractorError(u'invalid URL: %s' % url)
  104. api_base = 'http://api.justin.tv'
  105. paged = False
  106. if mobj.group('channelid'):
  107. paged = True
  108. video_id = mobj.group('channelid')
  109. api = api_base + '/channel/archives/%s.json' % video_id
  110. elif mobj.group('chapterid'):
  111. chapter_id = mobj.group('chapterid')
  112. webpage = self._download_webpage(url, chapter_id)
  113. m = re.search(r'PP\.archive_id = "([0-9]+)";', webpage)
  114. if not m:
  115. raise ExtractorError(u'Cannot find archive of a chapter')
  116. archive_id = m.group(1)
  117. api = api_base + '/broadcast/by_chapter/%s.xml' % chapter_id
  118. chapter_info_xml = self._download_webpage(api, chapter_id,
  119. note=u'Downloading chapter information',
  120. errnote=u'Chapter information download failed')
  121. doc = xml.etree.ElementTree.fromstring(chapter_info_xml)
  122. for a in doc.findall('.//archive'):
  123. if archive_id == a.find('./id').text:
  124. break
  125. else:
  126. raise ExtractorError(u'Could not find chapter in chapter information')
  127. video_url = a.find('./video_file_url').text
  128. video_ext = video_url.rpartition('.')[2] or u'flv'
  129. chapter_api_url = u'https://api.twitch.tv/kraken/videos/c' + chapter_id
  130. chapter_info_json = self._download_webpage(chapter_api_url, u'c' + chapter_id,
  131. note='Downloading chapter metadata',
  132. errnote='Download of chapter metadata failed')
  133. chapter_info = json.loads(chapter_info_json)
  134. bracket_start = int(doc.find('.//bracket_start').text)
  135. bracket_end = int(doc.find('.//bracket_end').text)
  136. # TODO determine start (and probably fix up file)
  137. # youtube-dl -v http://www.twitch.tv/firmbelief/c/1757457
  138. #video_url += u'?start=' + TODO:start_timestamp
  139. # bracket_start is 13290, but we want 51670615
  140. self._downloader.report_warning(u'Chapter detected, but we can just download the whole file. '
  141. u'Chapter starts at %s and ends at %s' % (formatSeconds(bracket_start), formatSeconds(bracket_end)))
  142. info = {
  143. 'id': u'c' + chapter_id,
  144. 'url': video_url,
  145. 'ext': video_ext,
  146. 'title': chapter_info['title'],
  147. 'thumbnail': chapter_info['preview'],
  148. 'description': chapter_info['description'],
  149. 'uploader': chapter_info['channel']['display_name'],
  150. 'uploader_id': chapter_info['channel']['name'],
  151. }
  152. return [info]
  153. else:
  154. video_id = mobj.group('videoid')
  155. api = api_base + '/broadcast/by_archive/%s.json' % video_id
  156. self.report_extraction(video_id)
  157. info = []
  158. offset = 0
  159. limit = self._JUSTIN_PAGE_LIMIT
  160. while True:
  161. if paged:
  162. self.report_download_page(video_id, offset)
  163. page_url = api + ('?offset=%d&limit=%d' % (offset, limit))
  164. page_count, page_info = self._parse_page(page_url, video_id)
  165. info.extend(page_info)
  166. if not paged or page_count != limit:
  167. break
  168. offset += limit
  169. return info
  170. class UstreamIE(InfoExtractor):
  171. _VALID_URL = r'https?://www\.ustream\.tv/recorded/(?P<videoID>\d+)'
  172. IE_NAME = u'ustream'
  173. def _real_extract(self, url):
  174. m = re.match(self._VALID_URL, url)
  175. video_id = m.group('videoID')
  176. video_url = u'http://tcdn.ustream.tv/video/%s' % video_id
  177. webpage = self._download_webpage(url, video_id)
  178. self.report_extraction(video_id)
  179. video_title = self._html_search_regex(r'data-title="(?P<title>.+)"',
  180. webpage, u'title')
  181. uploader = self._html_search_regex(r'data-content-type="channel".*?>(?P<uploader>.*?)</a>',
  182. webpage, u'uploader', fatal=False, flags=re.DOTALL)
  183. thumbnail = self._html_search_regex(r'<link rel="image_src" href="(?P<thumb>.*?)"',
  184. webpage, u'thumbnail', fatal=False)
  185. info = {
  186. 'id': video_id,
  187. 'url': video_url,
  188. 'ext': 'flv',
  189. 'title': video_title,
  190. 'uploader': uploader,
  191. 'thumbnail': thumbnail,
  192. }
  193. return info
  194. class RBMARadioIE(InfoExtractor):
  195. _VALID_URL = r'https?://(?:www\.)?rbmaradio\.com/shows/(?P<videoID>[^/]+)$'
  196. def _real_extract(self, url):
  197. m = re.match(self._VALID_URL, url)
  198. video_id = m.group('videoID')
  199. webpage = self._download_webpage(url, video_id)
  200. json_data = self._search_regex(r'window\.gon.*?gon\.show=(.+?);$',
  201. webpage, u'json data', flags=re.MULTILINE)
  202. try:
  203. data = json.loads(json_data)
  204. except ValueError as e:
  205. raise ExtractorError(u'Invalid JSON: ' + str(e))
  206. video_url = data['akamai_url'] + '&cbr=256'
  207. url_parts = compat_urllib_parse_urlparse(video_url)
  208. video_ext = url_parts.path.rpartition('.')[2]
  209. info = {
  210. 'id': video_id,
  211. 'url': video_url,
  212. 'ext': video_ext,
  213. 'title': data['title'],
  214. 'description': data.get('teaser_text'),
  215. 'location': data.get('country_of_origin'),
  216. 'uploader': data.get('host', {}).get('name'),
  217. 'uploader_id': data.get('host', {}).get('slug'),
  218. 'thumbnail': data.get('image', {}).get('large_url_2x'),
  219. 'duration': data.get('duration'),
  220. }
  221. return [info]
  222. class YouPornIE(InfoExtractor):
  223. """Information extractor for youporn.com."""
  224. _VALID_URL = r'^(?:https?://)?(?:\w+\.)?youporn\.com/watch/(?P<videoid>[0-9]+)/(?P<title>[^/]+)'
  225. def _print_formats(self, formats):
  226. """Print all available formats"""
  227. print(u'Available formats:')
  228. print(u'ext\t\tformat')
  229. print(u'---------------------------------')
  230. for format in formats:
  231. print(u'%s\t\t%s' % (format['ext'], format['format']))
  232. def _specific(self, req_format, formats):
  233. for x in formats:
  234. if(x["format"]==req_format):
  235. return x
  236. return None
  237. def _real_extract(self, url):
  238. mobj = re.match(self._VALID_URL, url)
  239. if mobj is None:
  240. raise ExtractorError(u'Invalid URL: %s' % url)
  241. video_id = mobj.group('videoid')
  242. req = compat_urllib_request.Request(url)
  243. req.add_header('Cookie', 'age_verified=1')
  244. webpage = self._download_webpage(req, video_id)
  245. # Get JSON parameters
  246. json_params = self._search_regex(r'var currentVideo = new Video\((.*)\);', webpage, u'JSON parameters')
  247. try:
  248. params = json.loads(json_params)
  249. except:
  250. raise ExtractorError(u'Invalid JSON')
  251. self.report_extraction(video_id)
  252. try:
  253. video_title = params['title']
  254. upload_date = unified_strdate(params['release_date_f'])
  255. video_description = params['description']
  256. video_uploader = params['submitted_by']
  257. thumbnail = params['thumbnails'][0]['image']
  258. except KeyError:
  259. raise ExtractorError('Missing JSON parameter: ' + sys.exc_info()[1])
  260. # Get all of the formats available
  261. DOWNLOAD_LIST_RE = r'(?s)<ul class="downloadList">(?P<download_list>.*?)</ul>'
  262. download_list_html = self._search_regex(DOWNLOAD_LIST_RE,
  263. webpage, u'download list').strip()
  264. # Get all of the links from the page
  265. LINK_RE = r'(?s)<a href="(?P<url>[^"]+)">'
  266. links = re.findall(LINK_RE, download_list_html)
  267. if(len(links) == 0):
  268. raise ExtractorError(u'ERROR: no known formats available for video')
  269. self.to_screen(u'Links found: %d' % len(links))
  270. formats = []
  271. for link in links:
  272. # A link looks like this:
  273. # http://cdn1.download.youporn.phncdn.com/201210/31/8004515/480p_370k_8004515/YouPorn%20-%20Nubile%20Films%20The%20Pillow%20Fight.mp4?nvb=20121113051249&nva=20121114051249&ir=1200&sr=1200&hash=014b882080310e95fb6a0
  274. # A path looks like this:
  275. # /201210/31/8004515/480p_370k_8004515/YouPorn%20-%20Nubile%20Films%20The%20Pillow%20Fight.mp4
  276. video_url = unescapeHTML( link )
  277. path = compat_urllib_parse_urlparse( video_url ).path
  278. extension = os.path.splitext( path )[1][1:]
  279. format = path.split('/')[4].split('_')[:2]
  280. size = format[0]
  281. bitrate = format[1]
  282. format = "-".join( format )
  283. # title = u'%s-%s-%s' % (video_title, size, bitrate)
  284. formats.append({
  285. 'id': video_id,
  286. 'url': video_url,
  287. 'uploader': video_uploader,
  288. 'upload_date': upload_date,
  289. 'title': video_title,
  290. 'ext': extension,
  291. 'format': format,
  292. 'thumbnail': thumbnail,
  293. 'description': video_description
  294. })
  295. if self._downloader.params.get('listformats', None):
  296. self._print_formats(formats)
  297. return
  298. req_format = self._downloader.params.get('format', None)
  299. self.to_screen(u'Format: %s' % req_format)
  300. if req_format is None or req_format == 'best':
  301. return [formats[0]]
  302. elif req_format == 'worst':
  303. return [formats[-1]]
  304. elif req_format in ('-1', 'all'):
  305. return formats
  306. else:
  307. format = self._specific( req_format, formats )
  308. if result is None:
  309. raise ExtractorError(u'Requested format not available')
  310. return [format]
  311. class PornotubeIE(InfoExtractor):
  312. """Information extractor for pornotube.com."""
  313. _VALID_URL = r'^(?:https?://)?(?:\w+\.)?pornotube\.com(/c/(?P<channel>[0-9]+))?(/m/(?P<videoid>[0-9]+))(/(?P<title>.+))$'
  314. def _real_extract(self, url):
  315. mobj = re.match(self._VALID_URL, url)
  316. if mobj is None:
  317. raise ExtractorError(u'Invalid URL: %s' % url)
  318. video_id = mobj.group('videoid')
  319. video_title = mobj.group('title')
  320. # Get webpage content
  321. webpage = self._download_webpage(url, video_id)
  322. # Get the video URL
  323. VIDEO_URL_RE = r'url: "(?P<url>http://video[0-9].pornotube.com/.+\.flv)",'
  324. video_url = self._search_regex(VIDEO_URL_RE, webpage, u'video url')
  325. video_url = compat_urllib_parse.unquote(video_url)
  326. #Get the uploaded date
  327. VIDEO_UPLOADED_RE = r'<div class="video_added_by">Added (?P<date>[0-9\/]+) by'
  328. upload_date = self._html_search_regex(VIDEO_UPLOADED_RE, webpage, u'upload date', fatal=False)
  329. if upload_date: upload_date = unified_strdate(upload_date)
  330. info = {'id': video_id,
  331. 'url': video_url,
  332. 'uploader': None,
  333. 'upload_date': upload_date,
  334. 'title': video_title,
  335. 'ext': 'flv',
  336. 'format': 'flv'}
  337. return [info]
  338. class YouJizzIE(InfoExtractor):
  339. """Information extractor for youjizz.com."""
  340. _VALID_URL = r'^(?:https?://)?(?:\w+\.)?youjizz\.com/videos/(?P<videoid>[^.]+).html$'
  341. def _real_extract(self, url):
  342. mobj = re.match(self._VALID_URL, url)
  343. if mobj is None:
  344. raise ExtractorError(u'Invalid URL: %s' % url)
  345. video_id = mobj.group('videoid')
  346. # Get webpage content
  347. webpage = self._download_webpage(url, video_id)
  348. # Get the video title
  349. video_title = self._html_search_regex(r'<title>(?P<title>.*)</title>',
  350. webpage, u'title').strip()
  351. # Get the embed page
  352. result = re.search(r'https?://www.youjizz.com/videos/embed/(?P<videoid>[0-9]+)', webpage)
  353. if result is None:
  354. raise ExtractorError(u'ERROR: unable to extract embed page')
  355. embed_page_url = result.group(0).strip()
  356. video_id = result.group('videoid')
  357. webpage = self._download_webpage(embed_page_url, video_id)
  358. # Get the video URL
  359. video_url = self._search_regex(r'so.addVariable\("file",encodeURIComponent\("(?P<source>[^"]+)"\)\);',
  360. webpage, u'video URL')
  361. info = {'id': video_id,
  362. 'url': video_url,
  363. 'title': video_title,
  364. 'ext': 'flv',
  365. 'format': 'flv',
  366. 'player_url': embed_page_url}
  367. return [info]
  368. class EightTracksIE(InfoExtractor):
  369. IE_NAME = '8tracks'
  370. _VALID_URL = r'https?://8tracks.com/(?P<user>[^/]+)/(?P<id>[^/#]+)(?:#.*)?$'
  371. def _real_extract(self, url):
  372. mobj = re.match(self._VALID_URL, url)
  373. if mobj is None:
  374. raise ExtractorError(u'Invalid URL: %s' % url)
  375. playlist_id = mobj.group('id')
  376. webpage = self._download_webpage(url, playlist_id)
  377. json_like = self._search_regex(r"PAGE.mix = (.*?);\n", webpage, u'trax information', flags=re.DOTALL)
  378. data = json.loads(json_like)
  379. session = str(random.randint(0, 1000000000))
  380. mix_id = data['id']
  381. track_count = data['tracks_count']
  382. first_url = 'http://8tracks.com/sets/%s/play?player=sm&mix_id=%s&format=jsonh' % (session, mix_id)
  383. next_url = first_url
  384. res = []
  385. for i in itertools.count():
  386. api_json = self._download_webpage(next_url, playlist_id,
  387. note=u'Downloading song information %s/%s' % (str(i+1), track_count),
  388. errnote=u'Failed to download song information')
  389. api_data = json.loads(api_json)
  390. track_data = api_data[u'set']['track']
  391. info = {
  392. 'id': track_data['id'],
  393. 'url': track_data['track_file_stream_url'],
  394. 'title': track_data['performer'] + u' - ' + track_data['name'],
  395. 'raw_title': track_data['name'],
  396. 'uploader_id': data['user']['login'],
  397. 'ext': 'm4a',
  398. }
  399. res.append(info)
  400. if api_data['set']['at_last_track']:
  401. break
  402. next_url = 'http://8tracks.com/sets/%s/next?player=sm&mix_id=%s&format=jsonh&track_id=%s' % (session, mix_id, track_data['id'])
  403. return res
  404. class KeekIE(InfoExtractor):
  405. _VALID_URL = r'http://(?:www\.)?keek\.com/(?:!|\w+/keeks/)(?P<videoID>\w+)'
  406. IE_NAME = u'keek'
  407. def _real_extract(self, url):
  408. m = re.match(self._VALID_URL, url)
  409. video_id = m.group('videoID')
  410. video_url = u'http://cdn.keek.com/keek/video/%s' % video_id
  411. thumbnail = u'http://cdn.keek.com/keek/thumbnail/%s/w100/h75' % video_id
  412. webpage = self._download_webpage(url, video_id)
  413. video_title = self._html_search_regex(r'<meta property="og:title" content="(?P<title>.*?)"',
  414. webpage, u'title')
  415. uploader = self._html_search_regex(r'<div class="user-name-and-bio">[\S\s]+?<h2>(?P<uploader>.+?)</h2>',
  416. webpage, u'uploader', fatal=False)
  417. info = {
  418. 'id': video_id,
  419. 'url': video_url,
  420. 'ext': 'mp4',
  421. 'title': video_title,
  422. 'thumbnail': thumbnail,
  423. 'uploader': uploader
  424. }
  425. return [info]
  426. class MySpassIE(InfoExtractor):
  427. _VALID_URL = r'http://www.myspass.de/.*'
  428. def _real_extract(self, url):
  429. META_DATA_URL_TEMPLATE = 'http://www.myspass.de/myspass/includes/apps/video/getvideometadataxml.php?id=%s'
  430. # video id is the last path element of the URL
  431. # usually there is a trailing slash, so also try the second but last
  432. url_path = compat_urllib_parse_urlparse(url).path
  433. url_parent_path, video_id = os.path.split(url_path)
  434. if not video_id:
  435. _, video_id = os.path.split(url_parent_path)
  436. # get metadata
  437. metadata_url = META_DATA_URL_TEMPLATE % video_id
  438. metadata_text = self._download_webpage(metadata_url, video_id)
  439. metadata = xml.etree.ElementTree.fromstring(metadata_text.encode('utf-8'))
  440. # extract values from metadata
  441. url_flv_el = metadata.find('url_flv')
  442. if url_flv_el is None:
  443. raise ExtractorError(u'Unable to extract download url')
  444. video_url = url_flv_el.text
  445. extension = os.path.splitext(video_url)[1][1:]
  446. title_el = metadata.find('title')
  447. if title_el is None:
  448. raise ExtractorError(u'Unable to extract title')
  449. title = title_el.text
  450. format_id_el = metadata.find('format_id')
  451. if format_id_el is None:
  452. format = ext
  453. else:
  454. format = format_id_el.text
  455. description_el = metadata.find('description')
  456. if description_el is not None:
  457. description = description_el.text
  458. else:
  459. description = None
  460. imagePreview_el = metadata.find('imagePreview')
  461. if imagePreview_el is not None:
  462. thumbnail = imagePreview_el.text
  463. else:
  464. thumbnail = None
  465. info = {
  466. 'id': video_id,
  467. 'url': video_url,
  468. 'title': title,
  469. 'ext': extension,
  470. 'format': format,
  471. 'thumbnail': thumbnail,
  472. 'description': description
  473. }
  474. return [info]
  475. class SpiegelIE(InfoExtractor):
  476. _VALID_URL = r'https?://(?:www\.)?spiegel\.de/video/[^/]*-(?P<videoID>[0-9]+)(?:\.html)?(?:#.*)?$'
  477. def _real_extract(self, url):
  478. m = re.match(self._VALID_URL, url)
  479. video_id = m.group('videoID')
  480. webpage = self._download_webpage(url, video_id)
  481. video_title = self._html_search_regex(r'<div class="module-title">(.*?)</div>',
  482. webpage, u'title')
  483. xml_url = u'http://video2.spiegel.de/flash/' + video_id + u'.xml'
  484. xml_code = self._download_webpage(xml_url, video_id,
  485. note=u'Downloading XML', errnote=u'Failed to download XML')
  486. idoc = xml.etree.ElementTree.fromstring(xml_code)
  487. last_type = idoc[-1]
  488. filename = last_type.findall('./filename')[0].text
  489. duration = float(last_type.findall('./duration')[0].text)
  490. video_url = 'http://video2.spiegel.de/flash/' + filename
  491. video_ext = filename.rpartition('.')[2]
  492. info = {
  493. 'id': video_id,
  494. 'url': video_url,
  495. 'ext': video_ext,
  496. 'title': video_title,
  497. 'duration': duration,
  498. }
  499. return [info]
  500. class LiveLeakIE(InfoExtractor):
  501. _VALID_URL = r'^(?:http?://)?(?:\w+\.)?liveleak\.com/view\?(?:.*?)i=(?P<video_id>[\w_]+)(?:.*)'
  502. IE_NAME = u'liveleak'
  503. def _real_extract(self, url):
  504. mobj = re.match(self._VALID_URL, url)
  505. if mobj is None:
  506. raise ExtractorError(u'Invalid URL: %s' % url)
  507. video_id = mobj.group('video_id')
  508. webpage = self._download_webpage(url, video_id)
  509. video_url = self._search_regex(r'file: "(.*?)",',
  510. webpage, u'video URL')
  511. video_title = self._html_search_regex(r'<meta property="og:title" content="(?P<title>.*?)"',
  512. webpage, u'title').replace('LiveLeak.com -', '').strip()
  513. video_description = self._html_search_regex(r'<meta property="og:description" content="(?P<desc>.*?)"',
  514. webpage, u'description', fatal=False)
  515. video_uploader = self._html_search_regex(r'By:.*?(\w+)</a>',
  516. webpage, u'uploader', fatal=False)
  517. info = {
  518. 'id': video_id,
  519. 'url': video_url,
  520. 'ext': 'mp4',
  521. 'title': video_title,
  522. 'description': video_description,
  523. 'uploader': video_uploader
  524. }
  525. return [info]
  526. class TumblrIE(InfoExtractor):
  527. _VALID_URL = r'http://(?P<blog_name>.*?)\.tumblr\.com/((post)|(video))/(?P<id>\d*)/(.*?)'
  528. def _real_extract(self, url):
  529. m_url = re.match(self._VALID_URL, url)
  530. video_id = m_url.group('id')
  531. blog = m_url.group('blog_name')
  532. url = 'http://%s.tumblr.com/post/%s/' % (blog, video_id)
  533. webpage = self._download_webpage(url, video_id)
  534. re_video = r'src=\\x22(?P<video_url>http://%s\.tumblr\.com/video_file/%s/(.*?))\\x22 type=\\x22video/(?P<ext>.*?)\\x22' % (blog, video_id)
  535. video = re.search(re_video, webpage)
  536. if video is None:
  537. raise ExtractorError(u'Unable to extract video')
  538. video_url = video.group('video_url')
  539. ext = video.group('ext')
  540. video_thumbnail = self._search_regex(r'posters(.*?)\[\\x22(?P<thumb>.*?)\\x22',
  541. webpage, u'thumbnail', fatal=False) # We pick the first poster
  542. if video_thumbnail: video_thumbnail = video_thumbnail.replace('\\', '')
  543. # The only place where you can get a title, it's not complete,
  544. # but searching in other places doesn't work for all videos
  545. video_title = self._html_search_regex(r'<title>(?P<title>.*?)</title>',
  546. webpage, u'title', flags=re.DOTALL)
  547. return [{'id': video_id,
  548. 'url': video_url,
  549. 'title': video_title,
  550. 'thumbnail': video_thumbnail,
  551. 'ext': ext
  552. }]
  553. class BandcampIE(InfoExtractor):
  554. _VALID_URL = r'http://.*?\.bandcamp\.com/track/(?P<title>.*)'
  555. def _real_extract(self, url):
  556. mobj = re.match(self._VALID_URL, url)
  557. title = mobj.group('title')
  558. webpage = self._download_webpage(url, title)
  559. # We get the link to the free download page
  560. m_download = re.search(r'freeDownloadPage: "(.*?)"', webpage)
  561. if m_download is None:
  562. raise ExtractorError(u'No free songs found')
  563. download_link = m_download.group(1)
  564. id = re.search(r'var TralbumData = {(.*?)id: (?P<id>\d*?)$',
  565. webpage, re.MULTILINE|re.DOTALL).group('id')
  566. download_webpage = self._download_webpage(download_link, id,
  567. 'Downloading free downloads page')
  568. # We get the dictionary of the track from some javascrip code
  569. info = re.search(r'items: (.*?),$',
  570. download_webpage, re.MULTILINE).group(1)
  571. info = json.loads(info)[0]
  572. # We pick mp3-320 for now, until format selection can be easily implemented.
  573. mp3_info = info[u'downloads'][u'mp3-320']
  574. # If we try to use this url it says the link has expired
  575. initial_url = mp3_info[u'url']
  576. re_url = r'(?P<server>http://(.*?)\.bandcamp\.com)/download/track\?enc=mp3-320&fsig=(?P<fsig>.*?)&id=(?P<id>.*?)&ts=(?P<ts>.*)$'
  577. m_url = re.match(re_url, initial_url)
  578. #We build the url we will use to get the final track url
  579. # This url is build in Bandcamp in the script download_bunde_*.js
  580. request_url = '%s/statdownload/track?enc=mp3-320&fsig=%s&id=%s&ts=%s&.rand=665028774616&.vrs=1' % (m_url.group('server'), m_url.group('fsig'), id, m_url.group('ts'))
  581. final_url_webpage = self._download_webpage(request_url, id, 'Requesting download url')
  582. # If we could correctly generate the .rand field the url would be
  583. #in the "download_url" key
  584. final_url = re.search(r'"retry_url":"(.*?)"', final_url_webpage).group(1)
  585. track_info = {'id':id,
  586. 'title' : info[u'title'],
  587. 'ext' : 'mp3',
  588. 'url' : final_url,
  589. 'thumbnail' : info[u'thumb_url'],
  590. 'uploader' : info[u'artist']
  591. }
  592. return [track_info]
  593. class RedTubeIE(InfoExtractor):
  594. """Information Extractor for redtube"""
  595. _VALID_URL = r'(?:http://)?(?:www\.)?redtube\.com/(?P<id>[0-9]+)'
  596. def _real_extract(self,url):
  597. mobj = re.match(self._VALID_URL, url)
  598. if mobj is None:
  599. raise ExtractorError(u'Invalid URL: %s' % url)
  600. video_id = mobj.group('id')
  601. video_extension = 'mp4'
  602. webpage = self._download_webpage(url, video_id)
  603. self.report_extraction(video_id)
  604. video_url = self._html_search_regex(r'<source src="(.+?)" type="video/mp4">',
  605. webpage, u'video URL')
  606. video_title = self._html_search_regex('<h1 class="videoTitle slidePanelMovable">(.+?)</h1>',
  607. webpage, u'title')
  608. return [{
  609. 'id': video_id,
  610. 'url': video_url,
  611. 'ext': video_extension,
  612. 'title': video_title,
  613. }]
  614. class InaIE(InfoExtractor):
  615. """Information Extractor for Ina.fr"""
  616. _VALID_URL = r'(?:http://)?(?:www\.)?ina\.fr/video/(?P<id>I[0-9]+)/.*'
  617. def _real_extract(self,url):
  618. mobj = re.match(self._VALID_URL, url)
  619. video_id = mobj.group('id')
  620. mrss_url='http://player.ina.fr/notices/%s.mrss' % video_id
  621. video_extension = 'mp4'
  622. webpage = self._download_webpage(mrss_url, video_id)
  623. self.report_extraction(video_id)
  624. video_url = self._html_search_regex(r'<media:player url="(?P<mp4url>http://mp4.ina.fr/[^"]+\.mp4)',
  625. webpage, u'video URL')
  626. video_title = self._search_regex(r'<title><!\[CDATA\[(?P<titre>.*?)]]></title>',
  627. webpage, u'title')
  628. return [{
  629. 'id': video_id,
  630. 'url': video_url,
  631. 'ext': video_extension,
  632. 'title': video_title,
  633. }]
  634. class HowcastIE(InfoExtractor):
  635. """Information Extractor for Howcast.com"""
  636. _VALID_URL = r'(?:https?://)?(?:www\.)?howcast\.com/videos/(?P<id>\d+)'
  637. def _real_extract(self, url):
  638. mobj = re.match(self._VALID_URL, url)
  639. video_id = mobj.group('id')
  640. webpage_url = 'http://www.howcast.com/videos/' + video_id
  641. webpage = self._download_webpage(webpage_url, video_id)
  642. self.report_extraction(video_id)
  643. video_url = self._search_regex(r'\'?file\'?: "(http://mobile-media\.howcast\.com/[0-9]+\.mp4)',
  644. webpage, u'video URL')
  645. video_title = self._html_search_regex(r'<meta content=(?:"([^"]+)"|\'([^\']+)\') property=\'og:title\'',
  646. webpage, u'title')
  647. video_description = self._html_search_regex(r'<meta content=(?:"([^"]+)"|\'([^\']+)\') name=\'description\'',
  648. webpage, u'description', fatal=False)
  649. thumbnail = self._html_search_regex(r'<meta content=\'(.+?)\' property=\'og:image\'',
  650. webpage, u'thumbnail', fatal=False)
  651. return [{
  652. 'id': video_id,
  653. 'url': video_url,
  654. 'ext': 'mp4',
  655. 'title': video_title,
  656. 'description': video_description,
  657. 'thumbnail': thumbnail,
  658. }]
  659. class VineIE(InfoExtractor):
  660. """Information Extractor for Vine.co"""
  661. _VALID_URL = r'(?:https?://)?(?:www\.)?vine\.co/v/(?P<id>\w+)'
  662. def _real_extract(self, url):
  663. mobj = re.match(self._VALID_URL, url)
  664. video_id = mobj.group('id')
  665. webpage_url = 'https://vine.co/v/' + video_id
  666. webpage = self._download_webpage(webpage_url, video_id)
  667. self.report_extraction(video_id)
  668. video_url = self._html_search_regex(r'<meta property="twitter:player:stream" content="(.+?)"',
  669. webpage, u'video URL')
  670. video_title = self._html_search_regex(r'<meta property="og:title" content="(.+?)"',
  671. webpage, u'title')
  672. thumbnail = self._html_search_regex(r'<meta property="og:image" content="(.+?)(\?.*?)?"',
  673. webpage, u'thumbnail', fatal=False)
  674. uploader = self._html_search_regex(r'<div class="user">.*?<h2>(.+?)</h2>',
  675. webpage, u'uploader', fatal=False, flags=re.DOTALL)
  676. return [{
  677. 'id': video_id,
  678. 'url': video_url,
  679. 'ext': 'mp4',
  680. 'title': video_title,
  681. 'thumbnail': thumbnail,
  682. 'uploader': uploader,
  683. }]
  684. class FlickrIE(InfoExtractor):
  685. """Information Extractor for Flickr videos"""
  686. _VALID_URL = r'(?:https?://)?(?:www\.)?flickr\.com/photos/(?P<uploader_id>[\w\-_@]+)/(?P<id>\d+).*'
  687. def _real_extract(self, url):
  688. mobj = re.match(self._VALID_URL, url)
  689. video_id = mobj.group('id')
  690. video_uploader_id = mobj.group('uploader_id')
  691. webpage_url = 'http://www.flickr.com/photos/' + video_uploader_id + '/' + video_id
  692. webpage = self._download_webpage(webpage_url, video_id)
  693. secret = self._search_regex(r"photo_secret: '(\w+)'", webpage, u'secret')
  694. first_url = 'https://secure.flickr.com/apps/video/video_mtl_xml.gne?v=x&photo_id=' + video_id + '&secret=' + secret + '&bitrate=700&target=_self'
  695. first_xml = self._download_webpage(first_url, video_id, 'Downloading first data webpage')
  696. node_id = self._html_search_regex(r'<Item id="id">(\d+-\d+)</Item>',
  697. first_xml, u'node_id')
  698. second_url = 'https://secure.flickr.com/video_playlist.gne?node_id=' + node_id + '&tech=flash&mode=playlist&bitrate=700&secret=' + secret + '&rd=video.yahoo.com&noad=1'
  699. second_xml = self._download_webpage(second_url, video_id, 'Downloading second data webpage')
  700. self.report_extraction(video_id)
  701. mobj = re.search(r'<STREAM APP="(.+?)" FULLPATH="(.+?)"', second_xml)
  702. if mobj is None:
  703. raise ExtractorError(u'Unable to extract video url')
  704. video_url = mobj.group(1) + unescapeHTML(mobj.group(2))
  705. video_title = self._html_search_regex(r'<meta property="og:title" content=(?:"([^"]+)"|\'([^\']+)\')',
  706. webpage, u'video title')
  707. video_description = self._html_search_regex(r'<meta property="og:description" content=(?:"([^"]+)"|\'([^\']+)\')',
  708. webpage, u'description', fatal=False)
  709. thumbnail = self._html_search_regex(r'<meta property="og:image" content=(?:"([^"]+)"|\'([^\']+)\')',
  710. webpage, u'thumbnail', fatal=False)
  711. return [{
  712. 'id': video_id,
  713. 'url': video_url,
  714. 'ext': 'mp4',
  715. 'title': video_title,
  716. 'description': video_description,
  717. 'thumbnail': thumbnail,
  718. 'uploader_id': video_uploader_id,
  719. }]
  720. class TeamcocoIE(InfoExtractor):
  721. _VALID_URL = r'http://teamcoco\.com/video/(?P<url_title>.*)'
  722. def _real_extract(self, url):
  723. mobj = re.match(self._VALID_URL, url)
  724. if mobj is None:
  725. raise ExtractorError(u'Invalid URL: %s' % url)
  726. url_title = mobj.group('url_title')
  727. webpage = self._download_webpage(url, url_title)
  728. video_id = self._html_search_regex(r'<article class="video" data-id="(\d+?)"',
  729. webpage, u'video id')
  730. self.report_extraction(video_id)
  731. video_title = self._html_search_regex(r'<meta property="og:title" content="(.+?)"',
  732. webpage, u'title')
  733. thumbnail = self._html_search_regex(r'<meta property="og:image" content="(.+?)"',
  734. webpage, u'thumbnail', fatal=False)
  735. video_description = self._html_search_regex(r'<meta property="og:description" content="(.*?)"',
  736. webpage, u'description', fatal=False)
  737. data_url = 'http://teamcoco.com/cvp/2.0/%s.xml' % video_id
  738. data = self._download_webpage(data_url, video_id, 'Downloading data webpage')
  739. video_url = self._html_search_regex(r'<file type="high".*?>(.*?)</file>',
  740. data, u'video URL')
  741. return [{
  742. 'id': video_id,
  743. 'url': video_url,
  744. 'ext': 'mp4',
  745. 'title': video_title,
  746. 'thumbnail': thumbnail,
  747. 'description': video_description,
  748. }]
  749. class XHamsterIE(InfoExtractor):
  750. """Information Extractor for xHamster"""
  751. _VALID_URL = r'(?:http://)?(?:www.)?xhamster\.com/movies/(?P<id>[0-9]+)/.*\.html'
  752. def _real_extract(self,url):
  753. mobj = re.match(self._VALID_URL, url)
  754. video_id = mobj.group('id')
  755. mrss_url = 'http://xhamster.com/movies/%s/.html' % video_id
  756. webpage = self._download_webpage(mrss_url, video_id)
  757. mobj = re.search(r'\'srv\': \'(?P<server>[^\']*)\',\s*\'file\': \'(?P<file>[^\']+)\',', webpage)
  758. if mobj is None:
  759. raise ExtractorError(u'Unable to extract media URL')
  760. if len(mobj.group('server')) == 0:
  761. video_url = compat_urllib_parse.unquote(mobj.group('file'))
  762. else:
  763. video_url = mobj.group('server')+'/key='+mobj.group('file')
  764. video_extension = video_url.split('.')[-1]
  765. video_title = self._html_search_regex(r'<title>(?P<title>.+?) - xHamster\.com</title>',
  766. webpage, u'title')
  767. # Can't see the description anywhere in the UI
  768. # video_description = self._html_search_regex(r'<span>Description: </span>(?P<description>[^<]+)',
  769. # webpage, u'description', fatal=False)
  770. # if video_description: video_description = unescapeHTML(video_description)
  771. mobj = re.search(r'hint=\'(?P<upload_date_Y>[0-9]{4})-(?P<upload_date_m>[0-9]{2})-(?P<upload_date_d>[0-9]{2}) [0-9]{2}:[0-9]{2}:[0-9]{2} [A-Z]{3,4}\'', webpage)
  772. if mobj:
  773. video_upload_date = mobj.group('upload_date_Y')+mobj.group('upload_date_m')+mobj.group('upload_date_d')
  774. else:
  775. video_upload_date = None
  776. self._downloader.report_warning(u'Unable to extract upload date')
  777. video_uploader_id = self._html_search_regex(r'<a href=\'/user/[^>]+>(?P<uploader_id>[^<]+)',
  778. webpage, u'uploader id', default=u'anonymous')
  779. video_thumbnail = self._search_regex(r'\'image\':\'(?P<thumbnail>[^\']+)\'',
  780. webpage, u'thumbnail', fatal=False)
  781. return [{
  782. 'id': video_id,
  783. 'url': video_url,
  784. 'ext': video_extension,
  785. 'title': video_title,
  786. # 'description': video_description,
  787. 'upload_date': video_upload_date,
  788. 'uploader_id': video_uploader_id,
  789. 'thumbnail': video_thumbnail
  790. }]
  791. class HypemIE(InfoExtractor):
  792. """Information Extractor for hypem"""
  793. _VALID_URL = r'(?:http://)?(?:www\.)?hypem\.com/track/([^/]+)/([^/]+)'
  794. def _real_extract(self, url):
  795. mobj = re.match(self._VALID_URL, url)
  796. if mobj is None:
  797. raise ExtractorError(u'Invalid URL: %s' % url)
  798. track_id = mobj.group(1)
  799. data = { 'ax': 1, 'ts': time.time() }
  800. data_encoded = compat_urllib_parse.urlencode(data)
  801. complete_url = url + "?" + data_encoded
  802. request = compat_urllib_request.Request(complete_url)
  803. response, urlh = self._download_webpage_handle(request, track_id, u'Downloading webpage with the url')
  804. cookie = urlh.headers.get('Set-Cookie', '')
  805. self.report_extraction(track_id)
  806. html_tracks = self._html_search_regex(r'<script type="application/json" id="displayList-data">(.*?)</script>',
  807. response, u'tracks', flags=re.MULTILINE|re.DOTALL).strip()
  808. try:
  809. track_list = json.loads(html_tracks)
  810. track = track_list[u'tracks'][0]
  811. except ValueError:
  812. raise ExtractorError(u'Hypemachine contained invalid JSON.')
  813. key = track[u"key"]
  814. track_id = track[u"id"]
  815. artist = track[u"artist"]
  816. title = track[u"song"]
  817. serve_url = "http://hypem.com/serve/source/%s/%s" % (compat_str(track_id), compat_str(key))
  818. request = compat_urllib_request.Request(serve_url, "" , {'Content-Type': 'application/json'})
  819. request.add_header('cookie', cookie)
  820. song_data_json = self._download_webpage(request, track_id, u'Downloading metadata')
  821. try:
  822. song_data = json.loads(song_data_json)
  823. except ValueError:
  824. raise ExtractorError(u'Hypemachine contained invalid JSON.')
  825. final_url = song_data[u"url"]
  826. return [{
  827. 'id': track_id,
  828. 'url': final_url,
  829. 'ext': "mp3",
  830. 'title': title,
  831. 'artist': artist,
  832. }]
  833. class Vbox7IE(InfoExtractor):
  834. """Information Extractor for Vbox7"""
  835. _VALID_URL = r'(?:http://)?(?:www\.)?vbox7\.com/play:([^/]+)'
  836. def _real_extract(self,url):
  837. mobj = re.match(self._VALID_URL, url)
  838. if mobj is None:
  839. raise ExtractorError(u'Invalid URL: %s' % url)
  840. video_id = mobj.group(1)
  841. redirect_page, urlh = self._download_webpage_handle(url, video_id)
  842. new_location = self._search_regex(r'window\.location = \'(.*)\';', redirect_page, u'redirect location')
  843. redirect_url = urlh.geturl() + new_location
  844. webpage = self._download_webpage(redirect_url, video_id, u'Downloading redirect page')
  845. title = self._html_search_regex(r'<title>(.*)</title>',
  846. webpage, u'title').split('/')[0].strip()
  847. ext = "flv"
  848. info_url = "http://vbox7.com/play/magare.do"
  849. data = compat_urllib_parse.urlencode({'as3':'1','vid':video_id})
  850. info_request = compat_urllib_request.Request(info_url, data)
  851. info_request.add_header('Content-Type', 'application/x-www-form-urlencoded')
  852. info_response = self._download_webpage(info_request, video_id, u'Downloading info webpage')
  853. if info_response is None:
  854. raise ExtractorError(u'Unable to extract the media url')
  855. (final_url, thumbnail_url) = map(lambda x: x.split('=')[1], info_response.split('&'))
  856. return [{
  857. 'id': video_id,
  858. 'url': final_url,
  859. 'ext': ext,
  860. 'title': title,
  861. 'thumbnail': thumbnail_url,
  862. }]
  863. def gen_extractors():
  864. """ Return a list of an instance of every supported extractor.
  865. The order does matter; the first extractor matched is the one handling the URL.
  866. """
  867. return [
  868. YoutubePlaylistIE(),
  869. YoutubeChannelIE(),
  870. YoutubeUserIE(),
  871. YoutubeSearchIE(),
  872. YoutubeIE(),
  873. MetacafeIE(),
  874. DailymotionIE(),
  875. GoogleSearchIE(),
  876. PhotobucketIE(),
  877. YahooIE(),
  878. YahooSearchIE(),
  879. DepositFilesIE(),
  880. FacebookIE(),
  881. BlipTVIE(),
  882. BlipTVUserIE(),
  883. VimeoIE(),
  884. MyVideoIE(),
  885. ComedyCentralIE(),
  886. EscapistIE(),
  887. CollegeHumorIE(),
  888. XVideosIE(),
  889. SoundcloudSetIE(),
  890. SoundcloudIE(),
  891. InfoQIE(),
  892. MixcloudIE(),
  893. StanfordOpenClassroomIE(),
  894. MTVIE(),
  895. YoukuIE(),
  896. XNXXIE(),
  897. YouJizzIE(),
  898. PornotubeIE(),
  899. YouPornIE(),
  900. GooglePlusIE(),
  901. ArteTvIE(),
  902. NBAIE(),
  903. WorldStarHipHopIE(),
  904. JustinTVIE(),
  905. FunnyOrDieIE(),
  906. SteamIE(),
  907. UstreamIE(),
  908. RBMARadioIE(),
  909. EightTracksIE(),
  910. KeekIE(),
  911. TEDIE(),
  912. MySpassIE(),
  913. SpiegelIE(),
  914. LiveLeakIE(),
  915. ARDIE(),
  916. ZDFIE(),
  917. TumblrIE(),
  918. BandcampIE(),
  919. RedTubeIE(),
  920. InaIE(),
  921. HowcastIE(),
  922. VineIE(),
  923. FlickrIE(),
  924. TeamcocoIE(),
  925. XHamsterIE(),
  926. HypemIE(),
  927. Vbox7IE(),
  928. GametrailersIE(),
  929. StatigramIE(),
  930. GenericIE()
  931. ]
  932. def get_info_extractor(ie_name):
  933. """Returns the info extractor class with the given ie_name"""
  934. return globals()[ie_name+'IE']