Fixed an indentation issue in peertube.py + fixed an error when parsing the json result
of the call to api/v1/videos
This commit is contained in:
parent
4729397b16
commit
37f1b91d54
12
peertube.py
12
peertube.py
|
@ -58,7 +58,7 @@ class PeertubeAddon():
|
||||||
|
|
||||||
# Create a list for our items.
|
# Create a list for our items.
|
||||||
listing = []
|
listing = []
|
||||||
for video in videos:
|
for video in videos['data']:
|
||||||
|
|
||||||
# Create a list item with a text label
|
# Create a list item with a text label
|
||||||
list_item = xbmcgui.ListItem(label=video['name'])
|
list_item = xbmcgui.ListItem(label=video['name'])
|
||||||
|
@ -99,12 +99,12 @@ class PeertubeAddon():
|
||||||
# Save magnet link temporarily.
|
# Save magnet link temporarily.
|
||||||
tmp_f = xbmc.translatePath('special://temp') + '/plugin.video.peertube/' + video['uuid']
|
tmp_f = xbmc.translatePath('special://temp') + '/plugin.video.peertube/' + video['uuid']
|
||||||
f = xbmcvfs.File(tmp_f, 'w')
|
f = xbmcvfs.File(tmp_f, 'w')
|
||||||
f.write(magnet)
|
f.write(magnet)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
# Add our item to the listing as a 3-element tuple.
|
# Add our item to the listing as a 3-element tuple.
|
||||||
url = '{0}?action=play&magnet={1}'.format(__url__, tmp_f)
|
url = '{0}?action=play&magnet={1}'.format(__url__, tmp_f)
|
||||||
listing.append((url, list_item, False))
|
listing.append((url, list_item, False))
|
||||||
|
|
||||||
# Add our listing to Kodi.
|
# Add our listing to Kodi.
|
||||||
xbmcplugin.addDirectoryItems(__handle__, listing, len(listing))
|
xbmcplugin.addDirectoryItems(__handle__, listing, len(listing))
|
||||||
|
|
Loading…
Reference in New Issue