projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
242a998
)
[snagfilms:embed] Capture geolocation restriction error
author
Sergey M․
<dstftw@gmail.com>
Sat, 27 Jun 2015 12:50:26 +0000
(18:50 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 27 Jun 2015 12:50:26 +0000
(18:50 +0600)
youtube_dl/extractor/snagfilms.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/snagfilms.py
b/youtube_dl/extractor/snagfilms.py
index f04ca60369410b1435eee232c382ef22ecf96a1c..2b1838bf90f5d659a169ca12a0376adb5eea9cfc 100644
(file)
--- 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 (
from .common import InfoExtractor
from ..utils import (
+ ExtractorError,
clean_html,
determine_ext,
int_or_none,
clean_html,
determine_ext,
int_or_none,
@@
-30,7
+31,8
@@
class SnagFilmsEmbedIE(InfoExtractor):
@staticmethod
def _extract_url(webpage):
mobj = re.search(
@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')
if mobj:
return mobj.group('url')
@@
-39,6
+41,10
@@
class SnagFilmsEmbedIE(InfoExtractor):
webpage = self._download_webpage(url, video_id)
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):
formats = []
for source in self._parse_json(js_to_json(self._search_regex(
r'(?s)sources:\s*(\[.+?\]),', webpage, 'json')), video_id):