From 18b00ae6735847368e2565a20030e73dbef166f8 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 3 Jun 2018 18:00:01 +0200 Subject: [PATCH] viafree: support for downloading video from the program page. --- lib/svtplay_dl/service/viaplay.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/svtplay_dl/service/viaplay.py b/lib/svtplay_dl/service/viaplay.py index 2cc3d62..7874778 100644 --- a/lib/svtplay_dl/service/viaplay.py +++ b/lib/svtplay_dl/service/viaplay.py @@ -58,8 +58,10 @@ class Viaplay(Service, OpenGraphThumbMixin): season = match.group(1) else: match = self._conentpage(self.get_urldata()) - if match: - print("printa") + if match: # this only happen on the program page? + janson2 = json.loads(match.group(1)) + season = janson2["formatPage"]["format"]["seasonNumber"] + return janson2["formatPage"]["format"]["videos"][str(season)]["program"][0]["id"] return None if "videoIdOrEpisodeNumber" in jansson: videp = jansson["videoIdOrEpisodeNumber"]