2020-05-12, 07:51
Hooray -- it works,
download script.modules.requests-2.22.0.zip and install from zip file
Then add into addon.xml file
Now add into main.py of the plugin.video.example following snippet
download script.modules.requests-2.22.0.zip and install from zip file
Then add into addon.xml file
xml:
<requires>
<import addon="script.module.requests" version="2.22.0"/>
</requires>
Now add into main.py of the plugin.video.example following snippet
[/s]python:
import json
import requests
url = 'http://iptv.server.com/series.json'
VIDEOS = {}
html = requests.get(url)
DATA = json.loads(html.content)
for series in DATA.keys():
s = series.encode('utf-8')
#xbmc.log(s, xbmc.LOGNOTICE)
VIDEOS = []
for episode in DATA[series]:
name = episode['name'].encode('utf-8')
genre = episode['genre'].encode('utf-8')
#xbmc.log(name, xbmc.LOGNOTICE)
#xbmc.log(genre, xbmc.LOGNOTICE)
e = { "name": name, "thumb": episode["thumb"], "video": episode["video"], "genre": genre }
VIDEOS[s].append(e)