Skip to content

Commit a9cc717

Browse files
committed
[plugin.video.pt] v0.1.2
1 parent 4650821 commit a9cc717

3 files changed

Lines changed: 19 additions & 9 deletions

File tree

plugin.video.pt/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This is an addon for [Kodi](http://kodi.tv) mediacenter to play and browse Peertube servers, channels and files.
44

5+
**Changes**
6+
- v0.1.2 Add error correction for raspberry pi based systems to make app usable.
7+
8+
**Installation**
59
An installable .zip can be downloaded from releases tab.
610
Do **not** try to install a .zip generated by GitHub. You need the plugin folder in the zip file (plugin.video.pt) for it to work. Otherwise Kodi will tell you the file structure is wrong and the install will fail.
711

@@ -14,4 +18,4 @@ Source: This plugin was inspired by this tutorial plugin: https://github.com/rom
1418
## Licenses:
1519

1620
* Code: [GPL v.3](http://www.gnu.org/copyleft/gpl.html)
17-
* Images: [Creative Commons Attribution-Share Alike 3.0](http://creativecommons.org/licenses/by-sa/3.0/us/).
21+
* Images: [Creative Commons Attribution-Share Alike 3.0](http://creativecommons.org/licenses/by-sa/3.0/us/).

plugin.video.pt/addon.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<addon id="plugin.video.pt"
3-
version="0.1.0"
3+
version="0.1.2"
44
name="Next Gen Peertube Addon"
55
provider-name="Haui111">
66
<requires>

plugin.video.pt/main.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,20 @@ def get_url(**kwargs):
2424
def get_instances():
2525
filename = "instances.json"
2626
if not os.path.exists(USERDATA_PATH):
27-
os.makedirs(USERDATA_PATH)
27+
try:
28+
os.makedirs(USERDATA_PATH)
29+
except:
30+
xbmc.log("Could not write %s" % USERDATA_PATH, xbmc.LOGDEBUG)
2831
FILE_PATH = os.path.join(USERDATA_PATH, filename)
2932
if not xbmcvfs.exists(FILE_PATH):
30-
print("No file, requesting new data!")
33+
xbmc.log("No file, requesting new data!", xbmc.LOGDEBUG)
3134
request = requests.get('https://instances.joinpeertube.org/api/v1/instances/hosts?count=1000&start=0&sort=createdAt')
3235
r = request.json()
33-
with xbmcvfs.File(FILE_PATH) as instances_file:
34-
instances_file.write(json.dumps(r, ensure_ascii=False, indent=4))
36+
try:
37+
with xbmcvfs.File(FILE_PATH) as instances_file:
38+
instances_file.write(json.dumps(r, ensure_ascii=False, indent=4))
39+
except:
40+
xbmc.log("Could not write %s" % FILE_PATH, xbmc.LOGDEBUG)
3541
else:
3642
with xbmcvfs.File(FILE_PATH) as instances_file:
3743
r = json.load(instances_file)
@@ -94,11 +100,11 @@ def list_videos(host):
94100
xbmcplugin.endOfDirectory(HANDLE)
95101

96102
def get_video(host, id):
97-
print(host)
98-
print(id)
103+
xbmc.log("host is %s" % host, xbmc.LOGDEBUG)
104+
xbmc.log("id is %s" % id, xbmc.LOGDEBUG)
99105
request = requests.get('https://%s/api/v1/videos/%d' % (host, id))
100106
r = request.json()
101-
print(r)
107+
xbmc.log("request is %s" % r, xbmc.LOGDEBUG)
102108
return r["streamingPlaylists"][0]["playlistUrl"]
103109

104110

0 commit comments

Comments
 (0)