diff options
author | Jesús <heckyel@hyperbola.info> | 2021-12-10 13:41:45 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-12-10 13:41:45 -0500 |
commit | 3a9fe880dddb69cfca33c8438683b69833139cd6 (patch) | |
tree | c43bb991c3291e6f54e3c72f2bd416c270c4cbe3 /yt_dlp/extractor/brightcove.py | |
parent | ab2840d99fe752985fb1259a1a364f591f955d89 (diff) | |
parent | aa4b0545120becc11a5992384ce52c943da8ead5 (diff) | |
download | hypervideo-pre-3a9fe880dddb69cfca33c8438683b69833139cd6.tar.lz hypervideo-pre-3a9fe880dddb69cfca33c8438683b69833139cd6.tar.xz hypervideo-pre-3a9fe880dddb69cfca33c8438683b69833139cd6.zip |
updated from upstream | 10/12/2021 at 13:41
Diffstat (limited to 'yt_dlp/extractor/brightcove.py')
-rw-r--r-- | yt_dlp/extractor/brightcove.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/yt_dlp/extractor/brightcove.py b/yt_dlp/extractor/brightcove.py index cd1c3f01c..171739b46 100644 --- a/yt_dlp/extractor/brightcove.py +++ b/yt_dlp/extractor/brightcove.py @@ -16,6 +16,7 @@ from ..compat import ( ) from ..utils import ( clean_html, + dict_get, extract_attributes, ExtractorError, find_xpath_attr, @@ -577,11 +578,20 @@ class BrightcoveNewIE(AdobePassIE): if duration is not None and duration <= 0: is_live = True + common_res = [(160, 90), (320, 180), (480, 720), (640, 360), (768, 432), (1024, 576), (1280, 720), (1366, 768), (1920, 1080)] + thumb_base_url = dict_get(json_data, ('poster', 'thumbnail')) + thumbnails = [{ + 'url': re.sub(r'\d+x\d+', f'{w}x{h}', thumb_base_url), + 'width': w, + 'height': h, + } for w, h in common_res] if thumb_base_url else None + return { 'id': video_id, 'title': self._live_title(title) if is_live else title, 'description': clean_html(json_data.get('description')), 'thumbnail': json_data.get('thumbnail') or json_data.get('poster'), + 'thumbnials': thumbnails, 'duration': duration, 'timestamp': parse_iso8601(json_data.get('published_at')), 'uploader_id': json_data.get('account_id'), |