def update_loco_context(self, loco_root_id, list_context_name, list_id, list_index): """Update a loco list by context""" path = [['locos', loco_root_id, 'refreshListByContext']] # After the introduction of LoCo, the following notes are to be reviewed (refers to old LoLoMo): # The fourth parameter is like a request-id, but it does not seem to match to # serverDefs/date/requestId of reactContext nor to request_id of the video event request, # seem to have some kind of relationship with renoMessageId suspect with the logblob but i am not sure. # I noticed also that this request can also be made with the fourth parameter empty. params = [ common.enclose_quotes(list_id), list_index, common.enclose_quotes(list_context_name), '' ] # path_suffixs = [ # [{'from': 0, 'to': 100}, 'itemSummary'], # [['componentSummary']] # ] try: response = self.callpath_request(path, params) LOG.debug('refreshListByContext response: {}', response) # The call response return the new context id of the previous invalidated loco context_id # and if path_suffixs is added return also the new video list data except Exception as exc: # pylint: disable=broad-except LOG.warn('refreshListByContext failed: {}', exc) if not LOG.is_enabled: return ui.show_notification( title=common.get_local_string(30105), msg='An error prevented the update the loco context on Netflix', time=10000)
def update_lolomo_context(context_name): """Update the lolomo list by context""" # 01/06/2020: refreshListByContext often return HTTP error 500, currently i have seen that in the website is # performed only when the video played is not added to "my list", but with a strange mixed data: # context_id: the id of continueWatching # context_index: that seem to point to "My list" id context index # This api is no more needed to update the continueWatching lolomo list lolomo_root = g.LOCAL_DB.get_value('lolomo_root_id', '', TABLE_SESSION) context_index = g.LOCAL_DB.get_value( 'lolomo_{}_index'.format(context_name.lower()), '', TABLE_SESSION) context_id = g.LOCAL_DB.get_value( 'lolomo_{}_id'.format(context_name.lower()), '', TABLE_SESSION) if not context_index: common.warn( 'Update lolomo context {} skipped due to missing lolomo index', context_name) return path = [['lolomos', lolomo_root, 'refreshListByContext']] # The fourth parameter is like a request-id, but it doesn't seem to match to # serverDefs/date/requestId of reactContext (g.LOCAL_DB.get_value('request_id', table=TABLE_SESSION)) # nor to request_id of the video event request # has a kind of relationship with renoMessageId suspect with the logblob but i'm not sure because my debug crashed, # and i am no longer able to trace the source. # I noticed also that this request can also be made with the fourth parameter empty, # but it still doesn't update the continueWatching list of lolomo, that is strange because of no error params = [ common.enclose_quotes(context_id), context_index, common.enclose_quotes(context_name), '' ] # path_suffixs = [ # [['trackIds', 'context', 'length', 'genreId', 'videoId', 'displayName', 'isTallRow', 'isShowAsARow', # 'impressionToken', 'showAsARow', 'id', 'requestId']], # [{'from': 0, 'to': 100}, 'reference', 'summary'], # [{'from': 0, 'to': 100}, 'reference', 'title'], # [{'from': 0, 'to': 100}, 'reference', 'titleMaturity'], # [{'from': 0, 'to': 100}, 'reference', 'userRating'], # [{'from': 0, 'to': 100}, 'reference', 'userRatingRequestId'], # [{'from': 0, 'to': 100}, 'reference', 'boxarts', '_342x192', 'jpg'], # [{'from': 0, 'to': 100}, 'reference', 'promoVideo'] # ] callargs = { 'callpaths': path, 'params': params, # 'path_suffixs': path_suffixs } try: response = common.make_http_call('callpath_request', callargs) common.debug('refreshListByContext response: {}', response) # The call response return the new context id of the previous invalidated lolomo context_id # and if path_suffixs is added return also the new video list data except Exception: # pylint: disable=broad-except if not common.is_debug_verbose(): return ui.show_notification( title=common.get_local_string(30105), msg='An error prevented the update the lolomo context on netflix', time=10000)
def update_lolomo_context(context_name): """Update the lolomo list by context""" lolomo_root = g.LOCAL_DB.get_value('lolomo_root_id', '', TABLE_SESSION) context_index = g.LOCAL_DB.get_value( 'lolomo_{}_index'.format(context_name.lower()), '', TABLE_SESSION) context_id = g.LOCAL_DB.get_value( 'lolomo_{}_id'.format(context_name.lower()), '', TABLE_SESSION) if not context_index: return path = [['lolomos', lolomo_root, 'refreshListByContext']] # The fourth parameter is like a request-id, but it doesn't seem to match to # serverDefs/date/requestId of reactContext (g.LOCAL_DB.get_value('request_id', table=TABLE_SESSION)) # nor to request_id of the video event request # has a kind of relationship with renoMessageId suspect with the logblob but i'm not sure because my debug crashed, # and i am no longer able to trace the source. # I noticed also that this request can also be made with the fourth parameter empty, # but it still doesn't update the continueWatching list of lolomo, that is strange because of no error params = [ common.enclose_quotes(context_id), context_index, common.enclose_quotes(context_name), '' ] # path_suffixs = [ # [['trackIds', 'context', 'length', 'genreId', 'videoId', 'displayName', 'isTallRow', 'isShowAsARow', # 'impressionToken', 'showAsARow', 'id', 'requestId']], # [{'from': 0, 'to': 100}, 'reference', 'summary'], # [{'from': 0, 'to': 100}, 'reference', 'title'], # [{'from': 0, 'to': 100}, 'reference', 'titleMaturity'], # [{'from': 0, 'to': 100}, 'reference', 'userRating'], # [{'from': 0, 'to': 100}, 'reference', 'userRatingRequestId'], # [{'from': 0, 'to': 100}, 'reference', 'boxarts', '_342x192', 'jpg'], # [{'from': 0, 'to': 100}, 'reference', 'promoVideo'] # ] callargs = { 'callpaths': path, 'params': params, # 'path_suffixs': path_suffixs } try: response = common.make_http_call('callpath_request', callargs) common.debug('refreshListByContext response: {}', response) except Exception: # pylint: disable=broad-except # I do not know the reason yet, but sometimes continues to return error 401, # making it impossible to update the bookmark position if not common.is_debug_verbose(): return ui.show_notification( title=common.get_local_string(30105), msg='An error prevented the update the lolomo context on netflix', time=10000)
def update_loco_context(context_name): """Update a loco list by context""" # This api seem no more needed to update the continueWatching loco list loco_root = g.LOCAL_DB.get_value('loco_root_id', '', TABLE_SESSION) context_index = g.LOCAL_DB.get_value( 'loco_{}_index'.format(context_name.lower()), '', TABLE_SESSION) context_id = g.LOCAL_DB.get_value( 'loco_{}_id'.format(context_name.lower()), '', TABLE_SESSION) if not context_index: common.warn('Update loco context {} skipped due to missing loco index', context_name) return path = [['locos', loco_root, 'refreshListByContext']] # After the introduction of LoCo, the following notes are to be reviewed (refers to old LoLoMo): # The fourth parameter is like a request-id, but it doesn't seem to match to # serverDefs/date/requestId of reactContext (g.LOCAL_DB.get_value('request_id', table=TABLE_SESSION)) # nor to request_id of the video event request, # has a kind of relationship with renoMessageId suspect with the logblob but i'm not sure because my debug crashed # and i am no longer able to trace the source. # I noticed also that this request can also be made with the fourth parameter empty. params = [ common.enclose_quotes(context_id), context_index, common.enclose_quotes(context_name), '' ] # path_suffixs = [ # [{'from': 0, 'to': 100}, 'itemSummary'], # [['componentSummary']] # ] callargs = { 'callpaths': path, 'params': params, # 'path_suffixs': path_suffixs } try: response = common.make_http_call('callpath_request', callargs) common.debug('refreshListByContext response: {}', response) # The call response return the new context id of the previous invalidated loco context_id # and if path_suffixs is added return also the new video list data except Exception: # pylint: disable=broad-except if not common.is_debug_verbose(): return ui.show_notification( title=common.get_local_string(30105), msg='An error prevented the update the loco context on netflix', time=10000)
def update_loco_context(self, context_name): """Update a loco list by context""" # Call this api seem no more needed to update the continueWatching loco list # Get current loco root data loco_data = self.path_request( [['loco', [context_name], ['context', 'id', 'index']]]) loco_root = loco_data['loco'][1] if 'continueWatching' in loco_data['locos'][loco_root]: context_index = loco_data['locos'][loco_root]['continueWatching'][ 2] context_id = loco_data['locos'][loco_root][context_index][1] else: # In the new profiles, there is no 'continueWatching' list and no list is returned LOG.warn( 'update_loco_context: Update skipped due to missing context {}', context_name) return path = [['locos', loco_root, 'refreshListByContext']] # After the introduction of LoCo, the following notes are to be reviewed (refers to old LoLoMo): # The fourth parameter is like a request-id, but it does not seem to match to # serverDefs/date/requestId of reactContext nor to request_id of the video event request, # seem to have some kind of relationship with renoMessageId suspect with the logblob but i am not sure. # I noticed also that this request can also be made with the fourth parameter empty. params = [ common.enclose_quotes(context_id), context_index, common.enclose_quotes(context_name), '' ] # path_suffixs = [ # [{'from': 0, 'to': 100}, 'itemSummary'], # [['componentSummary']] # ] try: response = self.callpath_request(path, params) LOG.debug('refreshListByContext response: {}', response) # The call response return the new context id of the previous invalidated loco context_id # and if path_suffixs is added return also the new video list data except Exception as exc: # pylint: disable=broad-except LOG.warn('refreshListByContext failed: {}', exc) if not LOG.level == LOG.LEVEL_VERBOSE: return ui.show_notification( title=common.get_local_string(30105), msg='An error prevented the update the loco context on Netflix', time=10000)
def update_lolomo_context(context_name, video_id=None): """Update the lolomo list by context""" # Should update the context list but it doesn't, what is missing? # The remaining requests made on the website that are missing here are of logging type, # it seems strange that they use log data to finish the operations are almost impossible to reproduce here: # pbo_logblobs /logblob # personalization/cl2 lolomo_data = common.make_call('path_request', [["lolomo", [context_name], ['context', 'id', 'index']]]) # Note: lolomo root seem differs according to the profile in use lolomo_root = lolomo_data['lolomo'][1] context_index = lolomo_data['lolomos'][lolomo_root][context_name][2] context_id = lolomo_data['lolomos'][lolomo_root][context_index][1] path = [['lolomos', lolomo_root, 'refreshListByContext']] params = [common.enclose_quotes(context_id), context_index, common.enclose_quotes(context_name), common.enclose_quotes(g.LOCAL_DB.get_value('request_id', table=TABLE_SESSION))] # path_suffixs = [ # [['trackIds', 'context', 'length', 'genreId', 'videoId', 'displayName', 'isTallRow', 'isShowAsARow', # 'impressionToken', 'showAsARow', 'id', 'requestId']], # [{'from': 0, 'to': 100}, 'reference', 'summary'], # [{'from': 0, 'to': 100}, 'reference', 'title'], # [{'from': 0, 'to': 100}, 'reference', 'titleMaturity'], # [{'from': 0, 'to': 100}, 'reference', 'userRating'], # [{'from': 0, 'to': 100}, 'reference', 'userRatingRequestId'], # [{'from': 0, 'to': 100}, 'reference', 'boxarts', '_342x192', 'jpg'], # [{'from': 0, 'to': 100}, 'reference', 'promoVideo'] # ] callargs = { 'callpaths': path, 'params': params, # 'path_suffixs': path_suffixs } response = common.make_http_call('callpath_request', callargs) common.debug('refreshListByContext response: {}', response) callargs = { 'callpaths': [['refreshVideoCurrentPositions']], 'params': ['[' + video_id + ']', ''], } response = common.make_http_call('callpath_request', callargs) common.debug('refreshVideoCurrentPositions response: {}', response)