Limit the number of results from the GET /videos API call.

This commit is contained in:
Cyrille Bollu 2018-07-27 15:05:09 +02:00
parent fe91fa4e90
commit 4c47e8e382
1 changed files with 4 additions and 1 deletions

View File

@ -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