aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornixxo <nixxo@protonmail.com>2021-03-07 08:31:59 +0100
committerGitHub <noreply@github.com>2021-03-07 13:01:59 +0530
commit0852947fcc32a423f048d8eec40ad4d318993554 (patch)
tree7805c1617974fd48fc3df83130b3844f8791bc9c
parent99594a11ce6eba9bb7d8f6455a368040b86f5ffa (diff)
downloadhypervideo-pre-0852947fcc32a423f048d8eec40ad4d318993554.tar.lz
hypervideo-pre-0852947fcc32a423f048d8eec40ad4d318993554.tar.xz
hypervideo-pre-0852947fcc32a423f048d8eec40ad4d318993554.zip
[rai] Check for DRM (#150)
Authored by: nixxo <nixxo@protonmail.com>
-rw-r--r--yt_dlp/extractor/rai.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/yt_dlp/extractor/rai.py b/yt_dlp/extractor/rai.py
index c78580d95..d09b4a735 100644
--- a/yt_dlp/extractor/rai.py
+++ b/yt_dlp/extractor/rai.py
@@ -158,6 +158,10 @@ class RaiPlayIE(RaiBaseIE):
# subtitles at 'subtitlesArray' key (see #27698)
'url': 'https://www.raiplay.it/video/2020/12/Report---04-01-2021-2e90f1de-8eee-4de4-ac0e-78d21db5b600.html',
'only_matching': True,
+ }, {
+ # DRM protected
+ 'url': 'https://www.raiplay.it/video/2020/09/Lo-straordinario-mondo-di-Zoey-S1E1-Lo-straordinario-potere-di-Zoey-ed493918-1d32-44b7-8454-862e473d00ff.html',
+ 'only_matching': True,
}]
def _real_extract(self, url):
@@ -166,6 +170,14 @@ class RaiPlayIE(RaiBaseIE):
media = self._download_json(
base + '.json', video_id, 'Downloading video JSON')
+ if not self.params.get('allow_unplayable_formats'):
+ if try_get(
+ media,
+ (lambda x: x['rights_management']['rights']['drm'],
+ lambda x: x['program_info']['rights_management']['rights']['drm']),
+ dict):
+ raise ExtractorError('This video is DRM protected.', expected=True)
+
title = media['name']
video = media['video']