def ViewFavorites(self,tname): url = base_api % ("youtube.users.list_favorite_videos","user=" + tname) dp = xbmcgui.DialogProgress() dp.create("YouTube.com","Grabbing User Favorites") urllib.urlretrieve(url,"E:\\info",lambda nb, bs, fs, url=url: _pbhook(nb,bs,fs,url,dp)) #try: # urllib.urlretrieve(url,"E:\\info",lambda nb, bs, fs, url=url: _pbhook(nb,bs,fs,url,dp)) #except: # #self.lblCatergory.setLabel("") # return 0 #fsock = open("E:\\info", 'r') #dat = fsock.read() #fsock.close() #dat = dat.replace("&","&") #dat= re.search("([^", dat,re.IGNORECASE) #dat2= re.search("(.*)", dat,re.IGNORECASE)# print "DOING" test = parseXMLFile("E:\\info") print test """ if "" in dat: xbmcgui.Dialog().ok(__title__,"Error Occured","User has no favorites ") self.lblCatergory.setLabel("") dp.close() return 0 dp.update(75) if dp.iscanceled(): self.lblCatergory.setLabel("") dp.close() return 0 dp.update(85) if dp.iscanceled(): self.lblCatergory.setLabel("") dp.close() return 0 info = the_re.findall(dat) self.title_list = [] self.video_id_list = [] self.author_list = [] self.thumb_picurl = [] if dp.iscanceled(): self.lblCatergory.setLabel("") dp.close() return 0 dp.update(90) for i in info: self.videoList.addItem(i[0]) self.title_list.append(i[0]) print i[0] self.video_id_list.append(i[1]) """ dp.close() return 1