def on_tick(self, player_state): # Stops playback when paused for more than one hour. # Some users leave the playback paused also for more than 12 hours, # this complicates things to resume playback, because the manifest data expires and with it also all # the streams urls are no longer guaranteed, so we force the stop of the playback. if self.is_player_in_pause and (time.time() - self.start_time) > 3600: LOG.info('The playback has been stopped because it has been exceeded 1 hour of pause') common.stop_playback()
def play_callback(data): """Callback function used for upnext integration""" common.debug('Received signal from Up Next. Playing next episode...') common.stop_playback() common.play_media(data['play_path'])