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)