浏览代码

[animeondemand] Detect geo restriction

Sergey M․ 9 年之前
父节点
当前提交
3e8bb9a972
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      youtube_dl/extractor/animeondemand.py

+ 4 - 0
youtube_dl/extractor/animeondemand.py

@@ -44,6 +44,10 @@ class AnimeOnDemandIE(InfoExtractor):
         login_page = self._download_webpage(
         login_page = self._download_webpage(
             self._LOGIN_URL, None, 'Downloading login page')
             self._LOGIN_URL, None, 'Downloading login page')
 
 
+        if '>Our licensing terms allow the distribution of animes only to German-speaking countries of Europe' in login_page:
+            self.raise_geo_restricted(
+                '%s is only available in German-speaking countries of Europe' % self.IE_NAME)
+
         login_form = self._form_hidden_inputs('new_user', login_page)
         login_form = self._form_hidden_inputs('new_user', login_page)
 
 
         login_form.update({
         login_form.update({