projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
63529e9
)
[youtube] detect DRM protected videos(#1774)
author
Remita Amine
<remitamine@gmail.com>
Wed, 26 Dec 2018 08:30:48 +0000
(09:30 +0100)
committer
Remita Amine
<remitamine@gmail.com>
Wed, 26 Dec 2018 09:56:10 +0000
(10:56 +0100)
youtube_dl/extractor/youtube.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/youtube.py
b/youtube_dl/extractor/youtube.py
index 954853e009bfc2ec312a3d3ea95b5bec3ecdf112..4b06cb5971c32267288b3e5368e7591acdf7da63 100644
(file)
--- a/
youtube_dl/extractor/youtube.py
+++ b/
youtube_dl/extractor/youtube.py
@@
-1077,6
+1077,11
@@
class YoutubeIE(YoutubeBaseInfoExtractor):
'url': 'https://invidio.us/watch?v=BaW_jenozKc',
'only_matching': True,
},
'url': 'https://invidio.us/watch?v=BaW_jenozKc',
'only_matching': True,
},
+ {
+ # DRM protected
+ 'url': 'https://www.youtube.com/watch?v=s7_qI6_mIXc',
+ 'only_matching': True,
+ }
]
def __init__(self, *args, **kwargs):
]
def __init__(self, *args, **kwargs):
@@
-1673,6
+1678,9
@@
class YoutubeIE(YoutubeBaseInfoExtractor):
'"token" parameter not in video info for unknown reason',
video_id=video_id)
'"token" parameter not in video info for unknown reason',
video_id=video_id)
+ if video_info.get('license_info'):
+ raise ExtractorError('This video is DRM protected.', expected=True)
+
video_details = try_get(
player_response, lambda x: x['videoDetails'], dict) or {}
video_details = try_get(
player_response, lambda x: x['videoDetails'], dict) or {}