diff options
author | Sergey M․ <[email protected]> | 2021-04-21 03:00:56 +0700 |
---|---|---|
committer | Sergey M․ <[email protected]> | 2021-04-21 03:00:56 +0700 |
commit | dab83a25972e0dbcc69583bf78d2a992f581563d (patch) | |
tree | 7be730e7e012a3f03bd687185e047766e38b9693 | |
parent | 41920fc80e4fe4a8996aeb31a04826a5a2534814 (diff) | |
download | youtube-dl-dab83a25972e0dbcc69583bf78d2a992f581563d.tar.gz youtube-dl-dab83a25972e0dbcc69583bf78d2a992f581563d.zip |
[bbc] Extract full description from __INITIAL_DATA__ (refs #28774)
-rw-r--r-- | youtube_dl/extractor/bbc.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/youtube_dl/extractor/bbc.py b/youtube_dl/extractor/bbc.py index 71ea25881..247d982ce 100644 --- a/youtube_dl/extractor/bbc.py +++ b/youtube_dl/extractor/bbc.py @@ -770,7 +770,7 @@ class BBCIE(BBCCoUkIE): 'id': 'p02xzws1', 'ext': 'mp4', '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', 'timestamp': 1437785037, 'upload_date': '20150725', @@ -1176,10 +1176,16 @@ class BBCIE(BBCCoUkIE): continue formats, subtitles = self._download_media_selector(item_id) self._sort_formats(formats) - item_desc = try_get( - media, - lambda x: x['summary']['blocks'][0]['model']['text'], - compat_str) + item_desc = None + blocks = try_get(media, lambda x: x['summary']['blocks'], list) + if blocks: + 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 for meta in try_get(media, lambda x: x['metadata']['items'], list) or []: if try_get(meta, lambda x: x['label']) == 'Published': |