2015-08-14, 19:07
Hello,
I have the following addon coded that shows me some video streams. Problem is it works fine on my PC (Windows10) and my old Raspberry PI1, but on my Raspberry PI2, it tells me "wrong structure".
The zip folder is setup as its supposed to, I have tried naming the zip with "-1.2.3", nothing works.
Can anyone figure out what is wrong with this script?
I have to say this is NOT my addon, and I haven't got a lot of coding experience, hence why I am asking for help here.
Log file here:
http://paste.osmc.io/fetehofobe
and zipfile here:
http://www.filedropper.com/
I have the following addon coded that shows me some video streams. Problem is it works fine on my PC (Windows10) and my old Raspberry PI1, but on my Raspberry PI2, it tells me "wrong structure".
The zip folder is setup as its supposed to, I have tried naming the zip with "-1.2.3", nothing works.
Can anyone figure out what is wrong with this script?
I have to say this is NOT my addon, and I haven't got a lot of coding experience, hence why I am asking for help here.
Log file here:
http://paste.osmc.io/fetehofobe
and zipfile here:
http://www.filedropper.com/
addon.xml Wrote:<?xml version="1.0" encoding="UTF-8"?>
<addon id="plugin.video.nameofaddon" version="6" name="nameofaddon" provider-name="nameofcoder">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
</requires>
<extension point="xbmc.python.pluginsource" library="default.py">
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en">none</summary>
<summary lang="da">none</summary>
<platform>all</platform>
<language>en</language>
</extension>
</addon>
default.py Wrote:import sys, urllib2, xbmcaddon, xbmcgui, xbmcplugin, json, cookielib
class nameofaddon(object):
def listTVChannels(self):
username = settings.getSetting("username")
password = settings.getSetting("password")
cookiejar = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar))
opener.addheaders = [('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2071.71 Safari/527.36')]
login_url = "https://login.viaplay.dk/api/login/v1?deviceKey=androidv2-dk&returnurl=https%3A%2F%2Fcontent.viaplay.dk%2Fandroidv2-dk%3Fdtg%3Dfalse&username={0}&password={1}&persistent=false".format(username, password)
opener.open(login_url)
token_url = "https://play.viaplay.dk/api/stream/byguid?deviceId=dsFdsfds&deviceName=Galaxy&deviceType=Mobile&userAgent=Viaplay%2F4.3.1%20%28Android%205.0%29&deviceKey=androidv2-dk&guid=TV3DK"
r = opener.open(token_url)
token = json.loads(r.read())['_links']['viaplay:playlist']['href'].split("m3u8")[1]
channels = {
"DR1": "http://dr01-lh.akamaihd.net/i/dr01_0@147054/master.m3u8?b=100-2000",
"DR2": "http://dr02-lh.akamaihd.net/i/dr02_0@147055/master.m3u8?b=100-2000",
"DR3": "http://dr03-lh.akamaihd.net/i/dr03_0@147056/master.m3u8?b=100-1600",
"DR ULTRA" : "http://dr06-lh.akamaihd.net/i/dr06_0@147059/master.m3u8?b=100-1600",
"RAMASJANG": "http://dr05-lh.akamaihd.net/i/dr05_0@147058/master.m3u8?b=100-1600",
"DR K" : "http://dr04-lh.akamaihd.net/i/dr04_0@147057/master.m3u8?b=100-1600"
}
for name, url in channels.items():
xbmcplugin.addDirectoryItem(HANDLE, url + token, xbmcgui.ListItem(name))
xbmcplugin.endOfDirectory(HANDLE, True)
if __name__ == '__main__':
HANDLE = int(sys.argv[1])
settings = xbmcaddon.Addon(id='plugin.video.nameofaddon')
a = nameofaddon()
a.listTVChannels()