From 37f1b91d549733888cb449d0667b53de5c235629 Mon Sep 17 00:00:00 2001 From: Famille Bollu Date: Thu, 26 Jul 2018 21:44:13 +0200 Subject: [PATCH] Fixed an indentation issue in peertube.py + fixed an error when parsing the json result of the call to api/v1/videos --- peertube.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/peertube.py b/peertube.py index f1dc94a..81760cd 100755 --- a/peertube.py +++ b/peertube.py @@ -58,7 +58,7 @@ class PeertubeAddon(): # Create a list for our items. listing = [] - for video in videos: + for video in videos['data']: # Create a list item with a text label list_item = xbmcgui.ListItem(label=video['name']) @@ -99,12 +99,12 @@ class PeertubeAddon(): # Save magnet link temporarily. tmp_f = xbmc.translatePath('special://temp') + '/plugin.video.peertube/' + video['uuid'] f = xbmcvfs.File(tmp_f, 'w') - f.write(magnet) - f.close() + f.write(magnet) + f.close() - # Add our item to the listing as a 3-element tuple. - url = '{0}?action=play&magnet={1}'.format(__url__, tmp_f) - listing.append((url, list_item, False)) + # Add our item to the listing as a 3-element tuple. + url = '{0}?action=play&magnet={1}'.format(__url__, tmp_f) + listing.append((url, list_item, False)) # Add our listing to Kodi. xbmcplugin.addDirectoryItems(__handle__, listing, len(listing))