1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

svtplay: fix embedded videos on svt.se

This commit is contained in:
Johan Andersson 2016-03-17 16:57:58 +01:00
parent 8da9cab05b
commit 05a20520b0

View File

@ -47,7 +47,11 @@ class Svtplay(Service, OpenGraphThumbMixin):
self.options.live = data["live"]
if old:
params = {"output": "json"}
try:
dataj = self.http.request("get", self.url, params=params).json()
except ValueError:
dataj = data
old = False
else:
dataj = data
@ -98,6 +102,9 @@ class Svtplay(Service, OpenGraphThumbMixin):
return match.group(1)
parse = urlparse(self.url)
match = re.search("/video/([0-9]+)/", parse.path)
if match:
return match.group(1)
match = re.search("data-video-id='([^']+)'", self.get_urldata())
if match:
return match.group(1)
match = re.search("/videoEpisod-([^/]+)/", parse.path)