def run(): plugintools.log("tv2go.run") # Get params params = plugintools.get_params() plugintools.log("tv2go.run params="+repr(params)) action = params.get('action') if action == None: getAllChannels() elif action == 'StreamFromUrl' or action == 'YouTube_Video': channelID = params.get('channelid') try: thumb = urllib.unquote_plus(params.get('thumbnail')) except: thumb='' prev = urllib.unquote_plus(params.get('prevchannel')) playStream(channelID,thumb,prev) elif action == 'pseudo': pseudo.getPseudoChannels()
self.win.setProperty('youtubeTV2GO', 'False') def onPlayBackEnded(self): print('TV2GO service: Playback Ended') if self.win.getProperty('youtubeTV2GO') == 'True': channelID = self.win.getProperty('channelIDTV2GO') thumbnail = self.win.getProperty('thumbnailTV2GO') prevChannel = self.win.getProperty('prevChannelTV2GO') xbmc.Player().play('plugin://plugin.video.tv2go/?action=YouTube_Video&title=&url=&thumbnail='+thumbnail+'&plot=&extra=&channelid='+channelID+'&prevchannel=8&prevthumbnail=&nextchannel=&nextthumbnail=') notify ('TV2GO','Service started!') try: repoCheck.UpdateRepo() repoCheck.fix() xbmc.sleep(2000) if plugintools.get_setting('pseudo_update')=='true': time_file = open( os.path.join( plugintools.get_runtime_path() , "last_update.txt" ) , "r" ) day_str = time_file.readline() diff = datetime.datetime.today().day-int(day_str) if diff>0: notify ('TV2GO','Channels loading started') pseudo.getPseudoChannels(False) time_file.close() except: pass player = Service() while not xbmc.abortRequested: player.isPlaying() xbmc.sleep(1)