aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/vrv.py
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2019-07-16 22:51:10 +0100
committerRemita Amine <remitamine@gmail.com>2019-07-16 22:51:10 +0100
commit1824bfdcdff1af4bfc4f7f6ed885d45ee7e8c376 (patch)
tree2d088ea841cc2e52f9d3b80eb2b2f6197395b3d3 /youtube_dl/extractor/vrv.py
parent2f1991ff1461b11134d2b09d6e8d681ce51d93d0 (diff)
[vrv] fix CMS signing query extraction(closes #21809)
Diffstat (limited to 'youtube_dl/extractor/vrv.py')
-rw-r--r--youtube_dl/extractor/vrv.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/youtube_dl/extractor/vrv.py b/youtube_dl/extractor/vrv.py
index c814a8a4a..6e51469b0 100644
--- a/youtube_dl/extractor/vrv.py
+++ b/youtube_dl/extractor/vrv.py
@@ -64,7 +64,15 @@ class VRVBaseIE(InfoExtractor):
def _call_cms(self, path, video_id, note):
if not self._CMS_SIGNING:
- self._CMS_SIGNING = self._call_api('index', video_id, 'CMS Signing')['cms_signing']
+ index = self._call_api('index', video_id, 'CMS Signing')
+ self._CMS_SIGNING = index.get('cms_signing') or {}
+ if not self._CMS_SIGNING:
+ for signing_policy in index.get('signing_policies', []):
+ signing_path = signing_policy.get('path')
+ if signing_path and signing_path.startswith('/cms/'):
+ name, value = signing_policy.get('name'), signing_policy.get('value')
+ if name and value:
+ self._CMS_SIGNING[name] = value
return self._download_json(
self._API_DOMAIN + path, video_id, query=self._CMS_SIGNING,
note='Downloading %s JSON metadata' % note, headers=self.geo_verification_headers())