Browse Source

[dailymotion] Raise GeoRestrictedError

master
Sergey M․ 7 years ago
parent
commit
8878789f11
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 6 additions and 1 deletions
  1. 7
      youtube_dl/extractor/dailymotion.py

7
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:

Loading…
Cancel
Save