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

tv4play: free videos with premuim showed up as None

This commit is contained in:
Johan Andersson 2016-04-30 14:10:43 +02:00
parent 03a6307f38
commit 5cf6e0fe45

View File

@ -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" % (