diff --git a/plugin.video.pt/README.md b/plugin.video.pt/README.md index 8e5677448..bbab00f2a 100644 --- a/plugin.video.pt/README.md +++ b/plugin.video.pt/README.md @@ -2,6 +2,10 @@ This is an addon for [Kodi](http://kodi.tv) mediacenter to play and browse Peertube servers, channels and files. +**Changes** +- v0.1.2 Add error correction for raspberry pi based systems to make app usable. + +**Installation** An installable .zip can be downloaded from releases tab. 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. @@ -14,4 +18,4 @@ Source: This plugin was inspired by this tutorial plugin: https://github.com/rom ## Licenses: * Code: [GPL v.3](http://www.gnu.org/copyleft/gpl.html) -* Images: [Creative Commons Attribution-Share Alike 3.0](http://creativecommons.org/licenses/by-sa/3.0/us/). \ No newline at end of file +* Images: [Creative Commons Attribution-Share Alike 3.0](http://creativecommons.org/licenses/by-sa/3.0/us/). diff --git a/plugin.video.pt/addon.xml b/plugin.video.pt/addon.xml index 676757b43..7a09be512 100644 --- a/plugin.video.pt/addon.xml +++ b/plugin.video.pt/addon.xml @@ -1,6 +1,6 @@ diff --git a/plugin.video.pt/main.py b/plugin.video.pt/main.py index 0b3af3e9a..09a09fbd3 100644 --- a/plugin.video.pt/main.py +++ b/plugin.video.pt/main.py @@ -24,14 +24,20 @@ def get_url(**kwargs): def get_instances(): filename = "instances.json" if not os.path.exists(USERDATA_PATH): - os.makedirs(USERDATA_PATH) + try: + os.makedirs(USERDATA_PATH) + except: + print("Could not write %s" % USERDATA_PATH) FILE_PATH = os.path.join(USERDATA_PATH, filename) if not xbmcvfs.exists(FILE_PATH): print("No file, requesting new data!") request = requests.get('https://instances.joinpeertube.org/api/v1/instances/hosts?count=1000&start=0&sort=createdAt') r = request.json() - with xbmcvfs.File(FILE_PATH) as instances_file: - instances_file.write(json.dumps(r, ensure_ascii=False, indent=4)) + try: + with xbmcvfs.File(FILE_PATH) as instances_file: + instances_file.write(json.dumps(r, ensure_ascii=False, indent=4)) + except: + print("Could not write %s" % FILE_PATH) else: with xbmcvfs.File(FILE_PATH) as instances_file: r = json.load(instances_file)