浏览代码

[vevo] Catch the georestriction message (#7802)

Yen Chi Hsuan 9 年之前
父节点
当前提交
4bf99ade15
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      youtube_dl/extractor/vevo.py

+ 3 - 0
youtube_dl/extractor/vevo.py

@@ -81,6 +81,9 @@ class VevoIE(InfoExtractor):
         if webpage is False:
             self._oauth_token = None
         else:
+            if 'THIS PAGE IS CURRENTLY UNAVAILABLE IN YOUR REGION' in webpage:
+                raise ExtractorError('%s said: This page is currently unavailable in your region.' % self.IE_NAME, expected=True)
+
             self._oauth_token = self._search_regex(
                 r'access_token":\s*"([^"]+)"',
                 webpage, 'access token', fatal=False)