def onPlayBackStarted(self): for i in range(0, 200): if control.condVisibility('Window.IsActive(busydialog)') == 1: control.idle() else: break control.sleep(100) try: while (True): if self._playing == True: if self._service == 'telewizjadanet': #control.log('PLAYBACK AAAAAAAAAAAAA' ) telewizjadanet.streamrefresh() control.sleep(5000) elif self._service == 'pierwsza': #control.log('PLAYBACK AAAAAAAAAAAAA' ) pierwsza.streamrefresh() control.sleep(5000) else: break else: break except: pass
def clear(table=None): try: control.idle() if table == None: table = ['rel_list', 'rel_lib'] elif not type(table) == list: table = [table] yes = control.yesnoDialog(control.lang(30401).encode('utf-8'), '', '') if not yes: return control.set_setting('telewizjada.token', '') control.set_setting('telewizjada.os', '') control.set_setting('telewizjada.ua', '') control.set_setting('telewizjada.browser', '') control.set_setting('telewizjada.device', '') control.set_setting('telewizjada.expire', '') control.set_setting('telewizjada.referer', '') control.set_setting('telewizjada.refreshcookie', '') control.set_setting('telewizjada.tokenExpireIn', '') control.set_setting('yoytv.sess', '') dbcon = database.connect(control.cacheFile) dbcur = dbcon.cursor() for t in table: try: dbcur.execute("DROP TABLE IF EXISTS %s" % t) dbcur.execute("VACUUM") dbcon.commit() except: pass control.infoDialog(control.lang(30402).encode('utf-8')) except: pass
def clearSources(self): try: control.idle() yes = control.yesnoDialog(control.lang(30510).encode('utf-8'), '', '') if not yes: return control.makeFile(control.dataPath) dbcon = database.connect(control.sourcescacheFile) dbcur = dbcon.cursor() dbcur.execute("DROP TABLE IF EXISTS rel_src") dbcur.execute("VACUUM") dbcon.commit() control.infoDialog(control.lang(30511).encode('utf-8')) except: pass
def clearSources(self): try: control.idle() yes = control.yesnoDialog( control.lang(30510).encode('utf-8'), '', '') if not yes: return control.makeFile(control.dataPath) dbcon = database.connect(control.sourcescacheFile) dbcur = dbcon.cursor() dbcur.execute("DROP TABLE IF EXISTS rel_src") dbcur.execute("VACUUM") dbcon.commit() control.infoDialog(control.lang(30511).encode('utf-8')) except: pass
def onPlayBackStarted(self): for i in range(0, 200): if control.condVisibility('Window.IsActive(busydialog)') == 1: control.idle() else: break control.sleep(100) try: while(True): if self._playing == True: if self._service =='pierwsza': #control.log('PLAYBACK AAAAAAAAAAAAA %s' ) pierwsza.streamrefresh() control.sleep(5000) else: break else: break except: pass
def clear(table=None): try: control.idle() if table == None: table = ["rel_list", "rel_lib"] elif not type(table) == list: table = [table] yes = control.yesnoDialog(control.lang(30401).encode("utf-8"), "", "") if not yes: return control.set_setting("telewizjada.token", "") control.set_setting("telewizjada.os", "") control.set_setting("telewizjada.ua", "") control.set_setting("telewizjada.browser", "") control.set_setting("telewizjada.device", "") control.set_setting("telewizjada.expire", "") control.set_setting("telewizjada.referer", "") control.set_setting("telewizjada.refreshcookie", "") control.set_setting("telewizjada.tokenExpireIn", "") control.set_setting("yoytv.sess", "") dbcon = database.connect(control.cacheFile) dbcur = dbcon.cursor() for t in table: try: dbcur.execute("DROP TABLE IF EXISTS %s" % t) dbcur.execute("VACUUM") dbcon.commit() except: pass control.infoDialog(control.lang(30402).encode("utf-8")) except: pass
def clear(table=None): try: control.idle() if table == None: table = ['rel_list', 'rel_lib'] elif not type(table) == list: table = [table] yes = control.yesnoDialog(control.lang(30401).encode('utf-8'), '', '') if not yes: return dbcon = database.connect(control.cacheFile) dbcur = dbcon.cursor() for t in table: try: dbcur.execute("DROP TABLE IF EXISTS %s" % t) dbcur.execute("VACUUM") dbcon.commit() except: pass control.infoDialog(control.lang(30402).encode('utf-8')) except: pass
def getSources(self, name, title, year, imdb, tmdb, tvdb, service, season, episode, tvshowtitle, alter, date): sourceDict = [] for package, name, is_pkg in pkgutil.walk_packages(__path__): sourceDict.append((name, is_pkg)) sourceDict = [i[0] for i in sourceDict if i[1] == False] content = 'movie' if tvshowtitle == None else 'episode' if content == 'movie': sourceDict = [i for i in sourceDict if i.endswith(('_mv', '_mv_tv'))] try: sourceDict = [(i, control.setting(re.sub('_mv_tv$|_mv$|_tv$', '', i))) for i in sourceDict] except: sourceDict = [(i, 'true') for i in sourceDict] else: sourceDict = [i for i in sourceDict if i.endswith(('_tv', '_mv_tv'))] try: sourceDict = [(i, control.setting(re.sub('_mv_tv$|_mv$|_tv$', '', i) + '_tv')) for i in sourceDict] except: sourceDict = [(i, 'true') for i in sourceDict] threads = [] control.makeFile(control.dataPath) self.sourceFile = control.sourcescacheFile sourceDict = [i[0] for i in sourceDict if i[1] == 'true'] if content == 'movie': title = cleantitle.normalize(title) for source in sourceDict: threads.append(workers.Thread(self.getMovieSource, title, year, imdb, re.sub('_mv_tv$|_mv$|_tv$', '', source), __import__(source, globals(), locals(), [], -1).source())) else: tvshowtitle = cleantitle.normalize(tvshowtitle) season, episode = alterepisode.alterepisode().get(imdb, tmdb, tvdb, service, season, episode, alter, title, date) for source in sourceDict: threads.append(workers.Thread(self.getEpisodeSource, title, year, imdb, tvdb, season, episode, tvshowtitle, date, re.sub('_mv_tv$|_mv$|_tv$', '', source), __import__(source, globals(), locals(), [], -1).source())) try: timeout = int(control.setting('sources_timeout_40')) except: timeout = 40 [i.start() for i in threads] control.idle() sourceLabel = [re.sub('_mv_tv$|_mv$|_tv$', '', i) for i in sourceDict] sourceLabel = [re.sub('v\d+$', '', i).upper() for i in sourceLabel] self.progressDialog = control.progressDialog self.progressDialog.create(control.addonInfo('name'), '') self.progressDialog.update(0) string1 = control.lang(30512).encode('utf-8') string2 = control.lang(30513).encode('utf-8') string3 = control.lang(30514).encode('utf-8') for i in range(0, timeout * 2): try: if xbmc.abortRequested == True: return sys.exit() try: info = [sourceLabel[int(re.sub('[^0-9]', '', str(x.getName()))) - 1] for x in threads if x.is_alive() == True] except: info = [] if len(info) > 5: info = len(info) self.progressDialog.update(int((100 / float(len(threads))) * len([x for x in threads if x.is_alive() == False])), str('%s: %s %s' % (string1, int(i * 0.5), string2)), str('%s: %s' % (string3, str(info).translate(None, "[]'")))) if self.progressDialog.iscanceled(): break is_alive = [x.is_alive() for x in threads] if all(x == False for x in is_alive): break time.sleep(0.5) except: pass self.progressDialog.close() return self.sources
def getSources(self, name, title, year, imdb, tmdb, tvdb, service, season, episode, tvshowtitle, alter, date): sourceDict = [] for package, name, is_pkg in pkgutil.walk_packages(__path__): sourceDict.append((name, is_pkg)) sourceDict = [i[0] for i in sourceDict if i[1] == False] content = 'movie' if tvshowtitle == None else 'episode' if content == 'movie': sourceDict = [ i for i in sourceDict if i.endswith(('_mv', '_mv_tv')) ] try: sourceDict = [ (i, control.setting(re.sub('_mv_tv$|_mv$|_tv$', '', i))) for i in sourceDict ] except: sourceDict = [(i, 'true') for i in sourceDict] else: sourceDict = [ i for i in sourceDict if i.endswith(('_tv', '_mv_tv')) ] try: sourceDict = [(i, control.setting( re.sub('_mv_tv$|_mv$|_tv$', '', i) + '_tv')) for i in sourceDict] except: sourceDict = [(i, 'true') for i in sourceDict] threads = [] control.makeFile(control.dataPath) self.sourceFile = control.sourcescacheFile sourceDict = [i[0] for i in sourceDict if i[1] == 'true'] if content == 'movie': title = cleantitle.normalize(title) for source in sourceDict: threads.append( workers.Thread( self.getMovieSource, title, year, imdb, re.sub('_mv_tv$|_mv$|_tv$', '', source), __import__(source, globals(), locals(), [], -1).source())) else: tvshowtitle = cleantitle.normalize(tvshowtitle) season, episode = alterepisode.alterepisode().get( imdb, tmdb, tvdb, service, season, episode, alter, title, date) for source in sourceDict: threads.append( workers.Thread( self.getEpisodeSource, title, year, imdb, tvdb, season, episode, tvshowtitle, date, re.sub('_mv_tv$|_mv$|_tv$', '', source), __import__(source, globals(), locals(), [], -1).source())) try: timeout = int(control.setting('sources_timeout_40')) except: timeout = 40 [i.start() for i in threads] control.idle() sourceLabel = [re.sub('_mv_tv$|_mv$|_tv$', '', i) for i in sourceDict] sourceLabel = [re.sub('v\d+$', '', i).upper() for i in sourceLabel] self.progressDialog = control.progressDialog self.progressDialog.create(control.addonInfo('name'), '') self.progressDialog.update(0) string1 = control.lang(30512).encode('utf-8') string2 = control.lang(30513).encode('utf-8') string3 = control.lang(30514).encode('utf-8') for i in range(0, timeout * 2): try: if xbmc.abortRequested == True: return sys.exit() try: info = [ sourceLabel[int(re.sub('[^0-9]', '', str(x.getName()))) - 1] for x in threads if x.is_alive() == True ] except: info = [] if len(info) > 5: info = len(info) self.progressDialog.update( int((100 / float(len(threads))) * len([x for x in threads if x.is_alive() == False])), str('%s: %s %s' % (string1, int(i * 0.5), string2)), str('%s: %s' % (string3, str(info).translate(None, "[]'")))) if self.progressDialog.iscanceled(): break is_alive = [x.is_alive() for x in threads] if all(x == False for x in is_alive): break time.sleep(0.5) except: pass self.progressDialog.close() return self.sources