diff --git a/lib/svtplay_dl/service/tv4play.py b/lib/svtplay_dl/service/tv4play.py index c49be01..7069b25 100644 --- a/lib/svtplay_dl/service/tv4play.py +++ b/lib/svtplay_dl/service/tv4play.py @@ -163,6 +163,13 @@ class Tv4play(Service, OpenGraphThumbMixin): return i["title"] return self._get_clip_info(vid) + def _getdays(self, data, text): + try: + days = int(data["availability"][text]) + except (ValueError, TypeError): + days = 999 + return days + def find_all_episodes(self, options): premium = False if options.username and options.password: @@ -181,10 +188,10 @@ class Tv4play(Service, OpenGraphThumbMixin): else: text = "availability_group_free" - try: - days = int(i["availability"][text]) - except (ValueError, TypeError): - days = 999 + days = self._getdays(i, text) + if premium and days == 0: + days = self._getdays(i, "availability_group_free") + if days > 0: video_id = i["id"] url = "http://www.tv4play.se/program/%s?video_id=%s" % (