aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/snagfilms.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-06-27 18:50:26 +0600
committerSergey M․ <dstftw@gmail.com>2015-06-27 18:50:26 +0600
commit9fbfc9bd4dd076e2b00f68dc43ce4fa0ed72c949 (patch)
tree95a3e8d488e974b6aa797d68d1a11d20326ecf65 /youtube_dl/extractor/snagfilms.py
parent242a998bdc5e808411870d7b13395b7739501f16 (diff)
[snagfilms:embed] Capture geolocation restriction error
Diffstat (limited to 'youtube_dl/extractor/snagfilms.py')
-rw-r--r--youtube_dl/extractor/snagfilms.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/youtube_dl/extractor/snagfilms.py b/youtube_dl/extractor/snagfilms.py
index f04ca6036..2b1838bf9 100644
--- a/youtube_dl/extractor/snagfilms.py
+++ b/youtube_dl/extractor/snagfilms.py
@@ -4,6 +4,7 @@ import re
from .common import InfoExtractor
from ..utils import (
+ ExtractorError,
clean_html,
determine_ext,
int_or_none,
@@ -30,7 +31,8 @@ class SnagFilmsEmbedIE(InfoExtractor):
@staticmethod
def _extract_url(webpage):
mobj = re.search(
- r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:embed\.)?snagfilms\.com/embed/player.+?)\1', webpage)
+ r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:embed\.)?snagfilms\.com/embed/player.+?)\1',
+ webpage)
if mobj:
return mobj.group('url')
@@ -39,6 +41,10 @@ class SnagFilmsEmbedIE(InfoExtractor):
webpage = self._download_webpage(url, video_id)
+ if '>This film is not playable in your area.<' in webpage:
+ raise ExtractorError(
+ 'This film is not playable in your area.', expected=True)
+
formats = []
for source in self._parse_json(js_to_json(self._search_regex(
r'(?s)sources:\s*(\[.+?\]),', webpage, 'json')), video_id):