def showNoiseCommon(localpath, handle, pageUrl): print "Opening page: " + pageUrl from comics_utils import HTTPCommunicator httpCommunicator = HTTPCommunicator() a = httpCommunicator.get( pageUrl ) numRE = '<div id="noise(.+?)" class="nimagebox">' thumbRE = '<div class="dimage"><img src="(.+?)" alt=.+?>' thumbPattern,numPattern = re.compile(thumbRE), re.compile(numRE) matchNum=numPattern.findall(a) matchThumb=thumbPattern.findall(a) n = 0 for name in matchNum: thumb = matchThumb[n] full_image_url = thumb.replace("noise_preview","noise") # Add directory entry... li=xbmcgui.ListItem(name,iconImage="DefaultPicture.png",thumbnailImage = thumb ) li.setInfo( type="pictures", infoLabels={ "Title": name} ) try: action = 'XBMC.RunPlugin(%s)' % (sys.argv[0] + '?mode=5&url=' + full_image_url) li.addContextMenuItems([(__language__(30201), action)]) except: pass xbmcplugin.addDirectoryItem(handle,url = full_image_url,listitem=li, isFolder=False) n=n+1
def showListCommon(localpath, handle, pageUrl): print "Opening page: " + pageUrl # getData = urllib2.Request(pageUrl) # f = urllib2.urlopen(getData) # a=f.read() # f.close() from comics_utils import HTTPCommunicator httpCommunicator = HTTPCommunicator() a = httpCommunicator.get( pageUrl ) print a thumbRE = '<div class="dimage">.+?<img src="(.+?)" alt=.+?>' imagesRE = '<div class="ident"><a href="(.+?)">#(.+?)</a></div>' rankRE = '<div id="divrank.+?">(.+?)</div>' thumbPattern,videoPattern = re.compile(thumbRE), re.compile(imagesRE) rankPattern = re.compile(rankRE) matchThumb=thumbPattern.findall(a) matchImg=videoPattern.findall(a) matchRank=rankPattern.findall(a) n = 0 for url, name in matchImg: thumb = matchThumb[n] rank = matchRank[n] full_image_url = thumb.replace("boobs_preview","boobs") # Add directory entry... li=xbmcgui.ListItem("#"+name+" ("+str(rank)+")",iconImage="DefaultPicture.png",thumbnailImage = thumb ) li.setInfo( type="pictures", infoLabels={ "Title": name, "Rating": str(rank)} ) try: action = 'XBMC.RunPlugin(%s)' % (sys.argv[0] + '?mode=5&url=' + full_image_url) action1 = 'XBMC.RunPlugin(%s)' % (sys.argv[0] + '?mode=6&url=' + name) action2 = 'XBMC.RunPlugin(%s)' % (sys.argv[0] + '?mode=7&url=' + name) li.addContextMenuItems([(__language__(30201), action),(__language__(30202), action1),(__language__(30203), action2)]) except: pass xbmcplugin.addDirectoryItem(handle,url = full_image_url,listitem=li, isFolder=False) n=n+1