[animeondemand] Detect geo restriction
authorSergey M․ <dstftw@gmail.com>
Sun, 20 Mar 2016 14:39:00 +0000 (20:39 +0600)
committerSergey M․ <dstftw@gmail.com>
Sun, 20 Mar 2016 14:39:00 +0000 (20:39 +0600)
youtube_dl/extractor/animeondemand.py

index 0158407f6a89a66f8b6d1a5b560dc3794b5152e3..85306a69cfae70d5ba7d2c1d27add81698cc07fe 100644 (file)
@@ -44,6 +44,10 @@ class AnimeOnDemandIE(InfoExtractor):
         login_page = self._download_webpage(
             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.update({