1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-28 06:04:17 +01:00

tv4play: support for downloading lastest X episodes

This commit is contained in:
Johan Andersson 2014-12-21 13:01:28 +01:00
parent 113fbbfd88
commit 48dd670625

View File

@ -157,6 +157,7 @@ class Tv4play(Service, OpenGraphThumbMixin):
error, data = get_http_data("http://webapi.tv4play.se/play/video_assets?type=episode&is_live=false&platform=web&node_nids=%s&per_page=99999" % show) error, data = get_http_data("http://webapi.tv4play.se/play/video_assets?type=episode&is_live=false&platform=web&node_nids=%s&per_page=99999" % show)
jsondata = json.loads(data) jsondata = json.loads(data)
episodes = [] episodes = []
n = 1
for i in jsondata["results"]: for i in jsondata["results"]:
try: try:
days = int(i["availability"]["availability_group_free"]) days = int(i["availability"]["availability_group_free"])
@ -167,4 +168,8 @@ class Tv4play(Service, OpenGraphThumbMixin):
url = "http://www.tv4play.se/program/%s?video_id=%s" % ( url = "http://www.tv4play.se/program/%s?video_id=%s" % (
show, video_id) show, video_id)
episodes.append(url) episodes.append(url)
if n == options.all_last:
break
n += 1
return episodes return episodes