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.

431 lines
16 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
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
10 years ago
  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. import re
  4. import json
  5. import itertools
  6. from .common import InfoExtractor
  7. from ..utils import (
  8. determine_ext,
  9. error_to_compat_str,
  10. ExtractorError,
  11. int_or_none,
  12. parse_iso8601,
  13. sanitized_Request,
  14. str_to_int,
  15. unescapeHTML,
  16. )
  17. class DailymotionBaseInfoExtractor(InfoExtractor):
  18. @staticmethod
  19. def _build_request(url):
  20. """Build a request with the family filter disabled"""
  21. request = sanitized_Request(url)
  22. request.add_header('Cookie', 'family_filter=off; ff=off')
  23. return request
  24. def _download_webpage_handle_no_ff(self, url, *args, **kwargs):
  25. request = self._build_request(url)
  26. return self._download_webpage_handle(request, *args, **kwargs)
  27. def _download_webpage_no_ff(self, url, *args, **kwargs):
  28. request = self._build_request(url)
  29. return self._download_webpage(request, *args, **kwargs)
  30. class DailymotionIE(DailymotionBaseInfoExtractor):
  31. _VALID_URL = r'(?i)(?:https?://)?(?:(www|touch)\.)?dailymotion\.[a-z]{2,3}/(?:(?:embed|swf|#)/)?video/(?P<id>[^/?_]+)'
  32. IE_NAME = 'dailymotion'
  33. _FORMATS = [
  34. ('stream_h264_ld_url', 'ld'),
  35. ('stream_h264_url', 'standard'),
  36. ('stream_h264_hq_url', 'hq'),
  37. ('stream_h264_hd_url', 'hd'),
  38. ('stream_h264_hd1080_url', 'hd180'),
  39. ]
  40. _TESTS = [
  41. {
  42. 'url': 'https://www.dailymotion.com/video/x2iuewm_steam-machine-models-pricing-listed-on-steam-store-ign-news_videogames',
  43. 'md5': '2137c41a8e78554bb09225b8eb322406',
  44. 'info_dict': {
  45. 'id': 'x2iuewm',
  46. 'ext': 'mp4',
  47. 'title': 'Steam Machine Models, Pricing Listed on Steam Store - IGN News',
  48. 'description': 'Several come bundled with the Steam Controller.',
  49. 'thumbnail': 're:^https?:.*\.(?:jpg|png)$',
  50. 'duration': 74,
  51. 'timestamp': 1425657362,
  52. 'upload_date': '20150306',
  53. 'uploader': 'IGN',
  54. 'uploader_id': 'xijv66',
  55. 'age_limit': 0,
  56. 'view_count': int,
  57. 'comment_count': int,
  58. }
  59. },
  60. # Vevo video
  61. {
  62. 'url': 'http://www.dailymotion.com/video/x149uew_katy-perry-roar-official_musi',
  63. 'info_dict': {
  64. 'title': 'Roar (Official)',
  65. 'id': 'USUV71301934',
  66. 'ext': 'mp4',
  67. 'uploader': 'Katy Perry',
  68. 'upload_date': '20130905',
  69. },
  70. 'params': {
  71. 'skip_download': True,
  72. },
  73. 'skip': 'VEVO is only available in some countries',
  74. },
  75. # age-restricted video
  76. {
  77. 'url': 'http://www.dailymotion.com/video/xyh2zz_leanna-decker-cyber-girl-of-the-year-desires-nude-playboy-plus_redband',
  78. 'md5': '0d667a7b9cebecc3c89ee93099c4159d',
  79. 'info_dict': {
  80. 'id': 'xyh2zz',
  81. 'ext': 'mp4',
  82. 'title': 'Leanna Decker - Cyber Girl Of The Year Desires Nude [Playboy Plus]',
  83. 'uploader': 'HotWaves1012',
  84. 'age_limit': 18,
  85. }
  86. },
  87. # geo-restricted, player v5
  88. {
  89. 'url': 'http://www.dailymotion.com/video/xhza0o',
  90. 'only_matching': True,
  91. },
  92. # with subtitles
  93. {
  94. 'url': 'http://www.dailymotion.com/video/x20su5f_the-power-of-nightmares-1-the-rise-of-the-politics-of-fear-bbc-2004_news',
  95. 'only_matching': True,
  96. },
  97. {
  98. 'url': 'http://www.dailymotion.com/swf/video/x3n92nf',
  99. 'only_matching': True,
  100. }
  101. ]
  102. def _real_extract(self, url):
  103. video_id = self._match_id(url)
  104. webpage = self._download_webpage_no_ff(
  105. 'https://www.dailymotion.com/video/%s' % video_id, video_id)
  106. age_limit = self._rta_search(webpage)
  107. description = self._og_search_description(webpage) or self._html_search_meta(
  108. 'description', webpage, 'description')
  109. view_count_str = self._search_regex(
  110. (r'<meta[^>]+itemprop="interactionCount"[^>]+content="UserPlays:([\s\d,.]+)"',
  111. r'video_views_count[^>]+>\s+([\s\d\,.]+)'),
  112. webpage, 'view count', fatal=False)
  113. if view_count_str:
  114. view_count_str = re.sub(r'\s', '', view_count_str)
  115. view_count = str_to_int(view_count_str)
  116. comment_count = int_or_none(self._search_regex(
  117. r'<meta[^>]+itemprop="interactionCount"[^>]+content="UserComments:(\d+)"',
  118. webpage, 'comment count', fatal=False))
  119. player_v5 = self._search_regex(
  120. [r'buildPlayer\(({.+?})\);\n', # See https://github.com/rg3/youtube-dl/issues/7826
  121. r'playerV5\s*=\s*dmp\.create\([^,]+?,\s*({.+?})\);',
  122. r'buildPlayer\(({.+?})\);'],
  123. webpage, 'player v5', default=None)
  124. if player_v5:
  125. player = self._parse_json(player_v5, video_id)
  126. metadata = player['metadata']
  127. self._check_error(metadata)
  128. formats = []
  129. for quality, media_list in metadata['qualities'].items():
  130. for media in media_list:
  131. media_url = media.get('url')
  132. if not media_url:
  133. continue
  134. type_ = media.get('type')
  135. if type_ == 'application/vnd.lumberjack.manifest':
  136. continue
  137. ext = determine_ext(media_url)
  138. if type_ == 'application/x-mpegURL' or ext == 'm3u8':
  139. formats.extend(self._extract_m3u8_formats(
  140. media_url, video_id, 'mp4', preference=-1,
  141. m3u8_id='hls', fatal=False))
  142. elif type_ == 'application/f4m' or ext == 'f4m':
  143. formats.extend(self._extract_f4m_formats(
  144. media_url, video_id, preference=-1, f4m_id='hds', fatal=False))
  145. else:
  146. f = {
  147. 'url': media_url,
  148. 'format_id': 'http-%s' % quality,
  149. }
  150. m = re.search(r'H264-(?P<width>\d+)x(?P<height>\d+)', media_url)
  151. if m:
  152. f.update({
  153. 'width': int(m.group('width')),
  154. 'height': int(m.group('height')),
  155. })
  156. formats.append(f)
  157. self._sort_formats(formats)
  158. title = metadata['title']
  159. duration = int_or_none(metadata.get('duration'))
  160. timestamp = int_or_none(metadata.get('created_time'))
  161. thumbnail = metadata.get('poster_url')
  162. uploader = metadata.get('owner', {}).get('screenname')
  163. uploader_id = metadata.get('owner', {}).get('id')
  164. subtitles = {}
  165. subtitles_data = metadata.get('subtitles', {}).get('data', {})
  166. if subtitles_data and isinstance(subtitles_data, dict):
  167. for subtitle_lang, subtitle in subtitles_data.items():
  168. subtitles[subtitle_lang] = [{
  169. 'ext': determine_ext(subtitle_url),
  170. 'url': subtitle_url,
  171. } for subtitle_url in subtitle.get('urls', [])]
  172. return {
  173. 'id': video_id,
  174. 'title': title,
  175. 'description': description,
  176. 'thumbnail': thumbnail,
  177. 'duration': duration,
  178. 'timestamp': timestamp,
  179. 'uploader': uploader,
  180. 'uploader_id': uploader_id,
  181. 'age_limit': age_limit,
  182. 'view_count': view_count,
  183. 'comment_count': comment_count,
  184. 'formats': formats,
  185. 'subtitles': subtitles,
  186. }
  187. # vevo embed
  188. vevo_id = self._search_regex(
  189. r'<link rel="video_src" href="[^"]*?vevo.com[^"]*?video=(?P<id>[\w]*)',
  190. webpage, 'vevo embed', default=None)
  191. if vevo_id:
  192. return self.url_result('vevo:%s' % vevo_id, 'Vevo')
  193. # fallback old player
  194. embed_page = self._download_webpage_no_ff(
  195. 'https://www.dailymotion.com/embed/video/%s' % video_id,
  196. video_id, 'Downloading embed page')
  197. timestamp = parse_iso8601(self._html_search_meta(
  198. 'video:release_date', webpage, 'upload date'))
  199. info = self._parse_json(
  200. self._search_regex(
  201. r'var info = ({.*?}),$', embed_page,
  202. 'video info', flags=re.MULTILINE),
  203. video_id)
  204. self._check_error(info)
  205. formats = []
  206. for (key, format_id) in self._FORMATS:
  207. video_url = info.get(key)
  208. if video_url is not None:
  209. m_size = re.search(r'H264-(\d+)x(\d+)', video_url)
  210. if m_size is not None:
  211. width, height = map(int_or_none, (m_size.group(1), m_size.group(2)))
  212. else:
  213. width, height = None, None
  214. formats.append({
  215. 'url': video_url,
  216. 'ext': 'mp4',
  217. 'format_id': format_id,
  218. 'width': width,
  219. 'height': height,
  220. })
  221. self._sort_formats(formats)
  222. # subtitles
  223. video_subtitles = self.extract_subtitles(video_id, webpage)
  224. title = self._og_search_title(webpage, default=None)
  225. if title is None:
  226. title = self._html_search_regex(
  227. r'(?s)<span\s+id="video_title"[^>]*>(.*?)</span>', webpage,
  228. 'title')
  229. return {
  230. 'id': video_id,
  231. 'formats': formats,
  232. 'uploader': info['owner.screenname'],
  233. 'timestamp': timestamp,
  234. 'title': title,
  235. 'description': description,
  236. 'subtitles': video_subtitles,
  237. 'thumbnail': info['thumbnail_url'],
  238. 'age_limit': age_limit,
  239. 'view_count': view_count,
  240. 'duration': info['duration']
  241. }
  242. def _check_error(self, info):
  243. if info.get('error') is not None:
  244. raise ExtractorError(
  245. '%s said: %s' % (self.IE_NAME, info['error']['title']), expected=True)
  246. def _get_subtitles(self, video_id, webpage):
  247. try:
  248. sub_list = self._download_webpage(
  249. 'https://api.dailymotion.com/video/%s/subtitles?fields=id,language,url' % video_id,
  250. video_id, note=False)
  251. except ExtractorError as err:
  252. self._downloader.report_warning('unable to download video subtitles: %s' % error_to_compat_str(err))
  253. return {}
  254. info = json.loads(sub_list)
  255. if (info['total'] > 0):
  256. sub_lang_list = dict((l['language'], [{'url': l['url'], 'ext': 'srt'}]) for l in info['list'])
  257. return sub_lang_list
  258. self._downloader.report_warning('video doesn\'t have subtitles')
  259. return {}
  260. class DailymotionPlaylistIE(DailymotionBaseInfoExtractor):
  261. IE_NAME = 'dailymotion:playlist'
  262. _VALID_URL = r'(?:https?://)?(?:www\.)?dailymotion\.[a-z]{2,3}/playlist/(?P<id>.+?)/'
  263. _MORE_PAGES_INDICATOR = r'(?s)<div class="pages[^"]*">.*?<a\s+class="[^"]*?icon-arrow_right[^"]*?"'
  264. _PAGE_TEMPLATE = 'https://www.dailymotion.com/playlist/%s/%s'
  265. _TESTS = [{
  266. 'url': 'http://www.dailymotion.com/playlist/xv4bw_nqtv_sport/1#video=xl8v3q',
  267. 'info_dict': {
  268. 'title': 'SPORT',
  269. 'id': 'xv4bw_nqtv_sport',
  270. },
  271. 'playlist_mincount': 20,
  272. }]
  273. def _extract_entries(self, id):
  274. video_ids = set()
  275. processed_urls = set()
  276. for pagenum in itertools.count(1):
  277. page_url = self._PAGE_TEMPLATE % (id, pagenum)
  278. webpage, urlh = self._download_webpage_handle_no_ff(
  279. page_url, id, 'Downloading page %s' % pagenum)
  280. if urlh.geturl() in processed_urls:
  281. self.report_warning('Stopped at duplicated page %s, which is the same as %s' % (
  282. page_url, urlh.geturl()), id)
  283. break
  284. processed_urls.add(urlh.geturl())
  285. for video_id in re.findall(r'data-xid="(.+?)"', webpage):
  286. if video_id not in video_ids:
  287. yield self.url_result('http://www.dailymotion.com/video/%s' % video_id, 'Dailymotion')
  288. video_ids.add(video_id)
  289. if re.search(self._MORE_PAGES_INDICATOR, webpage) is None:
  290. break
  291. def _real_extract(self, url):
  292. mobj = re.match(self._VALID_URL, url)
  293. playlist_id = mobj.group('id')
  294. webpage = self._download_webpage(url, playlist_id)
  295. return {
  296. '_type': 'playlist',
  297. 'id': playlist_id,
  298. 'title': self._og_search_title(webpage),
  299. 'entries': self._extract_entries(playlist_id),
  300. }
  301. class DailymotionUserIE(DailymotionPlaylistIE):
  302. IE_NAME = 'dailymotion:user'
  303. _VALID_URL = r'https?://(?:www\.)?dailymotion\.[a-z]{2,3}/(?!(?:embed|swf|#|video|playlist)/)(?:(?:old/)?user/)?(?P<user>[^/]+)'
  304. _PAGE_TEMPLATE = 'http://www.dailymotion.com/user/%s/%s'
  305. _TESTS = [{
  306. 'url': 'https://www.dailymotion.com/user/nqtv',
  307. 'info_dict': {
  308. 'id': 'nqtv',
  309. 'title': 'Rémi Gaillard',
  310. },
  311. 'playlist_mincount': 100,
  312. }, {
  313. 'url': 'http://www.dailymotion.com/user/UnderProject',
  314. 'info_dict': {
  315. 'id': 'UnderProject',
  316. 'title': 'UnderProject',
  317. },
  318. 'playlist_mincount': 1800,
  319. 'expected_warnings': [
  320. 'Stopped at duplicated page',
  321. ],
  322. 'skip': 'Takes too long time',
  323. }]
  324. def _real_extract(self, url):
  325. mobj = re.match(self._VALID_URL, url)
  326. user = mobj.group('user')
  327. webpage = self._download_webpage(
  328. 'https://www.dailymotion.com/user/%s' % user, user)
  329. full_user = unescapeHTML(self._html_search_regex(
  330. r'<a class="nav-image" title="([^"]+)" href="/%s">' % re.escape(user),
  331. webpage, 'user'))
  332. return {
  333. '_type': 'playlist',
  334. 'id': user,
  335. 'title': full_user,
  336. 'entries': self._extract_entries(user),
  337. }
  338. class DailymotionCloudIE(DailymotionBaseInfoExtractor):
  339. _VALID_URL_PREFIX = r'http://api\.dmcloud\.net/(?:player/)?embed/'
  340. _VALID_URL = r'%s[^/]+/(?P<id>[^/?]+)' % _VALID_URL_PREFIX
  341. _VALID_EMBED_URL = r'%s[^/]+/[^\'"]+' % _VALID_URL_PREFIX
  342. _TESTS = [{
  343. # From http://www.francetvinfo.fr/economie/entreprises/les-entreprises-familiales-le-secret-de-la-reussite_933271.html
  344. # Tested at FranceTvInfo_2
  345. 'url': 'http://api.dmcloud.net/embed/4e7343f894a6f677b10006b4/556e03339473995ee145930c?auth=1464865870-0-jyhsm84b-ead4c701fb750cf9367bf4447167a3db&autoplay=1',
  346. 'only_matching': True,
  347. }, {
  348. # http://www.francetvinfo.fr/societe/larguez-les-amarres-le-cobaturage-se-developpe_980101.html
  349. 'url': 'http://api.dmcloud.net/player/embed/4e7343f894a6f677b10006b4/559545469473996d31429f06?auth=1467430263-0-90tglw2l-a3a4b64ed41efe48d7fccad85b8b8fda&autoplay=1',
  350. 'only_matching': True,
  351. }]
  352. @classmethod
  353. def _extract_dmcloud_url(cls, webpage):
  354. mobj = re.search(r'<iframe[^>]+src=[\'"](%s)[\'"]' % cls._VALID_EMBED_URL, webpage)
  355. if mobj:
  356. return mobj.group(1)
  357. mobj = re.search(
  358. r'<input[^>]+id=[\'"]dmcloudUrlEmissionSelect[\'"][^>]+value=[\'"](%s)[\'"]' % cls._VALID_EMBED_URL,
  359. webpage)
  360. if mobj:
  361. return mobj.group(1)
  362. def _real_extract(self, url):
  363. video_id = self._match_id(url)
  364. webpage = self._download_webpage_no_ff(url, video_id)
  365. title = self._html_search_regex(r'<title>([^>]+)</title>', webpage, 'title')
  366. video_info = self._parse_json(self._search_regex(
  367. r'var\s+info\s*=\s*([^;]+);', webpage, 'video info'), video_id)
  368. # TODO: parse ios_url, which is in fact a manifest
  369. video_url = video_info['mp4_url']
  370. return {
  371. 'id': video_id,
  372. 'url': video_url,
  373. 'title': title,
  374. 'thumbnail': video_info.get('thumbnail_url'),
  375. }