diff options
author | pukkandan <pukkandan@gmail.com> | 2021-02-12 10:04:04 +0530 |
---|---|---|
committer | pukkandan <pukkandan@gmail.com> | 2021-02-12 20:32:49 +0530 |
commit | 068693675ef45c6f0b752c53d8810193d33dc712 (patch) | |
tree | 9c7093d8610a1be34290fc7f74799ccc36feb590 /youtube_dlc/extractor/brightcove.py | |
parent | 1ea241292770c6027b951aa045e00eadd140b9f5 (diff) |
Cleanup some code and fix typos
:ci skip dl
Diffstat (limited to 'youtube_dlc/extractor/brightcove.py')
-rw-r--r-- | youtube_dlc/extractor/brightcove.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/youtube_dlc/extractor/brightcove.py b/youtube_dlc/extractor/brightcove.py index 091992ebd..8b29ca993 100644 --- a/youtube_dlc/extractor/brightcove.py +++ b/youtube_dlc/extractor/brightcove.py @@ -478,11 +478,12 @@ class BrightcoveNewIE(AdobePassIE): container = source.get('container') ext = mimetype2ext(source.get('type')) src = source.get('src') + skip_unplayable = not self._downloader.params.get('allow_unplayable_formats') # https://support.brightcove.com/playback-api-video-fields-reference#key_systems_object - if not self._downloader.params.get('allow_unplayable_formats') and (container == 'WVM' or source.get('key_systems')): + if skip_unplayable and (container == 'WVM' or source.get('key_systems')): num_drm_sources += 1 continue - elif ext == 'ism' and not self._downloader.params.get('allow_unplayable_formats'): + elif ext == 'ism' and skip_unplayable: continue elif ext == 'm3u8' or container == 'M2TS': if not src: @@ -546,7 +547,8 @@ class BrightcoveNewIE(AdobePassIE): error = errors[0] raise ExtractorError( error.get('message') or error.get('error_subcode') or error['error_code'], expected=True) - if not self._downloader.params.get('allow_unplayable_formats') and sources and num_drm_sources == len(sources): + if (not self._downloader.params.get('allow_unplayable_formats') + and sources and num_drm_sources == len(sources)): raise ExtractorError('This video is DRM protected.', expected=True) self._sort_formats(formats) |