projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a5cf179
)
[dailymotion] Raise GeoRestrictedError
author
Sergey M․
<dstftw@gmail.com>
Sun, 26 Feb 2017 09:50:57 +0000
(16:50 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Sun, 26 Feb 2017 09:52:40 +0000
(16:52 +0700)
youtube_dl/extractor/dailymotion.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/dailymotion.py
b/youtube_dl/extractor/dailymotion.py
index b312401dc69b9a9ca35cebca767b11f10174e1c2..246efde4342cf5fd4c2b3807c16a118bab5175dc 100644
(file)
--- a/
youtube_dl/extractor/dailymotion.py
+++ b/
youtube_dl/extractor/dailymotion.py
@@
-282,9
+282,14
@@
class DailymotionIE(DailymotionBaseInfoExtractor):
}
def _check_error(self, info):
+ error = info.get('error')
if info.get('error') is not None:
+ title = error['title']
+ # See https://developer.dailymotion.com/api#access-error
+ if error.get('code') == 'DM007':
+ self.raise_geo_restricted(msg=title)
raise ExtractorError(
- '%s said: %s' % (self.IE_NAME,
info['error']['title']
), expected=True)
+ '%s said: %s' % (self.IE_NAME,
title
), expected=True)
def _get_subtitles(self, video_id, webpage):
try: