/[projects]/misc/xbmc/plugin.video.todic/default.py
ViewVC logotype

Diff of /misc/xbmc/plugin.video.todic/default.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1648 by torben, Sun Dec 4 14:40:44 2011 UTC revision 1659 by torben, Mon Dec 12 17:50:21 2011 UTC
# Line 28  def open_url(url): Line 28  def open_url(url):
28          return data          return data
29    
30  def rootMenu():  def rootMenu():
         link = open_url(__backend__)  
         m=re.compile('<title>(.+?)</title><url>(.+?)</url>').findall(link)  
         l = len(m)  
         for name,url in m:  
                 listitem = xbmcgui.ListItem(label = name, iconImage = 'DefaultFolder.png', thumbnailImage = 'DefaultFolder.png')  
                 listitem.setProperty('Fanart_Image', fanartImage)  
31    
32                  u = sys.argv[0] + "?mode=1&name=" + urllib.quote_plus(name) + "&url=" + urllib.quote_plus(url)          buildList(__backend__, "", False) # call default list
                 ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = listitem, isFolder = True, totalItems = l)  
33    
34            # Adde xtra items to root menu
35          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')
36          listitem.setProperty('Fanart_Image', fanartImage)          listitem.setProperty('Fanart_Image', fanartImage)
37    
38          u = sys.argv[0] + "?mode=10&name=" + urllib.quote_plus(name)          u = sys.argv[0] + "?mode=10&name="
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)
40    
41          xbmcplugin.endOfDirectory(int(sys.argv[1]))          xbmcplugin.endOfDirectory(int(sys.argv[1]))
42    
43    
44  def buildList(url,title):  def buildList(url,title, endlist=True):
45          print '[TODIC]:'+str(url)                  print '[TODIC]:'+str(url)        
46          link = open_url(url)          link = open_url(url)
47          ty=re.compile('<meta type=\'(.+?)\'').findall(link)          ty=re.compile('<meta type=\'(.+?)\'').findall(link)
# Line 63  def buildList(url,title): Line 57  def buildList(url,title):
57          m=re.compile('<title>(.+?)</title><url>(.+?)</url><cover>(.+?)</cover><description>(.*)</description>').findall(link)          m=re.compile('<title>(.+?)</title><url>(.+?)</url><cover>(.+?)</cover><description>(.*)</description>').findall(link)
58          l=len(m)          l=len(m)
59          for name,url,thumb,description in m:                                  for name,url,thumb,description in m:                        
                 infoLabels = {}  
                 infoLabels['title'] = name  
                 infoLabels['plot'] = description          
60    
61                  listitem = xbmcgui.ListItem(label = name, label2='test', iconImage = 'DefaultFolder.png', thumbnailImage = thumb)                  listitem = xbmcgui.ListItem(label = name, label2='test', iconImage = 'DefaultFolder.png', thumbnailImage = thumb)
                 listitem.setInfo('video', infoLabels)  
62                  listitem.setProperty('Fanart_Image', fanartImage)                  listitem.setProperty('Fanart_Image', fanartImage)
63                    if mode == '50':
64                            infoLabels = {}
65                            infoLabels['title'] = name
66                            infoLabels['plot'] = description        
67                            listitem.setInfo('video', infoLabels)
68    
69                  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)
70                  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)
71          xbmcplugin.endOfDirectory(int(sys.argv[1]))  
72            if (endlist == True):  
73                    xbmcplugin.endOfDirectory(int(sys.argv[1]))
74    
75    
76    

Legend:
Removed from v.1648  
changed lines
  Added in v.1659

  ViewVC Help
Powered by ViewVC 1.1.20