From 42829927190359218a7beadd9286c9f856a19f0b Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Tue, 6 Mar 2018 19:37:36 +0100 Subject: [PATCH] viafree: they changed from using StartPageStore to ApplicationStore fixes: #845 --- lib/svtplay_dl/service/viaplay.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/svtplay_dl/service/viaplay.py b/lib/svtplay_dl/service/viaplay.py index 55b687d..058b785 100644 --- a/lib/svtplay_dl/service/viaplay.py +++ b/lib/svtplay_dl/service/viaplay.py @@ -84,7 +84,7 @@ class Viaplay(Service, OpenGraphThumbMixin): if clips: return episodenr else: - match = re.search('"ContentPageProgramStore":({.*}),"StartPageStore', self.get_urldata()) + match = self._conentpage(self.get_urldata()) if match: janson = json.loads(match.group(1)) for i in janson["format"]["videos"].keys(): @@ -203,7 +203,7 @@ class Viaplay(Service, OpenGraphThumbMixin): def _grab_episodes(self, options, seasons): episodes = [] baseurl = self.url - match = re.search("(sasong|sesong)-\d+", urlparse(self.url).path) + match = re.search("(saeson|sasong|sesong)-\d+", urlparse(self.url).path) if match: baseurl = self.url[:self.url.rfind("/")] baseurl = baseurl[:baseurl.rfind("/")] @@ -227,11 +227,13 @@ class Viaplay(Service, OpenGraphThumbMixin): def _isswe(self, url): if re.search(".se$", urlparse(url).netloc): return "sasong" + elif re.search(".dk$", urlparse(url).netloc): + return "saeson" else: return "sesong" def _conentpage(self, data): - return re.search('"ContentPageProgramStore":({.*}),[ ]*"StartPageStore', data) + return re.search('"ContentPageProgramStore":({.*}),[ ]*"ApplicationStore', data) def _videos_to_list(self, url, vid, episodes): dataj = json.loads(self._get_video_data(vid).text)