aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/common.py
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2016-02-03 18:44:43 +0100
committerremitamine <remitamine@gmail.com>2016-02-03 18:44:43 +0100
commit675d001633c9446e9d53db2794614862d1d82607 (patch)
treedb6709e1b0756ac50562080747b62c5d0e243537 /youtube_dl/extractor/common.py
parentd577c79632e96e900f8ff5b89c98c3e60475d4b0 (diff)
[common] skip drm protected dash formats
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r--youtube_dl/extractor/common.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index ee0e3d8d1..4859b911a 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -1355,6 +1355,9 @@ class InfoExtractor(object):
def _add_ns(path):
return self._xpath_ns(path, namespace)
+ def is_drm_protected(element):
+ return element.find(_add_ns('ContentProtection')) is not None
+
def extract_multisegment_info(element, ms_parent_info):
ms_info = ms_parent_info.copy()
segment_list = element.find(_add_ns('SegmentList'))
@@ -1406,8 +1409,12 @@ class InfoExtractor(object):
'timescale': 1,
})
for adaptation_set in period.findall(_add_ns('AdaptationSet')):
+ if 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):
+ continue
representation_attrib = adaptation_set.attrib.copy()
representation_attrib.update(representation.attrib)
mime_type = representation_attrib.get('mimeType')