Last active
February 23, 2021 09:53
-
-
Save henryjfry/da363a29571e7c7ab143bd47d09da76f to your computer and use it in GitHub Desktop.
SEREN 2.0 SMARTPLAY_FIX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/home/osmc/.kodi/addons/plugin.video.seren/resources/lib/modules/player.py | |
def _keep_alive(self): | |
################################################ | |
#if self.min_time_before_scrape > time_left and not self.pre_scrape_initiated: | |
# self._handle_pre_scrape() | |
if self.current_time > 30 and not self.pre_scrape_initiated: | |
xbmc.log(str('SEREN_PRESCRAPE')+'===>PHIL', level=xbmc.LOGNOTICE) | |
self._handle_pre_scrape() | |
/home/osmc/.kodi/addons/plugin.video.seren/resources/lib/modules/globals.py | |
def init_request(self, argv): | |
############# | |
#xbmc.log(str(argv)+'===>PHIL', level=xbmc.LOGNOTICE) | |
if "actionArgs" in self.REQUEST_PARAMS: | |
try: | |
self.REQUEST_PARAMS["action_args"] = tools.deconstruct_action_args( | |
self.REQUEST_PARAMS["actionArgs"] | |
) | |
except: | |
pass | |
if isinstance(self.REQUEST_PARAMS["action_args"], dict): | |
self.REQUEST_PARAMS["action_args"] = self._legacy_action_args_converter( | |
self.REQUEST_PARAMS["actionArgs"] | |
) | |
self.FROM_WIDGET = self.REQUEST_PARAMS.get("from_widget", "true") == "true" | |
self.PAGE = int(g.REQUEST_PARAMS.get("page", 1)) | |
@staticmethod | |
/home/osmc/.kodi/addons/plugin.video.seren/resources/lib/gui/windows/playing_next.py | |
def handle_action(self, action, control_id=None): | |
""" | |
Handles click or keyboard actions | |
:param action: Action Id of event | |
:type action: int | |
:param control_id: Control event processed on if available | |
:type control_id: int | |
:return: None | |
:rtype: none | |
""" | |
g.log("Action Handle - {}".format(action)) | |
if action != 7: | |
return | |
if control_id is None: | |
control_id = self.getFocusId() | |
if control_id == 3001: | |
#self.seekTime(self.getTotalTime()) | |
#xbmc.executebuiltin('PlayerControl(Next)') | |
############################################## | |
xbmc.executebuiltin('PlayerControl(BigSkipForward)') | |
xbmc.sleep(500) | |
xbmc.executebuiltin('ActivateWindow(fullscreenvideo)') | |
xbmc.executebuiltin('Dialog.Close(ResolverWindow, True)') | |
self.close() | |
xbmc.executebuiltin('Dialog.Close(ResolverWindow, True)') | |
xbmc.sleep(500) | |
xbmc.executebuiltin('Dialog.Close(ResolverWindow, True)') | |
xbmc.executebuiltin('ActivateWindow(fullscreenvideo)') | |
xbmc.executebuiltin('Dialog.Close(ResolverWindow, True)') | |
xbmc.sleep(500) | |
xbmc.executebuiltin('Dialog.Close(ResolverWindow, True)') | |
xbmc.executebuiltin('ActivateWindow(fullscreenvideo)') | |
xbmc.executebuiltin('Dialog.Close(ResolverWindow, True)') | |
xbmc.sleep(500) | |
xbmc.executebuiltin('Dialog.Close(ResolverWindow, True)') | |
xbmc.executebuiltin('ActivateWindow(fullscreenvideo)') | |
xbmc.executebuiltin('Dialog.Close(ResolverWindow, True)') | |
############################################## | |
if control_id == 3002: | |
self.close() | |
/home/osmc/.kodi/addons/plugin.video.seren/resources/lib/modules/smartPlay.py | |
def playlist_present_check(self, ignore_setting=False): | |
##### | |
if [i for i in playlist_uris if g.ADDON_NAME.lower() not in i]: | |
g.log("Cleaning up other addon items from playlsit", "debug") | |
playlist_uris = [] | |
######################################### | |
playlist_uris2 = [] | |
import urllib | |
for i in playlist_uris: | |
x = urllib.unquote(i.encode("utf8")) | |
playlist_uris2.append(urllib.unquote(x.encode("utf8")).replace('?action=getSources&','/?action=smartPlay&').replace('&actionArgs=','&action_args=').replace('trakt_id','trakt_show_id')) | |
playlist_uris = playlist_uris2 | |
playlist_uris2 = [] | |
#xbmc.log(str(playlist_uris)+'===>PHIL', level=xbmc.LOGNOTICE) | |
############################################# | |
action_args = [dict(tools.parse_qsl(i.split("?")[-1]))["action_args"] for i in playlist_uris] | |
show_ids = set(tools.deconstruct_action_args(i).get('trakt_show_id') for i in action_args) | |
/home/osmc/.kodi/addons/plugin.video.seren/resources/lib/modules/router.py | |
def dispatch(params): | |
url = params.get("url") | |
action = params.get("action") | |
######################### | |
if action == 'smartPlay': | |
#action = 'getSources' | |
#params['action'] = 'getSources' | |
smart_url_arg = True | |
else: | |
smart_url_arg = params.get("smartPlay") == "true" | |
#xbmc.log(str(action)+'===>PHIL', level=xbmc.LOGNOTICE) | |
######################### | |
if 'actionAgrs' in str(params): | |
action_args = params.get("actionArgs") | |
else: | |
action_args = params.get("action_args") | |
#xbmc.log(str(action_args)+'===>PHIL', level=xbmc.LOGNOTICE) | |
#action_args = params.get("action_args") | |
######################### | |
pack_select = params.get("packSelect") | |
source_select = params.get("source_select") == "true" | |
overwrite_cache = params.get("seren_reload") == "true" | |
resume = params.get("resume") | |
force_resume_check = params.get("forceresumecheck") == "true" | |
force_resume_off = params.get("forceresumeoff") == "true" | |
force_resume_on = params.get("forceresumeon") == "true" | |
######################### | |
#if 'smartPlay' in str(params): | |
# smart_url_arg = True | |
#xbmc.log(str(smart_url_arg)+'===>PHIL', level=xbmc.LOGNOTICE) | |
######################### | |
mediatype = params.get("mediatype") | |
endpoint = params.get("endpoint") | |
##### | |
##### | |
elif action == "getSources" or action == 'smartPlay': | |
#xbmc.log(str(action)+'===>2PHIL', level=xbmc.LOGNOTICE) | |
from resources.lib.modules.smartPlay import SmartPlay | |
from resources.lib.common import tools | |
from resources.lib.modules import helpers | |
item_information = tools.get_item_information(action_args) | |
smart_play = SmartPlay(item_information) | |
background = None | |
resolver_window = None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment