From 4c47e8e382728819d826b96841990d6917cb22b1 Mon Sep 17 00:00:00 2001 From: Cyrille Bollu Date: Fri, 27 Jul 2018 15:05:09 +0200 Subject: [PATCH] Limit the number of results from the GET /videos API call. --- peertube.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/peertube.py b/peertube.py index e7f78bb..3bdac5e 100644 --- a/peertube.py +++ b/peertube.py @@ -9,6 +9,7 @@ # - When downloaded torrents are kept, do we want to seed them all the time, # or only when the addon is running, or only when kodi is playing one,...? # - Do sanity checks on received data +# - Add a menu: 1) browse instance, 2) browse connected instances, 3) connect to ..., 4) search... import time, sys import urllib2, json @@ -51,7 +52,9 @@ class PeertubeAddon(): # Get the list of videos published by the instance # TODO: Handle failures - resp = urllib2.urlopen(inst + '/api/v1/videos') + # Make count configurable + # Set up pagination + resp = urllib2.urlopen(inst + '/api/v1/videos?count=21') videos = json.load(resp) # Return when no videos are found