Skip to content

Commit

Permalink
[plugin.video.pt] v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Haui1112 committed Sep 15, 2024
1 parent 4650821 commit 20a967f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 5 additions & 1 deletion plugin.video.pt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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/).
* Images: [Creative Commons Attribution-Share Alike 3.0](http://creativecommons.org/licenses/by-sa/3.0/us/).
2 changes: 1 addition & 1 deletion plugin.video.pt/addon.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="plugin.video.pt"
version="0.1.0"
version="0.1.2"
name="Next Gen Peertube Addon"
provider-name="Haui111">
<requires>
Expand Down
12 changes: 9 additions & 3 deletions plugin.video.pt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 20a967f

Please sign in to comment.