1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-29 05:32:00 +00:00

[bbc] Extract full description from __INITIAL_DATA__ (refs #28774)

This commit is contained in:
Sergey M․ 2021-04-21 03:00:56 +07:00
parent 41920fc80e
commit dab83a2597
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D

View file

@ -770,7 +770,7 @@ class BBCIE(BBCCoUkIE):
'id': 'p02xzws1', 'id': 'p02xzws1',
'ext': 'mp4', 'ext': 'mp4',
'title': "Pluto may have 'nitrogen glaciers'", 'title': "Pluto may have 'nitrogen glaciers'",
'description': "Pluto could have glaciers of nitrogen ice, new photographs from Nasa's New Horizons probe suggest.", 'description': 'md5:6a95b593f528d7a5f2605221bc56912f',
'thumbnail': r're:https?://.+/.+\.jpg', 'thumbnail': r're:https?://.+/.+\.jpg',
'timestamp': 1437785037, 'timestamp': 1437785037,
'upload_date': '20150725', 'upload_date': '20150725',
@ -1176,10 +1176,16 @@ class BBCIE(BBCCoUkIE):
continue continue
formats, subtitles = self._download_media_selector(item_id) formats, subtitles = self._download_media_selector(item_id)
self._sort_formats(formats) self._sort_formats(formats)
item_desc = try_get( item_desc = None
media, blocks = try_get(media, lambda x: x['summary']['blocks'], list)
lambda x: x['summary']['blocks'][0]['model']['text'], if blocks:
compat_str) summary = []
for block in blocks:
text = try_get(block, lambda x: x['model']['text'], compat_str)
if text:
summary.append(text)
if summary:
item_desc = '\n\n'.join(summary)
item_time = None item_time = None
for meta in try_get(media, lambda x: x['metadata']['items'], list) or []: for meta in try_get(media, lambda x: x['metadata']['items'], list) or []:
if try_get(meta, lambda x: x['label']) == 'Published': if try_get(meta, lambda x: x['label']) == 'Published':