logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

rai.py (22552B)


  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. import re
  4. from .common import InfoExtractor
  5. from ..compat import (
  6. compat_str,
  7. compat_urlparse,
  8. )
  9. from ..utils import (
  10. determine_ext,
  11. ExtractorError,
  12. find_xpath_attr,
  13. fix_xml_ampersands,
  14. GeoRestrictedError,
  15. HEADRequest,
  16. int_or_none,
  17. parse_duration,
  18. remove_start,
  19. strip_or_none,
  20. try_get,
  21. unified_strdate,
  22. unified_timestamp,
  23. update_url_query,
  24. urljoin,
  25. xpath_text,
  26. )
  27. class RaiBaseIE(InfoExtractor):
  28. _UUID_RE = r'[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}'
  29. _GEO_COUNTRIES = ['IT']
  30. _GEO_BYPASS = False
  31. def _extract_relinker_info(self, relinker_url, video_id):
  32. if not re.match(r'https?://', relinker_url):
  33. return {'formats': [{'url': relinker_url}]}
  34. formats = []
  35. geoprotection = None
  36. is_live = None
  37. duration = None
  38. for platform in ('mon', 'flash', 'native'):
  39. relinker = self._download_xml(
  40. relinker_url, video_id,
  41. note='Downloading XML metadata for platform %s' % platform,
  42. transform_source=fix_xml_ampersands,
  43. query={'output': 45, 'pl': platform},
  44. headers=self.geo_verification_headers())
  45. if not geoprotection:
  46. geoprotection = xpath_text(
  47. relinker, './geoprotection', default=None) == 'Y'
  48. if not is_live:
  49. is_live = xpath_text(
  50. relinker, './is_live', default=None) == 'Y'
  51. if not duration:
  52. duration = parse_duration(xpath_text(
  53. relinker, './duration', default=None))
  54. url_elem = find_xpath_attr(relinker, './url', 'type', 'content')
  55. if url_elem is None:
  56. continue
  57. media_url = url_elem.text
  58. # This does not imply geo restriction (e.g.
  59. # http://www.raisport.rai.it/dl/raiSport/media/rassegna-stampa-04a9f4bd-b563-40cf-82a6-aad3529cb4a9.html)
  60. if '/video_no_available.mp4' in media_url:
  61. continue
  62. ext = determine_ext(media_url)
  63. if (ext == 'm3u8' and platform != 'mon') or (ext == 'f4m' and platform != 'flash'):
  64. continue
  65. if ext == 'm3u8' or 'format=m3u8' in media_url or platform == 'mon':
  66. formats.extend(self._extract_m3u8_formats(
  67. media_url, video_id, 'mp4', 'm3u8_native',
  68. m3u8_id='hls', fatal=False))
  69. elif ext == 'f4m' or platform == 'flash':
  70. manifest_url = update_url_query(
  71. media_url.replace('manifest#live_hds.f4m', 'manifest.f4m'),
  72. {'hdcore': '3.7.0', 'plugin': 'aasp-3.7.0.39.44'})
  73. formats.extend(self._extract_f4m_formats(
  74. manifest_url, video_id, f4m_id='hds', fatal=False))
  75. else:
  76. bitrate = int_or_none(xpath_text(relinker, 'bitrate'))
  77. formats.append({
  78. 'url': media_url,
  79. 'tbr': bitrate if bitrate > 0 else None,
  80. 'format_id': 'http-%d' % bitrate if bitrate > 0 else 'http',
  81. })
  82. if not formats and geoprotection is True:
  83. self.raise_geo_restricted(countries=self._GEO_COUNTRIES)
  84. formats.extend(self._create_http_urls(relinker_url, formats))
  85. return dict((k, v) for k, v in {
  86. 'is_live': is_live,
  87. 'duration': duration,
  88. 'formats': formats,
  89. }.items() if v is not None)
  90. def _create_http_urls(self, relinker_url, fmts):
  91. _RELINKER_REG = r'https?://(?P<host>[^/]+?)/(?:i/)?(?P<extra>[^/]+?)/(?P<path>.+?)/(?P<id>\w+)(?:_(?P<quality>[\d\,]+))?(?:\.mp4|/playlist\.m3u8).+?'
  92. _MP4_TMPL = '%s&overrideUserAgentRule=mp4-%s'
  93. _QUALITY = {
  94. # tbr: w, h
  95. '250': [352, 198],
  96. '400': [512, 288],
  97. '700': [512, 288],
  98. '800': [700, 394],
  99. '1200': [736, 414],
  100. '1800': [1024, 576],
  101. '2400': [1280, 720],
  102. '3200': [1440, 810],
  103. '3600': [1440, 810],
  104. '5000': [1920, 1080],
  105. '10000': [1920, 1080],
  106. }
  107. def test_url(url):
  108. resp = self._request_webpage(
  109. HEADRequest(url), None, headers={'User-Agent': 'Rai'},
  110. fatal=False, errnote=False, note=False)
  111. if resp is False:
  112. return False
  113. if resp.code == 200:
  114. return False if resp.url == url else resp.url
  115. return None
  116. def get_format_info(tbr):
  117. import math
  118. br = int_or_none(tbr)
  119. if len(fmts) == 1 and not br:
  120. br = fmts[0].get('tbr')
  121. if br > 300:
  122. tbr = compat_str(math.floor(br / 100) * 100)
  123. else:
  124. tbr = '250'
  125. # try extracting info from available m3u8 formats
  126. format_copy = None
  127. for f in fmts:
  128. if f.get('tbr'):
  129. br_limit = math.floor(br / 100)
  130. if br_limit - 1 <= math.floor(f['tbr'] / 100) <= br_limit + 1:
  131. format_copy = f.copy()
  132. return {
  133. 'width': format_copy.get('width'),
  134. 'height': format_copy.get('height'),
  135. 'tbr': format_copy.get('tbr'),
  136. 'vcodec': format_copy.get('vcodec'),
  137. 'acodec': format_copy.get('acodec'),
  138. 'fps': format_copy.get('fps'),
  139. 'format_id': 'https-%s' % tbr,
  140. } if format_copy else {
  141. 'width': _QUALITY[tbr][0],
  142. 'height': _QUALITY[tbr][1],
  143. 'format_id': 'https-%s' % tbr,
  144. 'tbr': int(tbr),
  145. }
  146. loc = test_url(_MP4_TMPL % (relinker_url, '*'))
  147. if not isinstance(loc, compat_str):
  148. return []
  149. mobj = re.match(
  150. _RELINKER_REG,
  151. test_url(relinker_url) or '')
  152. if not mobj:
  153. return []
  154. available_qualities = mobj.group('quality').split(',') if mobj.group('quality') else ['*']
  155. available_qualities = [i for i in available_qualities if i]
  156. formats = []
  157. for q in available_qualities:
  158. fmt = {
  159. 'url': _MP4_TMPL % (relinker_url, q),
  160. 'protocol': 'https',
  161. 'ext': 'mp4',
  162. }
  163. fmt.update(get_format_info(q))
  164. formats.append(fmt)
  165. return formats
  166. @staticmethod
  167. def _extract_subtitles(url, video_data):
  168. STL_EXT = 'stl'
  169. SRT_EXT = 'srt'
  170. subtitles = {}
  171. subtitles_array = video_data.get('subtitlesArray') or []
  172. for k in ('subtitles', 'subtitlesUrl'):
  173. subtitles_array.append({'url': video_data.get(k)})
  174. for subtitle in subtitles_array:
  175. sub_url = subtitle.get('url')
  176. if sub_url and isinstance(sub_url, compat_str):
  177. sub_lang = subtitle.get('language') or 'it'
  178. sub_url = urljoin(url, sub_url)
  179. sub_ext = determine_ext(sub_url, SRT_EXT)
  180. subtitles.setdefault(sub_lang, []).append({
  181. 'ext': sub_ext,
  182. 'url': sub_url,
  183. })
  184. if STL_EXT == sub_ext:
  185. subtitles[sub_lang].append({
  186. 'ext': SRT_EXT,
  187. 'url': sub_url[:-len(STL_EXT)] + SRT_EXT,
  188. })
  189. return subtitles
  190. class RaiPlayIE(RaiBaseIE):
  191. _VALID_URL = r'(?P<base>https?://(?:www\.)?raiplay\.it/.+?-(?P<id>%s))\.(?:html|json)' % RaiBaseIE._UUID_RE
  192. _TESTS = [{
  193. 'url': 'http://www.raiplay.it/video/2014/04/Report-del-07042014-cb27157f-9dd0-4aee-b788-b1f67643a391.html',
  194. 'md5': '8970abf8caf8aef4696e7b1f2adfc696',
  195. 'info_dict': {
  196. 'id': 'cb27157f-9dd0-4aee-b788-b1f67643a391',
  197. 'ext': 'mp4',
  198. 'title': 'Report del 07/04/2014',
  199. 'alt_title': 'St 2013/14 - Espresso nel caffè - 07/04/2014',
  200. 'description': 'md5:d730c168a58f4bb35600fc2f881ec04e',
  201. 'thumbnail': r're:^https?://.*\.jpg$',
  202. 'uploader': 'Rai Gulp',
  203. 'duration': 6160,
  204. 'series': 'Report',
  205. 'season': '2013/14',
  206. 'subtitles': {
  207. 'it': 'count:2',
  208. },
  209. },
  210. 'params': {
  211. 'skip_download': True,
  212. },
  213. }, {
  214. # 1080p direct mp4 url
  215. 'url': 'https://www.raiplay.it/video/2021/03/Leonardo-S1E1-b5703b02-82ee-475a-85b6-c9e4a8adf642.html',
  216. 'md5': '2e501e8651d72f05ffe8f5d286ad560b',
  217. 'info_dict': {
  218. 'id': 'b5703b02-82ee-475a-85b6-c9e4a8adf642',
  219. 'ext': 'mp4',
  220. 'title': 'Leonardo - S1E1',
  221. 'alt_title': 'St 1 Ep 1 - Episodio 1',
  222. 'description': 'md5:f5360cd267d2de146e4e3879a5a47d31',
  223. 'thumbnail': r're:^https?://.*\.jpg$',
  224. 'uploader': 'Rai 1',
  225. 'duration': 3229,
  226. 'series': 'Leonardo',
  227. 'season': 'Season 1',
  228. },
  229. }, {
  230. 'url': 'http://www.raiplay.it/video/2016/11/gazebotraindesi-efebe701-969c-4593-92f3-285f0d1ce750.html?',
  231. 'only_matching': True,
  232. }, {
  233. # subtitles at 'subtitlesArray' key (see #27698)
  234. 'url': 'https://www.raiplay.it/video/2020/12/Report---04-01-2021-2e90f1de-8eee-4de4-ac0e-78d21db5b600.html',
  235. 'only_matching': True,
  236. }, {
  237. # DRM protected
  238. 'url': 'https://www.raiplay.it/video/2020/09/Lo-straordinario-mondo-di-Zoey-S1E1-Lo-straordinario-potere-di-Zoey-ed493918-1d32-44b7-8454-862e473d00ff.html',
  239. 'only_matching': True,
  240. }]
  241. def _real_extract(self, url):
  242. base, video_id = re.match(self._VALID_URL, url).groups()
  243. media = self._download_json(
  244. base + '.json', video_id, 'Downloading video JSON')
  245. if try_get(
  246. media,
  247. (lambda x: x['rights_management']['rights']['drm'],
  248. lambda x: x['program_info']['rights_management']['rights']['drm']),
  249. dict):
  250. raise ExtractorError('This video is DRM protected.', expected=True)
  251. title = media['name']
  252. video = media['video']
  253. relinker_info = self._extract_relinker_info(video['content_url'], video_id)
  254. self._sort_formats(relinker_info['formats'])
  255. thumbnails = []
  256. for _, value in media.get('images', {}).items():
  257. if value:
  258. thumbnails.append({
  259. 'url': urljoin(url, value),
  260. })
  261. date_published = media.get('date_published')
  262. time_published = media.get('time_published')
  263. if date_published and time_published:
  264. date_published += ' ' + time_published
  265. subtitles = self._extract_subtitles(url, video)
  266. program_info = media.get('program_info') or {}
  267. season = media.get('season')
  268. info = {
  269. 'id': remove_start(media.get('id'), 'ContentItem-') or video_id,
  270. 'display_id': video_id,
  271. 'title': self._live_title(title) if relinker_info.get(
  272. 'is_live') else title,
  273. 'alt_title': strip_or_none(media.get('subtitle')),
  274. 'description': media.get('description'),
  275. 'uploader': strip_or_none(media.get('channel')),
  276. 'creator': strip_or_none(media.get('editor') or None),
  277. 'duration': parse_duration(video.get('duration')),
  278. 'timestamp': unified_timestamp(date_published),
  279. 'thumbnails': thumbnails,
  280. 'series': program_info.get('name'),
  281. 'season_number': int_or_none(season),
  282. 'season': season if (season and not season.isdigit()) else None,
  283. 'episode': media.get('episode_title'),
  284. 'episode_number': int_or_none(media.get('episode')),
  285. 'subtitles': subtitles,
  286. }
  287. info.update(relinker_info)
  288. return info
  289. class RaiPlayLiveIE(RaiPlayIE):
  290. _VALID_URL = r'(?P<base>https?://(?:www\.)?raiplay\.it/dirette/(?P<id>[^/?#&]+))'
  291. _TESTS = [{
  292. 'url': 'http://www.raiplay.it/dirette/rainews24',
  293. 'info_dict': {
  294. 'id': 'd784ad40-e0ae-4a69-aa76-37519d238a9c',
  295. 'display_id': 'rainews24',
  296. 'ext': 'mp4',
  297. 'title': 're:^Diretta di Rai News 24 [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
  298. 'description': 'md5:4d00bcf6dc98b27c6ec480de329d1497',
  299. 'uploader': 'Rai News 24',
  300. 'creator': 'Rai News 24',
  301. 'is_live': True,
  302. },
  303. 'params': {
  304. 'skip_download': True,
  305. },
  306. }]
  307. class RaiPlayPlaylistIE(InfoExtractor):
  308. _VALID_URL = r'(?P<base>https?://(?:www\.)?raiplay\.it/programmi/(?P<id>[^/?#&]+))'
  309. _TESTS = [{
  310. 'url': 'http://www.raiplay.it/programmi/nondirloalmiocapo/',
  311. 'info_dict': {
  312. 'id': 'nondirloalmiocapo',
  313. 'title': 'Non dirlo al mio capo',
  314. 'description': 'md5:98ab6b98f7f44c2843fd7d6f045f153b',
  315. },
  316. 'playlist_mincount': 12,
  317. }]
  318. def _real_extract(self, url):
  319. base, playlist_id = re.match(self._VALID_URL, url).groups()
  320. program = self._download_json(
  321. base + '.json', playlist_id, 'Downloading program JSON')
  322. entries = []
  323. for b in (program.get('blocks') or []):
  324. for s in (b.get('sets') or []):
  325. s_id = s.get('id')
  326. if not s_id:
  327. continue
  328. medias = self._download_json(
  329. '%s/%s.json' % (base, s_id), s_id,
  330. 'Downloading content set JSON', fatal=False)
  331. if not medias:
  332. continue
  333. for m in (medias.get('items') or []):
  334. path_id = m.get('path_id')
  335. if not path_id:
  336. continue
  337. video_url = urljoin(url, path_id)
  338. entries.append(self.url_result(
  339. video_url, ie=RaiPlayIE.ie_key(),
  340. video_id=RaiPlayIE._match_id(video_url)))
  341. return self.playlist_result(
  342. entries, playlist_id, program.get('name'),
  343. try_get(program, lambda x: x['program_info']['description']))
  344. class RaiIE(RaiBaseIE):
  345. _VALID_URL = r'https?://[^/]+\.(?:rai\.(?:it|tv)|rainews\.it)/.+?-(?P<id>%s)(?:-.+?)?\.html' % RaiBaseIE._UUID_RE
  346. _TESTS = [{
  347. # var uniquename = "ContentItem-..."
  348. # data-id="ContentItem-..."
  349. 'url': 'http://www.raisport.rai.it/dl/raiSport/media/rassegna-stampa-04a9f4bd-b563-40cf-82a6-aad3529cb4a9.html',
  350. 'info_dict': {
  351. 'id': '04a9f4bd-b563-40cf-82a6-aad3529cb4a9',
  352. 'ext': 'mp4',
  353. 'title': 'TG PRIMO TEMPO',
  354. 'thumbnail': r're:^https?://.*\.jpg$',
  355. 'duration': 1758,
  356. 'upload_date': '20140612',
  357. },
  358. 'skip': 'This content is available only in Italy',
  359. }, {
  360. # with ContentItem in many metas
  361. 'url': 'http://www.rainews.it/dl/rainews/media/Weekend-al-cinema-da-Hollywood-arriva-il-thriller-di-Tate-Taylor-La-ragazza-del-treno-1632c009-c843-4836-bb65-80c33084a64b.html',
  362. 'info_dict': {
  363. 'id': '1632c009-c843-4836-bb65-80c33084a64b',
  364. 'ext': 'mp4',
  365. 'title': 'Weekend al cinema, da Hollywood arriva il thriller di Tate Taylor "La ragazza del treno"',
  366. 'description': 'I film in uscita questa settimana.',
  367. 'thumbnail': r're:^https?://.*\.png$',
  368. 'duration': 833,
  369. 'upload_date': '20161103',
  370. }
  371. }, {
  372. # with ContentItem in og:url
  373. 'url': 'http://www.rai.it/dl/RaiTV/programmi/media/ContentItem-efb17665-691c-45d5-a60c-5301333cbb0c.html',
  374. 'md5': '06345bd97c932f19ffb129973d07a020',
  375. 'info_dict': {
  376. 'id': 'efb17665-691c-45d5-a60c-5301333cbb0c',
  377. 'ext': 'mp4',
  378. 'title': 'TG1 ore 20:00 del 03/11/2016',
  379. 'description': 'TG1 edizione integrale ore 20:00 del giorno 03/11/2016',
  380. 'thumbnail': r're:^https?://.*\.jpg$',
  381. 'duration': 2214,
  382. 'upload_date': '20161103',
  383. }
  384. }, {
  385. # initEdizione('ContentItem-...'
  386. 'url': 'http://www.tg1.rai.it/dl/tg1/2010/edizioni/ContentSet-9b6e0cba-4bef-4aef-8cf0-9f7f665b7dfb-tg1.html?item=undefined',
  387. 'info_dict': {
  388. 'id': 'c2187016-8484-4e3a-8ac8-35e475b07303',
  389. 'ext': 'mp4',
  390. 'title': r're:TG1 ore \d{2}:\d{2} del \d{2}/\d{2}/\d{4}',
  391. 'duration': 2274,
  392. 'upload_date': '20170401',
  393. },
  394. 'skip': 'Changes daily',
  395. }, {
  396. # HLS live stream with ContentItem in og:url
  397. 'url': 'http://www.rainews.it/dl/rainews/live/ContentItem-3156f2f2-dc70-4953-8e2f-70d7489d4ce9.html',
  398. 'info_dict': {
  399. 'id': '3156f2f2-dc70-4953-8e2f-70d7489d4ce9',
  400. 'ext': 'mp4',
  401. 'title': 'La diretta di Rainews24',
  402. },
  403. 'params': {
  404. 'skip_download': True,
  405. },
  406. }, {
  407. # ContentItem in iframe (see #12652) and subtitle at 'subtitlesUrl' key
  408. 'url': 'http://www.presadiretta.rai.it/dl/portali/site/puntata/ContentItem-3ed19d13-26c2-46ff-a551-b10828262f1b.html',
  409. 'info_dict': {
  410. 'id': '1ad6dc64-444a-42a4-9bea-e5419ad2f5fd',
  411. 'ext': 'mp4',
  412. 'title': 'Partiti acchiappavoti - Presa diretta del 13/09/2015',
  413. 'description': 'md5:d291b03407ec505f95f27970c0b025f4',
  414. 'upload_date': '20150913',
  415. 'subtitles': {
  416. 'it': 'count:2',
  417. },
  418. },
  419. 'params': {
  420. 'skip_download': True,
  421. },
  422. }, {
  423. # Direct MMS URL
  424. 'url': 'http://www.rai.it/dl/RaiTV/programmi/media/ContentItem-b63a4089-ac28-48cf-bca5-9f5b5bc46df5.html',
  425. 'only_matching': True,
  426. }, {
  427. 'url': 'https://www.rainews.it/tgr/marche/notiziari/video/2019/02/ContentItem-6ba945a2-889c-4a80-bdeb-8489c70a8db9.html',
  428. 'only_matching': True,
  429. }]
  430. def _extract_from_content_id(self, content_id, url):
  431. media = self._download_json(
  432. 'http://www.rai.tv/dl/RaiTV/programmi/media/ContentItem-%s.html?json' % content_id,
  433. content_id, 'Downloading video JSON')
  434. title = media['name'].strip()
  435. media_type = media['type']
  436. if 'Audio' in media_type:
  437. relinker_info = {
  438. 'formats': [{
  439. 'format_id': media.get('formatoAudio'),
  440. 'url': media['audioUrl'],
  441. 'ext': media.get('formatoAudio'),
  442. }]
  443. }
  444. elif 'Video' in media_type:
  445. relinker_info = self._extract_relinker_info(media['mediaUri'], content_id)
  446. else:
  447. raise ExtractorError('not a media file')
  448. self._sort_formats(relinker_info['formats'])
  449. thumbnails = []
  450. for image_type in ('image', 'image_medium', 'image_300'):
  451. thumbnail_url = media.get(image_type)
  452. if thumbnail_url:
  453. thumbnails.append({
  454. 'url': compat_urlparse.urljoin(url, thumbnail_url),
  455. })
  456. subtitles = self._extract_subtitles(url, media)
  457. info = {
  458. 'id': content_id,
  459. 'title': title,
  460. 'description': strip_or_none(media.get('desc')),
  461. 'thumbnails': thumbnails,
  462. 'uploader': media.get('author'),
  463. 'upload_date': unified_strdate(media.get('date')),
  464. 'duration': parse_duration(media.get('length')),
  465. 'subtitles': subtitles,
  466. }
  467. info.update(relinker_info)
  468. return info
  469. def _real_extract(self, url):
  470. video_id = self._match_id(url)
  471. webpage = self._download_webpage(url, video_id)
  472. content_item_id = None
  473. content_item_url = self._html_search_meta(
  474. ('og:url', 'og:video', 'og:video:secure_url', 'twitter:url',
  475. 'twitter:player', 'jsonlink'), webpage, default=None)
  476. if content_item_url:
  477. content_item_id = self._search_regex(
  478. r'ContentItem-(%s)' % self._UUID_RE, content_item_url,
  479. 'content item id', default=None)
  480. if not content_item_id:
  481. content_item_id = self._search_regex(
  482. r'''(?x)
  483. (?:
  484. (?:initEdizione|drawMediaRaiTV)\(|
  485. <(?:[^>]+\bdata-id|var\s+uniquename)=|
  486. <iframe[^>]+\bsrc=
  487. )
  488. (["\'])
  489. (?:(?!\1).)*\bContentItem-(?P<id>%s)
  490. ''' % self._UUID_RE,
  491. webpage, 'content item id', default=None, group='id')
  492. content_item_ids = set()
  493. if content_item_id:
  494. content_item_ids.add(content_item_id)
  495. if video_id not in content_item_ids:
  496. content_item_ids.add(video_id)
  497. for content_item_id in content_item_ids:
  498. try:
  499. return self._extract_from_content_id(content_item_id, url)
  500. except GeoRestrictedError:
  501. raise
  502. except ExtractorError:
  503. pass
  504. relinker_url = self._proto_relative_url(self._search_regex(
  505. r'''(?x)
  506. (?:
  507. var\s+videoURL|
  508. mediaInfo\.mediaUri
  509. )\s*=\s*
  510. ([\'"])
  511. (?P<url>
  512. (?:https?:)?
  513. //mediapolis(?:vod)?\.rai\.it/relinker/relinkerServlet\.htm\?
  514. (?:(?!\1).)*\bcont=(?:(?!\1).)+)\1
  515. ''',
  516. webpage, 'relinker URL', group='url'))
  517. relinker_info = self._extract_relinker_info(
  518. urljoin(url, relinker_url), video_id)
  519. self._sort_formats(relinker_info['formats'])
  520. title = self._search_regex(
  521. r'var\s+videoTitolo\s*=\s*([\'"])(?P<title>[^\'"]+)\1',
  522. webpage, 'title', group='title',
  523. default=None) or self._og_search_title(webpage)
  524. info = {
  525. 'id': video_id,
  526. 'title': title,
  527. }
  528. info.update(relinker_info)
  529. return info