vrt.py 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. import functools
  2. import json
  3. import time
  4. import urllib.parse
  5. from .gigya import GigyaBaseIE
  6. from ..networking.exceptions import HTTPError
  7. from ..utils import (
  8. ExtractorError,
  9. clean_html,
  10. extract_attributes,
  11. float_or_none,
  12. get_element_by_class,
  13. get_element_html_by_class,
  14. int_or_none,
  15. join_nonempty,
  16. jwt_encode_hs256,
  17. make_archive_id,
  18. merge_dicts,
  19. parse_age_limit,
  20. parse_iso8601,
  21. str_or_none,
  22. strip_or_none,
  23. traverse_obj,
  24. url_or_none,
  25. urlencode_postdata,
  26. )
  27. class VRTBaseIE(GigyaBaseIE):
  28. _GEO_BYPASS = False
  29. _PLAYER_INFO = {
  30. 'platform': 'desktop',
  31. 'app': {
  32. 'type': 'browser',
  33. 'name': 'Chrome',
  34. },
  35. 'device': 'undefined (undefined)',
  36. 'os': {
  37. 'name': 'Windows',
  38. 'version': 'x86_64',
  39. },
  40. 'player': {
  41. 'name': 'VRT web player',
  42. 'version': '2.7.4-prod-2023-04-19T06:05:45',
  43. },
  44. }
  45. # From https://player.vrt.be/vrtnws/js/main.js & https://player.vrt.be/ketnet/js/main.8cdb11341bcb79e4cd44.js
  46. _JWT_KEY_ID = '0-0Fp51UZykfaiCJrfTE3+oMI8zvDteYfPtR+2n1R+z8w='
  47. _JWT_SIGNING_KEY = 'b5f500d55cb44715107249ccd8a5c0136cfb2788dbb71b90a4f142423bacaf38' # -dev
  48. # player-stag.vrt.be key: d23987504521ae6fbf2716caca6700a24bb1579477b43c84e146b279de5ca595
  49. # player.vrt.be key: 2a9251d782700769fb856da5725daf38661874ca6f80ae7dc2b05ec1a81a24ae
  50. def _extract_formats_and_subtitles(self, data, video_id):
  51. if traverse_obj(data, 'drm'):
  52. self.report_drm(video_id)
  53. formats, subtitles = [], {}
  54. for target in traverse_obj(data, ('targetUrls', lambda _, v: url_or_none(v['url']) and v['type'])):
  55. format_type = target['type'].upper()
  56. format_url = target['url']
  57. if format_type in ('HLS', 'HLS_AES'):
  58. fmts, subs = self._extract_m3u8_formats_and_subtitles(
  59. format_url, video_id, 'mp4', m3u8_id=format_type, fatal=False)
  60. formats.extend(fmts)
  61. self._merge_subtitles(subs, target=subtitles)
  62. elif format_type == 'HDS':
  63. formats.extend(self._extract_f4m_formats(
  64. format_url, video_id, f4m_id=format_type, fatal=False))
  65. elif format_type == 'MPEG_DASH':
  66. fmts, subs = self._extract_mpd_formats_and_subtitles(
  67. format_url, video_id, mpd_id=format_type, fatal=False)
  68. formats.extend(fmts)
  69. self._merge_subtitles(subs, target=subtitles)
  70. elif format_type == 'HSS':
  71. fmts, subs = self._extract_ism_formats_and_subtitles(
  72. format_url, video_id, ism_id='mss', fatal=False)
  73. formats.extend(fmts)
  74. self._merge_subtitles(subs, target=subtitles)
  75. else:
  76. formats.append({
  77. 'format_id': format_type,
  78. 'url': format_url,
  79. })
  80. for sub in traverse_obj(data, ('subtitleUrls', lambda _, v: v['url'] and v['type'] == 'CLOSED')):
  81. subtitles.setdefault('nl', []).append({'url': sub['url']})
  82. return formats, subtitles
  83. def _call_api(self, video_id, client='null', id_token=None, version='v2'):
  84. player_info = {'exp': (round(time.time(), 3) + 900), **self._PLAYER_INFO}
  85. player_token = self._download_json(
  86. 'https://media-services-public.vrt.be/vualto-video-aggregator-web/rest/external/v2/tokens',
  87. video_id, 'Downloading player token', headers={
  88. **self.geo_verification_headers(),
  89. 'Content-Type': 'application/json',
  90. }, data=json.dumps({
  91. 'identityToken': id_token or {},
  92. 'playerInfo': jwt_encode_hs256(player_info, self._JWT_SIGNING_KEY, headers={
  93. 'kid': self._JWT_KEY_ID,
  94. }).decode(),
  95. }, separators=(',', ':')).encode())['vrtPlayerToken']
  96. return self._download_json(
  97. f'https://media-services-public.vrt.be/media-aggregator/{version}/media-items/{video_id}',
  98. video_id, 'Downloading API JSON', query={
  99. 'vrtPlayerToken': player_token,
  100. 'client': client,
  101. }, expected_status=400)
  102. class VRTIE(VRTBaseIE):
  103. IE_DESC = 'VRT NWS, Flanders News, Flandern Info and Sporza'
  104. _VALID_URL = r'https?://(?:www\.)?(?P<site>vrt\.be/vrtnws|sporza\.be)/[a-z]{2}/\d{4}/\d{2}/\d{2}/(?P<id>[^/?&#]+)'
  105. _TESTS = [{
  106. 'url': 'https://www.vrt.be/vrtnws/nl/2019/05/15/beelden-van-binnenkant-notre-dame-een-maand-na-de-brand/',
  107. 'info_dict': {
  108. 'id': 'pbs-pub-7855fc7b-1448-49bc-b073-316cb60caa71$vid-2ca50305-c38a-4762-9890-65cbd098b7bd',
  109. 'ext': 'mp4',
  110. 'title': 'Beelden van binnenkant Notre-Dame, één maand na de brand',
  111. 'description': 'md5:6fd85f999b2d1841aa5568f4bf02c3ff',
  112. 'duration': 31.2,
  113. 'thumbnail': 'https://images.vrt.be/orig/2019/05/15/2d914d61-7710-11e9-abcc-02b7b76bf47f.jpg',
  114. },
  115. 'params': {'skip_download': 'm3u8'},
  116. }, {
  117. 'url': 'https://sporza.be/nl/2019/05/15/de-belgian-cats-zijn-klaar-voor-het-ek/',
  118. 'info_dict': {
  119. 'id': 'pbs-pub-f2c86a46-8138-413a-a4b9-a0015a16ce2c$vid-1f112b31-e58e-4379-908d-aca6d80f8818',
  120. 'ext': 'mp4',
  121. 'title': 'De Belgian Cats zijn klaar voor het EK',
  122. 'description': 'Video: De Belgian Cats zijn klaar voor het EK mét Ann Wauters | basketbal, sport in het journaal',
  123. 'duration': 115.17,
  124. 'thumbnail': 'https://images.vrt.be/orig/2019/05/15/11c0dba3-770e-11e9-abcc-02b7b76bf47f.jpg',
  125. },
  126. 'params': {'skip_download': 'm3u8'},
  127. }]
  128. _CLIENT_MAP = {
  129. 'vrt.be/vrtnws': 'vrtnieuws',
  130. 'sporza.be': 'sporza',
  131. }
  132. def _real_extract(self, url):
  133. site, display_id = self._match_valid_url(url).groups()
  134. webpage = self._download_webpage(url, display_id)
  135. attrs = extract_attributes(get_element_html_by_class('vrtvideo', webpage) or '')
  136. asset_id = attrs.get('data-video-id') or attrs['data-videoid']
  137. publication_id = traverse_obj(attrs, 'data-publication-id', 'data-publicationid')
  138. if publication_id:
  139. asset_id = f'{publication_id}${asset_id}'
  140. client = traverse_obj(attrs, 'data-client-code', 'data-client') or self._CLIENT_MAP[site]
  141. data = self._call_api(asset_id, client)
  142. formats, subtitles = self._extract_formats_and_subtitles(data, asset_id)
  143. description = self._html_search_meta(
  144. ['og:description', 'twitter:description', 'description'], webpage)
  145. if description == '…':
  146. description = None
  147. return {
  148. 'id': asset_id,
  149. 'formats': formats,
  150. 'subtitles': subtitles,
  151. 'description': description,
  152. 'thumbnail': url_or_none(attrs.get('data-posterimage')),
  153. 'duration': float_or_none(attrs.get('data-duration'), 1000),
  154. '_old_archive_ids': [make_archive_id('Canvas', asset_id)],
  155. **traverse_obj(data, {
  156. 'title': ('title', {str}),
  157. 'description': ('shortDescription', {str}),
  158. 'duration': ('duration', {functools.partial(float_or_none, scale=1000)}),
  159. 'thumbnail': ('posterImageUrl', {url_or_none}),
  160. }),
  161. }
  162. class VrtNUIE(VRTBaseIE):
  163. IE_DESC = 'VRT MAX'
  164. _VALID_URL = r'https?://(?:www\.)?vrt\.be/vrtnu/a-z/(?:[^/]+/){2}(?P<id>[^/?#&]+)'
  165. _TESTS = [{
  166. # CONTENT_IS_AGE_RESTRICTED
  167. 'url': 'https://www.vrt.be/vrtnu/a-z/de-ideale-wereld/2023-vj/de-ideale-wereld-d20230116/',
  168. 'info_dict': {
  169. 'id': 'pbs-pub-855b00a8-6ce2-4032-ac4f-1fcf3ae78524$vid-d2243aa1-ec46-4e34-a55b-92568459906f',
  170. 'ext': 'mp4',
  171. 'title': 'Tom Waes',
  172. 'description': 'Satirisch actualiteitenmagazine met Ella Leyers. Tom Waes is te gast.',
  173. 'timestamp': 1673905125,
  174. 'release_timestamp': 1673905125,
  175. 'series': 'De ideale wereld',
  176. 'season_id': '1672830988794',
  177. 'episode': 'Aflevering 1',
  178. 'episode_number': 1,
  179. 'episode_id': '1672830988861',
  180. 'display_id': 'de-ideale-wereld-d20230116',
  181. 'channel': 'VRT',
  182. 'duration': 1939.0,
  183. 'thumbnail': 'https://images.vrt.be/orig/2023/01/10/1bb39cb3-9115-11ed-b07d-02b7b76bf47f.jpg',
  184. 'release_date': '20230116',
  185. 'upload_date': '20230116',
  186. 'age_limit': 12,
  187. },
  188. }, {
  189. 'url': 'https://www.vrt.be/vrtnu/a-z/buurman--wat-doet-u-nu-/6/buurman--wat-doet-u-nu--s6-trailer/',
  190. 'info_dict': {
  191. 'id': 'pbs-pub-ad4050eb-d9e5-48c2-9ec8-b6c355032361$vid-0465537a-34a8-4617-8352-4d8d983b4eee',
  192. 'ext': 'mp4',
  193. 'title': 'Trailer seizoen 6 \'Buurman, wat doet u nu?\'',
  194. 'description': 'md5:197424726c61384b4e5c519f16c0cf02',
  195. 'timestamp': 1652940000,
  196. 'release_timestamp': 1652940000,
  197. 'series': 'Buurman, wat doet u nu?',
  198. 'season': 'Seizoen 6',
  199. 'season_number': 6,
  200. 'season_id': '1652344200907',
  201. 'episode': 'Aflevering 0',
  202. 'episode_number': 0,
  203. 'episode_id': '1652951873524',
  204. 'display_id': 'buurman--wat-doet-u-nu--s6-trailer',
  205. 'channel': 'VRT',
  206. 'duration': 33.13,
  207. 'thumbnail': 'https://images.vrt.be/orig/2022/05/23/3c234d21-da83-11ec-b07d-02b7b76bf47f.jpg',
  208. 'release_date': '20220519',
  209. 'upload_date': '20220519',
  210. },
  211. 'params': {'skip_download': 'm3u8'},
  212. }]
  213. _NETRC_MACHINE = 'vrtnu'
  214. _authenticated = False
  215. def _perform_login(self, username, password):
  216. auth_info = self._gigya_login({
  217. 'APIKey': '3_0Z2HujMtiWq_pkAjgnS2Md2E11a1AwZjYiBETtwNE-EoEHDINgtnvcAOpNgmrVGy',
  218. 'targetEnv': 'jssdk',
  219. 'loginID': username,
  220. 'password': password,
  221. 'authMode': 'cookie',
  222. })
  223. if auth_info.get('errorDetails'):
  224. raise ExtractorError(f'Unable to login. VrtNU said: {auth_info["errorDetails"]}', expected=True)
  225. # Sometimes authentication fails for no good reason, retry
  226. for retry in self.RetryManager():
  227. if retry.attempt > 1:
  228. self._sleep(1, None)
  229. try:
  230. self._request_webpage(
  231. 'https://token.vrt.be/vrtnuinitlogin', None, note='Requesting XSRF Token',
  232. errnote='Could not get XSRF Token', query={
  233. 'provider': 'site',
  234. 'destination': 'https://www.vrt.be/vrtnu/',
  235. })
  236. self._request_webpage(
  237. 'https://login.vrt.be/perform_login', None,
  238. note='Performing login', errnote='Login failed',
  239. query={'client_id': 'vrtnu-site'}, data=urlencode_postdata({
  240. 'UID': auth_info['UID'],
  241. 'UIDSignature': auth_info['UIDSignature'],
  242. 'signatureTimestamp': auth_info['signatureTimestamp'],
  243. '_csrf': self._get_cookies('https://login.vrt.be').get('OIDCXSRF').value,
  244. }))
  245. except ExtractorError as e:
  246. if isinstance(e.cause, HTTPError) and e.cause.status == 401:
  247. retry.error = e
  248. continue
  249. raise
  250. self._authenticated = True
  251. def _real_extract(self, url):
  252. display_id = self._match_id(url)
  253. parsed_url = urllib.parse.urlparse(url)
  254. details = self._download_json(
  255. f'{parsed_url.scheme}://{parsed_url.netloc}{parsed_url.path.rstrip("/")}.model.json',
  256. display_id, 'Downloading asset JSON', 'Unable to download asset JSON')['details']
  257. watch_info = traverse_obj(details, (
  258. 'actions', lambda _, v: v['type'] == 'watch-episode', {dict}), get_all=False) or {}
  259. video_id = join_nonempty(
  260. 'episodePublicationId', 'episodeVideoId', delim='$', from_dict=watch_info)
  261. if '$' not in video_id:
  262. raise ExtractorError('Unable to extract video ID')
  263. vrtnutoken = self._download_json(
  264. 'https://token.vrt.be/refreshtoken', video_id, note='Retrieving vrtnutoken',
  265. errnote='Token refresh failed')['vrtnutoken'] if self._authenticated else None
  266. video_info = self._call_api(video_id, 'vrtnu-web@PROD', vrtnutoken)
  267. if 'title' not in video_info:
  268. code = video_info.get('code')
  269. if code in ('AUTHENTICATION_REQUIRED', 'CONTENT_IS_AGE_RESTRICTED'):
  270. self.raise_login_required(code, method='password')
  271. elif code in ('INVALID_LOCATION', 'CONTENT_AVAILABLE_ONLY_IN_BE'):
  272. self.raise_geo_restricted(countries=['BE'])
  273. elif code == 'CONTENT_AVAILABLE_ONLY_FOR_BE_RESIDENTS_AND_EXPATS':
  274. if not self._authenticated:
  275. self.raise_login_required(code, method='password')
  276. self.raise_geo_restricted(countries=['BE'])
  277. raise ExtractorError(code, expected=True)
  278. formats, subtitles = self._extract_formats_and_subtitles(video_info, video_id)
  279. return {
  280. **traverse_obj(details, {
  281. 'title': 'title',
  282. 'description': ('description', {clean_html}),
  283. 'timestamp': ('data', 'episode', 'onTime', 'raw', {parse_iso8601}),
  284. 'release_timestamp': ('data', 'episode', 'onTime', 'raw', {parse_iso8601}),
  285. 'series': ('data', 'program', 'title'),
  286. 'season': ('data', 'season', 'title', 'value'),
  287. 'season_number': ('data', 'season', 'title', 'raw', {int_or_none}),
  288. 'season_id': ('data', 'season', 'id', {str_or_none}),
  289. 'episode': ('data', 'episode', 'number', 'value', {str_or_none}),
  290. 'episode_number': ('data', 'episode', 'number', 'raw', {int_or_none}),
  291. 'episode_id': ('data', 'episode', 'id', {str_or_none}),
  292. 'age_limit': ('data', 'episode', 'age', 'raw', {parse_age_limit}),
  293. }),
  294. 'id': video_id,
  295. 'display_id': display_id,
  296. 'channel': 'VRT',
  297. 'formats': formats,
  298. 'duration': float_or_none(video_info.get('duration'), 1000),
  299. 'thumbnail': url_or_none(video_info.get('posterImageUrl')),
  300. 'subtitles': subtitles,
  301. '_old_archive_ids': [make_archive_id('Canvas', video_id)],
  302. }
  303. class KetnetIE(VRTBaseIE):
  304. _VALID_URL = r'https?://(?:www\.)?ketnet\.be/(?P<id>(?:[^/]+/)*[^/?#&]+)'
  305. _TESTS = [{
  306. 'url': 'https://www.ketnet.be/kijken/m/meisjes/6/meisjes-s6a5',
  307. 'info_dict': {
  308. 'id': 'pbs-pub-39f8351c-a0a0-43e6-8394-205d597d6162$vid-5e306921-a9aa-4fa9-9f39-5b82c8f1028e',
  309. 'ext': 'mp4',
  310. 'title': 'Meisjes',
  311. 'episode': 'Reeks 6: Week 5',
  312. 'season': 'Reeks 6',
  313. 'series': 'Meisjes',
  314. 'timestamp': 1685251800,
  315. 'upload_date': '20230528',
  316. },
  317. 'params': {'skip_download': 'm3u8'},
  318. }]
  319. def _real_extract(self, url):
  320. display_id = self._match_id(url)
  321. video = self._download_json(
  322. 'https://senior-bff.ketnet.be/graphql', display_id, query={
  323. 'query': '''{
  324. video(id: "content/ketnet/nl/%s.model.json") {
  325. description
  326. episodeNr
  327. imageUrl
  328. mediaReference
  329. programTitle
  330. publicationDate
  331. seasonTitle
  332. subtitleVideodetail
  333. titleVideodetail
  334. }
  335. }''' % display_id, # noqa: UP031
  336. })['data']['video']
  337. video_id = urllib.parse.unquote(video['mediaReference'])
  338. data = self._call_api(video_id, 'ketnet@PROD', version='v1')
  339. formats, subtitles = self._extract_formats_and_subtitles(data, video_id)
  340. return {
  341. 'id': video_id,
  342. 'formats': formats,
  343. 'subtitles': subtitles,
  344. '_old_archive_ids': [make_archive_id('Canvas', video_id)],
  345. **traverse_obj(video, {
  346. 'title': ('titleVideodetail', {str}),
  347. 'description': ('description', {str}),
  348. 'thumbnail': ('thumbnail', {url_or_none}),
  349. 'timestamp': ('publicationDate', {parse_iso8601}),
  350. 'series': ('programTitle', {str}),
  351. 'season': ('seasonTitle', {str}),
  352. 'episode': ('subtitleVideodetail', {str}),
  353. 'episode_number': ('episodeNr', {int_or_none}),
  354. }),
  355. }
  356. class DagelijkseKostIE(VRTBaseIE):
  357. IE_DESC = 'dagelijksekost.een.be'
  358. _VALID_URL = r'https?://dagelijksekost\.een\.be/gerechten/(?P<id>[^/?#&]+)'
  359. _TESTS = [{
  360. 'url': 'https://dagelijksekost.een.be/gerechten/hachis-parmentier-met-witloof',
  361. 'info_dict': {
  362. 'id': 'md-ast-27a4d1ff-7d7b-425e-b84f-a4d227f592fa',
  363. 'ext': 'mp4',
  364. 'title': 'Hachis parmentier met witloof',
  365. 'description': 'md5:9960478392d87f63567b5b117688cdc5',
  366. 'display_id': 'hachis-parmentier-met-witloof',
  367. },
  368. 'params': {'skip_download': 'm3u8'},
  369. }]
  370. def _real_extract(self, url):
  371. display_id = self._match_id(url)
  372. webpage = self._download_webpage(url, display_id)
  373. video_id = self._html_search_regex(
  374. r'data-url=(["\'])(?P<id>(?:(?!\1).)+)\1', webpage, 'video id', group='id')
  375. data = self._call_api(video_id, 'dako@prod', version='v1')
  376. formats, subtitles = self._extract_formats_and_subtitles(data, video_id)
  377. return {
  378. 'id': video_id,
  379. 'formats': formats,
  380. 'subtitles': subtitles,
  381. 'display_id': display_id,
  382. 'title': strip_or_none(get_element_by_class(
  383. 'dish-metadata__title', webpage) or self._html_search_meta('twitter:title', webpage)),
  384. 'description': clean_html(get_element_by_class(
  385. 'dish-description', webpage)) or self._html_search_meta(
  386. ['description', 'twitter:description', 'og:description'], webpage),
  387. '_old_archive_ids': [make_archive_id('Canvas', video_id)],
  388. }
  389. class Radio1BeIE(VRTBaseIE):
  390. _VALID_URL = r'https?://radio1\.be/(?:lees|luister/select)/(?P<id>[\w/-]+)'
  391. _TESTS = [{
  392. 'url': 'https://radio1.be/luister/select/de-ochtend/komt-n-va-volgend-jaar-op-in-wallonie',
  393. 'info_dict': {
  394. 'id': 'eb6c22e9-544f-44f4-af39-cf8cccd29e22',
  395. 'title': 'Komt N-VA volgend jaar op in Wallonië?',
  396. 'display_id': 'de-ochtend/komt-n-va-volgend-jaar-op-in-wallonie',
  397. 'description': 'md5:b374ea1c9302f38362df9dea1931468e',
  398. 'thumbnail': r're:https?://cds\.vrt\.radio/[^/#\?&]+',
  399. },
  400. 'playlist_mincount': 1,
  401. }, {
  402. 'url': 'https://radio1.be/lees/europese-unie-wil-onmiddellijke-humanitaire-pauze-en-duurzaam-staakt-het-vuren-in-gaza?view=web',
  403. 'info_dict': {
  404. 'id': '5d47f102-dbdb-4fa0-832b-26c1870311f2',
  405. 'title': 'Europese Unie wil "onmiddellijke humanitaire pauze" en "duurzaam staakt-het-vuren" in Gaza',
  406. 'description': 'md5:1aad1fae7d39edeffde5d3e67d276b64',
  407. 'thumbnail': r're:https?://cds\.vrt\.radio/[^/#\?&]+',
  408. 'display_id': 'europese-unie-wil-onmiddellijke-humanitaire-pauze-en-duurzaam-staakt-het-vuren-in-gaza',
  409. },
  410. 'playlist_mincount': 1,
  411. }]
  412. def _extract_video_entries(self, next_js_data, display_id):
  413. video_data = traverse_obj(
  414. next_js_data, ((None, ('paragraphs', ...)), {lambda x: x if x['mediaReference'] else None}))
  415. for data in video_data:
  416. media_reference = data['mediaReference']
  417. formats, subtitles = self._extract_formats_and_subtitles(
  418. self._call_api(media_reference), display_id)
  419. yield {
  420. 'id': media_reference,
  421. 'formats': formats,
  422. 'subtitles': subtitles,
  423. **traverse_obj(data, {
  424. 'title': ('title', {str}),
  425. 'description': ('body', {clean_html}),
  426. }),
  427. }
  428. def _real_extract(self, url):
  429. display_id = self._match_id(url)
  430. webpage = self._download_webpage(url, display_id)
  431. next_js_data = self._search_nextjs_data(webpage, display_id)['props']['pageProps']['item']
  432. return self.playlist_result(
  433. self._extract_video_entries(next_js_data, display_id), **merge_dicts(traverse_obj(
  434. next_js_data, ({
  435. 'id': ('id', {str}),
  436. 'title': ('title', {str}),
  437. 'description': (('description', 'content'), {clean_html}),
  438. }), get_all=False), {
  439. 'display_id': display_id,
  440. 'title': self._html_search_meta(['name', 'og:title', 'twitter:title'], webpage),
  441. 'description': self._html_search_meta(['description', 'og:description', 'twitter:description'], webpage),
  442. 'thumbnail': self._html_search_meta(['og:image', 'twitter:image'], webpage),
  443. }))