mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-28 14:15:53 +01:00
[snagfilms:embed] Capture geolocation restriction error
This commit is contained in:
parent
242a998bdc
commit
9fbfc9bd4d
@ -4,6 +4,7 @@
|
||||
|
||||
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 @@ def _real_extract(self, url):
|
||||
|
||||
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):
|
||||
|
Loading…
Reference in New Issue
Block a user