5 |
|
|
6 |
import sys |
import sys |
7 |
import cgi as urlparse |
import cgi as urlparse |
8 |
|
import os |
9 |
|
|
10 |
|
|
11 |
import xbmc |
import xbmc |
12 |
import xbmcaddon |
import xbmcaddon |
18 |
__addon__ = xbmcaddon.Addon(id='plugin.video.todic') |
__addon__ = xbmcaddon.Addon(id='plugin.video.todic') |
19 |
__key__ = __addon__.getSetting('xbmckey').lower() |
__key__ = __addon__.getSetting('xbmckey').lower() |
20 |
__backend__ = "http://todic.dk/xbmc.php?xbmckey=" + __key__ |
__backend__ = "http://todic.dk/xbmc.php?xbmckey=" + __key__ |
21 |
|
fanartImage = os.path.join(__addon__.getAddonInfo('path'), 'fanart.jpg') |
22 |
|
|
23 |
def open_url(url): |
def open_url(url): |
24 |
req = urllib2.Request(url) |
req = urllib2.Request(url) |
33 |
l = len(m) |
l = len(m) |
34 |
for name,url in m: |
for name,url in m: |
35 |
listitem = xbmcgui.ListItem(label = name, iconImage = 'DefaultFolder.png', thumbnailImage = 'DefaultFolder.png') |
listitem = xbmcgui.ListItem(label = name, iconImage = 'DefaultFolder.png', thumbnailImage = 'DefaultFolder.png') |
36 |
|
listitem.setProperty('Fanart_Image', fanartImage) |
37 |
|
|
38 |
u = sys.argv[0] + "?mode=1&name=" + urllib.quote_plus(name) + "&url=" + urllib.quote_plus(url) |
u = sys.argv[0] + "?mode=1&name=" + urllib.quote_plus(name) + "&url=" + urllib.quote_plus(url) |
39 |
ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = listitem, isFolder = True, totalItems = l) |
ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = listitem, isFolder = True, totalItems = l) |
40 |
|
|
41 |
listitem = xbmcgui.ListItem(label = "Søg film ...", iconImage = 'DefaultFolder.png', thumbnailImage = 'DefaultFolder.png') |
listitem = xbmcgui.ListItem(label = "Søg film ...", iconImage = 'DefaultFolder.png', thumbnailImage = 'DefaultFolder.png') |
42 |
|
listitem.setProperty('Fanart_Image', fanartImage) |
43 |
|
|
44 |
u = sys.argv[0] + "?mode=10&name=" + urllib.quote_plus(name) |
u = sys.argv[0] + "?mode=10&name=" + urllib.quote_plus(name) |
45 |
ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = listitem, isFolder = True, totalItems = l) |
ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = listitem, isFolder = True, totalItems = l) |
46 |
|
|
69 |
|
|
70 |
listitem = xbmcgui.ListItem(label = name, label2='test', iconImage = 'DefaultFolder.png', thumbnailImage = thumb) |
listitem = xbmcgui.ListItem(label = name, label2='test', iconImage = 'DefaultFolder.png', thumbnailImage = thumb) |
71 |
listitem.setInfo('video', infoLabels) |
listitem.setInfo('video', infoLabels) |
72 |
|
listitem.setProperty('Fanart_Image', fanartImage) |
73 |
|
|
74 |
u = sys.argv[0] + "?mode=" + urllib.quote_plus(mode) + "&name=" + urllib.quote_plus(name) + "&url=" + urllib.quote_plus(url) |
u = sys.argv[0] + "?mode=" + urllib.quote_plus(mode) + "&name=" + urllib.quote_plus(name) + "&url=" + urllib.quote_plus(url) |
75 |
ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = listitem, isFolder = folder, totalItems = l) |
ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = listitem, isFolder = folder, totalItems = l) |
76 |
xbmcplugin.endOfDirectory(int(sys.argv[1])) |
xbmcplugin.endOfDirectory(int(sys.argv[1])) |