def scrape_movie(self, title, year, imdb, debrid=False): try: movies = cache.get(self.desiRulezCache, 168) url = [ i['url'] for i in movies if cleantitle.get(i['title'].decode( 'UTF-8')) == cleantitle.get(title) ][0] return self.sources(client.replaceHTMLCodes(url)) except Exception as e: logger.error(e) pass return []
def root(self): self.addDirectoryItem(30860, 'movieLangNavigator', 'movies.png', 'DefaultMovies.png') self.addDirectoryItem(30861, 'desiTVNavigator', 'tv-vod.png', 'DefaultMovies.png') self.addDirectoryItem(90116, 'tools', 'settings.png', 'DefaultMovies.png') self.addDirectoryItem(90117, 'clearCache', 'clearcache.png', 'DefaultMovies.png') self.addDirectoryItem(30864, 'changelog', 'changelog.png', 'DefaultMovies.png') cache.get(changelog.get, 600000000, control.addonInfo('version'), table='changelog') cache.get(self.donation, 336, control.addonInfo('version'), table='changelog') #cache.get(control.resetSettings, 600000000, 'true', control.addonInfo('version'), table='changelog') cache.get(analytics.sendAnalytics, 600000000, ("Installed-%s" % control.addonInfo('version')), table='changelog') self.endDirectory()
def get(self, url, idx=True, provider=None, network=None): try: self.list = cache.get(self.shows, 168, url, provider, network, table='rel_shows') self.list = sorted(self.list, key=lambda k: k['name']) if idx == True: self.tvshowDirectory(self.list) return self.list except Exception as e: logger.error(e, __name__) pass
def get(self, url, idx=True, provider=None, lang=None): logger.debug( 'url [%s] provider [%s] lang [%s] ' % (url, provider, lang), self.__class__) self.lang = lang try: try: u = urlparse.urlparse(url).netloc.lower() except: pass if u in self.imdb_link: self.list = cache.get(self.imdb_list, 48, url) if idx == True: self.worker() if idx == True: self.movieDirectory(self.list, lang=lang) return self.list except Exception as e: logger.error(e, __name__) pass
def search(self, query=None, lang=None): try: if query == None: t = control.lang(30201).encode('utf-8') k = control.keyboard('', t) k.doModal() self.query = k.getText() if k.isConfirmed() else None else: self.query = query if (self.query == None or self.query == ''): return url = self.search_link % (urllib.quote_plus(self.query)) self.list = cache.get(self.imdb_list, 0, url) self.worker() self.movieDirectory(self.list) return self.list except: return