aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/extractor/common.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2021-02-12 10:04:04 +0530
committerpukkandan <pukkandan@gmail.com>2021-02-12 20:32:49 +0530
commit068693675ef45c6f0b752c53d8810193d33dc712 (patch)
tree9c7093d8610a1be34290fc7f74799ccc36feb590 /youtube_dlc/extractor/common.py
parent1ea241292770c6027b951aa045e00eadd140b9f5 (diff)
downloadhypervideo-pre-068693675ef45c6f0b752c53d8810193d33dc712.tar.lz
hypervideo-pre-068693675ef45c6f0b752c53d8810193d33dc712.tar.xz
hypervideo-pre-068693675ef45c6f0b752c53d8810193d33dc712.zip
Cleanup some code and fix typos
:ci skip dl
Diffstat (limited to 'youtube_dlc/extractor/common.py')
-rw-r--r--youtube_dlc/extractor/common.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/youtube_dlc/extractor/common.py b/youtube_dlc/extractor/common.py
index 1fe2d0a93..371c34929 100644
--- a/youtube_dlc/extractor/common.py
+++ b/youtube_dlc/extractor/common.py
@@ -2358,7 +2358,7 @@ class InfoExtractor(object):
extract_Initialization(segment_template)
return ms_info
- allow_unplayable_formats = self._downloader.params.get('allow_unplayable_formats')
+ skip_unplayable = not self._downloader.params.get('allow_unplayable_formats')
mpd_duration = parse_duration(mpd_doc.get('mediaPresentationDuration'))
formats = []
@@ -2369,11 +2369,11 @@ class InfoExtractor(object):
'timescale': 1,
})
for adaptation_set in period.findall(_add_ns('AdaptationSet')):
- if is_drm_protected(adaptation_set) and allow_unplayable_formats is False:
+ if skip_unplayable and is_drm_protected(adaptation_set):
continue
adaption_set_ms_info = extract_multisegment_info(adaptation_set, period_ms_info)
for representation in adaptation_set.findall(_add_ns('Representation')):
- if is_drm_protected(representation) and allow_unplayable_formats is False:
+ if skip_unplayable and is_drm_protected(representation):
continue
representation_attrib = adaptation_set.attrib.copy()
representation_attrib.update(representation.attrib)
@@ -2587,7 +2587,10 @@ class InfoExtractor(object):
1. [MS-SSTR]: Smooth Streaming Protocol,
https://msdn.microsoft.com/en-us/library/ff469518.aspx
"""
- if ism_doc.get('IsLive') == 'TRUE' or (ism_doc.find('Protection') is not None and not self._downloader.params.get('allow_unplayable_formats')):
+ if ism_doc.get('IsLive') == 'TRUE':
+ return []
+ if (not self._downloader.params.get('allow_unplayable_formats')
+ and ism_doc.find('Protection') is not None):
return []
duration = int(ism_doc.attrib['Duration'])