1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 12:15:40 +01:00

svtplay: fix -A again after the svtplay move away from redux

This commit is contained in:
Johan Andersson 2016-10-31 19:14:29 +01:00
parent 4901d89cf6
commit 59456c799f

View File

@ -192,7 +192,7 @@ class Svtplay(Service, OpenGraphThumbMixin):
return videos return videos
res = self.http.get("http://www.svtplay.se/sista-chansen?sida=%s" % page) res = self.http.get("http://www.svtplay.se/sista-chansen?sida=%s" % page)
match = re.search("__reduxStore'] = ({.*});", res.text) match = re.search("__svtplay'] = ({.*});", res.text)
if not match: if not match:
return videos return videos
@ -224,15 +224,15 @@ class Svtplay(Service, OpenGraphThumbMixin):
if match is None: if match is None:
videos = [] videos = []
match = re.search("__reduxStore'] = ({.*});", self.get_urldata()) match = re.search("__svtplay'] = ({.*});", self.get_urldata())
if match:
dataj = json.loads(match.group(1))
else:
log.error("Couldn't retrieve episode list")
return
if re.search("sista-chansen", parse.path): if re.search("sista-chansen", parse.path):
videos = self._last_chance(videos, 1) videos = self._last_chance(videos, 1)
elif re.search("/genre", parse.path): elif not match:
log.error("Couldn't retrieve episode list")
return
else:
dataj = json.loads(match.group(1))
if re.search("/genre", parse.path):
videos = self._genre(dataj) videos = self._genre(dataj)
else: else:
items = dataj["videoTitlePage"]["realatedVideosTabs"] items = dataj["videoTitlePage"]["realatedVideosTabs"]