1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00

viafree: fix -A so it works again

fixes 805
This commit is contained in:
Johan Andersson 2018-02-21 22:44:19 -05:00
parent 2fb54e368b
commit b47ce3ba26

View File

@ -193,7 +193,7 @@ class Viaplay(Service, OpenGraphThumbMixin):
episodes = self._grab_episodes(options, seasons)
if options.all_last > 0:
return sorted(episodes)[-options.all_last:]
return episodes[-options.all_last:]
return sorted(episodes)
def _grab_episodes(self, options, seasons):
@ -202,6 +202,7 @@ class Viaplay(Service, OpenGraphThumbMixin):
match = re.search("(sasong|sesong)-\d+", urlparse(self.url).path)
if match:
baseurl = self.url[:self.url.rfind("/")]
baseurl = baseurl[:baseurl.rfind("/")]
for i in seasons:
url = "{0}/{1}-{2}".format(baseurl, self._isswe(self.url), i)
@ -226,7 +227,7 @@ class Viaplay(Service, OpenGraphThumbMixin):
return "sesong"
def _conentpage(self, data):
return re.search('"ContentPageProgramStore":({.*}), "StartPageStore', data)
return re.search('"ContentPageProgramStore":({.*}),[ ]*"StartPageStore', data)
def _videos_to_list(self, url, vid, episodes):
dataj = json.loads(self._get_video_data(vid).text)