33 |
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) |
34 |
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) |
35 |
|
|
36 |
listitem = xbmcgui.ListItem(label = "Søg ...", iconImage = 'DefaultFolder.png', thumbnailImage = 'DefaultFolder.png') |
listitem = xbmcgui.ListItem(label = "Søg film ...", iconImage = 'DefaultFolder.png', thumbnailImage = 'DefaultFolder.png') |
37 |
u = sys.argv[0] + "?mode=10&name=" + urllib.quote_plus(name) |
u = sys.argv[0] + "?mode=10&name=" + urllib.quote_plus(name) |
38 |
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) |
39 |
|
|
44 |
print '[TODIC]:'+str(url) |
print '[TODIC]:'+str(url) |
45 |
link = open_url(url) |
link = open_url(url) |
46 |
ty=re.compile('<meta type=\'(.+?)\'').findall(link) |
ty=re.compile('<meta type=\'(.+?)\'').findall(link) |
47 |
print '[TOD]'+str(ty[0]) |
print '[TODIC]'+str(ty[0]) |
48 |
m=re.compile('<title>(.+?)</title><url>(.+?)</url><cover>(.+?)</cover>').findall(link) |
|
49 |
|
if ty[0] == 'clipList': |
50 |
|
mode = '50' |
51 |
|
folder = False |
52 |
|
else: |
53 |
|
mode = '1' |
54 |
|
folder = True |
55 |
|
|
56 |
|
m=re.compile('<title>(.+?)</title><url>(.+?)</url><cover>(.+?)</cover><description>(.*)</description>').findall(link) |
57 |
l=len(m) |
l=len(m) |
58 |
for name,url,thumb in m: |
for name,url,thumb,description in m: |
59 |
if ty[0] == 'clipList': |
infoLabels = {} |
60 |
mode = '50' |
infoLabels['title'] = name |
61 |
folder = False |
infoLabels['plot'] = description |
62 |
else: |
|
63 |
mode = '2' |
listitem = xbmcgui.ListItem(label = name, label2='test', iconImage = 'DefaultFolder.png', thumbnailImage = thumb) |
64 |
folder = True |
listitem.setInfo('video', infoLabels) |
|
|
|
|
listitem = xbmcgui.ListItem(label = name, iconImage = 'DefaultFolder.png', thumbnailImage = thumb) |
|
65 |
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) |
66 |
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) |
67 |
xbmcplugin.endOfDirectory(int(sys.argv[1])) |
xbmcplugin.endOfDirectory(int(sys.argv[1])) |
68 |
|
|
|
def buildSubList(url,title): |
|
|
print '[TODIC]:'+str(url) |
|
|
link = open_url(url) |
|
|
m=re.compile('<title>(.+?)</title><url>(.+?)</url><cover>(.+?)</cover>').findall(link) |
|
|
l = len(m) |
|
|
for name,url,thumb in m: |
|
|
listitem = xbmcgui.ListItem(label = name, iconImage = 'DefaultFolder.png', thumbnailImage = thumb) |
|
|
u = sys.argv[0] + "?mode=50&name=" + urllib.quote_plus(name) + "&url=" + urllib.quote_plus(url) |
|
|
ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = listitem, isFolder = False, totalItems = l) |
|
|
xbmcplugin.endOfDirectory(int(sys.argv[1])) |
|
69 |
|
|
70 |
|
|
71 |
|
|
84 |
def search(): |
def search(): |
85 |
search = getUserInput("Todic Søgning") |
search = getUserInput("Todic Søgning") |
86 |
|
|
87 |
url = __backend__ + "&action=search&search=" + urllib.quote_plus(search) |
if (search != None and search != ""): |
88 |
|
url = __backend__ + "&action=search&search=" + urllib.quote_plus(search) |
89 |
|
|
90 |
print "[TODIC] Search start: " + search |
#print "[TODIC] Search start: " + search |
91 |
print "[TODIC] Search url: " + url |
#print "[TODIC] Search url: " + url |
92 |
|
|
93 |
buildSubList(url, "søgning") |
buildList(url, "søgning") |
94 |
|
|
95 |
|
|
96 |
|
|
170 |
#build list of movie starting letters |
#build list of movie starting letters |
171 |
buildList(url, name) |
buildList(url, name) |
172 |
|
|
|
elif mode == 2: |
|
|
#build list of series |
|
|
buildSubList(url, name) |
|
|
|
|
173 |
elif mode == 10: |
elif mode == 10: |
174 |
search() |
search() |
175 |
|
|