author
int64 658
755k
| date
stringlengths 19
19
| timezone
int64 -46,800
43.2k
| hash
stringlengths 40
40
| message
stringlengths 5
490
| mods
list | language
stringclasses 20
values | license
stringclasses 3
values | repo
stringlengths 5
68
| original_message
stringlengths 12
491
|
---|---|---|---|---|---|---|---|---|---|
105,989 | 06.11.2018 20:21:32 | -3,600 | 0059611ece6daf66214125a7d941318e581e6482 | Possible fix for empty main menu | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/shakti.py",
"new_path": "resources/lib/api/shakti.py",
"diff": "@@ -69,22 +69,17 @@ def root_lists():\ncommon.debug('Requesting root lists from API')\nreturn LoLoMo(common.make_call(\n'path_request',\n- # By prepending this as first pathitem, we will trigger special\n- # handling in nfsession, which will inject the ID of the root LoLoMo\n- # extracted from falkorCache\n- ['root_lolomo'] +\n- # Make sure these 3 are always retrieved (even is not in top40 lists)\n- [[['mylist', 'continueWatching', 'netflixOriginals'],\n- ['displayName', 'context', 'id', 'index', 'length', 'genreId']]] +\n- # Retrieve additional lists on start page\n- [[{'from': 0, 'to': 40},\n+ [['lolomo',\n+ {'from': 0, 'to': 40},\n['displayName', 'context', 'id', 'index', 'length', 'genreId']]] +\n# Titles of first 4 videos in each video list\n- [[{'from': 0, 'to': 40},\n+ [['lolomo',\n+ {'from': 0, 'to': 40},\n{'from': 0, 'to': 3}, 'reference', ['title', 'summary']]] +\n# Art for first video in each video list\n# (will be displayed as video list art)\n- build_paths([{'from': 0, 'to': 40},\n+ build_paths(['lolomo',\n+ {'from': 0, 'to': 40},\n{'from': 0, 'to': 0}, 'reference'],\nART_PARTIAL_PATHS)))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession.py",
"new_path": "resources/lib/services/nfsession.py",
"diff": "@@ -256,8 +256,7 @@ class NetflixSession(object):\n@needs_login\ndef path_request(self, paths):\n\"\"\"Perform a path request against the Shakti API\"\"\"\n- return self._path_request(\n- _inject_root_lolomo(paths, self.session_data['root_lolomo']))\n+ return self._path_request(paths)\[email protected]_return_call\n@needs_login\n@@ -360,20 +359,6 @@ class NetflixSession(object):\nelse response.content)\n-def _inject_root_lolomo(paths, root_lolomo):\n- \"\"\"Apply special handling for path requests that query the root lists\n- (displayed on homepage): If first pathitem == 'root_lolomo' (will be\n- supplied by shakti api client), we prepend ['lolomos', root_lolomo] to\n- all paths, where root_lolomo is the ID of the root LoLoMo as extracted\n- from falkorCache.\n- If the first pathitem is not the 'root_lolomo' indicator, we just return\n- the untouched paths\"\"\"\n- if paths[0] != 'root_lolomo':\n- return paths\n- return [['lolomos', root_lolomo] + path\n- for path in paths[1:]]\n-\n-\ndef _set_range_selector(paths, range_start, range_end):\n\"\"\"Replace the RANGE_SELECTOR placeholder with an actual dict:\n{'from': range_start, 'to': range_end}\"\"\"\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Possible fix for empty main menu |
105,989 | 06.11.2018 20:24:42 | -3,600 | caee95dd04c24db5e1e3d19e1426b47af136e33a | Fix android_crypto (again) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta6\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta7\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/cache.py",
"new_path": "resources/lib/cache.py",
"diff": "@@ -265,7 +265,7 @@ class Cache(object):\n# Only persist if we acquired the original lock or if the lock is older\n# than 15 seconds (override stale locks)\nis_own_lock = lock[:14] == self.lock_marker(bucket)[:14]\n- is_stale_lock = int(lock[18:]) <= time() - 15\n+ is_stale_lock = int(lock[18:] or 1) <= time() - 15\nif is_own_lock or is_stale_lock:\nif is_stale_lock:\nself.common.info('Overriding stale cache lock {}'.format(lock))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/library.py",
"new_path": "resources/lib/kodi/library.py",
"diff": "@@ -42,7 +42,7 @@ def get_item(videoid):\nreturn _get_item(entry_type, library_entry['file'])\nexcept (KeyError, AttributeError, IndexError, ItemNotFound):\nimport traceback\n- common.error(traceback.format_exc())\n+ common.debug(traceback.format_exc())\nraise ItemNotFound(\n'The video with id {} is not present in the Kodi library'\n.format(videoid))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/cookies.py",
"new_path": "resources/lib/services/cookies.py",
"diff": "@@ -69,7 +69,7 @@ def load_from_file(account_hash):\ntry:\nreturn pickle.loads(cookie_file.read())\nexcept Exception as exc:\n- common.error('Failed to load cookies from file: {exc}', exc)\n+ common.debug('Failed to load cookies from file: {exc}', exc)\nraise MissingCookiesError()\nfinally:\ncookie_file.close()\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/android_crypto.py",
"new_path": "resources/lib/services/msl/android_crypto.py",
"diff": "@@ -120,7 +120,7 @@ class AndroidMSLCrypto(MSLBaseCrypto):\nsignature = self.crypto_session.Sign(self.hmac_key_id, message)\nif not signature:\nraise MSLError('Widevine CryptoSession sign failed!')\n- return signature\n+ return base64.standard_b64encode(signature)\ndef verify(self, message, signature):\n\"\"\"Verify a message's signature\"\"\"\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix android_crypto (again) |
105,989 | 06.11.2018 21:18:15 | -3,600 | 54c0c64c2aee37bcf6bcc409eef1f94eaa8ef8fb | Fix missing error handler for proxy/VPN blocking. | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta7\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta8\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/msl_handler.py",
"new_path": "resources/lib/services/msl/msl_handler.py",
"diff": "@@ -197,6 +197,7 @@ def _process_json_response(response):\ndef _raise_if_error(decoded_response):\nif ('errordata' in decoded_response or\n+ 'errorDisplayMessage' in decoded_response.get('result', {}) or\nnot decoded_response.get('success', True)):\nraise MSLError(_get_error_details(decoded_response))\nreturn decoded_response\n@@ -207,7 +208,7 @@ def _get_error_details(decoded_response):\nreturn json.loads(\nbase64.standard_b64decode(\ndecoded_response['errordata']))['errormsg']\n- elif 'errorDisplayMessage' in decoded_response['result']:\n+ elif 'errorDisplayMessage' in decoded_response.get('result', {}):\nreturn decoded_response['result']['errorDisplayMessage']\ncommon.error('Received an unknown error from MSL endpoint:\\n{}'\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix missing error handler for proxy/VPN blocking. |
105,989 | 08.11.2018 14:06:50 | -3,600 | 016478908da30726c469ce8a178e88885abab865 | Fix newlines contained in server certificate (hopefully fixes playback on Android) | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/player.py",
"new_path": "resources/lib/navigation/player.py",
"diff": "@@ -17,19 +17,21 @@ SERVICE_URL_FORMAT = 'http://localhost:{port}'\nMANIFEST_PATH_FORMAT = '/manifest?id={videoid}'\nLICENSE_PATH_FORMAT = '/license?id={videoid}'\n-INPUTSTREAM_SERVER_CERTIFICATE = '''Cr0CCAMSEOVEukALwQ8307Y2+LVP+0MYh/HPkwUijg\n-IwggEKAoIBAQDm875btoWUbGqQD8eAGuBlGY+Pxo8YF1LQR+Ex0pDONMet8EHslcZRBKNQ/09RZFTP\n-0vrYimyYiBmk9GG+S0wB3CRITgweNE15cD33MQYyS3zpBd4z+sCJam2+jj1ZA4uijE2dxGC+gRBRnw\n-9WoPyw7D8RuhGSJ95OEtzg3Ho+mEsxuE5xg9LM4+Zuro/9msz2bFgJUjQUVHo5j+k4qLWu4ObugFmc\n-9DLIAohL58UR5k0XnvizulOHbMMxdzna9lwTw/4SALadEV/CZXBmswUtBgATDKNqjXwokohncpdsWS\n-auH6vfS6FXwizQoZJ9TdjSGC60rUB2t+aYDm74cIuxAgMBAAE6EHRlc3QubmV0ZmxpeC5jb20SgAOE\n-0y8yWw2Win6M2/bw7+aqVuQPwzS/YG5ySYvwCGQd0Dltr3hpik98WijUODUr6PxMn1ZYXOLo3eED6x\n-YGM7Riza8XskRdCfF8xjj7L7/THPbixyn4mULsttSmWFhexzXnSeKqQHuoKmerqu0nu39iW3pcxDV/\n-K7E6aaSr5ID0SCi7KRcL9BCUCz1g9c43sNj46BhMCWJSm0mx1XFDcoKZWhpj5FAgU4Q4e6f+S8eX39\n-nf6D6SJRb4ap7Znzn7preIvmS93xWjm75I6UBVQGo6pn4qWNCgLYlGGCQCUm5tg566j+/g5jvYZkTJ\n-vbiZFwtjMW5njbSRwB3W4CrKoyxw4qsJNSaZRTKAvSjTKdqVDXV/U5HK7SaBA6iJ981/aforXbd2vZ\n-lRXO/2S+Maa2mHULzsD+S5l4/YGpSt7PnkCe25F+nAovtl/ogZgjMeEdFyd/9YMYjOS4krYmwp3yJ7\n-m9ZzYCQ6I8RQN4x/yLlHG5RH/+WNLNUs6JAZ0fFdCmw='''\n+INPUTSTREAM_SERVER_CERTIFICATE = (\n+ 'Cr0CCAMSEOVEukALwQ8307Y2+LVP+0MYh/HPkwUijgIwggEKAoIBAQDm875btoWUbGqQD8eA'\n+ 'GuBlGY+Pxo8YF1LQR+Ex0pDONMet8EHslcZRBKNQ/09RZFTP0vrYimyYiBmk9GG+S0wB3CRI'\n+ 'TgweNE15cD33MQYyS3zpBd4z+sCJam2+jj1ZA4uijE2dxGC+gRBRnw9WoPyw7D8RuhGSJ95O'\n+ 'Etzg3Ho+mEsxuE5xg9LM4+Zuro/9msz2bFgJUjQUVHo5j+k4qLWu4ObugFmc9DLIAohL58UR'\n+ '5k0XnvizulOHbMMxdzna9lwTw/4SALadEV/CZXBmswUtBgATDKNqjXwokohncpdsWSauH6vf'\n+ 'S6FXwizQoZJ9TdjSGC60rUB2t+aYDm74cIuxAgMBAAE6EHRlc3QubmV0ZmxpeC5jb20SgAOE'\n+ '0y8yWw2Win6M2/bw7+aqVuQPwzS/YG5ySYvwCGQd0Dltr3hpik98WijUODUr6PxMn1ZYXOLo'\n+ '3eED6xYGM7Riza8XskRdCfF8xjj7L7/THPbixyn4mULsttSmWFhexzXnSeKqQHuoKmerqu0n'\n+ 'u39iW3pcxDV/K7E6aaSr5ID0SCi7KRcL9BCUCz1g9c43sNj46BhMCWJSm0mx1XFDcoKZWhpj'\n+ '5FAgU4Q4e6f+S8eX39nf6D6SJRb4ap7Znzn7preIvmS93xWjm75I6UBVQGo6pn4qWNCgLYlG'\n+ 'GCQCUm5tg566j+/g5jvYZkTJvbiZFwtjMW5njbSRwB3W4CrKoyxw4qsJNSaZRTKAvSjTKdqV'\n+ 'DXV/U5HK7SaBA6iJ981/aforXbd2vZlRXO/2S+Maa2mHULzsD+S5l4/YGpSt7PnkCe25F+nA'\n+ 'ovtl/ogZgjMeEdFyd/9YMYjOS4krYmwp3yJ7m9ZzYCQ6I8RQN4x/yLlHG5RH/+WNLNUs6JAZ'\n+ '0fFdCmw=')\nclass InputstreamError(Exception):\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix newlines contained in server certificate (hopefully fixes playback on Android) |
105,989 | 08.11.2018 14:29:42 | -3,600 | 2127544d498cfcab657393b85467b19e82693b9c | Add execution time tracing. Add setting to suppress modal error dialogs and show notification instead. Add option to purge the cache. | [
{
"change_type": "MODIFY",
"old_path": "addon.py",
"new_path": "addon.py",
"diff": "@@ -66,12 +66,12 @@ def route(pathitems):\nroot_handler = pathitems[0] if pathitems else g.MODE_DIRECTORY\nif root_handler == g.MODE_PLAY:\nplayer.play(pathitems=pathitems[1:])\n- elif root_handler not in NAV_HANDLERS:\n- raise nav.InvalidPathError(\n- 'No root handler for path {}'.format('/'.join(pathitems)))\nelif root_handler == 'extrafanart':\ncommon.debug('Ignoring extrafanart invocation')\nxbmcplugin.endOfDirectory(handle=g.PLUGIN_HANDLE, succeeded=False)\n+ elif root_handler not in NAV_HANDLERS:\n+ raise nav.InvalidPathError(\n+ 'No root handler for path {}'.format('/'.join(pathitems)))\nelse:\nnav.execute(NAV_HANDLERS[root_handler], pathitems[1:],\ng.REQUEST_PARAMS)\n@@ -93,3 +93,4 @@ if __name__ == '__main__':\nxbmcplugin.endOfDirectory(handle=g.PLUGIN_HANDLE, succeeded=False)\ng.CACHE.commit()\n+ common.log_time_trace()\n"
},
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta8\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta9\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -539,3 +539,23 @@ msgstr \"\"\nmsgctxt \"#30129\"\nmsgid \"Enable Up Next integration\"\nmsgstr \"\"\n+\n+msgctxt \"#30130\"\n+msgid \"Show notification instead of modal dialog for errors\"\n+msgstr \"\"\n+\n+msgctxt \"#30131\"\n+msgid \"Check the logfile for detailed information\"\n+msgstr \"\"\n+\n+msgctxt \"#30132\"\n+msgid \"Purge in-memory cache\"\n+msgstr \"\"\n+\n+msgctxt \"#30133\"\n+msgid \"Purge in-memory and on-disk cache\"\n+msgstr \"\"\n+\n+msgctxt \"#30134\"\n+msgid \"Enable execution timing\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/website.py",
"new_path": "resources/lib/api/website.py",
"diff": "@@ -28,7 +28,7 @@ JSON_REGEX = r'netflix\\.%s\\s*=\\s*(.*?);\\s*</script>'\nAVATAR_SUBPATH = ['images', 'byWidth', '320', 'value']\[email protected]_execution\[email protected]_execution(immediate=True)\ndef extract_session_data(content):\n\"\"\"\nCall all the parsers we need to extract all\n@@ -51,7 +51,7 @@ def extract_session_data(content):\n}\[email protected]_execution\[email protected]_execution(immediate=True)\ndef extract_profiles(falkor_cache):\n\"\"\"Extract profile information from Netflix website\"\"\"\nprofiles = {}\n@@ -85,7 +85,7 @@ def _get_avatar(falkor_cache, profile):\nreturn ''\[email protected]_execution\[email protected]_execution(immediate=True)\ndef extract_userdata(content):\n\"\"\"Extract essential userdata from the reactContext of the webpage\"\"\"\ncommon.debug('Extracting userdata from webpage')\n@@ -145,7 +145,7 @@ def generate_esn(user_data):\nreturn user_data.get('esn', '')\[email protected]_execution\[email protected]_execution(immediate=True)\ndef extract_json(content, name):\n\"\"\"Extract json from netflix content page\"\"\"\ncommon.debug('Extracting {} JSON'.format(name))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/cache.py",
"new_path": "resources/lib/cache.py",
"diff": "@@ -169,14 +169,22 @@ class Cache(object):\n# del self.buckets[bucket]\nself.common.debug('Cache committ successful')\n- def invalidate(self):\n+ def invalidate(self, on_disk=False):\n\"\"\"Clear all cache buckets\"\"\"\n# pylint: disable=global-statement\nfor bucket in BUCKET_NAMES:\nself.window.clearProperty(_window_property(bucket))\nself.buckets = {}\n+ if on_disk:\n+ self._invalidate_on_disk()\nself.common.info('Cache invalidated')\n+ def _invalidate_on_disk(self):\n+ for bucket in BUCKET_NAMES:\n+ if bucket != CACHE_LIBRARY:\n+ self.common.delete_folder_contents(\n+ os.path.join(self.cache_path, bucket))\n+\ndef invalidate_entry(self, bucket, identifier):\n\"\"\"Remove an item from a bucket\"\"\"\ntry:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/fileops.py",
"new_path": "resources/lib/common/fileops.py",
"diff": "@@ -68,3 +68,9 @@ def list_dir(data_path=g.DATA_PATH):\n:return: The contents of the folder\n\"\"\"\nreturn xbmcvfs.listdir(xbmc.translatePath(data_path))\n+\n+\n+def delete_folder_contents(path):\n+ \"\"\"Delete all files in a folder\"\"\"\n+ for filename in list_dir(path)[1]:\n+ xbmcvfs.delete(filename)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/misc_utils.py",
"new_path": "resources/lib/common/misc_utils.py",
"diff": "@@ -218,11 +218,14 @@ def any_value_except(mapping, excluded_key):\nreturn next(mapping[key] for key in mapping if key != excluded_key)\n-def time_execution(func):\n+def time_execution(func, immediate=False):\n\"\"\"A decorator that wraps a function call and times its execution\"\"\"\n@wraps(func)\ndef timing_wrapper(*args, **kwargs):\n\"\"\"Time the execution of a function\"\"\"\n+ if not g.TIME_TRACE_ENABLED:\n+ return func(*args, **kwargs)\n+\nfuncname = '.'.join(\n((func.im_class.__name__\nif hasattr(func, 'im_class')\n@@ -232,5 +235,24 @@ def time_execution(func):\ntry:\nreturn func(*args, **kwargs)\nfinally:\n- debug('Call to {} took {}s'.format(funcname, clock() - start))\n+ execution_time = int((clock() - start) * 1000)\n+ if immediate:\n+ debug('Call to {} took {}ms'.format(funcname, execution_time))\n+ else:\n+ g.TIME_TRACE.append([funcname, execution_time])\nreturn timing_wrapper\n+\n+\n+def log_time_trace():\n+ \"\"\"Write the time tracing info to the debug log\"\"\"\n+ if not g.TIME_TRACE_ENABLED:\n+ return\n+\n+ time_trace = ['Execution time info for this run:\\n']\n+ for trace in g.TIME_TRACE:\n+ time_trace.append(format(trace[0], '<30'))\n+ time_trace.append('{:<5} ms |'.format(trace[1]))\n+ time_trace.append('=' * int(trace[1] / 10))\n+ time_trace.append('\\n')\n+ debug(''.join(time_trace))\n+ g.reset_time_trace()\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/pathops.py",
"new_path": "resources/lib/common/pathops.py",
"diff": "\"\"\"Helper functions for retrieving values from nested dicts\"\"\"\nfrom __future__ import unicode_literals\n-from .misc_utils import time_execution\n-\n-@time_execution\ndef get_path(path, search_space, include_key=False):\n\"\"\"Retrieve a value from a nested dict by following the path.\nThrows KeyError if any key along the path does not exist\"\"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -13,6 +13,7 @@ from urlparse import urlparse, parse_qsl\nimport xbmc\nimport xbmcaddon\n+import xbmcvfs\nimport resources.lib.cache as cache\n@@ -79,6 +80,8 @@ class GlobalVariables(object):\nexcept IndexError:\nself.PARAM_STRING = ''\nself.REQUEST_PARAMS = dict(parse_qsl(self.PARAM_STRING))\n+ self.reset_time_trace()\n+ self.TIME_TRACE_ENABLED = self.ADDON.getSettingBool('enable_timing')\ntry:\nos.mkdir(self.DATA_PATH)\n@@ -98,17 +101,15 @@ class GlobalVariables(object):\nself.CACHE_METADATA_TTL, self.PLUGIN_HANDLE)\ndef _init_filesystem_cache(self):\n+ # pylint: disable=broad-except\nfor bucket in cache.BUCKET_NAMES:\n- if bucket == cache.CACHE_LIBRARY:\n+ if bucket != cache.CACHE_LIBRARY:\n# Library gets special location in DATA_PATH root because\n# we don't want users accidentally deleting it.\n- continue\n- try:\n- os.makedirs(\n+ xbmcvfs.mkdirs(\nxbmc.translatePath(\n- os.path.join(self.CACHE_PATH, bucket)).decode('utf-8'))\n- except OSError:\n- pass\n+ os.path.join(self.CACHE_PATH, bucket)))\n+\ndef library(self):\n\"\"\"Get the current library instance\"\"\"\n@@ -145,6 +146,10 @@ class GlobalVariables(object):\n# pylint: disable=attribute-defined-outside-init\nself.ADDON = xbmcaddon.Addon()\n+ def reset_time_trace(self):\n+ \"\"\"Reset current time trace info\"\"\"\n+ self.TIME_TRACE = []\n+\n# pylint: disable=invalid-name\n# This will have no effect most of the time, as it doesn't seem to be executed\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/ui/dialogs.py",
"new_path": "resources/lib/kodi/ui/dialogs.py",
"diff": "@@ -95,7 +95,11 @@ def show_error_info(title, message, unknown_error=False, netflix_error=False):\ndef show_addon_error_info(exc):\n\"\"\"Show a dialog to notify of an addon internal error\"\"\"\n+ if g.ADDON.getSettingBool('disable_modal_error_display'):\nshow_error_info(title=common.get_local_string(30105),\nmessage=': '.join((exc.__class__.__name__,\nexc.message)),\nnetflix_error=False)\n+ else:\n+ show_notification(title=common.get_local_string(30105),\n+ msg=common.get_local_string(30131))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/actions.py",
"new_path": "resources/lib/navigation/actions.py",
"diff": "@@ -83,6 +83,13 @@ class AddonActionExecutor(object):\ncommon.refresh_container()\n+ @common.time_execution\n+ def purge_cache(self):\n+ \"\"\"Clear the cache. If on_disk param is supplied, also clear cached\n+ items from disk\"\"\"\n+ g.CACHE.invalidate(self.params.get('on_disk', False))\n+\n+\ndef _sync_library(videoid, operation):\noperation = {\n'add': 'export_silent',\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/msl_handler.py",
"new_path": "resources/lib/services/msl/msl_handler.py",
"diff": "@@ -75,7 +75,7 @@ class MSLHandler(object):\ncallback=self.perform_key_handshake)\n@display_error_info\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef perform_key_handshake(self, data=None):\n\"\"\"Perform a key handshake and initialize crypto keys\"\"\"\n# pylint: disable=unused-argument\n@@ -94,7 +94,7 @@ class MSLHandler(object):\ncommon.debug('Key handshake successful')\n@display_error_info\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef load_manifest(self, viewable_id):\n\"\"\"\nLoads the manifets for the given viewable_id and\n@@ -130,7 +130,7 @@ class MSLHandler(object):\nreturn self.__tranform_to_dash(manifest)\n@display_error_info\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef get_license(self, challenge, sid):\n\"\"\"\nRequests and returns a license for the given challenge and sid\n@@ -159,7 +159,7 @@ class MSLHandler(object):\nlicense_request_data)\nreturn response['result']['licenses'][0]['data']\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef __tranform_to_dash(self, manifest):\ncommon.save_file('manifest.json', json.dumps(manifest))\nmanifest = manifest['result']['viewables'][0]\n@@ -167,14 +167,14 @@ class MSLHandler(object):\nself.last_drm_context = manifest['drmContextId']\nreturn convert_to_dash(manifest)\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef _chunked_request(self, endpoint, request_data):\n\"\"\"Do a POST request and process the chunked response\"\"\"\nreturn self._process_chunked_response(\nself._post(endpoint,\nself.request_builder.msl_request(request_data)))\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef _post(self, endpoint, request_data):\n\"\"\"Execute a post request\"\"\"\ncommon.debug('Executing POST request to {}'.format(endpoint))\n@@ -186,7 +186,7 @@ class MSLHandler(object):\nresponse.raise_for_status()\nreturn response\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef _process_chunked_response(self, response):\n\"\"\"Parse and decrypt an encrypted chunked response. Raise an error\nif the response is plaintext json\"\"\"\n@@ -202,7 +202,7 @@ class MSLHandler(object):\nself.request_builder.crypto)\[email protected]_execution\[email protected]_execution(immediate=True)\ndef _process_json_response(response):\n\"\"\"Execute a post request and expect a JSON response\"\"\"\ntry:\n@@ -232,7 +232,7 @@ def _get_error_details(decoded_response):\nreturn ''\[email protected]_execution\[email protected]_execution(immediate=True)\ndef _parse_chunks(message):\nheader = message.split('}}')[0] + '}}'\npayloads = re.split(',\\\"signature\\\":\\\"[0-9A-Za-z=/+]+\\\"}',\n@@ -241,7 +241,7 @@ def _parse_chunks(message):\nreturn {'header': header, 'payloads': payloads}\[email protected]_execution\[email protected]_execution(immediate=True)\ndef _decrypt_chunks(chunks, crypto):\ndecrypted_payload = ''\nfor chunk in chunks:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/request_builder.py",
"new_path": "resources/lib/services/msl/request_builder.py",
"diff": "@@ -31,13 +31,13 @@ class MSLRequestBuilder(object):\nself.rndm = random.SystemRandom()\nself.crypto = MSLCrypto(msl_data)\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef msl_request(self, data):\n\"\"\"Create an encrypted MSL request\"\"\"\nreturn (json.dumps(self._signed_header()) +\njson.dumps(self._encrypted_chunk(data)))\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef handshake_request(self):\n\"\"\"Create a key handshake request\"\"\"\nreturn json.dumps({\n@@ -51,7 +51,7 @@ class MSLRequestBuilder(object):\n'signature': ''\n}, sort_keys=True)\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef _signed_header(self):\nencryption_envelope = self.crypto.encrypt(self._headerdata())\nreturn {\n@@ -89,7 +89,7 @@ class MSLRequestBuilder(object):\nreturn json.dumps(header_data)\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef _encrypted_chunk(self, data):\n# Serialize the given Data\nserialized_data = ''.join((\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession.py",
"new_path": "resources/lib/services/nfsession.py",
"diff": "@@ -117,7 +117,7 @@ class NetflixSession(object):\nexcept (AttributeError, KeyError) as exc:\nraise website.InvalidAuthURLError(exc)\n- @common.time_execution\n+ @common.time_execution(immediate=True)(immediate=True)\ndef _init_session(self):\n\"\"\"Initialize the session to use for all future connections\"\"\"\ntry:\n@@ -135,7 +135,7 @@ class NetflixSession(object):\n})\ncommon.info('Initialized new session')\n- @common.time_execution\n+ @common.time_execution(immediate=True)(immediate=True)\ndef _prefetch_login(self):\n\"\"\"Check if we have stored credentials.\nIf so, do the login before the user requests it\"\"\"\n@@ -148,7 +148,7 @@ class NetflixSession(object):\nexcept LoginFailedError:\nui.show_notification(common.get_local_string(30009))\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef _is_logged_in(self):\n\"\"\"Check if the user is logged in\"\"\"\nif not self.session.cookies:\n@@ -156,7 +156,7 @@ class NetflixSession(object):\nreturn self._load_cookies() and self._refresh_session_data()\nreturn True\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef _refresh_session_data(self):\n\"\"\"Refresh session_data from the Netflix website\"\"\"\n# pylint: disable=broad-except\n@@ -172,7 +172,7 @@ class NetflixSession(object):\ncommon.debug('Successfully refreshed session data')\nreturn True\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef _load_cookies(self):\n\"\"\"Load stored cookies from disk\"\"\"\n# pylint: disable=broad-except\n@@ -200,7 +200,7 @@ class NetflixSession(object):\n\"\"\"AddonSignals interface for login function\"\"\"\nself._login()\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef _login(self):\n\"\"\"Perform account login\"\"\"\ntry:\n@@ -221,7 +221,7 @@ class NetflixSession(object):\nself.session_data = session_data\[email protected]_return_call\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef logout(self):\n\"\"\"Logout of the current account and reset the session\"\"\"\ncommon.debug('Logging out of current account')\n@@ -243,7 +243,7 @@ class NetflixSession(object):\[email protected]_return_call\n@needs_login\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef activate_profile(self, guid):\n\"\"\"Set the profile identified by guid as active\"\"\"\ncommon.debug('Activating profile {}'.format(guid))\n@@ -269,7 +269,7 @@ class NetflixSession(object):\[email protected]_return_call\n@needs_login\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef perpetual_path_request(self, paths, path_type, length_params=None):\n\"\"\"Perform a perpetual path request against the Shakti API to retrieve\na possibly large video list. If the requested video list's size is\n@@ -292,7 +292,7 @@ class NetflixSession(object):\nrange_end += MAX_PATH_REQUEST_SIZE\nreturn merged_response\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef _path_request(self, paths):\n\"\"\"Execute a path request with static paths\"\"\"\ncommon.debug('Executing path request: {}'.format(json.dumps(paths)))\n@@ -335,7 +335,7 @@ class NetflixSession(object):\ncomponent=component,\n**kwargs)\n- @common.time_execution\n+ @common.time_execution(immediate=True)\ndef _request(self, method, component, **kwargs):\nurl = (_api_url(component, self.session_data['api_data'])\nif URLS[component]['is_api_call']\n@@ -373,7 +373,7 @@ class NetflixSession(object):\nreturn data, headers, params\[email protected]_execution\[email protected]_execution(immediate=True)\ndef _set_range_selector(paths, range_start, range_end):\n\"\"\"Replace the RANGE_SELECTOR placeholder with an actual dict:\n{'from': range_start, 'to': range_end}\"\"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<category label=\"30014\">\n<setting id=\"email\" type=\"text\" visible=\"false\" default=\"\"/>\n<setting id=\"password\" type=\"text\" visible=\"false\" default=\"\"/>\n- <setting id=\"switch_account\" type=\"action\" label=\"30059c\" action=\"RunPlugin(plugin://plugin.video.netflix/action/switch_account)\" option=\"close\"/>\n- <setting id=\"logout\" type=\"action\" label=\"30017\" action=\"RunPlugin(plugin://plugin.video.netflix/action/logout)\" option=\"close\"/>\n- <setting id=\"adultpin_enable\" type=\"action\" label=\"30062\" default=\"False\" action=\"RunPlugin(plugin://plugin.video.netflix/action/toggle_adult_pin)\"/>\n+ <setting id=\"switch_account\" type=\"action\" label=\"30059c\" action=\"RunPlugin(plugin://plugin.video.netflix/action/switch_account/)\" option=\"close\"/>\n+ <setting id=\"logout\" type=\"action\" label=\"30017\" action=\"RunPlugin(plugin://plugin.video.netflix/action/logout/)\" option=\"close\"/>\n+ <setting id=\"adultpin_enable\" type=\"action\" label=\"30062\" default=\"False\" action=\"RunPlugin(plugin://plugin.video.netflix/action/toggle_adult_pin/)\"/>\n<setting label=\"30053\" type=\"lsep\"/>\n<setting id=\"autologin_enable\" type=\"bool\" label=\"30054\" default=\"false\"/>\n<setting id=\"autologin_user\" type=\"text\" label=\"30055\" default=\"\" enable=\"false\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n<setting id=\"autologin_id\" type=\"text\" label=\"30056\" default=\"\" enable=\"false\" visible=\"eq(-2,true)\" subsetting=\"true\"/>\n<setting id=\"info\" type=\"text\" label=\"30057\" default=\"\" enable=\"false\" visible=\"eq(-3,true)\"/>\n<setting type=\"sep\"/>\n- <setting id=\"is_settings\" type=\"action\" label=\"30035\" action=\"RunPlugin(plugin://plugin.video.netflix/action/opensettings/inputstream.adaptive)\" enable=\"System.HasAddon(inputstream.adaptive)\" option=\"close\"/>\n+ <setting id=\"is_settings\" type=\"action\" label=\"30035\" action=\"RunPlugin(plugin://plugin.video.netflix/action/opensettings/inputstream.adaptive/)\" enable=\"System.HasAddon(inputstream.adaptive)\" option=\"close\"/>\n</category>\n<category label=\"30025\">\n<setting id=\"enablelibraryfolder\" type=\"bool\" label=\"30026\" default=\"false\"/>\n<setting id=\"customlibraryfolder\" type=\"folder\" label=\"30027\" enable=\"eq(-1,true)\" default=\"special://profile/addon_data/plugin.video.netflix\" source=\"auto\" option=\"writeable\" subsetting=\"true\"/>\n<setting id=\"mylist_library_sync\" type=\"bool\" label=\"30114\" default=\"false\"/>\n- <setting id=\"initial_mylist_sync\" type=\"action\" label=\"30121\" action=\"RunPlugin(plugin://plugin.video.netflix/library/initial_mylist_sync)\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n- <setting id=\"purge_library\" type=\"action\" label=\"30125\" action=\"RunPlugin(plugin://plugin.video.netflix/library/purge)\"/>\n+ <setting id=\"initial_mylist_sync\" type=\"action\" label=\"30121\" action=\"RunPlugin(plugin://plugin.video.netflix/library/initial_mylist_sync/)\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n+ <setting id=\"purge_library\" type=\"action\" label=\"30125\" action=\"RunPlugin(plugin://plugin.video.netflix/library/purge/)\"/>\n<setting id=\"customexportname\" type=\"bool\" label=\"No longer in use\" default=\"true\" visible=\"false\"/>\n<setting id=\"invalidate_cache_on_mylist_modify\" type=\"bool\" label=\"No longer in use\" default=\"true\" visible=\"false\"/>\n<setting label=\"30065\" type=\"lsep\"/>\n<setting id=\"enable_dolbyvision_profiles\" type=\"bool\" label=\"30099\" default=\"false\" visible=\"eq(-2,true)\" subsetting=\"true\"/>\n<setting id=\"enable_vp9_profiles\" type=\"bool\" label=\"30136\" default=\"false\" visible=\"eq(-3,true)\" subsetting=\"true\"/>\n<setting label=\"30116\" type=\"lsep\"/>\n+ <setting id=\"enable_timing\" type=\"bool\" label=\"30134\" default=\"false\"/>\n<setting id=\"ssl_verification\" type=\"bool\" label=\"30024\" default=\"true\"/>\n<setting id=\"enable_tracking\" type=\"bool\" label=\"30032\" default=\"true\"/>\n<setting id=\"esn\" type=\"text\" label=\"30034\" value=\"\" default=\"\"/>\n<setting label=\"30117\" type=\"lsep\"/>\n<setting id=\"cache_ttl\" type=\"slider\" option=\"int\" range=\"0,10,525600\" label=\"30084\" default=\"10\"/>\n<setting id=\"cache_metadata_ttl\" type=\"slider\" option=\"int\" range=\"0,1,365\" label=\"30085\" default=\"30\"/>\n+ <setting id=\"purge_inmemory_cache\" type=\"action\" label=\"30131\" action=\"RunPlugin(plugin://plugin.video.netflix/action/purge_cache/)\"/>\n+ <setting id=\"purge_complete_cache\" type=\"action\" label=\"30132\" action=\"RunPlugin(plugin://plugin.video.netflix/action/purge_cache/?on_disk=True)\"/>\n</category>\n</settings>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add execution time tracing. Add setting to suppress modal error dialogs and show notification instead. Add option to purge the cache. |
105,989 | 08.11.2018 15:05:41 | -3,600 | 5cdfd9c46476faf3f2959d99f5621493e0fd0c8c | Hotfix for beta9 | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta9\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta10\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/misc_utils.py",
"new_path": "resources/lib/common/misc_utils.py",
"diff": "@@ -218,11 +218,12 @@ def any_value_except(mapping, excluded_key):\nreturn next(mapping[key] for key in mapping if key != excluded_key)\n-def time_execution(func, immediate=False):\n+def time_execution(immediate=False):\n\"\"\"A decorator that wraps a function call and times its execution\"\"\"\n+ # pylint: disable=missing-docstring\n+ def time_execution_decorator(func):\n@wraps(func)\ndef timing_wrapper(*args, **kwargs):\n- \"\"\"Time the execution of a function\"\"\"\nif not g.TIME_TRACE_ENABLED:\nreturn func(*args, **kwargs)\n@@ -237,10 +238,12 @@ def time_execution(func, immediate=False):\nfinally:\nexecution_time = int((clock() - start) * 1000)\nif immediate:\n- debug('Call to {} took {}ms'.format(funcname, execution_time))\n+ debug('Call to {} took {}ms'\n+ .format(funcname, execution_time))\nelse:\ng.TIME_TRACE.append([funcname, execution_time])\nreturn timing_wrapper\n+ return time_execution_decorator\ndef log_time_trace():\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Hotfix for beta9 |
105,989 | 08.11.2018 15:21:01 | -3,600 | b76e767a1b5e8500295ff200a6a20414be873c31 | Add missing setting for disabling modal error dialogs | [
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<setting id=\"enable_vp9_profiles\" type=\"bool\" label=\"30136\" default=\"false\" visible=\"eq(-3,true)\" subsetting=\"true\"/>\n<setting label=\"30116\" type=\"lsep\"/>\n<setting id=\"enable_timing\" type=\"bool\" label=\"30134\" default=\"false\"/>\n+ <setting id=\"disable_modal_error_display\" type=\"bool\" label=\"30130\" default=\"false\"/>\n<setting id=\"ssl_verification\" type=\"bool\" label=\"30024\" default=\"true\"/>\n<setting id=\"enable_tracking\" type=\"bool\" label=\"30032\" default=\"true\"/>\n<setting id=\"esn\" type=\"text\" label=\"30034\" value=\"\" default=\"\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add missing setting for disabling modal error dialogs |
105,989 | 08.11.2018 15:25:14 | -3,600 | 779fb2b26d085670c3b194677fe07f9c03ef8309 | Fix messed up timing annotations | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta10\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta11\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession.py",
"new_path": "resources/lib/services/nfsession.py",
"diff": "@@ -117,7 +117,7 @@ class NetflixSession(object):\nexcept (AttributeError, KeyError) as exc:\nraise website.InvalidAuthURLError(exc)\n- @common.time_execution(immediate=True)(immediate=True)\n+ @common.time_execution(immediate=True)\ndef _init_session(self):\n\"\"\"Initialize the session to use for all future connections\"\"\"\ntry:\n@@ -135,7 +135,7 @@ class NetflixSession(object):\n})\ncommon.info('Initialized new session')\n- @common.time_execution(immediate=True)(immediate=True)\n+ @common.time_execution(immediate=True)\ndef _prefetch_login(self):\n\"\"\"Check if we have stored credentials.\nIf so, do the login before the user requests it\"\"\"\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix messed up timing annotations |
105,989 | 09.11.2018 18:06:00 | -3,600 | 4f4599ce52021735d53f8d2ea7be725322b7fbb0 | Add full 1080p support on Linux | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta12\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta13\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/android_crypto.py",
"new_path": "resources/lib/services/msl/android_crypto.py",
"diff": "@@ -78,12 +78,13 @@ class AndroidMSLCrypto(MSLBaseCrypto):\ncommon.debug('Widevine CryptoSession provideKeyResponse successful')\ncommon.debug('keySetId: {}'.format(self.keyset_id))\n- def encrypt(self, plaintext):\n+ def encrypt(self, plaintext, esn):\n\"\"\"\nEncrypt the given Plaintext with the encryption key\n:param plaintext:\n:return: Serialized JSON String of the encryption Envelope\n\"\"\"\n+ # pylint: disable=unused-argument\ninit_vector = urandom(16)\nplaintext = plaintext.encode('utf-8')\n# Add PKCS5Padding\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/base_crypto.py",
"new_path": "resources/lib/services/msl/base_crypto.py",
"diff": "@@ -19,10 +19,11 @@ class MSLBaseCrypto(object):\nif msl_data:\nself._set_mastertoken(msl_data['tokens']['mastertoken'])\n- def parse_key_response(self, headerdata):\n+ def parse_key_response(self, headerdata, save_to_disk):\n\"\"\"Parse a key response and update crypto keys\"\"\"\nself._set_mastertoken(headerdata['keyresponsedata']['mastertoken'])\nself._init_keys(headerdata['keyresponsedata'])\n+ if save_to_disk:\nself._save_msl_data()\ndef _set_mastertoken(self, mastertoken):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/default_crypto.py",
"new_path": "resources/lib/services/msl/default_crypto.py",
"diff": "@@ -48,7 +48,7 @@ class DefaultMSLCrypto(MSLBaseCrypto):\n'keypairid': 'superKeyPair'\n}}]\n- def encrypt(self, plaintext):\n+ def encrypt(self, plaintext, esn):\n\"\"\"\nEncrypt the given Plaintext with the encryption key\n:param plaintext:\n@@ -58,7 +58,7 @@ class DefaultMSLCrypto(MSLBaseCrypto):\ncipher = AES.new(self.encryption_key, AES.MODE_CBC, init_vector)\nencryption_envelope = {\n'ciphertext': '',\n- 'keyid': '_'.join((g.get_esn(), str(self.sequence_number))),\n+ 'keyid': '_'.join((esn, str(self.sequence_number))),\n'sha256': 'AA==',\n'iv': base64.standard_b64encode(init_vector)\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/msl_handler.py",
"new_path": "resources/lib/services/msl/msl_handler.py",
"diff": "@@ -79,18 +79,20 @@ class MSLHandler(object):\ndef perform_key_handshake(self, data=None):\n\"\"\"Perform a key handshake and initialize crypto keys\"\"\"\n# pylint: disable=unused-argument\n- if not g.get_esn():\n+ esn = data or g.get_esn()\n+ if not esn:\ncommon.info('Cannot perform key handshake, missing ESN')\nreturn\n- common.debug('Performing key handshake. ESN: {}'.format(g.get_esn()))\n+ common.debug('Performing key handshake. ESN: {}'.format(esn))\nresponse = _process_json_response(\nself._post(ENDPOINTS['chrome']['manifest'],\n- self.request_builder.handshake_request()))\n+ self.request_builder.handshake_request(esn)))\nheaderdata = json.loads(\nbase64.standard_b64decode(response['headerdata']))\n- self.request_builder.crypto.parse_key_response(headerdata)\n+ self.request_builder.crypto.parse_key_response(\n+ headerdata, not esn.startswith('NFCDIE-02-'))\ncommon.debug('Key handshake successful')\n@display_error_info\n@@ -103,10 +105,34 @@ class MSLHandler(object):\n:param viewable_id: The id of of the viewable\n:return: MPD XML Manifest or False if no success\n\"\"\"\n- common.debug('Requesting manifest for {}'.format(viewable_id))\n+ manifest = self._load_manifest(viewable_id, g.get_esn())\n+ if not has_1080p(manifest):\n+ common.debug('Manifest has no 1080p viewables')\n+ manifest = self.get_edge_manifest(viewable_id, manifest)\n+ return self.__tranform_to_dash(manifest)\n+\n+ def get_edge_manifest(self, viewable_id, chrome_manifest):\n+ \"\"\"Load a manifest with an EDGE ESN and replace playback_context and\n+ drm_context\"\"\"\n+ common.debug('Loading EDGE manifest')\n+ esn = generate_edge_esn()\n+ common.debug('Switching MSL data to EDGE')\n+ self.perform_key_handshake(esn)\n+ manifest = self._load_manifest(viewable_id, esn)\n+ manifest['playbackContextId'] = chrome_manifest['playbackContextId']\n+ manifest['drmContextId'] = chrome_manifest['drmContextId']\n+ common.debug('Successfully loaded EDGE manifest')\n+ common.debug('Resetting MSL data to Chrome')\n+ self.perform_key_handshake()\n+ return manifest\n+\n+ @common.time_execution(immediate=True)\n+ def _load_manifest(self, viewable_id, esn):\n+ common.debug('Requesting manifest for {} with ESN {}'\n+ .format(viewable_id, esn))\nmanifest_request_data = {\n'method': 'manifest',\n- 'lookupType': 'PREPARE',\n+ 'lookupType': 'STANDARD',\n'viewableIds': [viewable_id],\n'profiles': enabled_profiles(),\n'drmSystem': 'widevine',\n@@ -117,7 +143,7 @@ class MSLHandler(object):\n},\n'sessionId': '14673889385265',\n'trackId': 0,\n- 'flavor': 'PRE_FETCH',\n+ 'flavor': 'STANDARD',\n'secureUrls': False,\n'supportPreviewContent': True,\n'forceClearStreams': False,\n@@ -126,8 +152,9 @@ class MSLHandler(object):\n'uiVersion': 'akira'\n}\nmanifest = self._chunked_request(ENDPOINTS['chrome']['manifest'],\n- manifest_request_data)\n- return self.__tranform_to_dash(manifest)\n+ manifest_request_data, esn)\n+ common.save_file('manifest.json', json.dumps(manifest))\n+ return manifest['result']['viewables'][0]\n@display_error_info\[email protected]_execution(immediate=True)\n@@ -153,26 +180,24 @@ class MSLHandler(object):\n}],\n'clientTime': int(time.time()),\n'xid': int((int(time.time()) + 0.1612) * 1000)\n-\n}\nresponse = self._chunked_request(ENDPOINTS['chrome']['license'],\n- license_request_data)\n+ license_request_data, g.get_esn())\n+ common.debug(response)\nreturn response['result']['licenses'][0]['data']\[email protected]_execution(immediate=True)\ndef __tranform_to_dash(self, manifest):\n- common.save_file('manifest.json', json.dumps(manifest))\n- manifest = manifest['result']['viewables'][0]\nself.last_playback_context = manifest['playbackContextId']\nself.last_drm_context = manifest['drmContextId']\nreturn convert_to_dash(manifest)\[email protected]_execution(immediate=True)\n- def _chunked_request(self, endpoint, request_data):\n+ def _chunked_request(self, endpoint, request_data, esn):\n\"\"\"Do a POST request and process the chunked response\"\"\"\nreturn self._process_chunked_response(\nself._post(endpoint,\n- self.request_builder.msl_request(request_data)))\n+ self.request_builder.msl_request(request_data, esn)))\[email protected]_execution(immediate=True)\ndef _post(self, endpoint, request_data):\n@@ -268,3 +293,20 @@ def _decrypt_chunks(chunks, crypto):\ndecrypted_payload = json.loads(decrypted_payload)[1]['payload']['data']\ndecrypted_payload = base64.standard_b64decode(decrypted_payload)\nreturn json.loads(decrypted_payload)\n+\n+\n+def has_1080p(manifest):\n+ \"\"\"Return True if any of the video tracks in manifest have a 1080p profile\n+ available, else False\"\"\"\n+ return any(video['contentProfile'] == 'playready-h264mpl40-dash'\n+ for video in manifest['videoTracks'][0]['downloadables'])\n+\n+\n+def generate_edge_esn():\n+ \"\"\"Generate a random EDGE ESN\"\"\"\n+ import random\n+ esn = ['NFCDIE-02-']\n+ possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'\n+ for _ in range(0, 30):\n+ esn.append(random.choice(possible))\n+ return''.join(esn)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/profiles.py",
"new_path": "resources/lib/services/msl/profiles.py",
"diff": "@@ -32,6 +32,7 @@ PROFILES = {\n'playready-h264mpl31-dash', 'playready-h264mpl40-dash',\n# Audio\n'heaac-2-dash',\n+ 'heaac-5.1-dash',\n# Subtiltes\n# 'dfxp-ls-sdh',\n# 'simplesdh',\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/request_builder.py",
"new_path": "resources/lib/services/msl/request_builder.py",
"diff": "@@ -7,7 +7,6 @@ import base64\nimport subprocess\nimport random\n-from resources.lib.globals import g\nimport resources.lib.common as common\n# check if we are on Android\n@@ -32,35 +31,36 @@ class MSLRequestBuilder(object):\nself.crypto = MSLCrypto(msl_data)\[email protected]_execution(immediate=True)\n- def msl_request(self, data):\n+ def msl_request(self, data, esn):\n\"\"\"Create an encrypted MSL request\"\"\"\n- return (json.dumps(self._signed_header()) +\n- json.dumps(self._encrypted_chunk(data)))\n+ return (json.dumps(self._signed_header(esn)) +\n+ json.dumps(self._encrypted_chunk(data, esn)))\[email protected]_execution(immediate=True)\n- def handshake_request(self):\n+ def handshake_request(self, esn):\n\"\"\"Create a key handshake request\"\"\"\nreturn json.dumps({\n'entityauthdata': {\n'scheme': 'NONE',\n- 'authdata': {'identity': g.get_esn()}},\n+ 'authdata': {'identity': esn}},\n'headerdata':\nbase64.standard_b64encode(\nself._headerdata(is_key_request=True, is_handshake=True,\n- compression=None)),\n+ compression=None, esn=esn)),\n'signature': ''\n}, sort_keys=True)\[email protected]_execution(immediate=True)\n- def _signed_header(self):\n- encryption_envelope = self.crypto.encrypt(self._headerdata())\n+ def _signed_header(self, esn):\n+ encryption_envelope = self.crypto.encrypt(self._headerdata(esn=esn),\n+ esn)\nreturn {\n'headerdata': base64.standard_b64encode(encryption_envelope),\n'signature': self.crypto.sign(encryption_envelope),\n'mastertoken': self.crypto.mastertoken,\n}\n- def _headerdata(self, is_handshake=False, is_key_request=False,\n+ def _headerdata(self, esn, is_handshake=False, is_key_request=False,\ncompression='GZIP'):\n\"\"\"\nFunction that generates a MSL header dict\n@@ -68,7 +68,7 @@ class MSLRequestBuilder(object):\n\"\"\"\nself.current_message_id = self.rndm.randint(0, pow(2, 52))\nheader_data = {\n- 'sender': g.get_esn(),\n+ 'sender': esn,\n'handshake': is_handshake,\n'nonreplayable': False,\n'capabilities': {\n@@ -90,7 +90,7 @@ class MSLRequestBuilder(object):\nreturn json.dumps(header_data)\[email protected]_execution(immediate=True)\n- def _encrypted_chunk(self, data):\n+ def _encrypted_chunk(self, data, esn):\n# Serialize the given Data\nserialized_data = ''.join((\n'[{},{\"headers\":{},\"path\":\"/cbp/cadmium-13\",\"payload\":{\"data\":\"',\n@@ -103,7 +103,7 @@ class MSLRequestBuilder(object):\n'sequencenumber': 1,\n'endofmsg': True\n}\n- encryption_envelope = self.crypto.encrypt(json.dumps(payload))\n+ encryption_envelope = self.crypto.encrypt(json.dumps(payload), esn)\nreturn {\n'payload': base64.standard_b64encode(encryption_envelope),\n'signature': self.crypto.sign(encryption_envelope),\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add full 1080p support on Linux |
105,989 | 09.11.2018 19:29:22 | -3,600 | 776578a1779f5a1606d380778a94b186e6ca6649 | Fix library export. Fix KeyErrors when playing exported items from library. Restrict 1080p workaround to non-Android (shouldn't be neccessary there) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta13\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta14\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/kodiops.py",
"new_path": "resources/lib/common/kodiops.py",
"diff": "@@ -11,18 +11,15 @@ from resources.lib.globals import g\nfrom .logging import debug\nLIBRARY_PROPS = {\n- 'episode': ['title', 'plot', 'writer', 'firstaired', 'playcount',\n- 'runtime', 'director', 'productioncode', 'season',\n- 'episode', 'originaltitle', 'showtitle', 'lastplayed',\n- 'fanart', 'thumbnail', 'file', 'resume', 'tvshowid',\n- 'dateadded', 'art', 'specialsortseason',\n- 'specialsortepisode', 'userrating', 'seasonid'],\n+ 'episode': ['title', 'plot', 'writer', 'playcount', 'director', 'season',\n+ 'episode', 'originaltitle', 'showtitle', 'lastplayed', 'file',\n+ 'resume', 'dateadded', 'art', 'userrating', 'firstaired'],\n'movie': ['title', 'genre', 'year', 'director', 'trailer',\n'tagline', 'plot', 'plotoutline', 'originaltitle', 'lastplayed',\n'playcount', 'writer', 'studio', 'mpaa', 'country',\n'imdbnumber', 'runtime', 'set', 'showlink', 'premiered',\n- 'top250', 'fanart', 'thumbnail', 'file', 'sorttitle',\n- 'resume', 'setid', 'dateadded', 'tag', 'art', 'userrating']\n+ 'top250', 'file', 'sorttitle', 'resume', 'setid', 'dateadded',\n+ 'tag', 'art', 'userrating']\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -14,6 +14,11 @@ QUALITIES = [\n{'codec': 'h265', 'width': '3840', 'height': '2160'}\n]\n+JSONRPC_MAPPINGS = {\n+ 'showtitle': 'tvshowtitle',\n+ 'userrating': 'rating'\n+}\n+\ndef add_info(videoid, list_item, item, raw_data):\n\"\"\"Add infolabels to the list_item. The passed in list_item is modified\n@@ -200,6 +205,7 @@ def add_info_from_library(videoid, list_item):\ndetails = library.get_item(videoid)\ncommon.debug('Got fileinfo from library: {}'.format(details))\nart = details.pop('art', {})\n+ _sanitize_infos(details)\n# Resuming for strm files in library is currently broken in Leia Beta\n# keeping this for reference / in hopes this will get fixed\nresume = details.pop('resume', {})\n@@ -214,3 +220,11 @@ def add_info_from_library(videoid, list_item):\nlist_item.setInfo('video', infos)\nlist_item.setArt(art)\nreturn infos, art\n+\n+\n+def _sanitize_infos(details):\n+ for source, target in JSONRPC_MAPPINGS.items():\n+ if source in details:\n+ details[target] = details.pop(source)\n+ for prop in ['file', 'label']:\n+ details.pop(prop, None)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/library.py",
"new_path": "resources/lib/kodi/library.py",
"diff": "@@ -150,18 +150,16 @@ def compile_tasks(videoid):\ncommon.debug('Compiling library tasks for {}'.format(videoid))\nmetadata = api.metadata(videoid)\nif videoid.mediatype == common.VideoId.MOVIE:\n- return _create_movie_task(videoid, metadata)\n+ return _create_movie_task(videoid, metadata[0])\nelif videoid.mediatype in common.VideoId.TV_TYPES:\nreturn _create_tv_tasks(videoid, metadata)\nraise ValueError('Cannot handle {}'.format(videoid))\n-def _create_movie_task(videoid, metadata):\n+def _create_movie_task(videoid, movie):\n\"\"\"Create a task for a movie\"\"\"\n- name = '{title} ({year})'.format(\n- title=metadata['title'],\n- year=metadata['year'])\n+ name = '{title} ({year})'.format(title=movie['title'], year=movie['year'])\nreturn [_create_item_task(name, FOLDER_MOVIES, videoid, name, name)]\n@@ -170,41 +168,37 @@ def _create_tv_tasks(videoid, metadata):\nIf videoid represents a show or season, tasks will be generated for\nall contained seasons and episodes\"\"\"\nif videoid.mediatype == common.VideoId.SHOW:\n- return _compile_show_tasks(videoid, metadata)\n+ return _compile_show_tasks(videoid, metadata[0])\nelif videoid.mediatype == common.VideoId.SEASON:\n- return _compile_season_tasks(videoid, metadata,\n+ return _compile_season_tasks(videoid, metadata[0],\ncommon.find(videoid.seasonid, 'id',\n- metadata['seasons']))\n- return [_create_episode_task(videoid, metadata)]\n+ metadata[0]['seasons']))\n+ return [_create_episode_task(videoid, *metadata)]\n-def _compile_show_tasks(videoid, metadata):\n+def _compile_show_tasks(videoid, show):\n\"\"\"Compile a list of task items for all episodes of all seasons\nof a tvshow\"\"\"\n# This nested comprehension is nasty but neccessary. It flattens\n# the task lists for each season into one list\n- return [task for season in metadata['seasons']\n+ return [task for season in show['seasons']\nfor task in _compile_season_tasks(\n- videoid.derive_season(season['id']), metadata, season)]\n+ videoid.derive_season(season['id']), show, season)]\n-def _compile_season_tasks(videoid, metadata, season):\n+def _compile_season_tasks(videoid, show, season):\n\"\"\"Compile a list of task items for all episodes in a season\"\"\"\nreturn [_create_episode_task(videoid.derive_episode(episode['id']),\n- metadata, season, episode)\n+ episode, season, show)\nfor episode in season['episodes']]\n-def _create_episode_task(videoid, metadata, season=None, episode=None):\n+def _create_episode_task(videoid, episode, season, show):\n\"\"\"Export a single episode to the library\"\"\"\n- showname = metadata['title']\n- season = season or common.find(videoid.seasonid, 'id', metadata['seasons'])\n- episode = episode or common.find(videoid.episodeid, 'id',\n- season['episodes'])\n- title = episode['title']\nfilename = 'S{:02d}E{:02d}'.format(season['seq'], episode['seq'])\n- title = ' - '.join((showname, filename, title))\n- return _create_item_task(title, FOLDER_TV, videoid, showname, filename)\n+ title = ' - '.join((show['title'], filename, episode['title']))\n+ return _create_item_task(title, FOLDER_TV, videoid, show['title'],\n+ filename)\ndef _create_item_task(title, section, videoid, destination, filename):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/actions.py",
"new_path": "resources/lib/navigation/actions.py",
"diff": "@@ -21,6 +21,7 @@ class AddonActionExecutor(object):\ndef logout(self, pathitems=None):\n\"\"\"Perform account logout\"\"\"\n+ # pylint: disable=unused-argument\napi.logout()\ndef opensettings(self, pathitems):\n@@ -44,12 +45,13 @@ class AddonActionExecutor(object):\ndef switch_account(self, pathitems=None):\n\"\"\"Logo out of the curent account and login into another one\"\"\"\n+ # pylint: disable=unused-argument\napi.logout()\napi.login()\ndef toggle_adult_pin(self, pathitems=None):\n\"\"\"Toggle adult PIN verification\"\"\"\n- # pylint: disable=no-member\n+ # pylint: disable=no-member, unused-argument\npin = ui.ask_for_pin()\nif pin is None:\nreturn\n@@ -83,9 +85,10 @@ class AddonActionExecutor(object):\[email protected]_execution(immediate=False)\n- def purge_cache(self):\n+ def purge_cache(self, pathitems=None):\n\"\"\"Clear the cache. If on_disk param is supplied, also clear cached\nitems from disk\"\"\"\n+ # pylint: disable=unused-argument\ng.CACHE.invalidate(self.params.get('on_disk', False))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/player.py",
"new_path": "resources/lib/navigation/player.py",
"diff": "@@ -177,6 +177,6 @@ def upnext_info(videoid, infos, art):\n'playcount': infos['playcount'],\n'season': infos['season'],\n'episode': infos['episode'],\n- 'rating': infos['rating'],\n- 'firstaired': infos['year']\n+ 'rating': infos.get('rating', infos.get('userrating', '')),\n+ 'firstaired': infos.get('year', infos.get('firstaired', ''))\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/msl_handler.py",
"new_path": "resources/lib/services/msl/msl_handler.py",
"diff": "@@ -18,7 +18,7 @@ from resources.lib.globals import g\nimport resources.lib.common as common\nimport resources.lib.kodi.ui as ui\n-from .request_builder import MSLRequestBuilder\n+from .request_builder import MSLRequestBuilder, SDKVERSION\nfrom .profiles import enabled_profiles\nfrom .converter import convert_to_dash\nfrom .exceptions import MSLError\n@@ -106,7 +106,7 @@ class MSLHandler(object):\n:return: MPD XML Manifest or False if no success\n\"\"\"\nmanifest = self._load_manifest(viewable_id, g.get_esn())\n- if not has_1080p(manifest):\n+ if SDKVERSION < 18 and not has_1080p(manifest):\ncommon.debug('Manifest has no 1080p viewables')\nmanifest = self.get_edge_manifest(viewable_id, manifest)\nreturn self.__tranform_to_dash(manifest)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix library export. Fix KeyErrors when playing exported items from library. Restrict 1080p workaround to non-Android (shouldn't be neccessary there) |
105,989 | 14.11.2018 14:50:39 | -3,600 | ce16084fb1d9f19a076a8db7c14800f129fe36a8 | Make 1080p workaround toggleable. Fix watched status issues. | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -563,3 +563,7 @@ msgstr \"\"\nmsgctxt \"#30135\"\nmsgid \"Cache cleared\"\nmsgstr \"\"\n+\n+msgctxt \"#30136\"\n+msgid \"Enable 1080p Unlock (not recommended for Android)\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/paths.py",
"new_path": "resources/lib/api/paths.py",
"diff": "@@ -71,7 +71,7 @@ INFO_MAPPINGS = {\n'mpaa': ['maturity', 'rating', 'value'],\n'duration': 'runtime',\n# 'bookmark': 'bookmarkPosition',\n- 'playcount': 'watched'\n+ # 'playcount': 'watched'\n}\nINFO_TRANSFORMATIONS = {\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/website.py",
"new_path": "resources/lib/api/website.py",
"diff": "@@ -35,16 +35,16 @@ def extract_session_data(content):\nthe session relevant data from the HTML page\n\"\"\"\ncommon.debug('Extracting session data...')\n- falkor_cache = extract_json(content, 'falcorCache')\n- profiles, active_profile = extract_profiles(falkor_cache)\n+ profiles, active_profile = extract_profiles(\n+ extract_json(content, 'falcorCache'))\nuser_data = extract_userdata(content)\nif user_data.get('membershipStatus') != 'CURRENT_MEMBER':\n- common.error(user_data)\n- raise InvalidMembershipStatusError(user_data.get('membershipStatus'))\n+ common.debug(user_data)\n+ # Ignore this for now\n+ # raise InvalidMembershipStatusError(user_data.get('membershipStatus'))\nreturn {\n'profiles': profiles,\n'active_profile': active_profile,\n- 'root_lolomo': next(falkor_cache.get('lolomos', {}).iterkeys(), None),\n'user_data': user_data,\n'esn': generate_esn(user_data),\n'api_data': _parse_api_data(user_data)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -82,6 +82,8 @@ def parse_info(videoid, item, raw_data):\nelse videoid.mediatype)}\nif videoid.mediatype in common.VideoId.TV_TYPES:\ninfos['tvshowtitle'] = raw_data['videos'][videoid.tvshowid]['title']\n+ if item.get('watched', False):\n+ infos['playcount'] = 1\ninfos.update(parse_atomic_infos(item))\ninfos.update(parse_referenced_infos(item, raw_data))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/msl_handler.py",
"new_path": "resources/lib/services/msl/msl_handler.py",
"diff": "@@ -18,19 +18,15 @@ from resources.lib.globals import g\nimport resources.lib.common as common\nimport resources.lib.kodi.ui as ui\n-from .request_builder import MSLRequestBuilder, SDKVERSION\n+from .request_builder import MSLRequestBuilder\nfrom .profiles import enabled_profiles\nfrom .converter import convert_to_dash\nfrom .exceptions import MSLError\nCHROME_BASE_URL = 'http://www.netflix.com/api/msl/NFCDCH-LX/cadmium/'\nENDPOINTS = {\n- 'chrome': {\n'manifest': CHROME_BASE_URL + 'manifest',\n- 'license': CHROME_BASE_URL + 'license'},\n- 'edge': {\n- 'manifest': None,\n- 'license': None}\n+ 'license': CHROME_BASE_URL + 'license'\n}\n@@ -87,7 +83,7 @@ class MSLHandler(object):\ncommon.debug('Performing key handshake. ESN: {}'.format(esn))\nresponse = _process_json_response(\n- self._post(ENDPOINTS['chrome']['manifest'],\n+ self._post(ENDPOINTS['manifest'],\nself.request_builder.handshake_request(esn)))\nheaderdata = json.loads(\nbase64.standard_b64decode(response['headerdata']))\n@@ -106,7 +102,8 @@ class MSLHandler(object):\n:return: MPD XML Manifest or False if no success\n\"\"\"\nmanifest = self._load_manifest(viewable_id, g.get_esn())\n- if SDKVERSION < 18 and not has_1080p(manifest):\n+ if (g.ADDON.getSettingBool('enable_1080p_unlock') and\n+ not has_1080p(manifest)):\ncommon.debug('Manifest has no 1080p viewables')\nmanifest = self.get_edge_manifest(viewable_id, manifest)\nreturn self.__tranform_to_dash(manifest)\n@@ -132,7 +129,7 @@ class MSLHandler(object):\n.format(viewable_id, esn))\nmanifest_request_data = {\n'method': 'manifest',\n- 'lookupType': 'STANDARD',\n+ 'lookupType': 'PREPARE',\n'viewableIds': [viewable_id],\n'profiles': enabled_profiles(),\n'drmSystem': 'widevine',\n@@ -143,7 +140,7 @@ class MSLHandler(object):\n},\n'sessionId': '14673889385265',\n'trackId': 0,\n- 'flavor': 'STANDARD',\n+ 'flavor': 'PRE_FETCH',\n'secureUrls': False,\n'supportPreviewContent': True,\n'forceClearStreams': False,\n@@ -151,7 +148,7 @@ class MSLHandler(object):\n'clientVersion': '4.0004.899.011',\n'uiVersion': 'akira'\n}\n- manifest = self._chunked_request(ENDPOINTS['chrome']['manifest'],\n+ manifest = self._chunked_request(ENDPOINTS['manifest'],\nmanifest_request_data, esn)\ncommon.save_file('manifest.json', json.dumps(manifest))\nreturn manifest['result']['viewables'][0]\n@@ -181,7 +178,7 @@ class MSLHandler(object):\n'clientTime': int(time.time()),\n'xid': int((int(time.time()) + 0.1612) * 1000)\n}\n- response = self._chunked_request(ENDPOINTS['chrome']['license'],\n+ response = self._chunked_request(ENDPOINTS['license'],\nlicense_request_data, g.get_esn())\ncommon.debug(response)\nreturn response['result']['licenses'][0]['data']\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession.py",
"new_path": "resources/lib/services/nfsession.py",
"diff": "@@ -164,7 +164,7 @@ class NetflixSession(object):\ntry:\n# If we can get session data, cookies are still valid\nself.session_data = website.extract_session_data(\n- self._get('browse'))\n+ self._get('profiles'))\nexcept Exception:\ncommon.debug(traceback.format_exc())\ncommon.info('Failed to refresh session data, login expired')\n@@ -206,7 +206,7 @@ class NetflixSession(object):\n\"\"\"Perform account login\"\"\"\ntry:\nauth_url = website.extract_userdata(\n- self._get('browse'))['authURL']\n+ self._get('profiles'))['authURL']\ncommon.debug('Logging in...')\nlogin_response = self._post(\n'login',\n"
},
{
"change_type": "DELETE",
"old_path": "resources/lib/services/playback/bookmarks.py",
"new_path": null,
"diff": "-# -*- coding: utf-8 -*-\n-\n-\"\"\"Save bookmarks for library items and mark them as watched\"\"\"\n-from __future__ import unicode_literals\n-\n-import resources.lib.common as common\n-\n-from .action_manager import PlaybackActionManager\n-from .markers import OFFSET_WATCHED_TO_END\n-\n-\n-class BookmarkManager(PlaybackActionManager):\n- \"\"\"\n- Saves bookmarks on each playback tick if the played item exists in the\n- Kodi library and marks it as watched after playback.\n- \"\"\"\n- def __init__(self):\n- super(BookmarkManager, self).__init__()\n- self.infos = None\n- self.markers = None\n- self.progress = 0\n- self.elapsed = 0\n-\n- def __str__(self):\n- return ('enabled={}, dbinfo={}, markers={}'\n- .format(self.enabled, self.infos, self.markers))\n-\n- def _initialize(self, data):\n- if 'DBID' in data['infos']:\n- self.infos = data['infos']\n- self.markers = data['timeline_markers']\n- self.progress = 0\n- self.elapsed = 0\n- else:\n- self.enabled = False\n-\n- def _on_playback_stopped(self):\n- if self._watched_to_end():\n- self._mark_as_watched()\n- else:\n- common.debug('Progress insufficient, not marking {} as watched.'\n- .format(self.infos))\n- self.infos = None\n- self.markers = None\n-\n- def _on_tick(self, player_state):\n- self.progress = player_state['percentage']\n- self.elapsed = player_state['elapsed_seconds']\n- if self.progress > 5 and self.elapsed % 5 == 0:\n- self._save_bookmark()\n-\n- def _save_bookmark(self):\n- common.debug('Saving bookmark for {} at {}s'.format(self.infos,\n- self.elapsed))\n- common.update_library_item_details(\n- self.infos['mediatype'], self.infos['DBID'],\n- {'resume': {'position': self.elapsed}})\n-\n- def _watched_to_end(self):\n- if OFFSET_WATCHED_TO_END in self.markers:\n- return self.elapsed >= self.markers[OFFSET_WATCHED_TO_END]\n- return self.progress >= 90\n-\n- def _mark_as_watched(self):\n- common.info('Marking {} as watched'.format(self.infos))\n- common.update_library_item_details(\n- self.infos['mediatype'], self.infos['DBID'],\n- {'playcount': self.infos.get('playcount', 0) + 1,\n- 'resume': {'position': 0}})\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/playback/controller.py",
"new_path": "resources/lib/services/playback/controller.py",
"diff": "@@ -12,7 +12,6 @@ from resources.lib.globals import g\nimport resources.lib.common as common\nfrom .action_manager import PlaybackActionManager\n-from .bookmarks import BookmarkManager\nfrom .section_skipping import SectionSkipper\nfrom .stream_continuity import StreamContinuityManager\nfrom .upnext import UpNextNotifier\n@@ -42,7 +41,6 @@ class PlaybackController(xbmc.Monitor):\nself.tracking = True\nself.active_player_id = None\nself.action_managers = [\n- BookmarkManager(),\nSectionSkipper(),\nStreamContinuityManager(),\nUpNextNotifier()\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<setting id=\"viewmodeexported\" type=\"number\" label=\"30074\" enable=\"eq(-7,true)\" default=\"504\"/>\n</category>\n<category label=\"30078\">\n- <setting id=\"BookmarkManager_enabled\" type=\"bool\" label=\"30083\" default=\"true\"/>\n+ <setting id=\"BookmarkManager_enabled\" type=\"bool\" label=\"30083\" visible=\"false\" default=\"true\"/>\n<setting id=\"StreamContinuityManager_enabled\" type=\"bool\" label=\"30082\" default=\"true\"/>\n<setting id=\"SectionSkipper_enabled\" type=\"bool\" label=\"30075\" default=\"true\"/>\n<setting id=\"auto_skip_credits\" type=\"bool\" label=\"30079\" default=\"false\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n</category>\n<category label=\"30023\">\n<setting label=\"30115\" type=\"lsep\"/>\n+ <setting id=\"enable_1080p_unlock\" type=\"bool\" label=\"30136\" default=\"false\"/>\n<setting id=\"enable_dolby_sound\" type=\"bool\" label=\"30033\" default=\"true\"/>\n<setting id=\"enable_atmos_sound\" type=\"bool\" label=\"30111\" default=\"false\"/>\n<setting id=\"enable_hevc_profiles\" type=\"bool\" label=\"30060\" default=\"false\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Make 1080p workaround toggleable. Fix watched status issues. |
105,989 | 20.11.2018 22:10:15 | -3,600 | 3b9df2052d214128faf4e83ba306c80b9d38bd84 | Fix cookie loading and recurring login issues. Fix KeyError on playcount in Up Next integration. Fix playback issues due to Netflix changes. | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/player.py",
"new_path": "resources/lib/navigation/player.py",
"diff": "@@ -174,7 +174,7 @@ def upnext_info(videoid, infos, art):\n},\n'plot': infos['plot'],\n'showtitle': infos['tvshowtitle'],\n- 'playcount': infos['playcount'],\n+ 'playcount': infos.get('playcount', 0),\n'season': infos['season'],\n'episode': infos['episode'],\n'rating': infos.get('rating', infos.get('userrating', '')),\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/cookies.py",
"new_path": "resources/lib/services/cookies.py",
"diff": "@@ -51,37 +51,36 @@ def delete(account_hash):\ndef load(account_hash):\n\"\"\"Load cookies for a given account and check them for validity\"\"\"\n- cookie_jar = (g.COOKIES.get(account_hash) or\n- load_from_file(account_hash))\n-\n- if expired(cookie_jar):\n- raise CookiesExpiredError()\n-\n- g.COOKIES[account_hash] = cookie_jar\n-\n- return cookie_jar\n-\n-\n-def load_from_file(account_hash):\n- \"\"\"Load cookies for a given account from file\"\"\"\n- common.debug('Loading cookies from file')\n- cookie_file = xbmcvfs.File(cookie_filename(account_hash), 'r')\ntry:\n- return pickle.loads(cookie_file.read())\n+ filename = cookie_filename(account_hash)\n+ common.debug('Loading cookies from {}'.format(filename))\n+ cookie_file = xbmcvfs.File(filename, 'r')\n+ cookie_jar = pickle.loads(cookie_file.read())\nexcept Exception as exc:\ncommon.debug('Failed to load cookies from file: {exc}', exc)\nraise MissingCookiesError()\nfinally:\ncookie_file.close()\n+ # Clear flwssn cookie if present, as it is trouble with early expiration\n+ try:\n+ cookie_jar.clear(domain='.netflix.com', path='/', name='flwssn')\n+ except KeyError:\n+ pass\n+ common.debug('Loaded cookies:\\n' + '\\n'.join(\n+ ['{} ({}m remaining TTL'.format(cookie.name,\n+ ((cookie.expires or 0) - time() / 60))\n+ for cookie in cookie_jar]))\n+ if expired(cookie_jar):\n+ raise CookiesExpiredError()\n+ return cookie_jar\ndef expired(cookie_jar):\n\"\"\"Check if one of the cookies in the jar is already expired\"\"\"\nearliest_expiration = 99999999999999999999\nfor cookie in cookie_jar:\n- if (cookie.expires is not None and\n- int(cookie.expires) < earliest_expiration):\n- earliest_expiration = int(cookie.expires)\n+ if cookie.expires is not None:\n+ earliest_expiration = min(int(cookie.expires), earliest_expiration)\nreturn int(time()) > earliest_expiration\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/converter.py",
"new_path": "resources/lib/services/msl/converter.py",
"diff": "@@ -90,27 +90,38 @@ def _add_protection_info(adaptation_set, pssh, keyid):\ndef _convert_video_downloadable(downloadable, adaptation_set,\ninit_length):\n- codec = ('hevc'\n- if 'hevc' in downloadable['contentProfile']\n- else 'h264')\n- hdcp_versions = next((hdcp\n- for hdcp\n- in downloadable['hdcpVersions']\n- if hdcp != 'none'), '0.0')\nrepresentation = ET.SubElement(\nparent=adaptation_set,\ntag='Representation',\nwidth=str(downloadable['width']),\nheight=str(downloadable['height']),\nbandwidth=str(downloadable['bitrate']*1024),\n- hdcp=hdcp_versions,\n+ hdcp=_determine_hdcp_version(downloadable['hdcpVersions']),\nnflxContentProfile=str(downloadable['contentProfile']),\n- codecs=codec,\n+ codecs=_determine_video_codec(downloadable['contentProfile']),\nmimeType='video/mp4')\n_add_base_url(representation, downloadable)\n_add_segment_base(representation, init_length)\n+def _determine_hdcp_version(hdcp_versions):\n+ hdcp_version = '0.0'\n+ for hdcp in hdcp_versions:\n+ if hdcp != 'none':\n+ hdcp_version = hdcp if hdcp != 'any' else '1.0'\n+ return hdcp_version\n+\n+\n+def _determine_video_codec(content_profile):\n+ if 'hevc' in content_profile:\n+ return 'hevc'\n+ elif content_profile == 'vp9-profile0-L30-dash-cenc':\n+ return 'vp9.0.30'\n+ elif content_profile == 'vp9-profile0-L31-dash-cenc':\n+ return 'vp9.0.31'\n+ return 'h264'\n+\n+\ndef _convert_audio_track(audio_track, period, init_length, default):\nadaptation_set = ET.SubElement(\nparent=period,\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/profiles.py",
"new_path": "resources/lib/services/msl/profiles.py",
"diff": "@@ -10,7 +10,7 @@ HEVC = 'hevc-main-'\nHEVC_M10 = 'hevc-main10-'\nCENC_PRK = 'dash-cenc-prk'\nCENC = 'dash-cenc'\n-CENC_TL = 'dash-cenc-tl'\n+CENC_TL = 'dash-cenc-ctl'\nHDR = 'hevc-hdr-main10-'\nDV = 'hevc-dv-main10-'\nDV5 = 'hevc-dv5-main10-'\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession.py",
"new_path": "resources/lib/services/nfsession.py",
"diff": "@@ -152,10 +152,8 @@ class NetflixSession(object):\[email protected]_execution(immediate=True)\ndef _is_logged_in(self):\n\"\"\"Check if the user is logged in\"\"\"\n- if not self.session.cookies:\n- common.debug('Active session has no cookies, trying to restore...')\n- return self._load_cookies() and self._refresh_session_data()\n- return True\n+ return (self.session.cookies or\n+ (self._load_cookies() and self._refresh_session_data()))\[email protected]_execution(immediate=True)\ndef _refresh_session_data(self):\n@@ -179,21 +177,12 @@ class NetflixSession(object):\n# pylint: disable=broad-except\ntry:\nself.session.cookies = cookies.load(self.account_hash)\n- except MissingCredentialsError:\n+ except Exception as exc:\ncommon.debug(\n- 'No stored credentials available, cannot identify account')\n- return False\n- except cookies.MissingCookiesError:\n- common.info('No stored cookies available')\n- return False\n- except cookies.CookiesExpiredError:\n- # Ignore this for now, because login is sometimes valid anyway\n- pass\n- except Exception:\n- common.error('Unexpected error while trying to load cookies. '\n- 'Maybe using old storage format?')\n+ 'Failed to load stored cookies: {}'.format(type(exc).__name__))\ncommon.debug(traceback.format_exc())\nreturn False\n+ common.debug('Successfully loaded stored cookies')\nreturn True\[email protected]_return_call\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix cookie loading and recurring login issues. Fix KeyError on playcount in Up Next integration. Fix playback issues due to Netflix changes. |
105,989 | 21.11.2018 01:33:02 | -3,600 | ba6bd4c161757c5d4e2159e2c47b1b475c193c73 | Version bump (beta16) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta15\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta16\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (beta16) |
105,989 | 21.11.2018 21:07:30 | -3,600 | be99cfd2dd78fae18a3ec25b77a0f1a6e8e16a03 | Clean up the profiles mess. Improve MSL error handling. | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta16\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta17\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -416,10 +416,6 @@ msgctxt \"#30099\"\nmsgid \"Enable DolbyVision profiles\"\nmsgstr \"\"\n-msgctxt \"#30136\"\n-msgid \"Enable VP9 profiles\"\n-msgstr \"\"\n-\nmsgctxt \"#30100\"\nmsgid \"Results for \\\"{}\\\"\"\nmsgstr \"\"\n@@ -567,3 +563,7 @@ msgstr \"\"\nmsgctxt \"#30136\"\nmsgid \"Enable 1080p Unlock (not recommended for Android)\"\nmsgstr \"\"\n+\n+msgctxt \"#30137\"\n+msgid \"Enable VP9 profiles (disables 1080p unlock)\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/misc_utils.py",
"new_path": "resources/lib/common/misc_utils.py",
"diff": "@@ -260,3 +260,8 @@ def log_time_trace():\ntime_trace.append('{:>5} ms\\n'.format(trace[1]))\ndebug(''.join(time_trace))\ng.reset_time_trace()\n+\n+\n+def is_edge_esn(esn):\n+ \"\"\"Return True if the esn is an EDGE esn\"\"\"\n+ return esn.startswith('NFCDIE-02-')\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -141,6 +141,22 @@ class GlobalVariables(object):\nreturn True\nreturn False\n+ def get_edge_esn(self):\n+ \"\"\"Get a previously generated edge ESN from the settings or generate\n+ a new one if none exists\"\"\"\n+ return self.ADDON.getSetting('edge_esn') or self.generate_edge_esn()\n+\n+ def generate_edge_esn(self):\n+ \"\"\"Generate a random EDGE ESN and save it to the settings\"\"\"\n+ import random\n+ esn = ['NFCDIE-02-']\n+ possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'\n+ for _ in range(0, 30):\n+ esn.append(random.choice(possible))\n+ edge_esn = ''.join(esn)\n+ self.ADDON.setSetting('edge_esn', edge_esn)\n+ return edge_esn\n+\ndef flush_settings(self):\n\"\"\"Reload the ADDON\"\"\"\n# pylint: disable=attribute-defined-outside-init\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/ui/dialogs.py",
"new_path": "resources/lib/kodi/ui/dialogs.py",
"diff": "@@ -88,7 +88,7 @@ def ask_for_confirmation(title, message):\ndef show_error_info(title, message, unknown_error=False, netflix_error=False):\n\"\"\"Show a dialog that displays the error message\"\"\"\n- prefix = (30104, 30101, 30102)[unknown_error + netflix_error]\n+ prefix = (30104, 30102, 30101)[unknown_error + netflix_error]\nreturn xbmcgui.Dialog().ok(title,\nline1=common.get_local_string(prefix),\nline2=message,\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/converter.py",
"new_path": "resources/lib/services/msl/converter.py",
"diff": "@@ -115,10 +115,8 @@ def _determine_hdcp_version(hdcp_versions):\ndef _determine_video_codec(content_profile):\nif 'hevc' in content_profile:\nreturn 'hevc'\n- elif content_profile == 'vp9-profile0-L30-dash-cenc':\n- return 'vp9.0.30'\n- elif content_profile == 'vp9-profile0-L31-dash-cenc':\n- return 'vp9.0.31'\n+ elif 'vp9' in content_profile:\n+ return 'vp9.0.' + content_profile[14:16]\nreturn 'h264'\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/msl_handler.py",
"new_path": "resources/lib/services/msl/msl_handler.py",
"diff": "@@ -39,10 +39,9 @@ def display_error_info(func):\ntry:\nreturn func(*args, **kwargs)\nexcept Exception as exc:\n- import traceback\n- common.error(traceback.format_exc())\nui.show_error_info(common.get_local_string(30028), exc.message,\n- unknown_error=not exc.message)\n+ unknown_error=not exc.message,\n+ netflix_error=isinstance(exc, MSLError))\nraise\nreturn error_catching_wrapper\n@@ -88,7 +87,7 @@ class MSLHandler(object):\nheaderdata = json.loads(\nbase64.standard_b64decode(response['headerdata']))\nself.request_builder.crypto.parse_key_response(\n- headerdata, not esn.startswith('NFCDIE-02-'))\n+ headerdata, not common.is_edge_esn(esn))\ncommon.debug('Key handshake successful')\n@display_error_info\n@@ -103,8 +102,9 @@ class MSLHandler(object):\n\"\"\"\nmanifest = self._load_manifest(viewable_id, g.get_esn())\nif (g.ADDON.getSettingBool('enable_1080p_unlock') and\n+ not g.ADDON.getSettingBool('enable_vp9_profiles') and\nnot has_1080p(manifest)):\n- common.debug('Manifest has no 1080p viewables')\n+ common.debug('Manifest has no 1080p viewables, trying unlock')\nmanifest = self.get_edge_manifest(viewable_id, manifest)\nreturn self.__tranform_to_dash(manifest)\n@@ -112,7 +112,7 @@ class MSLHandler(object):\n\"\"\"Load a manifest with an EDGE ESN and replace playback_context and\ndrm_context\"\"\"\ncommon.debug('Loading EDGE manifest')\n- esn = generate_edge_esn()\n+ esn = g.get_edge_esn()\ncommon.debug('Switching MSL data to EDGE')\nself.perform_key_handshake(esn)\nmanifest = self._load_manifest(viewable_id, esn)\n@@ -180,7 +180,6 @@ class MSLHandler(object):\n}\nresponse = self._chunked_request(ENDPOINTS['license'],\nlicense_request_data, g.get_esn())\n- common.debug(response)\nreturn response['result']['licenses'][0]['data']\[email protected]_execution(immediate=True)\n@@ -220,8 +219,9 @@ class MSLHandler(object):\n# json() failed so parse and decrypt the chunked response\ncommon.debug('Received encrypted chunked response')\nresponse = _parse_chunks(response.text)\n- return _decrypt_chunks(response['payloads'],\n+ decrypted_response = _decrypt_chunks(response['payloads'],\nself.request_builder.crypto)\n+ return _raise_if_error(decrypted_response)\[email protected]_execution(immediate=True)\n@@ -235,8 +235,9 @@ def _process_json_response(response):\ndef _raise_if_error(decoded_response):\nif ('errordata' in decoded_response or\n- 'errorDisplayMessage' in decoded_response.get('result', {}) or\nnot decoded_response.get('success', True)):\n+ common.error('Full MSL error information:')\n+ common.error(json.dumps(decoded_response))\nraise MSLError(_get_error_details(decoded_response))\nreturn decoded_response\n@@ -246,11 +247,10 @@ def _get_error_details(decoded_response):\nreturn json.loads(\nbase64.standard_b64decode(\ndecoded_response['errordata']))['errormsg']\n- elif 'errorDisplayMessage' in decoded_response.get('result', {}):\n+ elif decoded_response.get('result', {}).get('errorDisplayMessage'):\nreturn decoded_response['result']['errorDisplayMessage']\n-\n- common.error('Received an unknown error from MSL endpoint:\\n{}'\n- .format(json.dumps(decoded_response)))\n+ elif decoded_response.get('result', {}).get('errorDetails'):\n+ return decoded_response['result']['errorDetails']\nreturn ''\n@@ -295,15 +295,5 @@ def _decrypt_chunks(chunks, crypto):\ndef has_1080p(manifest):\n\"\"\"Return True if any of the video tracks in manifest have a 1080p profile\navailable, else False\"\"\"\n- return any(video['contentProfile'] == 'playready-h264mpl40-dash'\n+ return any(video['width'] >= 1920\nfor video in manifest['videoTracks'][0]['downloadables'])\n-\n-\n-def generate_edge_esn():\n- \"\"\"Generate a random EDGE ESN\"\"\"\n- import random\n- esn = ['NFCDIE-02-']\n- possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'\n- for _ in range(0, 30):\n- esn.append(random.choice(possible))\n- return''.join(esn)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/profiles.py",
"new_path": "resources/lib/services/msl/profiles.py",
"diff": "@@ -14,6 +14,7 @@ CENC_TL = 'dash-cenc-ctl'\nHDR = 'hevc-hdr-main10-'\nDV = 'hevc-dv-main10-'\nDV5 = 'hevc-dv5-main10-'\n+VP9 = 'vp9-profile0-'\nBASE_LEVELS = ['L30-', 'L31-', 'L40-', 'L41-', 'L50-', 'L51-']\nCENC_TL_LEVELS = ['L30-L31-', 'L31-L40-', 'L40-L41-', 'L50-L51-']\n@@ -27,20 +28,16 @@ def _profile_strings(base, tails):\nPROFILES = {\n'base': [\n- # Video\n- 'playready-h264bpl30-dash', 'playready-h264mpl30-dash',\n- 'playready-h264mpl31-dash', 'playready-h264mpl40-dash',\n+ # include bogus hevc profile to work around missing prk profile error\n+ 'hevc-main10-L30-dash-cenc-prk',\n# Audio\n'heaac-2-dash',\n- # 'heaac-5.1-dash',\n- # Subtiltes\n- # 'dfxp-ls-sdh',\n- # 'simplesdh',\n- # 'nflx-cmisc',\n# Unkown\n'BIF240', 'BIF320'],\n- 'dolbysound': ['ddplus-2.0-dash', 'ddplus-5.1-dash'],\n- 'atmos': ['ddplus-atmos-dash'],\n+ 'dolbysound': ['ddplus-2.0-dash', 'ddplus-5.1-dash', 'ddplus-5.1hq-dash',\n+ 'ddplus-atmos-dash'],\n+ 'h264': ['playready-h264mpl30-dash', 'playready-h264mpl31-dash',\n+ 'playready-h264mpl40-dash', 'playready-h264mpl41-dash'],\n'hevc':\n_profile_strings(base=HEVC,\ntails=[(BASE_LEVELS, CENC),\n@@ -58,24 +55,26 @@ PROFILES = {\ntails=[(BASE_LEVELS, CENC)]) +\n_profile_strings(base=DV5,\ntails=[(BASE_LEVELS, CENC_PRK)]),\n- 'vp9': ['vp9-profile0-L30-dash-cenc', 'vp9-profile0-L31-dash-cenc']\n+ 'vp9':\n+ _profile_strings(base=VP9,\n+ tails=[(BASE_LEVELS, CENC)])\n}\ndef enabled_profiles():\n\"\"\"Return a list of all base and enabled additional profiles\"\"\"\nreturn (PROFILES['base'] +\n+ PROFILES['h264'] +\n_subtitle_profiles() +\n+ _additional_profiles('vp9', 'enable_vp9_profiles') +\n_additional_profiles('dolbysound', 'enable_dolby_sound') +\n- _additional_profiles('atmos', 'enable_atmos_sound') +\n_additional_profiles('hevc', 'enable_hevc_profiles') +\n_additional_profiles('hdr',\n['enable_hevc_profiles',\n'enable_hdr_profiles']) +\n_additional_profiles('dolbyvision',\n['enable_hevc_profiles',\n- 'enable_dolbyvision_profiles']) +\n- _vp9_profiles())\n+ 'enable_dolbyvision_profiles']))\ndef _subtitle_profiles():\n@@ -90,10 +89,3 @@ def _additional_profiles(profiles, settings):\nreturn (PROFILES[profiles]\nif all(g.ADDON.getSettingBool(setting) for setting in settings)\nelse [])\n-\n-\n-def _vp9_profiles():\n- return (PROFILES['vp9']\n- if (not g.ADDON.getSettingBool('enable_hevc_profiles') or\n- g.ADDON.getSettingBool('enable_vp9_profiles'))\n- else [])\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<category label=\"30023\">\n<setting label=\"30115\" type=\"lsep\"/>\n<setting id=\"enable_1080p_unlock\" type=\"bool\" label=\"30136\" default=\"false\"/>\n+ <setting id=\"enable_vp9_profiles\" type=\"bool\" label=\"30137\" default=\"false\"/>\n<setting id=\"enable_dolby_sound\" type=\"bool\" label=\"30033\" default=\"true\"/>\n- <setting id=\"enable_atmos_sound\" type=\"bool\" label=\"30111\" default=\"false\"/>\n+ <setting id=\"enable_atmos_sound\" type=\"bool\" label=\"30111\" default=\"false\" visible=\"false\"/> <!-- Deprecated (always on now) -->\n<setting id=\"enable_hevc_profiles\" type=\"bool\" label=\"30060\" default=\"false\"/>\n<setting id=\"enable_hdr_profiles\" type=\"bool\" label=\"30098\" default=\"false\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n<setting id=\"enable_dolbyvision_profiles\" type=\"bool\" label=\"30099\" default=\"false\" visible=\"eq(-2,true)\" subsetting=\"true\"/>\n- <setting id=\"enable_vp9_profiles\" type=\"bool\" label=\"30136\" default=\"false\" visible=\"eq(-3,true)\" subsetting=\"true\"/>\n<setting label=\"30116\" type=\"lsep\"/>\n<setting id=\"enable_timing\" type=\"bool\" label=\"30134\" default=\"false\"/>\n<setting id=\"disable_modal_error_display\" type=\"bool\" label=\"30130\" default=\"false\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Clean up the profiles mess. Improve MSL error handling. |
105,989 | 24.11.2018 15:55:39 | -3,600 | b32dca81a0563dcfba02dad3bcd59d8ea5ce37e0 | Fix profiles issues. Disable 1080 Unlock permanently (broken for good). | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/misc_utils.py",
"new_path": "resources/lib/common/misc_utils.py",
"diff": "@@ -265,3 +265,18 @@ def log_time_trace():\ndef is_edge_esn(esn):\n\"\"\"Return True if the esn is an EDGE esn\"\"\"\nreturn esn.startswith('NFCDIE-02-')\n+\n+\n+def is_minimum_version(version, min_version):\n+ \"\"\"Rrturn True if version is equal or greater to min_version\"\"\"\n+ return map(int, version.split('.')) >= map(int, min_version.split('.'))\n+\n+\n+def make_list(arg):\n+ \"\"\"Return a list with arg as its member or arg if arg is already a list.\n+ Returns an empty list if arg is None\"\"\"\n+ return (arg\n+ if isinstance(arg, list)\n+ else ([arg]\n+ if arg is not None\n+ else []))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -192,7 +192,7 @@ def add_info_from_netflix(videoid, list_item):\ninfos = add_info(videoid, list_item, None, None)\nart = add_art(videoid, list_item, None)\ncommon.debug('Got infolabels and art from cache')\n- except TypeError:\n+ except (AttributeError, TypeError):\ncommon.info('Infolabels or art were not in cache, retrieving from API')\nimport resources.lib.api.shakti as api\napi_data = api.single_info(videoid)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/converter.py",
"new_path": "resources/lib/services/msl/converter.py",
"diff": "@@ -138,12 +138,10 @@ def _convert_audio_track(audio_track, period, init_length, default):\ndef _convert_audio_downloadable(downloadable, adaptation_set, init_length,\nchannels_count):\n- is_dplus2 = downloadable['contentProfile'] == 'ddplus-2.0-dash'\n- is_dplus5 = downloadable['contentProfile'] == 'ddplus-5.1-dash'\nrepresentation = ET.SubElement(\nparent=adaptation_set,\ntag='Representation',\n- codecs='ec-3' if is_dplus2 or is_dplus5 else 'aac',\n+ codecs='ec-3' if 'ddplus' in downloadable['contentProfile'] else 'aac',\nbandwidth=str(downloadable['bitrate'] * 1024),\nmimeType='audio/mp4')\nET.SubElement(\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/msl_handler.py",
"new_path": "resources/lib/services/msl/msl_handler.py",
"diff": "@@ -101,11 +101,12 @@ class MSLHandler(object):\n:return: MPD XML Manifest or False if no success\n\"\"\"\nmanifest = self._load_manifest(viewable_id, g.get_esn())\n- if (g.ADDON.getSettingBool('enable_1080p_unlock') and\n- not g.ADDON.getSettingBool('enable_vp9_profiles') and\n- not has_1080p(manifest)):\n- common.debug('Manifest has no 1080p viewables, trying unlock')\n- manifest = self.get_edge_manifest(viewable_id, manifest)\n+ # Disable 1080p Unlock for now, as it is broken due to Netflix changes\n+ # if (g.ADDON.getSettingBool('enable_1080p_unlock') and\n+ # not g.ADDON.getSettingBool('enable_vp9_profiles') and\n+ # not has_1080p(manifest)):\n+ # common.debug('Manifest has no 1080p viewables, trying unlock')\n+ # manifest = self.get_edge_manifest(viewable_id, manifest)\nreturn self.__tranform_to_dash(manifest)\ndef get_edge_manifest(self, viewable_id, chrome_manifest):\n@@ -127,11 +128,15 @@ class MSLHandler(object):\ndef _load_manifest(self, viewable_id, esn):\ncommon.debug('Requesting manifest for {} with ESN {}'\n.format(viewable_id, esn))\n+ profiles = enabled_profiles()\n+ import pprint\n+ common.debug('Requested profiles:\\n{}'\n+ .format(pprint.pformat(profiles, indent=2)))\nmanifest_request_data = {\n'method': 'manifest',\n'lookupType': 'PREPARE',\n'viewableIds': [viewable_id],\n- 'profiles': enabled_profiles(),\n+ 'profiles': profiles,\n'drmSystem': 'widevine',\n'appId': '14673889385265',\n'sessionParams': {\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/profiles.py",
"new_path": "resources/lib/services/msl/profiles.py",
"diff": "@@ -5,6 +5,7 @@ from __future__ import unicode_literals\nimport xbmcaddon\nfrom resources.lib.globals import g\n+import resources.lib.common as common\nHEVC = 'hevc-main-'\nHEVC_M10 = 'hevc-main10-'\n@@ -28,8 +29,6 @@ def _profile_strings(base, tails):\nPROFILES = {\n'base': [\n- # include bogus hevc profile to work around missing prk profile error\n- 'hevc-main10-L30-dash-cenc-prk',\n# Audio\n'heaac-2-dash',\n# Unkown\n@@ -66,7 +65,7 @@ def enabled_profiles():\nreturn (PROFILES['base'] +\nPROFILES['h264'] +\n_subtitle_profiles() +\n- _additional_profiles('vp9', 'enable_vp9_profiles') +\n+ _additional_profiles('vp9', forb_settings='enable_hevc_profiles') +\n_additional_profiles('dolbysound', 'enable_dolby_sound') +\n_additional_profiles('hevc', 'enable_hevc_profiles') +\n_additional_profiles('hdr',\n@@ -78,14 +77,16 @@ def enabled_profiles():\ndef _subtitle_profiles():\n- inputstream_addon = xbmcaddon.Addon('inputstream.adaptive')\n+ isversion = xbmcaddon.Addon('inputstream.adaptive').getAddonInfo('version')\nreturn ['webvtt-lssdh-ios8'\n- if inputstream_addon.getAddonInfo('version') >= '2.3.8'\n+ if common.is_minimum_version(isversion, '2.3.8')\nelse 'simplesdh']\n-def _additional_profiles(profiles, settings):\n- settings = settings if isinstance(settings, list) else [settings]\n+def _additional_profiles(profiles, req_settings=None, forb_settings=None):\nreturn (PROFILES[profiles]\n- if all(g.ADDON.getSettingBool(setting) for setting in settings)\n+ if (all(g.ADDON.getSettingBool(setting)\n+ for setting in common.make_list(req_settings)) and\n+ not (any(g.ADDON.getSettingBool(setting)\n+ for setting in common.make_list(forb_settings))))\nelse [])\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "</category>\n<category label=\"30023\">\n<setting label=\"30115\" type=\"lsep\"/>\n- <setting id=\"enable_1080p_unlock\" type=\"bool\" label=\"30136\" default=\"false\"/>\n- <setting id=\"enable_vp9_profiles\" type=\"bool\" label=\"30137\" default=\"false\"/>\n+ <setting id=\"enable_1080p_unlock\" type=\"bool\" label=\"30136\" default=\"false\" visible=\"false\"/> <!-- Deprecated (broken) -->\n+ <setting id=\"enable_vp9_profiles\" type=\"bool\" label=\"30137\" default=\"false\" visible=\"false\"/> <!-- Deprecated (always on now) -->\n<setting id=\"enable_dolby_sound\" type=\"bool\" label=\"30033\" default=\"true\"/>\n- <setting id=\"enable_atmos_sound\" type=\"bool\" label=\"30111\" default=\"false\" visible=\"false\"/> <!-- Deprecated (always on now) -->\n+ <setting id=\"enable_atmos_sound\" type=\"bool\" label=\"30111\" default=\"false\" visible=\"false\"/> <!-- Deprecated (linked to dolby_sound) -->\n<setting id=\"enable_hevc_profiles\" type=\"bool\" label=\"30060\" default=\"false\"/>\n<setting id=\"enable_hdr_profiles\" type=\"bool\" label=\"30098\" default=\"false\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n<setting id=\"enable_dolbyvision_profiles\" type=\"bool\" label=\"30099\" default=\"false\" visible=\"eq(-2,true)\" subsetting=\"true\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix profiles issues. Disable 1080 Unlock permanently (broken for good). |
105,989 | 24.11.2018 17:59:16 | -3,600 | 3deceece88e62bb67b2e0c00ce3706ab84f32a69 | Add option to use inter-process communication via HTTP instead of AddonSignals | [
{
"change_type": "MODIFY",
"old_path": "addon.py",
"new_path": "addon.py",
"diff": "@@ -83,14 +83,19 @@ if __name__ == '__main__':\n# (necessary when reusing language invoker)\ncommon.info('Started (Version {})'.format(g.VERSION))\ncommon.info('URL is {}'.format(g.URL))\n+ success = False\ntry:\nroute(filter(None, g.PATH.split('/')))\n+ success = True\n+ except common.BackendNotReady:\n+ ui.show_backend_not_ready()\nexcept Exception as exc:\nimport traceback\ncommon.error(traceback.format_exc())\nui.show_addon_error_info(exc)\n- xbmcplugin.endOfDirectory(handle=g.PLUGIN_HANDLE, succeeded=False)\n+\n+ xbmcplugin.endOfDirectory(g.PLUGIN_HANDLE, succeeded=success)\ng.CACHE.commit()\ncommon.log_time_trace()\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -567,3 +567,11 @@ msgstr \"\"\nmsgctxt \"#30137\"\nmsgid \"Enable VP9 profiles (disables 1080p unlock)\"\nmsgstr \"\"\n+\n+msgctxt \"#30138\"\n+msgid \"The requested action timed out. The background services may not yet be available if you just started Kodi/the addon. In this case, try again in a moment.\"\n+msgstr \"\"\n+\n+msgctxt \"#30139\"\n+msgid \"Enable IPC over HTTP (use when experiencing AddonSignals timeouts)\"\n+msgstr \"\"\n"
},
{
"change_type": "RENAME",
"old_path": "resources/lib/services/cookies.py",
"new_path": "resources/lib/common/cookies.py",
"diff": ""
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/ipc.py",
"new_path": "resources/lib/common/ipc.py",
"diff": "@@ -14,6 +14,11 @@ from .logging import debug, error\nfrom .misc_utils import time_execution\n+class BackendNotReady(Exception):\n+ \"\"\"The background services are not started yet\"\"\"\n+ pass\n+\n+\nclass Signals(object):\n\"\"\"Signal names for use with AddonSignals\"\"\"\n# pylint: disable=too-few-public-methods\n@@ -50,24 +55,56 @@ def send_signal(signal, data=None):\n@time_execution(immediate=False)\ndef make_call(callname, data=None):\n- \"\"\"Make a call via AddonSignals and wait for it to return.\n+ if g.IPC_OVER_HTTP:\n+ return make_http_call(callname, data)\n+ return make_addonsignals_call(callname, data)\n+\n+\n+def make_http_call(callname, data):\n+ \"\"\"Make an IPC call via HTTP and wait for it to return.\n+ The contents of data will be expanded to kwargs and passed into the target\n+ function.\"\"\"\n+ from collections import OrderedDict\n+ import urllib2\n+ import json\n+ # don't use proxy for localhost\n+ url = 'http://127.0.0.1:{}/{}'.format(\n+ g.ADDON.getSetting('ns_service_port'), callname)\n+ urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler({})))\n+ try:\n+ result = json.loads(\n+ urllib2.urlopen(url=url, data=json.dumps(data)).read(),\n+ object_pairs_hook=OrderedDict)\n+ except urllib2.URLError:\n+ raise BackendNotReady\n+ _raise_for_error(callname, result)\n+ return result\n+\n+\n+def make_addonsignals_call(callname, data):\n+ \"\"\"Make an IPC call via AddonSignals and wait for it to return.\nThe contents of data will be expanded to kwargs and passed into the target\nfunction.\"\"\"\n+ debug('Handling AddonSignals IPC call to {}'.format(callname))\nresult = AddonSignals.makeCall(\nsource_id=g.ADDON_ID,\nsignal=callname,\ndata=data,\ntimeout_ms=10000)\n+ _raise_for_error(callname, result)\n+ if result is None:\n+ raise Exception('AddonSignals call timed out')\n+ return result\n+\n+\n+def _raise_for_error(callname, result):\nif isinstance(result, dict) and 'error' in result:\n- error('AddonSignals call {callname} returned {error}: {message}'\n+ error('IPC call {callname} returned {error}: {message}'\n.format(callname=callname, **result))\ntry:\nraise apierrors.__dict__[result['error']](result['message'])\nexcept KeyError:\nraise Exception(result['error'])\n- elif result is None:\n- raise Exception('AddonSignals call timed out')\n- return result\ndef addonsignals_return_call(func):\n@@ -79,14 +116,16 @@ def addonsignals_return_call(func):\nhandles catching, conversion and forwarding of exceptions\"\"\"\n# pylint: disable=broad-except\ntry:\n- result = _call(instance, func, data)\n+ result = call(instance, func, data)\nexcept Exception as exc:\n- error('AddonSignals callback raised exception: {exc}', exc)\n+ error('IPC callback raised exception: {exc}', exc)\nerror(traceback.format_exc())\nresult = {\n'error': exc.__class__.__name__,\n'message': exc.__unicode__()\n}\n+ if g.IPC_OVER_HTTP:\n+ return result\n# Do not return None or AddonSignals will keep waiting till timeout\nif result is None:\nresult = False\n@@ -95,7 +134,7 @@ def addonsignals_return_call(func):\nreturn make_return_call\n-def _call(instance, func, data):\n+def call(instance, func, data):\nif isinstance(data, dict):\nreturn func(instance, **data)\nelif data is not None:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/misc_utils.py",
"new_path": "resources/lib/common/misc_utils.py",
"diff": "@@ -35,11 +35,11 @@ def find_episode_metadata(videoid, metadata):\nseason)\n-def select_port():\n+def select_port(service):\n\"\"\"Select a port for a server and store it in the settings\"\"\"\nport = select_unused_port()\n- g.ADDON.setSetting('msl_service_port', str(port))\n- info('[MSL] Picked Port: {}'.format(port))\n+ g.ADDON.setSetting('{}_service_port'.format(service.lower()), str(port))\n+ info('[{}] Picked Port: {}'.format(service, port))\nreturn port\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -83,6 +83,7 @@ class GlobalVariables(object):\nself.REQUEST_PARAMS = dict(parse_qsl(self.PARAM_STRING))\nself.reset_time_trace()\nself.TIME_TRACE_ENABLED = self.ADDON.getSettingBool('enable_timing')\n+ self.IPC_OVER_HTTP = self.ADDON.getSettingBool('enable_ipc_over_http')\ntry:\nos.mkdir(self.DATA_PATH)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/listings.py",
"new_path": "resources/lib/kodi/listings.py",
"diff": "@@ -292,4 +292,3 @@ def finalize_directory(items, content_type=CONTENT_FOLDER, refresh=False,\nxbmcplugin.setPluginCategory(g.PLUGIN_HANDLE, title)\nxbmcplugin.addDirectoryItems(g.PLUGIN_HANDLE, items)\nxbmcplugin.setContent(g.PLUGIN_HANDLE, content_type)\n- xbmcplugin.endOfDirectory(g.PLUGIN_HANDLE, updateListing=refresh)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/ui/dialogs.py",
"new_path": "resources/lib/kodi/ui/dialogs.py",
"diff": "@@ -86,6 +86,11 @@ def ask_for_confirmation(title, message):\nreturn xbmcgui.Dialog().yesno(heading=title, line1=message)\n+def show_backend_not_ready():\n+ return xbmcgui.Dialog().ok(common.get_local_string(30105),\n+ line1=common.get_local_string(30138))\n+\n+\ndef show_error_info(title, message, unknown_error=False, netflix_error=False):\n\"\"\"Show a dialog that displays the error message\"\"\"\nprefix = (30104, 30102, 30101)[unknown_error + netflix_error]\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/__init__.py",
"new_path": "resources/lib/services/__init__.py",
"diff": "from __future__ import unicode_literals\nfrom .msl.http_server import MSLTCPServer\n+from .nfsession.http_server import NetflixTCPServer\nfrom .library_updater import LibraryUpdateService\nfrom .playback.controller import PlaybackController\n"
},
{
"change_type": "ADD",
"old_path": "resources/lib/services/nfsession/__init__.py",
"new_path": "resources/lib/services/nfsession/__init__.py",
"diff": ""
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "resources/lib/services/nfsession/http_server.py",
"diff": "+# -*- coding: utf-8 -*-\n+\"\"\"HTTP Endpoint for Netflix session management\"\"\"\n+from __future__ import unicode_literals\n+\n+import json\n+import BaseHTTPServer\n+\n+from SocketServer import TCPServer\n+import resources.lib.common as common\n+\n+from .nfsession import NetflixSession\n+\n+\n+class NetflixHttpRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n+ \"\"\"Handles & translates requests from Inputstream to Netflix\"\"\"\n+ # pylint: disable=invalid-name, broad-except\n+ def do_HEAD(self):\n+ \"\"\"Answers head requests with a success code\"\"\"\n+ self.send_response(200)\n+\n+ def do_POST(self):\n+ \"\"\"Loads the licence for the requested resource\"\"\"\n+ common.debug('Handling HTTP IPC call to {}'.format(self.path[1:]))\n+ func = getattr(NetflixSession, self.path[1:])\n+ length = int(self.headers.get('content-length', 0))\n+ data = json.loads(self.rfile.read(length)) or None\n+ result = func(self.server.netflix_session, data)\n+ self.send_response(200\n+ if (not isinstance(result, dict) or\n+ 'error' not in result)\n+ else 500)\n+ self.end_headers()\n+ self.wfile.write(json.dumps(result))\n+ self.finish()\n+\n+ def log_message(self, *args):\n+ # pylint: disable=arguments-differ\n+ \"\"\"Disable the BaseHTTPServer Log\"\"\"\n+ pass\n+\n+\n+class NetflixTCPServer(TCPServer):\n+ \"\"\"Override TCPServer to allow usage of shared members\"\"\"\n+ def __init__(self, server_address):\n+ \"\"\"Initialization of MSLTCPServer\"\"\"\n+ common.log('Constructing NetflixTCPServer')\n+ self.netflix_session = NetflixSession()\n+ TCPServer.__init__(self, server_address, NetflixHttpRequestHandler)\n"
},
{
"change_type": "RENAME",
"old_path": "resources/lib/services/nfsession.py",
"new_path": "resources/lib/services/nfsession/nfsession.py",
"diff": "@@ -11,9 +11,9 @@ import requests\nfrom resources.lib.globals import g\nimport resources.lib.common as common\n+import resources.lib.common.cookies as cookies\nimport resources.lib.api.website as website\nimport resources.lib.api.paths as apipaths\n-import resources.lib.services.cookies as cookies\nimport resources.lib.kodi.ui as ui\nfrom resources.lib.api.exceptions import (NotLoggedInError, LoginFailedError,\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<setting id=\"UpNextNotifier_enabled\" type=\"bool\" label=\"30129\" default=\"true\"/>\n</category>\n<category label=\"30023\">\n+ <setting id=\"enable_ipc_over_http\" type=\"bool\" label=\"30139\" default=\"false\"/>\n<setting label=\"30115\" type=\"lsep\"/>\n<setting id=\"enable_1080p_unlock\" type=\"bool\" label=\"30136\" default=\"false\" visible=\"false\"/> <!-- Deprecated (broken) -->\n<setting id=\"enable_vp9_profiles\" type=\"bool\" label=\"30137\" default=\"false\" visible=\"false\"/> <!-- Deprecated (always on now) -->\n<setting id=\"hidden_esn\" visible=\"false\" value=\"\" />\n<setting id=\"tracking_id\" value=\"\" visible=\"false\"/>\n<setting id=\"msl_service_port\" value=\"8000\" visible=\"false\"/>\n+ <setting id=\"ns_service_port\" value=\"8001\" visible=\"false\"/>\n<setting id=\"show_update_db\" type=\"bool\" default=\"false\" visible=\"false\"/>\n<setting label=\"30117\" type=\"lsep\"/>\n<setting id=\"cache_ttl\" type=\"slider\" option=\"int\" range=\"0,10,525600\" label=\"30084\" default=\"10\"/>\n"
},
{
"change_type": "MODIFY",
"old_path": "service.py",
"new_path": "service.py",
"diff": "@@ -22,32 +22,47 @@ g.init_globals(sys.argv)\nimport resources.lib.common as common\nimport resources.lib.services as services\nimport resources.lib.kodi.ui as ui\n-from resources.lib.services.nfsession import NetflixSession\nclass NetflixService(object):\n\"\"\"\nNetflix addon service\n\"\"\"\n+ SERVERS = [\n+ {\n+ 'name': 'MSL',\n+ 'class': services.MSLTCPServer,\n+ 'instance': None,\n+ 'thread': None},\n+ {\n+ 'name': 'NS',\n+ 'class': services.NetflixTCPServer,\n+ 'instance': None,\n+ 'thread': None},\n+ ]\n+\ndef __init__(self):\n- services.MSLTCPServer.allow_reuse_address = True\n- self.msl_server = services.MSLTCPServer(\n- ('127.0.0.1', common.select_port()))\n- self.msl_thread = threading.Thread(\n- target=self.msl_server.serve_forever)\n- self.session = None\n+ for server in self.SERVERS:\n+ self.init_server(server)\nself.controller = None\nself.library_updater = None\n+ def init_server(self, server):\n+ server['class'].allow_reuse_address = True\n+ server['instance'] = server['class'](\n+ ('127.0.0.1', common.select_port(server['name'])))\n+ server['thread'] = threading.Thread(\n+ target=server['instance'].serve_forever)\n+\ndef start_services(self):\n\"\"\"\nStart the background services\n\"\"\"\n- self.session = NetflixSession()\n- self.msl_server.server_activate()\n- self.msl_server.timeout = 1\n- self.msl_thread.start()\n- common.info('[MSL] Thread started')\n+ for server in self.SERVERS:\n+ server['instance'].server_activate()\n+ server['instance'].timeout = 1\n+ server['thread'].start()\n+ common.info('[{}] Thread started'.format(server['name']))\nself.controller = services.PlaybackController()\nself.library_updater = services.LibraryUpdateService()\nui.show_notification(common.get_local_string(30110))\n@@ -56,12 +71,12 @@ class NetflixService(object):\n\"\"\"\nStop the background services\n\"\"\"\n- del self.session\n- self.msl_server.server_close()\n- self.msl_server.shutdown()\n- self.msl_server = None\n- self.msl_thread.join()\n- self.msl_thread = None\n+ for server in self.SERVERS:\n+ server['instance'].server_close()\n+ server['instance'].shutdown()\n+ server['instance'] = None\n+ server['thread'].join()\n+ server['thread'] = None\ncommon.info('Stopped MSL Service')\ndef run(self):\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add option to use inter-process communication via HTTP instead of AddonSignals |
105,989 | 24.11.2018 18:08:19 | -3,600 | b63b3481d272a5494c109440505dcf8334064cf7 | Fix ESN generation on Android | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/website.py",
"new_path": "resources/lib/api/website.py",
"diff": "@@ -4,7 +4,7 @@ from __future__ import unicode_literals\nimport json\nimport traceback\n-from re import compile as recompile, DOTALL\n+from re import compile as recompile, DOTALL, sub\nimport resources.lib.common as common\n@@ -124,20 +124,23 @@ def generate_esn(user_data):\nmanufacturer = subprocess.check_output(\n['/system/bin/getprop', 'ro.product.manufacturer'])\nif manufacturer:\n- esn = ['NFANDROID1-PRV-']\n+ esn = ('NFANDROID1-PRV-'\n+ if subprocess.check_output(\n+ ['/system/bin/getprop', 'ro.build.characteristics']\n+ ).strip(' \\t\\n\\r') != 'tv'\n+ else 'NFANDROID2-PRV-')\ninp = subprocess.check_output(\n- ['/system/bin/getprop', 'ro.nrdp.modelgroup'])\n- if inp:\n- esn.append(inp.strip(' \\t\\n\\r'))\n- esn.append('-')\n+ ['/system/bin/getprop', 'ro.nrdp.modelgroup']).strip(' \\t\\n\\r')\n+ if not inp:\n+ esn += 'T-L3-'\nelse:\n- esn.append('T-L3-')\n- esn.append('{:5}'.format(manufacturer.strip(' \\t\\n\\r').upper()))\n+ esn += inp + '-'\n+ esn += '{:=<5}'.format(manufacturer.strip(' \\t\\n\\r').upper())\ninp = subprocess.check_output(\n['/system/bin/getprop', 'ro.product.model'])\n- esn.append(inp.strip(' \\t\\n\\r').replace(' ', '=').upper())\n- esn = ''.join(esn)\n- common.log('Android generated ESN:' + esn)\n+ esn += inp.strip(' \\t\\n\\r').replace(' ', '=').upper()\n+ esn = sub(r'[^A-Za-z0-9=-]', '=', esn)\n+ common.debug('Android generated ESN:' + esn)\nreturn esn\nexcept OSError:\npass\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix ESN generation on Android |
105,989 | 24.11.2018 19:13:42 | -3,600 | 25cb3da83c9ce311bb4692cdebb3dfdfbda736e1 | Add option to migrate library from old storage format to the new one. | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta17\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta18\" provider-name=\"libdev + jojo + asciidisco + caphm\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -575,3 +575,7 @@ msgstr \"\"\nmsgctxt \"#30139\"\nmsgid \"Enable IPC over HTTP (use when experiencing AddonSignals timeouts)\"\nmsgstr \"\"\n+\n+msgctxt \"#30140\"\n+msgid \"Migrate Library to new format\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/library.py",
"new_path": "resources/lib/kodi/library.py",
"diff": "@@ -312,7 +312,6 @@ def update_library():\n.format(g.ADDON_ID))\n-\n@update_kodi_library\ndef execute_library_tasks(videoid, task_handler, title, sync_mylist=True):\n\"\"\"Execute library tasks for videoid and show errors in foreground\"\"\"\n@@ -348,3 +347,42 @@ def _sync_mylist(videoid, task_handler, enabled):\nif enabled and operation and g.ADDON.getSettingBool('mylist_library_sync'):\ncommon.debug('Syncing my list due to change of Kodi library')\napi.update_my_list(videoid, operation)\n+\n+\n+def get_previously_exported_items():\n+ \"\"\"Return a list of movie or tvshow VideoIds for items that were exported in\n+ the old storage format\"\"\"\n+ result = []\n+ videoid_pattern = re.compile('video_id=(\\\\d+)')\n+ for folder in _lib_folders(FOLDER_MOVIES) + _lib_folders(FOLDER_TV):\n+ for file in xbmcvfs.listdir(folder)[1]:\n+ filepath = os.path.join(folder, file.decode('utf-8'))\n+ if filepath.endswith('.strm'):\n+ common.debug('Trying to migrate {}'.format(filepath))\n+ try:\n+ # Only get a VideoId from the first file in each folder.\n+ # For shows, all episodes will result in the same VideoId\n+ # and movies only contain one file\n+ result.append(\n+ _get_root_videoid(filepath, videoid_pattern))\n+ except (AttributeError, IndexError):\n+ common.debug('Item does not conform to old format')\n+ break\n+ return result\n+\n+\n+def _lib_folders(section):\n+ section_dir = xbmc.translatePath(os.path.join(library_path(), section))\n+ return [os.path.join(section_dir, folder.decode('utf-8'))\n+ for folder\n+ in xbmcvfs.listdir(section_dir)[0]]\n+\n+\n+def _get_root_videoid(filename, pattern):\n+ match = re.search(pattern,\n+ xbmcvfs.File(filename, 'r').read().split('\\n')[-1])\n+ metadata = api.metadata(\n+ common.VideoId(videoid=match.groups()[0]))[0]\n+ if metadata['type'] == 'show':\n+ return common.VideoId(tvshowid=metadata['id'])\n+ return common.VideoId(movieid=metadata['id'])\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/library.py",
"new_path": "resources/lib/navigation/library.py",
"diff": "@@ -87,3 +87,10 @@ class LibraryActionExecutor(object):\nif ui.ask_for_confirmation(common.get_local_string(30125),\ncommon.get_local_string(30126)):\nlibrary.purge()\n+\n+ def migrate(self, pathitems):\n+ \"\"\"Migrate exported items from old library format to the new format\"\"\"\n+ for videoid in library.get_previously_exported_items():\n+ library.execute_library_tasks(videoid, library.export_item,\n+ common.get_local_string(30018),\n+ sync_mylist=False)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<setting id=\"mylist_library_sync\" type=\"bool\" label=\"30114\" default=\"false\"/>\n<setting id=\"initial_mylist_sync\" type=\"action\" label=\"30121\" action=\"RunPlugin(plugin://plugin.video.netflix/library/initial_mylist_sync/)\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n<setting id=\"purge_library\" type=\"action\" label=\"30125\" action=\"RunPlugin(plugin://plugin.video.netflix/library/purge/)\"/>\n+ <setting id=\"migrate_library\" type=\"action\" label=\"30140\" action=\"RunPlugin(plugin://plugin.video.netflix/library/migrate/)\"/>\n<setting id=\"customexportname\" type=\"bool\" label=\"No longer in use\" default=\"true\" visible=\"false\"/>\n<setting id=\"invalidate_cache_on_mylist_modify\" type=\"bool\" label=\"No longer in use\" default=\"true\" visible=\"false\"/>\n<setting label=\"30065\" type=\"lsep\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add option to migrate library from old storage format to the new one. |
105,989 | 24.11.2018 19:49:55 | -3,600 | 517e03e7b0ab0ee2cf28541943515a31d59ed159 | Add option to disable startup notification | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -579,3 +579,7 @@ msgstr \"\"\nmsgctxt \"#30140\"\nmsgid \"Migrate Library to new format\"\nmsgstr \"\"\n+\n+msgctxt \"#30141\"\n+msgid \"Disable startup notification\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<setting id=\"UpNextNotifier_enabled\" type=\"bool\" label=\"30129\" default=\"true\"/>\n</category>\n<category label=\"30023\">\n- <setting id=\"enable_ipc_over_http\" type=\"bool\" label=\"30139\" default=\"false\"/>\n<setting label=\"30115\" type=\"lsep\"/>\n<setting id=\"enable_1080p_unlock\" type=\"bool\" label=\"30136\" default=\"false\" visible=\"false\"/> <!-- Deprecated (broken) -->\n<setting id=\"enable_vp9_profiles\" type=\"bool\" label=\"30137\" default=\"false\" visible=\"false\"/> <!-- Deprecated (always on now) -->\n<setting id=\"enable_hdr_profiles\" type=\"bool\" label=\"30098\" default=\"false\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n<setting id=\"enable_dolbyvision_profiles\" type=\"bool\" label=\"30099\" default=\"false\" visible=\"eq(-2,true)\" subsetting=\"true\"/>\n<setting label=\"30116\" type=\"lsep\"/>\n+ <setting id=\"enable_ipc_over_http\" type=\"bool\" label=\"30139\" default=\"false\"/>\n+ <setting id=\"disable_startup_notification\" type=\"bool\" label=\"30141\" default=\"false\"/>\n<setting id=\"enable_timing\" type=\"bool\" label=\"30134\" default=\"false\"/>\n<setting id=\"disable_modal_error_display\" type=\"bool\" label=\"30130\" default=\"false\"/>\n<setting id=\"ssl_verification\" type=\"bool\" label=\"30024\" default=\"true\"/>\n"
},
{
"change_type": "MODIFY",
"old_path": "service.py",
"new_path": "service.py",
"diff": "@@ -65,6 +65,7 @@ class NetflixService(object):\ncommon.info('[{}] Thread started'.format(server['name']))\nself.controller = services.PlaybackController()\nself.library_updater = services.LibraryUpdateService()\n+ if not g.ADDON.getSettingBool('disable_startup_notification'):\nui.show_notification(common.get_local_string(30110))\ndef shutdown(self):\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add option to disable startup notification |
105,989 | 26.11.2018 18:10:26 | -3,600 | 44742179649bf6951bafb93cffb7d46c260839c5 | Always request VP9 profiles | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/profiles.py",
"new_path": "resources/lib/services/msl/profiles.py",
"diff": "@@ -64,8 +64,8 @@ def enabled_profiles():\n\"\"\"Return a list of all base and enabled additional profiles\"\"\"\nreturn (PROFILES['base'] +\nPROFILES['h264'] +\n+ PROFILES['vp9'] +\n_subtitle_profiles() +\n- _additional_profiles('vp9', forb_settings='enable_hevc_profiles') +\n_additional_profiles('dolbysound', 'enable_dolby_sound') +\n_additional_profiles('hevc', 'enable_hevc_profiles') +\n_additional_profiles('hdr',\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Always request VP9 profiles |
106,046 | 23.01.2019 20:16:39 | -3,600 | 67e0d5e01967c9be53376501dc51c39a3999680b | v2 license request + some fixes from MSLv2 impl.
refs commit:
v2 license request / Add h264 profileLevel40 streams
MSLv2 implementation | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/website.py",
"new_path": "resources/lib/api/website.py",
"diff": "@@ -8,6 +8,7 @@ from re import compile as recompile, DOTALL, sub\nimport resources.lib.common as common\n+from resources.lib.globals import g\nfrom .exceptions import (InvalidProfilesError, InvalidAuthURLError,\nInvalidMembershipStatusError, WebsiteParsingError)\n@@ -21,7 +22,8 @@ PAGE_ITEMS = [\n'models/serverDefs/data/ICHNAEA_ROOT',\n'models/serverDefs/data/API_ROOT',\n'models/serverDefs/data/API_BASE_URL',\n- 'models/esnGeneratorModel/data/esn'\n+ 'models/esnGeneratorModel/data/esn',\n+ 'models/memberContext/data/geo/preferredLocale'\n]\nJSON_REGEX = r'netflix\\.%s\\s*=\\s*(.*?);\\s*</script>'\n@@ -38,6 +40,10 @@ def extract_session_data(content):\nprofiles, active_profile = extract_profiles(\nextract_json(content, 'falcorCache'))\nuser_data = extract_userdata(content)\n+\n+ if user_data.get('preferredLocale'):\n+ g.LOCALE_ID = user_data.get('preferredLocale').get('id','en-US')\n+\nif user_data.get('membershipStatus') != 'CURRENT_MEMBER':\ncommon.debug(user_data)\n# Ignore this for now\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -84,6 +84,7 @@ class GlobalVariables(object):\nself.reset_time_trace()\nself.TIME_TRACE_ENABLED = self.ADDON.getSettingBool('enable_timing')\nself.IPC_OVER_HTTP = self.ADDON.getSettingBool('enable_ipc_over_http')\n+ self.LOCALE_ID = 'en-US'\ntry:\nos.mkdir(self.DATA_PATH)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/converter.py",
"new_path": "resources/lib/services/msl/converter.py",
"diff": "# -*- coding: utf-8 -*-\n\"\"\"Manifest format conversion\"\"\"\nfrom __future__ import unicode_literals\n-\n+import re\nimport base64\nimport uuid\nimport xml.etree.ElementTree as ET\n@@ -11,7 +11,7 @@ import resources.lib.common as common\ndef convert_to_dash(manifest):\n\"\"\"Convert a Netflix style manifest to MPEGDASH manifest\"\"\"\n- seconds = manifest['runtime'] / 1000\n+ seconds = manifest['duration'] / 1000\ninit_length = seconds / 2 * 12 + 20 * 1000\nduration = \"PT\" + str(seconds) + \".00S\"\n@@ -19,16 +19,19 @@ def convert_to_dash(manifest):\nperiod = ET.SubElement(root, 'Period', start='PT0S', duration=duration)\nprotection = _protection_info(manifest)\n- for video_track in manifest['videoTracks']:\n+\n+ for video_track in manifest['video_tracks']:\n_convert_video_track(\nvideo_track, period, init_length, protection)\n- for index, audio_track in enumerate(manifest['audioTracks']):\n+ for index, audio_track in enumerate(manifest['audio_tracks']):\n# Assume that first listed track is the default\n_convert_audio_track(audio_track, period, init_length,\ndefault=(index == 0))\n- for text_track in manifest.get('textTracks'):\n+ for text_track in manifest['timedtexttracks']:\n+ if text_track['isNoneTrack']:\n+ continue\n_convert_text_track(text_track, period)\nxml = ET.tostring(root, encoding='utf-8', method='xml')\n@@ -46,10 +49,11 @@ def _mpd_manifest_root(duration):\ndef _protection_info(manifest):\ntry:\n- pssh = manifest['psshb64'][0]\n- psshbytes = base64.standard_b64decode(pssh)\n- if len(psshbytes) == 52:\n- keyid = psshbytes[36:]\n+ pssh = None\n+ keyid = None\n+ if 'drmHeader' in manifest:\n+ pssh = manifest['drmHeader']['bytes']\n+ keyid = manifest['drmHeader']['keyId']\nexcept (KeyError, AttributeError, IndexError):\npssh = None\nkeyid = None\n@@ -63,7 +67,7 @@ def _convert_video_track(video_track, period, init_length, protection):\nmimeType='video/mp4',\ncontentType='video')\n_add_protection_info(adaptation_set, **protection)\n- for downloadable in video_track['downloadables']:\n+ for downloadable in video_track['streams']:\n_convert_video_downloadable(\ndownloadable, adaptation_set, init_length)\n@@ -93,14 +97,15 @@ def _convert_video_downloadable(downloadable, adaptation_set,\nrepresentation = ET.SubElement(\nparent=adaptation_set,\ntag='Representation',\n- width=str(downloadable['width']),\n- height=str(downloadable['height']),\n+ width=str(downloadable['res_w']),\n+ height=str(downloadable['res_h']),\nbandwidth=str(downloadable['bitrate'] * 1024),\n- hdcp=_determine_hdcp_version(downloadable['hdcpVersions']),\n- nflxContentProfile=str(downloadable['contentProfile']),\n- codecs=_determine_video_codec(downloadable['contentProfile']),\n+ #Does tag hdcpVersions still exist? to check if the tag is present when hdcp activated\n+ hdcp=_determine_hdcp_version(downloadable.get('hdcpVersions', 'none')),\n+ nflxContentProfile=str(downloadable['content_profile']),\n+ codecs=_determine_video_codec(downloadable['content_profile']),\nmimeType='video/mp4')\n- _add_base_url(representation, downloadable)\n+ _add_base_url(representation, downloadable['urls'][0]['url'])\n_add_segment_base(representation, init_length)\n@@ -121,16 +126,22 @@ def _determine_video_codec(content_profile):\ndef _convert_audio_track(audio_track, period, init_length, default):\n+ languageMap = {}\n+ channelCount = {'1.0':'1', '2.0':'2', '5.1':'6', '7.1':'8'}\n+ impaired = 'true' if audio_track['trackType'] == 'ASSISTIVE' else 'false'\n+ original = 'true' if audio_track['isNative'] else 'false'\n+ default = 'false' if audio_track['language'] in languageMap else 'true'\n+ languageMap[audio_track['language']] = True\nadaptation_set = ET.SubElement(\nparent=period,\ntag='AdaptationSet',\n- lang=audio_track['bcp47'],\n+ lang=audio_track['language'],\ncontentType='audio',\nmimeType='audio/mp4',\n- impaired=str(audio_track.get('trackType') == 'ASSISTIVE').lower(),\n- original=str(audio_track.get('language', '').find('[') > 0).lower(),\n- default=str(default).lower())\n- for downloadable in audio_track['downloadables']:\n+ impaired=impaired,\n+ original=original,\n+ default=default)\n+ for downloadable in audio_track['streams']:\n_convert_audio_downloadable(\ndownloadable, adaptation_set, init_length,\naudio_track.get('channelsCount'))\n@@ -141,7 +152,7 @@ def _convert_audio_downloadable(downloadable, adaptation_set, init_length,\nrepresentation = ET.SubElement(\nparent=adaptation_set,\ntag='Representation',\n- codecs='ec-3' if 'ddplus' in downloadable['contentProfile'] else 'aac',\n+ codecs='ec-3' if 'ddplus' in downloadable['content_profile'] else 'aac',\nbandwidth=str(downloadable['bitrate'] * 1024),\nmimeType='audio/mp4')\nET.SubElement(\n@@ -149,19 +160,23 @@ def _convert_audio_downloadable(downloadable, adaptation_set, init_length,\ntag='AudioChannelConfiguration',\nschemeIdUri='urn:mpeg:dash:23003:3:audio_channel_configuration:2011',\nvalue=str(channels_count))\n- _add_base_url(representation, downloadable)\n+ _add_base_url(representation, downloadable['urls'][0]['url'])\n_add_segment_base(representation, init_length)\ndef _convert_text_track(text_track, period):\n- if text_track.get('downloadables'):\n+ if text_track.get('ttDownloadables'):\n# Only one subtitle representation per adaptationset\n- downloadable = text_track['downloadables'][0]\n- is_ios8 = downloadable.get('contentProfile') == 'webvtt-lssdh-ios8'\n+ downloadable = text_track['ttDownloadables']\n+ #common.save_file('downloadable.log', str(downloadable))\n+\n+ content_profile = downloadable.keys()[0]\n+ is_ios8 = content_profile == 'webvtt-lssdh-ios8'\n+\nadaptation_set = ET.SubElement(\nparent=period,\ntag='AdaptationSet',\n- lang=text_track.get('bcp47'),\n+ lang=text_track.get('language'),\ncodecs=('stpp', 'wvtt')[is_ios8],\ncontentType='text',\nmimeType=('application/ttml+xml', 'text/vtt')[is_ios8])\n@@ -169,19 +184,18 @@ def _convert_text_track(text_track, period):\nparent=adaptation_set,\ntag='Role',\nschemeIdUri='urn:mpeg:dash:role:2011',\n- value='forced' if text_track.get('isForced') else 'main')\n+ value = 'forced' if text_track.get('isForcedNarrative') else 'main')\nrepresentation = ET.SubElement(\nparent=adaptation_set,\ntag='Representation',\n- nflxProfile=downloadable.get('contentProfile'))\n- _add_base_url(representation, downloadable)\n+ nflxProfile=content_profile)\n+ _add_base_url(representation, downloadable[content_profile]['downloadUrls'].values()[0])\n-def _add_base_url(representation, downloadable):\n+def _add_base_url(representation, base_url):\nET.SubElement(\nparent=representation,\n- tag='BaseURL').text = downloadable['urls'].values()[0]\n-\n+ tag='BaseURL').text = base_url\ndef _add_segment_base(representation, init_length):\nET.SubElement(\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/msl_handler.py",
"new_path": "resources/lib/services/msl/msl_handler.py",
"diff": "@@ -13,6 +13,7 @@ import time\nimport base64\nfrom functools import wraps\nimport requests\n+import xbmcaddon\nfrom resources.lib.globals import g\nimport resources.lib.common as common\n@@ -23,10 +24,10 @@ from .profiles import enabled_profiles\nfrom .converter import convert_to_dash\nfrom .exceptions import MSLError\n-CHROME_BASE_URL = 'http://www.netflix.com/api/msl/NFCDCH-LX/cadmium/'\n+CHROME_BASE_URL = 'https://www.netflix.com/nq/msl_v1/cadmium/'\nENDPOINTS = {\n- 'manifest': CHROME_BASE_URL + 'manifest',\n- 'license': CHROME_BASE_URL + 'license'\n+ 'manifest': CHROME_BASE_URL + 'pbo_manifests/%5E1.0.0/router', #\"pbo_manifests/^1.0.0/router\"\n+ 'license': CHROME_BASE_URL + 'pbo_licenses/%5E1.0.0/router'\n}\n@@ -49,6 +50,7 @@ def display_error_info(func):\nclass MSLHandler(object):\n\"\"\"Handles session management and crypto for license and manifest\nrequests\"\"\"\n+ last_license_url = ''\nlast_drm_context = ''\nlast_playback_context = ''\nsession = requests.session()\n@@ -132,31 +134,51 @@ class MSLHandler(object):\nimport pprint\ncommon.debug('Requested profiles:\\n{}'\n.format(pprint.pformat(profiles, indent=2)))\n+\n+ ia_addon = xbmcaddon.Addon('inputstream.adaptive')\n+ hdcp = ia_addon is not None and ia_addon.getSetting('HDCPOVERRIDE') == 'true'\n+\n+ id = int(time.time() * 10000)\nmanifest_request_data = {\n- 'method': 'manifest',\n- 'lookupType': 'PREPARE',\n- 'viewableIds': [viewable_id],\n+ 'version': 2,\n+ 'url': '/manifest',\n+ 'id': id,\n+ 'esn': esn,\n+ 'languages' : [g.LOCALE_ID],\n+ 'uiVersion': 'shakti-v25d2fa21',\n+ 'clientVersion': '6.0011.474.011',\n+ 'params': {\n+ 'type': 'standard',\n+ 'viewableId': [viewable_id],\n'profiles': profiles,\n- 'drmSystem': 'widevine',\n- 'appId': '14673889385265',\n- 'sessionParams': {\n- 'pinCapableClient': False,\n- 'uiplaycontext': 'null'\n- },\n- 'sessionId': '14673889385265',\n- 'trackId': 0,\n'flavor': 'PRE_FETCH',\n- 'secureUrls': False,\n- 'supportPreviewContent': True,\n- 'forceClearStreams': False,\n- 'languages': ['de-DE'],\n- 'clientVersion': '4.0004.899.011',\n- 'uiVersion': 'akira'\n+ 'drmType': 'widevine',\n+ 'drmVersion': 25,\n+ 'usePsshBox': True,\n+ 'isBranching': False,\n+ 'useHttpsStreams': False,\n+ 'imageSubtitleHeight': 1080,\n+ 'uiVersion': 'shakti-vb45817f4',\n+ 'clientVersion': '6.0011.511.011',\n+ 'supportsPreReleasePin': True,\n+ 'supportsWatermark': True,\n+ 'showAllSubDubTracks': False,\n+ 'titleSpecificData': {},\n+ 'videoOutputInfo': [{\n+ 'type': 'DigitalVideoOutputDescriptor',\n+ 'outputType': 'unknown',\n+ 'supportedHdcpVersions': [],\n+ 'isHdcpEngaged': hdcp\n+ }],\n+ 'preferAssistiveAudio': False,\n+ 'isNonMember': False\n}\n+ }\n+\nmanifest = self._chunked_request(ENDPOINTS['manifest'],\nmanifest_request_data, esn)\ncommon.save_file('manifest.json', json.dumps(manifest))\n- return manifest['result']['viewables'][0]\n+ return manifest['result']\n@display_error_info\[email protected]_execution(immediate=True)\n@@ -168,27 +190,32 @@ class MSLHandler(object):\n:return: Base64 representation of the licensekey or False unsuccessfull\n\"\"\"\ncommon.debug('Requesting license')\n+ id = int(time.time() * 10000)\n+\nlicense_request_data = {\n- 'method': 'license',\n- 'licenseType': 'STANDARD',\n- 'clientVersion': '4.0004.899.011',\n- 'uiVersion': 'akira',\n- 'languages': ['de-DE'],\n- 'playbackContextId': self.last_playback_context,\n- 'drmContextIds': [self.last_drm_context],\n- 'challenges': [{\n- 'dataBase64': challenge,\n- 'sessionId': sid\n+ 'version': 2,\n+ 'url': self.last_license_url,\n+ 'id': id,\n+ 'esn': g.get_esn(),\n+ 'languages': [g.LOCALE_ID],\n+ 'uiVersion': 'shakti-v25d2fa21',\n+ 'clientVersion': '6.0011.511.011',\n+ 'params': [{\n+ 'sessionId': sid,\n+ 'clientTime': int(id / 10000),\n+ 'challengeBase64': challenge,\n+ 'xid': str(id + 1610)\n}],\n- 'clientTime': int(time.time()),\n- 'xid': int((int(time.time()) + 0.1612) * 1000)\n+ 'echo': 'sessionId'\n}\n+\nresponse = self._chunked_request(ENDPOINTS['license'],\nlicense_request_data, g.get_esn())\n- return response['result']['licenses'][0]['data']\n+ return response['result'][0]['licenseResponseBase64']\[email protected]_execution(immediate=True)\ndef __tranform_to_dash(self, manifest):\n+ self.last_license_url = manifest['links']['license']['href']\nself.last_playback_context = manifest['playbackContextId']\nself.last_drm_context = manifest['drmContextId']\nreturn convert_to_dash(manifest)\n@@ -291,12 +318,8 @@ def _decrypt_chunks(chunks, crypto):\nelse:\ndata = base64.standard_b64decode(data)\ndecrypted_payload += data\n-\n- decrypted_payload = json.loads(decrypted_payload)[1]['payload']['data']\n- decrypted_payload = base64.standard_b64decode(decrypted_payload)\nreturn json.loads(decrypted_payload)\n-\ndef has_1080p(manifest):\n\"\"\"Return True if any of the video tracks in manifest have a 1080p profile\navailable, else False\"\"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/request_builder.py",
"new_path": "resources/lib/services/msl/request_builder.py",
"diff": "@@ -7,6 +7,7 @@ import base64\nimport subprocess\nimport random\n+from resources.lib.globals import g\nimport resources.lib.common as common\n# check if we are on Android\n@@ -72,7 +73,7 @@ class MSLRequestBuilder(object):\n'handshake': is_handshake,\n'nonreplayable': False,\n'capabilities': {\n- 'languages': ['en-US'],\n+ 'languages': [g.LOCALE_ID],\n'compressionalgos': [compression] if compression else []\n},\n'recipient': 'Netflix',\n@@ -81,7 +82,7 @@ class MSLRequestBuilder(object):\n'timestamp': 1467733923\n}\n- # If this is a keyrequest act diffrent then other requests\n+ # If this is a keyrequest act different then other requests\nif is_key_request:\nheader_data['keyrequestdata'] = self.crypto.key_request_data()\nelse:\n@@ -91,14 +92,10 @@ class MSLRequestBuilder(object):\[email protected]_execution(immediate=True)\ndef _encrypted_chunk(self, data, esn):\n- # Serialize the given Data\n- serialized_data = ''.join((\n- '[{},{\"headers\":{},\"path\":\"/cbp/cadmium-13\",\"payload\":{\"data\":\"',\n- json.dumps(data).replace('\"', '\\\\\"'),\n- '\"},\"query\":\"\"}]\\n'))\npayload = {\n'messageid': self.current_message_id,\n- 'data': common.compress_data(serialized_data),\n+ #'data': base64.standard_b64encode(json.dumps(data)),\n+ 'data': common.compress_data(json.dumps(data)),\n'compressionalgo': 'GZIP',\n'sequencenumber': 1,\n'endofmsg': True\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | v2 license request + some fixes from MSLv2 impl.
refs commit:
v2 license request / Add h264 profileLevel40 streams
c2d113597bfee4ca1a4c4e4ec4cfca3ed158ad5d
MSLv2 implementation
c2307770dadc99da6f463d08b2e5bcfa6d162eff |
106,046 | 23.01.2019 20:18:13 | -3,600 | 8911bd9be7ded7cafeeeef7ff02b7f84add7ae43 | Add some h264 profileLevel40 streams | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/profiles.py",
"new_path": "resources/lib/services/msl/profiles.py",
"diff": "@@ -36,7 +36,8 @@ PROFILES = {\n'dolbysound': ['ddplus-2.0-dash', 'ddplus-5.1-dash', 'ddplus-5.1hq-dash',\n'ddplus-atmos-dash'],\n'h264': ['playready-h264mpl30-dash', 'playready-h264mpl31-dash',\n- 'playready-h264mpl40-dash', 'playready-h264mpl41-dash'],\n+ 'playready-h264mpl40-dash', 'playready-h264mpl41-dash',\n+ 'playready-h264hpl30-dash', 'playready-h264hpl31-dash'],\n'hevc':\n_profile_strings(base=HEVC,\ntails=[(BASE_LEVELS, CENC),\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add some h264 profileLevel40 streams |
106,046 | 23.01.2019 20:39:38 | -3,600 | f2988abbc9397a4ac6d43cddbe58ce5693e9de23 | Fixed default audio language track selection | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/converter.py",
"new_path": "resources/lib/services/msl/converter.py",
"diff": "# -*- coding: utf-8 -*-\n\"\"\"Manifest format conversion\"\"\"\nfrom __future__ import unicode_literals\n+from resources.lib.globals import g\nimport re\nimport base64\nimport uuid\n+import xbmc\nimport xml.etree.ElementTree as ET\nimport resources.lib.common as common\n@@ -19,15 +21,16 @@ def convert_to_dash(manifest):\nperiod = ET.SubElement(root, 'Period', start='PT0S', duration=duration)\nprotection = _protection_info(manifest)\n-\nfor video_track in manifest['video_tracks']:\n_convert_video_track(\nvideo_track, period, init_length, protection)\n+ default_audio_language_index = _get_default_audio_language(manifest)\n+\nfor index, audio_track in enumerate(manifest['audio_tracks']):\n# Assume that first listed track is the default\n_convert_audio_track(audio_track, period, init_length,\n- default=(index == 0))\n+ default=(index == default_audio_language_index))\nfor text_track in manifest['timedtexttracks']:\nif text_track['isNoneTrack']:\n@@ -126,12 +129,10 @@ def _determine_video_codec(content_profile):\ndef _convert_audio_track(audio_track, period, init_length, default):\n- languageMap = {}\n- channelCount = {'1.0':'1', '2.0':'2', '5.1':'6', '7.1':'8'}\nimpaired = 'true' if audio_track['trackType'] == 'ASSISTIVE' else 'false'\noriginal = 'true' if audio_track['isNative'] else 'false'\n- default = 'false' if audio_track['language'] in languageMap else 'true'\n- languageMap[audio_track['language']] = True\n+ default = 'true' if default else 'false'\n+\nadaptation_set = ET.SubElement(\nparent=period,\ntag='AdaptationSet',\n@@ -144,7 +145,7 @@ def _convert_audio_track(audio_track, period, init_length, default):\nfor downloadable in audio_track['streams']:\n_convert_audio_downloadable(\ndownloadable, adaptation_set, init_length,\n- audio_track.get('channelsCount'))\n+ audio_track.get('channels'))\ndef _convert_audio_downloadable(downloadable, adaptation_set, init_length,\n@@ -203,3 +204,39 @@ def _add_segment_base(representation, init_length):\ntag='SegmentBase',\nindexRange='0-' + str(init_length),\nindexRangeExact='true')\n+\n+def _get_default_audio_language(manifest):\n+ channelList = {'1.0': '1', '2.0': '2'}\n+ channelListDolby = {'5.1': '6', '7.1': '8'}\n+\n+ # Read language in kodi settings\n+ audio_language = common.json_rpc('Settings.GetSettingValue', {'setting': 'locale.audiolanguage'})\n+ audio_language = xbmc.convertLanguage(audio_language['value'], xbmc.ISO_639_1)\n+ audio_language = audio_language if audio_language else xbmc.getLanguage(xbmc.ISO_639_1, False)\n+ audio_language = audio_language if audio_language else 'en'\n+\n+ # Try to find the preferred language with the right channels\n+ if g.ADDON.getSettingBool('enable_dolby_sound'):\n+ for index, audio_track in enumerate(manifest['audio_tracks']):\n+ if audio_track['language'] == audio_language and audio_track['channels'] in channelListDolby:\n+ return index\n+ break\n+ # If dolby audio track not exists check other channels list\n+ for index, audio_track in enumerate(manifest['audio_tracks']):\n+ if audio_track['language'] == audio_language and audio_track['channels'] in channelList:\n+ return index\n+ break\n+\n+ # If there is no matches to preferred language, try to sets the original language track as default\n+ # Check if the dolby audio track in selected language exists\n+ if g.ADDON.getSettingBool('enable_dolby_sound'):\n+ for index, audio_track in enumerate(manifest['audio_tracks']):\n+ if audio_track['isNative'] and audio_track['channels'] in channelListDolby:\n+ return index\n+ break\n+ # If dolby audio track not exists check other channels list\n+ for index, audio_track in enumerate(manifest['audio_tracks']):\n+ if audio_track['isNative'] and audio_track['channels'] in channelList:\n+ return index\n+ break\n+ return 0\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed default audio language track selection |
106,046 | 23.01.2019 20:43:01 | -3,600 | 1e798f2bdde50ae22556270ce259f83f6d0259c4 | Fixed msldata renewal on expired mastertoken
Cause of errors:
Widevine CryptoSession getKeyRequest failed! (on android)
Only byte strings can be passed to C code (on windows) | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/android_crypto.py",
"new_path": "resources/lib/services/msl/android_crypto.py",
"diff": "@@ -11,6 +11,7 @@ import xbmcdrm\nimport resources.lib.common as common\nfrom .base_crypto import MSLBaseCrypto\n+from .exceptions import MastertokenExpired\nfrom .exceptions import MSLError\n@@ -35,6 +36,9 @@ class AndroidMSLCrypto(MSLBaseCrypto):\nself.hmac_key_id = base64.standard_b64decode(\nmsl_data['hmac_key_id'])\nself.crypto_session.RestoreKeys(self.keyset_id)\n+\n+ except MastertokenExpired as me:\n+ raise me\nexcept Exception:\nself.keyset_id = None\nself.key_id = None\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/default_crypto.py",
"new_path": "resources/lib/services/msl/default_crypto.py",
"diff": "@@ -15,6 +15,7 @@ from resources.lib.globals import g\nimport resources.lib.common as common\nfrom .base_crypto import MSLBaseCrypto\n+from .exceptions import MastertokenExpired\nclass DefaultMSLCrypto(MSLBaseCrypto):\n@@ -31,6 +32,9 @@ class DefaultMSLCrypto(MSLBaseCrypto):\nraise ValueError('Missing encryption_key or sign_key')\nself.rsa_key = RSA.importKey(\nbase64.standard_b64decode(msl_data['rsa_key']))\n+\n+ except MastertokenExpired as me:\n+ raise me\nexcept Exception:\ncommon.debug('Generating new RSA keys')\nself.rsa_key = RSA.generate(2048)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/msl_handler.py",
"new_path": "resources/lib/services/msl/msl_handler.py",
"diff": "@@ -67,6 +67,9 @@ class MSLHandler(object):\ncommon.debug('Stored MSL data expired or not available')\nself.request_builder = MSLRequestBuilder()\nself.perform_key_handshake()\n+ self.request_builder = MSLRequestBuilder(json.loads(\n+ common.load_file('msl_data.json')))\n+ common.debug('Loaded renewed MSL data from disk')\ncommon.register_slot(\nsignal=common.Signals.ESN_CHANGED,\ncallback=self.perform_key_handshake)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed msldata renewal on expired mastertoken
Cause of errors:
Widevine CryptoSession getKeyRequest failed! (on android)
Only byte strings can be passed to C code (on windows) |
106,046 | 23.01.2019 20:43:20 | -3,600 | 28e7bdb828d6ddc6d8e409216129df715227a4cd | Fix mslhandler error on new installations
it is necessary to take into account that in new installations there is
no esn, so perform a key handshake isn't possible, so nothing msl_data
saved. | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/msl_handler.py",
"new_path": "resources/lib/services/msl/msl_handler.py",
"diff": "@@ -66,7 +66,7 @@ class MSLHandler(object):\ncommon.debug(traceback.format_exc())\ncommon.debug('Stored MSL data expired or not available')\nself.request_builder = MSLRequestBuilder()\n- self.perform_key_handshake()\n+ if self.perform_key_handshake():\nself.request_builder = MSLRequestBuilder(json.loads(\ncommon.load_file('msl_data.json')))\ncommon.debug('Loaded renewed MSL data from disk')\n@@ -82,7 +82,7 @@ class MSLHandler(object):\nesn = data or g.get_esn()\nif not esn:\ncommon.info('Cannot perform key handshake, missing ESN')\n- return\n+ return False\ncommon.debug('Performing key handshake. ESN: {}'.format(esn))\n@@ -94,6 +94,7 @@ class MSLHandler(object):\nself.request_builder.crypto.parse_key_response(\nheaderdata, not common.is_edge_esn(esn))\ncommon.debug('Key handshake successful')\n+ return True\n@display_error_info\[email protected]_execution(immediate=True)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix mslhandler error on new installations
it is necessary to take into account that in new installations there is
no esn, so perform a key handshake isn't possible, so nothing msl_data
saved. |
106,046 | 27.01.2019 18:51:53 | -3,600 | 66fe9536dfbf17ef06c53929bd329d92fb8eadd4 | decrypt_chunks: fixed UnicodeDecodeError
error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 11037: ordinal not in range(128)
it happens with languages containing special characters such as fr_FR | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/msl_handler.py",
"new_path": "resources/lib/services/msl/msl_handler.py",
"diff": "@@ -325,6 +325,9 @@ def _decrypt_chunks(chunks, crypto):\nelse:\ndata = base64.standard_b64decode(data)\n+ if isinstance(data, str):\n+ decrypted_payload += unicode(data, 'utf-8')\n+ else:\ndecrypted_payload += data\ndecrypted_payload = json.loads(decrypted_payload)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | decrypt_chunks: fixed UnicodeDecodeError
error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 11037: ordinal not in range(128)
it happens with languages containing special characters such as fr_FR |
106,046 | 27.01.2019 18:55:47 | -3,600 | 4a39ef4377dc3d46018b31ff13c27d1e95b199ea | msl_handler: temporany removed 'success' check
*for now removed, i have not been able to fix it, i can not get a wrong
manifest or license, needs more tests | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/msl_handler.py",
"new_path": "resources/lib/services/msl/msl_handler.py",
"diff": "@@ -273,8 +273,7 @@ def _process_json_response(response):\ndef _raise_if_error(decoded_response):\ncommon.debug('decoded_response: ' + str(decoded_response))\n- if ('errordata' in decoded_response or\n- or not decoded_response.values().get('success', True)):\n+ if 'errordata' in decoded_response:\ncommon.error('Full MSL error information:')\ncommon.error(json.dumps(decoded_response))\nraise MSLError(_get_error_details(decoded_response))\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | msl_handler: temporany removed 'success' check
*for now removed, i have not been able to fix it, i can not get a wrong
manifest or license, needs more tests |
106,046 | 29.01.2019 19:59:29 | -3,600 | 20b6d703e1ac5c34e8d371229b412dff90dceb6e | Version bump (beta19) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta18\" provider-name=\"libdev + jojo + asciidisco + caphm\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta19\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (beta19) |
106,046 | 09.02.2019 20:12:09 | -3,600 | e8d71eea391a002bdaa6cf923b3858b14aec1b7f | Profiles: update and added VP9 Profile 2 | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/profiles.py",
"new_path": "resources/lib/services/msl/profiles.py",
"diff": "@@ -15,7 +15,8 @@ CENC_TL = 'dash-cenc-ctl'\nHDR = 'hevc-hdr-main10-'\nDV = 'hevc-dv-main10-'\nDV5 = 'hevc-dv5-main10-'\n-VP9 = 'vp9-profile0-'\n+VP9_PROFILE0 = 'vp9-profile0-'\n+VP9_PROFILE2 = 'vp9-profile2-'\nBASE_LEVELS = ['L30-', 'L31-', 'L40-', 'L41-', 'L50-', 'L51-']\nCENC_TL_LEVELS = ['L30-L31-', 'L31-L40-', 'L40-L41-', 'L50-L51-']\n@@ -31,13 +32,15 @@ PROFILES = {\n'base': [\n# Audio\n'heaac-2-dash',\n- # Unkown\n+ 'playready-heaac-2-dash',\n+ # Unknown\n'BIF240', 'BIF320'],\n'dolbysound': ['ddplus-2.0-dash', 'ddplus-5.1-dash', 'ddplus-5.1hq-dash',\n'ddplus-atmos-dash'],\n'h264': ['playready-h264mpl30-dash', 'playready-h264mpl31-dash',\n- 'playready-h264mpl40-dash', 'playready-h264mpl41-dash',\n- 'playready-h264hpl30-dash', 'playready-h264hpl31-dash'],\n+ 'playready-h264mpl40-dash',\n+ 'playready-h264hpl30-dash', 'playready-h264hpl31-dash',\n+ 'playready-h264hpl40-dash'],\n'hevc':\n_profile_strings(base=HEVC,\ntails=[(BASE_LEVELS, CENC),\n@@ -55,9 +58,12 @@ PROFILES = {\ntails=[(BASE_LEVELS, CENC)]) +\n_profile_strings(base=DV5,\ntails=[(BASE_LEVELS, CENC_PRK)]),\n- 'vp9':\n- _profile_strings(base=VP9,\n- tails=[(BASE_LEVELS, CENC)])\n+ 'vp9profile0':\n+ _profile_strings(base=VP9_PROFILE0,\n+ tails=[(BASE_LEVELS, CENC)]),\n+ 'vp9profile2':\n+ _profile_strings(base=VP9_PROFILE2,\n+ tails=[(BASE_LEVELS, CENC_PRK)])\n}\n@@ -65,7 +71,8 @@ def enabled_profiles():\n\"\"\"Return a list of all base and enabled additional profiles\"\"\"\nreturn (PROFILES['base'] +\nPROFILES['h264'] +\n- PROFILES['vp9'] +\n+ PROFILES['vp9profile0'] +\n+ PROFILES['vp9profile2'] +\n_subtitle_profiles() +\n_additional_profiles('dolbysound', 'enable_dolby_sound') +\n_additional_profiles('hevc', 'enable_hevc_profiles') +\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Profiles: update and added VP9 Profile 2 |
106,046 | 10.02.2019 14:26:04 | -3,600 | b003df0fe54792555d3bc894799c233061b373c4 | Updated changelog
Readded deleted changelog after rebase
Added changelog of beta versions | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<forum>https://www.kodinerds.net/index.php/Thread/55612-PreRelease-Plugin-Netflix-Inputstream/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n<news>\n+v0.14.0 beta19 (2019-01-29)\n+- Reintroduced MSLv2 for manifest retrieval\n+- Reintroduced get locale language from Netflix settings\n+- Re-added h264 profile level 40\n+- Fixed the default audio language selection\n+- Changes to settings menu Views (works partially)\n+- Fixed off-screen \"skip recap\" dialog\n+- Fixed error on mastertoken renewal\n+\n+v0.14.0 beta18 (2018-11-24)\n+- Replace Netflix HTTP Service with AddonSignals\n+- Improved code maintainability\n+- Improved caching TTL by content type\n+- Fully unicode compatible\n+- Discover more content (browse video lists for all shows and all movies)\n+- Improved library integration (auto-sync with kodi library)\n+- No longer an upper limit of 40 for the number of items to be displayed in a single listing\n+- Improved error handling\n+- Up Next integration (only for tests not yet working)\n+- A long list of bugfixes\n+\n+v0.13.21 (2018-12-03)\n+- License request version 2\n+- Get locale language from Netflix settings\n+- Fixed subtitles for ipsa < 2.3.8\n+- VP9 optional\n+- Added more VP9 profiles and h264 profile level 40\n+\n+v0.13.20 (2018-11-29)\n+- MSLv2 for manifest retrieval\n+\n+v0.13.19 (2018-11-24)\n+- Fix VTT / VP9 issues\n+\nv0.13.18 (2018-11-17)\n- Write correct codec into VP9 MPEG DAS profiles\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Updated changelog
-Readded deleted changelog after rebase
-Added changelog of beta versions |
106,046 | 10.02.2019 14:11:31 | -3,600 | b55ce2e2becffa093c842948367df856614530a7 | Version bump (beta20) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta19\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta20\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n<forum>https://www.kodinerds.net/index.php/Thread/55612-PreRelease-Plugin-Netflix-Inputstream/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n<news>\n+v0.14.0 beta20 (2019-02-10)\n+- Update profiles and added VP9 Profile 2\n+- Fixed saving preferences of audio/subtitle streams\n+- Handle error in license request\n+\nv0.14.0 beta19 (2019-01-29)\n- Reintroduced MSLv2 for manifest retrieval\n- Reintroduced get locale language from Netflix settings\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (beta20) |
106,046 | 17.02.2019 20:57:43 | -3,600 | 673a0db899a1f19a593d6f4741a264bcae9dc78e | infolabels: added support to Atmos media flag
currently the kodi theme does not have a specific media-flag for
Atmos codec, so we use Dolby TrueHD | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -137,10 +137,14 @@ def get_quality_infos(item):\ndelivery.get('hasHD')), 2)]\nquality_infos['audio'] = {\n'channels': 2 + 4 * delivery.get('has51Audio', False)}\n- quality_infos['audio']['codec'] = (\n- 'eac3'\n- if g.ADDON.getSettingBool('enable_dolby_sound')\n- else 'aac')\n+\n+ if g.ADDON.getSettingBool('enable_dolby_sound'):\n+ if delivery.get('hasDolbyAtmos', False):\n+ quality_infos['audio']['codec'] = 'truehd'\n+ else:\n+ quality_infos['audio']['codec'] = 'eac3'\n+ else:\n+ quality_infos['audio']['codec'] = 'aac'\nreturn quality_infos\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | infolabels: added support to Atmos media flag
currently the kodi theme does not have a specific media-flag for
Atmos codec, so we use Dolby TrueHD |
106,046 | 17.02.2019 21:21:37 | -3,600 | b708b247b58db56a1f1a2529f07dcc906dc2fdfe | nfsession: more debug informations to perpetual_path_request | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/nfsession.py",
"new_path": "resources/lib/services/nfsession/nfsession.py",
"diff": "@@ -274,6 +274,7 @@ class NetflixSession(object):\nwhile range_start < range_end:\npath_response = self._path_request(\n_set_range_selector(paths, range_start, range_end))\n+ common.debug('perpetual_path_request path_response: ' + str(path_response))\ncommon.merge_dicts(path_response, merged_response)\nrange_start = range_end + 1\nif length(path_response, *length_params) > range_end:\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | nfsession: more debug informations to perpetual_path_request |
106,046 | 19.02.2019 20:43:30 | -3,600 | cd03b53ed0ef8d2da3efd8bbb63fcb7990af4d30 | msl_converter: fixed wrong number of channels in audio stream | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/converter.py",
"new_path": "resources/lib/services/msl/converter.py",
"diff": "@@ -128,6 +128,7 @@ def _determine_video_codec(content_profile):\ndef _convert_audio_track(audio_track, period, init_length, default):\n+ channels_count = {'1.0': '1', '2.0': '2', '5.1': '6', '7.1': '8'}\nimpaired = 'true' if audio_track['trackType'] == 'ASSISTIVE' else 'false'\noriginal = 'true' if audio_track['isNative'] else 'false'\ndefault = 'true' if default else 'false'\n@@ -144,7 +145,7 @@ def _convert_audio_track(audio_track, period, init_length, default):\nfor downloadable in audio_track['streams']:\n_convert_audio_downloadable(\ndownloadable, adaptation_set, init_length,\n- audio_track.get('channels'))\n+ channels_count[downloadable['channels']])\ndef _convert_audio_downloadable(downloadable, adaptation_set, init_length,\n@@ -159,7 +160,7 @@ def _convert_audio_downloadable(downloadable, adaptation_set, init_length,\nparent=representation,\ntag='AudioChannelConfiguration',\nschemeIdUri='urn:mpeg:dash:23003:3:audio_channel_configuration:2011',\n- value=str(channels_count))\n+ value=channels_count)\n_add_base_url(representation, downloadable['urls'][0]['url'])\n_add_segment_base(representation, init_length)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | msl_converter: fixed wrong number of channels in audio stream |
106,046 | 20.02.2019 20:31:16 | -3,600 | 83fdfcad1fdf9b60d7879ea9c45a43d2c43e4eef | Reintroduced possibility to disable VP9
This because some users report the following problems
on some linux systems artifacts of black bands
some old android devices even though with L1 DRM they can show green
screens
problems with android devices without VP9 hw decoder | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -565,7 +565,7 @@ msgid \"Enable 1080p Unlock (not recommended for Android)\"\nmsgstr \"\"\nmsgctxt \"#30137\"\n-msgid \"Enable VP9 profiles (disables 1080p unlock)\"\n+msgid \"Enable VP9 profiles (not use with HEVC, disable if it causes artifacts)\"\nmsgstr \"\"\nmsgctxt \"#30138\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.it_it/strings.po",
"new_path": "resources/language/resource.language.it_it/strings.po",
"diff": "@@ -565,8 +565,8 @@ msgid \"Enable 1080p Unlock (not recommended for Android)\"\nmsgstr \"Abilita sblocco 1080p (non raccomandato per Android)\"\nmsgctxt \"#30137\"\n-msgid \"Enable VP9 profiles (disables 1080p unlock)\"\n-msgstr \"Abilita profili VP9 (disabilita sblocco 1080p)\"\n+msgid \"Enable VP9 profiles (not use with HEVC, disable if it causes artifacts)\"\n+msgstr \"Abilita profili VP9 (non usare con HEVC, disabilitare se causa artefatti)\"\nmsgctxt \"#30138\"\nmsgid \"The requested action timed out. The background services may not yet be available if you just started Kodi/the addon. In this case, try again in a moment.\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/profiles.py",
"new_path": "resources/lib/services/msl/profiles.py",
"diff": "@@ -71,9 +71,9 @@ def enabled_profiles():\n\"\"\"Return a list of all base and enabled additional profiles\"\"\"\nreturn (PROFILES['base'] +\nPROFILES['h264'] +\n- PROFILES['vp9profile0'] +\n- PROFILES['vp9profile2'] +\n_subtitle_profiles() +\n+ _additional_profiles('vp9profile0', 'enable_vp9_profiles') +\n+ _additional_profiles('vp9profile2', 'enable_vp9_profiles') +\n_additional_profiles('dolbysound', 'enable_dolby_sound') +\n_additional_profiles('hevc', 'enable_hevc_profiles') +\n_additional_profiles('hdr',\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<category label=\"30023\">\n<setting label=\"30115\" type=\"lsep\"/>\n<setting id=\"enable_1080p_unlock\" type=\"bool\" label=\"30136\" default=\"false\" visible=\"false\"/> <!-- Deprecated (broken) -->\n- <setting id=\"enable_vp9_profiles\" type=\"bool\" label=\"30137\" default=\"false\" visible=\"false\"/> <!-- Deprecated (always on now) -->\n<setting id=\"enable_dolby_sound\" type=\"bool\" label=\"30033\" default=\"true\"/>\n<setting id=\"enable_atmos_sound\" type=\"bool\" label=\"30111\" default=\"false\" visible=\"false\"/> <!-- Deprecated (linked to dolby_sound) -->\n+ <setting id=\"enable_vp9_profiles\" type=\"bool\" label=\"30137\" default=\"true\"/>\n<setting id=\"enable_hevc_profiles\" type=\"bool\" label=\"30060\" default=\"false\"/>\n<setting id=\"enable_hdr_profiles\" type=\"bool\" label=\"30098\" default=\"false\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n<setting id=\"enable_dolbyvision_profiles\" type=\"bool\" label=\"30099\" default=\"false\" visible=\"eq(-2,true)\" subsetting=\"true\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Reintroduced possibility to disable VP9
This because some users report the following problems
-on some linux systems artifacts of black bands
-some old android devices even though with L1 DRM they can show green
screens
-problems with android devices without VP9 hw decoder |
106,046 | 22.02.2019 20:09:57 | -3,600 | 1d1f9c4419e24f4bfb39a261665639a86d476b40 | Version bump (beta21) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta20\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta21\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n<forum>https://www.kodinerds.net/index.php/Thread/55612-PreRelease-Plugin-Netflix-Inputstream/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n<news>\n+v0.14.0 beta21 (2019-02-22)\n+- Re-added option to disable VP9 profile\n+- Added support to Atmos media flag\n+- Added option to disable WebVTT subtitle\n+- Added option to use hdcp 2.2 instead of 1.4 for 4K content\n+- Fixed wrong number of channels in audio stream\n+- Fixed subtitle default selection\n+- Some cleaning to hdcp logic\n+\nv0.14.0 beta20 (2019-02-10)\n- Update profiles and added VP9 Profile 2\n- Fixed saving preferences of audio/subtitle streams\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (beta21) |
106,046 | 22.02.2019 20:17:28 | -3,600 | 36ee21045f3b566bc906fa5bc8a05313b4787823 | Updated readme.md and source info | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<website>https://www.netflix.com</website>\n<email>public at asciidisco dot com</email>\n<forum>https://www.kodinerds.net/index.php/Thread/55612-PreRelease-Plugin-Netflix-Inputstream/</forum>\n- <source>https://github.com/asciidisco/plugin.video.netflix</source>\n+ <source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\nv0.14.0 beta21 (2019-02-22)\n- Re-added option to disable VP9 profile\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Updated readme.md and source info |
106,046 | 04.03.2019 20:29:36 | -3,600 | 3deba350262a9e864edb5c06c3a8d05b65319e75 | directory: fixed 'exported' menu | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/directory.py",
"new_path": "resources/lib/navigation/directory.py",
"diff": "@@ -129,7 +129,7 @@ class DirectoryBuilder(object):\nlibrary_contents = library.list_contents()\nif library_contents:\nlistings.build_video_listing(\n- api.custom_video_list(library_contents))\n+ api.custom_video_list(library_contents), g.MAIN_MENU_ITEMS['exported'])\nelse:\nui.show_notification(common.get_local_string(30013))\nxbmcplugin.endOfDirectory(g.PLUGIN_HANDLE, succeeded=False)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | directory: fixed 'exported' menu |
106,046 | 04.03.2019 21:21:40 | -3,600 | 1e062ae1e5ee3dd7d301d5d97465f5ea8dc71f22 | Fixed loading of video lists in children's profile
and the context menu "add/remove to 'My list'" will no longer be shown
is not supported in the children's profile | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -168,6 +168,8 @@ class GlobalVariables(object):\n'show_in_menu': True})\n])\n+ MAIN_MENU_HAVE_MYLIST = True\n+\nMODE_DIRECTORY = 'directory'\nMODE_HUB = 'hub'\nMODE_ACTION = 'action'\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/context_menu.py",
"new_path": "resources/lib/kodi/context_menu.py",
"diff": "@@ -46,7 +46,7 @@ def generate_context_menu_items(videoid):\nif videoid.mediatype != common.VideoId.SEASON:\nitems.insert(0, _ctx_item('rate', videoid))\n- if videoid.mediatype in [common.VideoId.MOVIE, common.VideoId.SHOW]:\n+ if videoid.mediatype in [common.VideoId.MOVIE, common.VideoId.SHOW] and g.MAIN_MENU_HAVE_MYLIST:\nlist_action = ('remove_from_list'\nif videoid.value in api.mylist_items()\nelse 'add_to_list')\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/listings.py",
"new_path": "resources/lib/kodi/listings.py",
"diff": "@@ -95,6 +95,7 @@ def build_main_menu_listing(lolomo):\nBuilds the video lists (my list, continue watching, etc.) Kodi screen\n\"\"\"\ndirectory_items = []\n+ mylist_menu_exists = False\nfor menu_id, data in g.MAIN_MENU_ITEMS.iteritems():\nif data['show_in_menu']:\n@@ -102,6 +103,8 @@ def build_main_menu_listing(lolomo):\nfor list_id, user_list in lolomo.lists_by_context(data['contexts'], break_on_first=True):\ndirectory_items.append(_create_videolist_item(list_id, user_list, data, static_lists=True))\ndata['menu_title'] = user_list['displayName']\n+ if \"queue\" in data['contexts']:\n+ mylist_menu_exists = True\nelse:\nmenu_title = common.get_local_string(data['label_id']) \\\nif data['label_id'] is not None else 'Missing menu title'\n@@ -115,6 +118,7 @@ def build_main_menu_listing(lolomo):\ndescription=menu_description),\nTrue))\n+ g.MAIN_MENU_HAVE_MYLIST = mylist_menu_exists\nfinalize_directory(directory_items, g.CONTENT_FOLDER,\ntitle=common.get_local_string(30097))\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed loading of video lists in children's profile
and the context menu "add/remove to 'My list'" will no longer be shown
is not supported in the children's profile |
106,046 | 08.03.2019 21:03:59 | -3,600 | ac04440a660f79986f1da5e6b0f6c9f2fca37bd3 | nfsession: changed content-type of post request
now netflix no longer accepts application/json | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/nfsession.py",
"new_path": "resources/lib/services/nfsession/nfsession.py",
"diff": "@@ -310,13 +310,12 @@ class NetflixSession(object):\n\"\"\"Execute a path request with static paths\"\"\"\ncommon.debug('Executing path request: {}'.format(json.dumps(paths)))\nheaders = {\n- 'Content-Type': 'application/json',\n+ 'Content-Type': 'application/x-www-form-urlencoded',\n'Accept': 'application/json, text/javascript, */*'}\nparams = {\n'model': self.session_data['user_data']['gpsModel']}\n- data = json.dumps({\n- 'paths': paths,\n- 'authURL': self.auth_url})\n+ data = 'path=' + '&path='.join(json.dumps(path) for path in paths)\n+ data += '&authURL=' + self.auth_url\nreturn self._post(\ncomponent='shakti',\nreq_type='api',\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | nfsession: changed content-type of post request
now netflix no longer accepts application/json |
106,046 | 08.03.2019 21:39:32 | -3,600 | f79811835c998709668f94fd350bdf428d797c64 | Version bump (beta22) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta21\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta22\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n<forum>https://www.kodinerds.net/index.php/Thread/55612-PreRelease-Plugin-Netflix-Inputstream/</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n+v0.14.0 beta22 (2019-03-08)\n+- Fixed error when accessing profile (lolomo error due to netflix changes)\n+- Exceeded the limit of the lists with only 40 results!\n+- It is possible to customize the maximum limit of the results (exp.settings)\n+- Reworked menus code (not yet finished)\n+- Fixed missing menu titles on all submenus\n+- Order of the menus is now respected\n+- Fixed children profile menus\n+- Added a new menu \"recently added\"\n+- Updated polish translation\n+\nv0.14.0 beta21 (2019-02-22)\n- Re-added option to disable VP9 profile\n- Added support to Atmos media flag\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (beta22) |
106,042 | 09.03.2019 03:12:07 | 10,800 | 887256938ece9128787910f0e0610c4b5ec8cc1a | Decode chars in old style library files
When clicking on Migrate Library to new style, old style file contents should be decoded from before searching patterns, to avoid UnicodeDecodeError in split() method. | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/library.py",
"new_path": "resources/lib/kodi/library.py",
"diff": "@@ -380,7 +380,7 @@ def _lib_folders(section):\ndef _get_root_videoid(filename, pattern):\nmatch = re.search(pattern,\n- xbmcvfs.File(filename, 'r').read().split('\\n')[-1])\n+ xbmcvfs.File(filename, 'r').read().decode('utf-8').split('\\n')[-1])\nmetadata = api.metadata(\ncommon.VideoId(videoid=match.groups()[0]))[0]\nif metadata['type'] == 'show':\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Decode UTF-8 chars in old style library files
When clicking on Migrate Library to new style, old style file contents should be decoded from UTF-8 before searching patterns, to avoid UnicodeDecodeError in split() method. |
106,046 | 10.03.2019 18:27:12 | -3,600 | 6424777b6b9ff806b2c41af5e4c66d211a0c86fb | Converter: fixed error with subtitle/audio language
error detail:
File "...\services\msl\converter.py", line 246, in_get_default_subtitle_language
subtitle_language = xbmc.convertLanguage(subtitle_language['value'],xbmc.ISO_639_1)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5' in position 14: ordinal not in range(128) | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/converter.py",
"new_path": "resources/lib/services/msl/converter.py",
"diff": "@@ -207,7 +207,7 @@ def _get_default_audio_language(manifest):\n# Read language in kodi settings\naudio_language = common.json_rpc('Settings.GetSettingValue', {'setting': 'locale.audiolanguage'})\n- audio_language = xbmc.convertLanguage(audio_language['value'], xbmc.ISO_639_1)\n+ audio_language = xbmc.convertLanguage(audio_language['value'].encode('utf-8'), xbmc.ISO_639_1)\naudio_language = audio_language if audio_language else xbmc.getLanguage(xbmc.ISO_639_1, False)\naudio_language = audio_language if audio_language else 'en'\n@@ -243,7 +243,7 @@ def _get_default_subtitle_language(manifest):\n# Leave the selection of forced subtitles to kodi\nreturn -1\nelse:\n- subtitle_language = xbmc.convertLanguage(subtitle_language['value'], xbmc.ISO_639_1)\n+ subtitle_language = xbmc.convertLanguage(subtitle_language['value'].encode('utf-8'), xbmc.ISO_639_1)\nsubtitle_language = subtitle_language if subtitle_language else xbmc.getLanguage(xbmc.ISO_639_1, False)\nsubtitle_language = subtitle_language if subtitle_language else 'en'\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Converter: fixed error with subtitle/audio language
error detail:
File "...\services\msl\converter.py", line 246, in_get_default_subtitle_language
subtitle_language = xbmc.convertLanguage(subtitle_language['value'],xbmc.ISO_639_1)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5' in position 14: ordinal not in range(128) |
106,046 | 11.03.2019 20:51:11 | -3,600 | d9965868ff5510338bf41899b7988f65d56da506 | After logout return to Kodi home | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/nfsession.py",
"new_path": "resources/lib/services/nfsession/nfsession.py",
"diff": "@@ -9,6 +9,8 @@ from functools import wraps\nimport json\nimport requests\n+import xbmc\n+\nfrom resources.lib.globals import g\nimport resources.lib.common as common\nimport resources.lib.common.cookies as cookies\n@@ -221,6 +223,8 @@ class NetflixSession(object):\ncommon.info('Logout successful')\nui.show_notification(common.get_local_string(30113))\nself._init_session()\n+ xbmc.executebuiltin('XBMC.Container.Update(path,replace)') # Clean path history\n+ xbmc.executebuiltin('XBMC.ActivateWindow(Home)')\[email protected]_return_call\n@needs_login\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | After logout return to Kodi home |
106,046 | 13.03.2019 20:46:12 | -3,600 | d7e71454814cb63660a88ff57580b6e25efc86f1 | msl_handler: fixed wrong error handler description | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/msl_handler.py",
"new_path": "resources/lib/services/msl/msl_handler.py",
"diff": "@@ -290,7 +290,7 @@ def _raise_if_error(decoded_response):\nraise MSLError(_get_error_details(decoded_response))\nif isinstance(decoded_response, list):\nif decoded_response[0].get('error'):\n- raise MSLError(_get_error_details(decoded_response))\n+ raise MSLError(_get_error_details(decoded_response[0]))\nreturn decoded_response\n@@ -303,10 +303,9 @@ def _get_error_details(decoded_response):\nreturn decoded_response['result']['errorDisplayMessage']\nelif decoded_response.get('result', {}).get('errorDetails'):\nreturn decoded_response['result']['errorDetails']\n- elif isinstance(decoded_response, list):\n- if decoded_response[0].get('error', {}).get('errorDisplayMessage'):\n- return decoded_response[0]['error']['errorDisplayMessage']\n- return ''\n+ elif decoded_response.get('error', {}).get('errorDisplayMessage'):\n+ return decoded_response['error']['errorDisplayMessage']\n+ return 'Unhandled error check log.'\[email protected]_execution(immediate=True)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | msl_handler: fixed wrong error handler description |
106,046 | 17.03.2019 14:23:17 | -3,600 | c7493e2c0ea2330f77c76cfa7fc14fab72330b13 | Version bump (beta23) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta22\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta23\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.25.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n<forum>https://www.kodinerds.net/index.php/Thread/55612-PreRelease-Plugin-Netflix-Inputstream/</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n+v0.14.0 beta23 (2019-03-17)\n+- Fixed InvalidVideoId error when try to access a profile\n+- Fixed UnicodeEncodeError when play a video with some particular languages\n+- Fixed PersistentStorage went to remove existing files\n+- Fixed storage of subtitle preference for TV Series\n+- Fixed menu_title error when try to open any menu\n+- Fixed error when try to open 'My list' when empty\n+- Fixed UnicodeDecodeError when migrate library\n+- No more double menu in sub-menus\n+- Minor fix to Polish translation\n+\nv0.14.0 beta22 (2019-03-08)\n- Fixed error when accessing profile (lolomo error due to netflix changes)\n- Exceeded the limit of the lists with only 40 results!\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (beta23) |
106,046 | 23.03.2019 21:03:57 | -3,600 | da8ede27ded08a95342e344dda91456b1dcd41c4 | converter: workaround for locale with country code
Kodi does not understand ISO code 639-1 with country code, this causes an incorrect translation of the language description, and no longer automatically selects tracks. | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/converter.py",
"new_path": "resources/lib/services/msl/converter.py",
"diff": "@@ -25,6 +25,9 @@ def convert_to_dash(manifest):\n_convert_video_track(\nvideo_track, period, init_length, protection)\n+ _fix_locale_languages(manifest['audio_tracks'])\n+ _fix_locale_languages(manifest['timedtexttracks'])\n+\ndefault_audio_language_index = _get_default_audio_language(manifest)\nfor index, audio_track in enumerate(manifest['audio_tracks']):\n_convert_audio_track(audio_track, period, init_length,\n@@ -216,12 +219,10 @@ def _get_default_audio_language(manifest):\nfor index, audio_track in enumerate(manifest['audio_tracks']):\nif audio_track['language'] == audio_language and audio_track['channels'] in channelListDolby:\nreturn index\n- break\n# If dolby audio track not exists check other channels list\nfor index, audio_track in enumerate(manifest['audio_tracks']):\nif audio_track['language'] == audio_language and audio_track['channels'] in channelList:\nreturn index\n- break\n# If there is no matches to preferred language, try to sets the original language track as default\n# Check if the dolby audio track in selected language exists\n@@ -229,12 +230,10 @@ def _get_default_audio_language(manifest):\nfor index, audio_track in enumerate(manifest['audio_tracks']):\nif audio_track['isNative'] and audio_track['channels'] in channelListDolby:\nreturn index\n- break\n# If dolby audio track not exists check other channels list\nfor index, audio_track in enumerate(manifest['audio_tracks']):\nif audio_track['isNative'] and audio_track['channels'] in channelList:\nreturn index\n- break\nreturn 0\ndef _get_default_subtitle_language(manifest):\n@@ -252,5 +251,43 @@ def _get_default_subtitle_language(manifest):\ncontinue\nif not text_track.get('isForcedNarrative') and text_track['language'] == subtitle_language:\nreturn index\n- break\nreturn -1\n+\n+def _fix_locale_languages(data_list):\n+ \"\"\"Replace locale code, Kodi does not understand the country code\"\"\"\n+ # Get all the ISO 639-1 codes (without country)\n+ locale_list_nocountry = []\n+ for item in data_list:\n+ if item.get('isNoneTrack',False):\n+ continue\n+ if len(item['language']) == 2 and not item['language'] in locale_list_nocountry:\n+ locale_list_nocountry.append(item['language'])\n+ # Replace the locale languages with country with a new one\n+ for item in data_list:\n+ if item.get('isNoneTrack',False):\n+ continue\n+ if len(item['language']) == 2:\n+ continue\n+ item['language'] = _adjust_locale(item['language'], item['language'][0:2] in locale_list_nocountry)\n+\n+def _adjust_locale(locale_code, lang_code_without_country_exists):\n+ \"\"\"\n+ Locale conversion helper\n+ Conversion table to prevent Kodi to display es-ES as Spanish - Spanish, pt-BR as Portuguese - Breton, and so on\n+ \"\"\"\n+ locale_conversion_table = {\n+ 'es-ES': 'es-Spain',\n+ 'pt-BR': 'pt-Brazil',\n+ 'fr-CA': 'fr-Canada',\n+ 'ar-EG': 'ar-Egypt',\n+ 'nl-BE': 'nl-Belgium'\n+ }\n+ language_code = locale_code[0:2]\n+ if not lang_code_without_country_exists:\n+ return language_code\n+ else:\n+ if locale_code in locale_conversion_table:\n+ return locale_conversion_table[locale_code]\n+ else:\n+ common.debug('AdjustLocale - missing mapping conversion for locale: {}'.format(locale_code))\n+ return locale_code\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | converter: workaround for locale with country code
Kodi does not understand ISO code 639-1 with country code, this causes an incorrect translation of the language description, and no longer automatically selects tracks. |
106,046 | 25.03.2019 20:14:07 | -3,600 | 934d25c8455b44cc55566412952c9187789f64a9 | request_builder: fallback to us-US when there is not yet its own value | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/request_builder.py",
"new_path": "resources/lib/services/msl/request_builder.py",
"diff": "@@ -73,7 +73,7 @@ class MSLRequestBuilder(object):\n'handshake': is_handshake,\n'nonreplayable': False,\n'capabilities': {\n- 'languages': [g.PERSISTENT_STORAGE['locale_id']],\n+ 'languages': [g.PERSISTENT_STORAGE.get('locale_id', 'en-US')],\n'compressionalgos': [compression] if compression else []\n},\n'recipient': 'Netflix',\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | request_builder: fallback to us-US when there is not yet its own value |
106,046 | 30.03.2019 19:36:08 | -3,600 | 280d3dba13e17b78df548cfd150674f19ea3515d | Fixed search with special characters
and fixed error when there are no results | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/data_types.py",
"new_path": "resources/lib/api/data_types.py",
"diff": "@@ -127,14 +127,19 @@ class SearchVideoList(object):\n# pylint: disable=invalid-name\ndef __init__(self, path_response):\nself.data = path_response\n- self.title = common.get_local_string(30100).format(\n- self.data['search']['byTerm'].keys()[0][1:])\n- self.videos = OrderedDict(\n- resolve_refs(self.data['search']['byReference'].values()[0],\n- self.data))\n+ have_data = 'search' in path_response\n+ if have_data:\n+ self.title = common.get_local_string(30100).format(self.data['search']['byTerm'].keys()[0][1:])\n+ self.videos = OrderedDict(resolve_refs(self.data['search']['byReference'].values()[0], self.data))\nself.videoids = _get_videoids(self.videos)\nself.artitem = next(self.videos.itervalues(), None)\nself.contained_titles = _get_titles(self.videos)\n+ else:\n+ common.debug('SearchVideoList - No data in path_response')\n+ self.videos = {}\n+ self.videoids = None\n+ self.artitem = None\n+ self.contained_titles = None\ndef __getitem__(self, key):\nreturn _check_sentinel(self.data['search'][key])\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/shakti.py",
"new_path": "resources/lib/api/shakti.py",
"diff": "@@ -344,8 +344,8 @@ def search(search_term):\nbase_path = ['search', 'byTerm', '|' + search_term, 'titles', 40]\nreturn SearchVideoList(common.make_call(\n'path_request',\n- [base_path + ['referenceId', 'id', 'length', 'name', 'trackIds',\n- 'requestId', 'regularSynopsis', 'evidence']] +\n+ [base_path + [['referenceId', 'id', 'length', 'name', 'trackIds',\n+ 'requestId', 'regularSynopsis', 'evidence']]] +\nbuild_paths(base_path + [{'from': 0, 'to': 40}, 'reference'],\nVIDEO_LIST_PARTIAL_PATHS)))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/nfsession.py",
"new_path": "resources/lib/services/nfsession/nfsession.py",
"diff": "@@ -312,20 +312,20 @@ class NetflixSession(object):\[email protected]_execution(immediate=True)\ndef _path_request(self, paths):\n\"\"\"Execute a path request with static paths\"\"\"\n- common.debug('Executing path request: {}'.format(json.dumps(paths)))\n+ common.debug('Executing path request: {}'.format(json.dumps(paths, ensure_ascii=False)))\nheaders = {\n'Content-Type': 'application/x-www-form-urlencoded',\n'Accept': 'application/json, text/javascript, */*'}\nparams = {\n'model': self.session_data['user_data']['gpsModel']}\n- data = 'path=' + '&path='.join(json.dumps(path) for path in paths)\n+ data = 'path=' + '&path='.join(json.dumps(path, ensure_ascii=False) for path in paths)\ndata += '&authURL=' + self.auth_url\nreturn self._post(\ncomponent='shakti',\nreq_type='api',\nparams=params,\nheaders=headers,\n- data=data)['value']\n+ data=data.encode('utf-8'))['value']\[email protected]_return_call\n@needs_login\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed search with special characters
and fixed error when there are no results |
106,046 | 30.03.2019 19:41:16 | -3,600 | ea8d9910df6a027fbb25b225c07c328da1f7e47a | Update python dependency version
The current version in leila is 2.26 | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta23\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n- <import addon=\"xbmc.python\" version=\"2.25.0\"/>\n+ <import addon=\"xbmc.python\" version=\"2.26.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n<import addon=\"script.module.pycryptodome\" version=\"3.4.3\"/>\n<import addon=\"script.module.inputstreamhelper\" version=\"0.3.3\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Update python dependency version
The current version in leila is 2.26 |
106,046 | 31.03.2019 13:20:56 | -7,200 | 9eed811744dbf9c200e91f0911bc4d6fdfaf40e8 | Reinitialize global settings when setting are changed
this fixes several problems when changing expert settings,
for example activating/deactivating Enable IPC over HTTP caused inability to load menu lists until kodi restarts
or change cache TTL was always applied after a reboot of kodi | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/ipc.py",
"new_path": "resources/lib/common/ipc.py",
"diff": "@@ -67,6 +67,7 @@ def make_http_call(callname, data):\nfrom collections import OrderedDict\nimport urllib2\nimport json\n+ debug('Handling HTTP IPC call to {}'.format(callname))\n# don't use proxy for localhost\nurl = 'http://127.0.0.1:{}/{}'.format(\ng.ADDON.getSetting('ns_service_port'), callname)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/__init__.py",
"new_path": "resources/lib/services/__init__.py",
"diff": "@@ -7,3 +7,4 @@ from .msl.http_server import MSLTCPServer\nfrom .nfsession.http_server import NetflixTCPServer\nfrom .library_updater import LibraryUpdateService\nfrom .playback.controller import PlaybackController\n+from .settings_monitor import SettingsMonitor\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "resources/lib/services/settings_monitor.py",
"diff": "+# -*- coding: utf-8 -*-\n+\"\"\"Checks when settings are changed\"\"\"\n+\n+from __future__ import unicode_literals\n+\n+import xbmc\n+import sys\n+\n+from resources.lib.globals import g\n+import resources.lib.common as common\n+\n+class SettingsMonitor(xbmc.Monitor):\n+ def __init__(self):\n+ xbmc.Monitor.__init__(self)\n+\n+ def onSettingsChanged(self):\n+ self._on_change()\n+\n+ def _on_change(self):\n+ common.debug('SettingsMonitor: Settings changed, reinitialize global settings')\n+ g.init_globals(sys.argv)\n"
},
{
"change_type": "MODIFY",
"old_path": "service.py",
"new_path": "service.py",
"diff": "@@ -46,6 +46,7 @@ class NetflixService(object):\nself.init_server(server)\nself.controller = None\nself.library_updater = None\n+ self.settings_monitor = None\ndef init_server(self, server):\nserver['class'].allow_reuse_address = True\n@@ -65,6 +66,7 @@ class NetflixService(object):\ncommon.info('[{}] Thread started'.format(server['name']))\nself.controller = services.PlaybackController()\nself.library_updater = services.LibraryUpdateService()\n+ self.settings_monitor = services.SettingsMonitor()\nif not g.ADDON.getSettingBool('disable_startup_notification'):\nui.show_notification(common.get_local_string(30110))\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Reinitialize global settings when setting are changed
this fixes several problems when changing expert settings,
for example activating/deactivating Enable IPC over HTTP caused inability to load menu lists until kodi restarts
or change cache TTL was always applied after a reboot of kodi |
106,046 | 31.03.2019 16:29:34 | -7,200 | c262fd7926cc97a240540f3208220c742ab3b6f9 | Fixed loss of tv series and films exported
also fixed context menu "remove from library" and "update inside library" that after the operation the list was not updated | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/cache.py",
"new_path": "resources/lib/cache.py",
"diff": "@@ -146,6 +146,8 @@ class Cache(object):\nexcept KeyError:\ncache_entry = self._get_from_disk(bucket, identifier)\nself.add(bucket, identifier, cache_entry['content'])\n+ # Do not verify TTL on cache library, prevents the loss of exported objects\n+ if not bucket == CACHE_LIBRARY:\nself.verify_ttl(bucket, identifier, cache_entry)\nreturn cache_entry['content']\n@@ -170,14 +172,18 @@ class Cache(object):\n# same languageInvoker thread is being used so we MUST clear its\n# contents to allow cache consistency between instances\n# del self.buckets[bucket]\n- self.common.debug('Cache committ successful')\n+ self.common.debug('Cache commit successful')\ndef invalidate(self, on_disk=False):\n\"\"\"Clear all cache buckets\"\"\"\n# pylint: disable=global-statement\nfor bucket in BUCKET_NAMES:\n+ if bucket == CACHE_LIBRARY:\n+ continue\nself.window.clearProperty(_window_property(bucket))\n- self.buckets = {}\n+ if bucket in self.buckets:\n+ del self.buckets[bucket]\n+\nif on_disk:\nself._invalidate_on_disk()\nself.common.info('Cache invalidated')\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/library.py",
"new_path": "resources/lib/navigation/library.py",
"diff": "@@ -30,12 +30,14 @@ class LibraryActionExecutor(object):\nif ui.ask_for_removal_confirmation():\nlibrary.execute_library_tasks(videoid, library.remove_item,\ncommon.get_local_string(30030))\n+ common.refresh_container()\[email protected]_video_id(path_offset=1)\ndef update(self, videoid):\n\"\"\"Update an item in the Kodi library\"\"\"\nlibrary.execute_library_tasks(videoid, library.update_item,\ncommon.get_local_string(30061))\n+ common.refresh_container()\[email protected]_video_id(path_offset=1)\ndef export_silent(self, videoid):\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed loss of tv series and films exported
also fixed context menu "remove from library" and "update inside library" that after the operation the list was not updated |
106,046 | 31.03.2019 17:36:31 | -7,200 | 9b4368641f761cf9a8ca0bd14725e1fba5260159 | library: fixed UnicodeDecodeError when remove a item from library | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/library.py",
"new_path": "resources/lib/kodi/library.py",
"diff": "@@ -268,10 +268,10 @@ def remove_item(item_task, library_home=None):\nreturn\nid_path = item_task['videoid'].to_list()\nexported_filename = xbmc.translatePath(\n- common.get_path(id_path, g.library())['file'])\n+ common.get_path(id_path, g.library())['file']).decode(\"utf-8\")\nparent_folder = os.path.dirname(exported_filename)\ntry:\n- xbmcvfs.delete(xbmc.translatePath(exported_filename))\n+ xbmcvfs.delete(xbmc.translatePath(exported_filename).decode(\"utf-8\"))\nif not os.listdir(parent_folder):\nos.rmdir(parent_folder)\nexcept Exception:\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | library: fixed UnicodeDecodeError when remove a item from library |
106,046 | 31.03.2019 18:20:13 | -7,200 | b74d3bb4c7dc00941d8db26c85a16722b6d47ff3 | library: fixed UnicodeWarning
17:55:06.627 T:2824 ERROR: C:\Users\Smeulf\AppData\Roaming\Kodi\addons\plugin.video.netflix\resources\lib\kodi\library.py:81:
UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if os.path.normcase(library_item['file']) == exported_filepath: | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/library.py",
"new_path": "resources/lib/kodi/library.py",
"diff": "@@ -76,7 +76,7 @@ def _any_child_library_entry(library_entry):\[email protected]_execution(immediate=False)\ndef _get_item(mediatype, filename):\n- exported_filepath = os.path.normcase(xbmc.translatePath(filename))\n+ exported_filepath = os.path.normcase(xbmc.translatePath(filename).decode(\"utf-8\"))\nfor library_item in common.get_library_items(mediatype):\nif os.path.normcase(library_item['file']) == exported_filepath:\nreturn common.get_library_item_details(\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | library: fixed UnicodeWarning
17:55:06.627 T:2824 ERROR: C:\Users\Smeulf\AppData\Roaming\Kodi\addons\plugin.video.netflix\resources\lib\kodi\library.py:81:
UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if os.path.normcase(library_item['file']) == exported_filepath: |
106,046 | 07.04.2019 19:36:14 | -7,200 | 82b8f197aaa337e047a78cb6a9a24304fa7f9c10 | Added choice of type sorting of results | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -611,3 +611,23 @@ msgstr \"\"\nmsgctxt \"#30148\"\nmsgid \"<< Previous page\"\nmsgstr \"\"\n+\n+msgctxt \"#30149\"\n+msgid \"Sort results by (works on menus with paging)\"\n+msgstr \"\"\n+\n+msgctxt \"#30150\"\n+msgid \"Alphabetical order (A-Z)\"\n+msgstr \"\"\n+\n+msgctxt \"#30151\"\n+msgid \"Alphabetical order (Z-A)\"\n+msgstr \"\"\n+\n+msgctxt \"#30152\"\n+msgid \"Suggestions for you\"\n+msgstr \"\"\n+\n+msgctxt \"#30153\"\n+msgid \"Year released\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.it_it/strings.po",
"new_path": "resources/language/resource.language.it_it/strings.po",
"diff": "@@ -611,3 +611,23 @@ msgstr \"Pagina seguente >>\"\nmsgctxt \"#30148\"\nmsgid \"<< Previous page\"\nmsgstr \"<< Pagina precedente\"\n+\n+msgctxt \"#30149\"\n+msgid \"Sort results by (works on menus with paging)\"\n+msgstr \"Ordina i risultati per (funziona solo per elenchi paginati)\"\n+\n+msgctxt \"#30150\"\n+msgid \"Alphabetical order (A-Z)\"\n+msgstr \"Ordine alfabetico (A-Z)\"\n+\n+msgctxt \"#30151\"\n+msgid \"Alphabetical order (Z-A)\"\n+msgstr \"Ordine alfabetico (Z-A)\"\n+\n+msgctxt \"#30152\"\n+msgid \"Suggestions for you\"\n+msgstr \"Suggerimenti per te\"\n+\n+msgctxt \"#30153\"\n+msgid \"Year released\"\n+msgstr \"Anno di uscita\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/data_types.py",
"new_path": "resources/lib/api/data_types.py",
"diff": "@@ -5,6 +5,7 @@ from __future__ import unicode_literals\nfrom collections import OrderedDict\n+from resources.lib.globals import g\nimport resources.lib.common as common\nfrom .paths import resolve_refs\n@@ -99,8 +100,8 @@ class VideoListSorted(object):\nand path_response[context_name].get(context_id)) or \\\n(not context_id and path_response.get(context_name)) else False\nif data_present:\n- self.data_lists = path_response[context_name][context_id]['az'] \\\n- if context_id else path_response[context_name]['az']\n+ self.data_lists = path_response[context_name][context_id][g.REQ_SORT_ORDER_TYPE] \\\n+ if context_id else path_response[context_name][g.REQ_SORT_ORDER_TYPE]\nself.videos = OrderedDict(resolve_refs(self.data_lists, self.data))\nelse:\nself.data_lists = {}\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/paths.py",
"new_path": "resources/lib/api/paths.py",
"diff": "\"\"\"Path info to query the Shakti pathEvaluator\"\"\"\nfrom __future__ import unicode_literals\n+from resources.lib.globals import g\nimport resources.lib.common as common\nfrom .exceptions import InvalidReferenceError\n@@ -18,9 +19,9 @@ LENGTH_ATTRIBUTES = {\n'videolist': lambda r, listid:\nlen(r['lists'][listid]),\n'videolist_sorted': lambda r, context_name:\n- len(r[context_name]['az']),\n+ len(r[context_name][g.REQ_SORT_ORDER_TYPE]),\n'videolist_wid_sorted': lambda r, context_name, context_id:\n- len(r[context_name][context_id]['az']),\n+ len(r[context_name][context_id][g.REQ_SORT_ORDER_TYPE]),\n'seasonlist': lambda r, tvshowid:\nlen(r['videos'][tvshowid]['seasonList']),\n'episodelist': lambda r, seasonid:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/shakti.py",
"new_path": "resources/lib/api/shakti.py",
"diff": "@@ -129,15 +129,14 @@ def video_list_sorted(context_name, context_id=None, perpetual_range_start=None)\ncommon.debug('Requesting video list sorted {}'.format(context_id))\ncall_data = {'length_params1': context_name,\n'perpetual_range_start': perpetual_range_start}\n- request_sort_order = 'az'\nif context_id:\ncall_data['path_type'] = 'videolist_wid_sorted'\n- call_data['paths'] = build_paths([context_name, context_id, request_sort_order, RANGE_SELECTOR],\n+ call_data['paths'] = build_paths([context_name, context_id, g.REQ_SORT_ORDER_TYPE, RANGE_SELECTOR],\nVIDEO_LIST_PARTIAL_PATHS)\ncall_data['length_params2'] = context_id\nelse:\ncall_data['path_type'] = 'videolist_sorted'\n- call_data['paths'] = build_paths([context_name, request_sort_order, RANGE_SELECTOR],\n+ call_data['paths'] = build_paths([context_name, g.REQ_SORT_ORDER_TYPE, RANGE_SELECTOR],\nVIDEO_LIST_PARTIAL_PATHS)\nreturn VideoListSorted(common.make_call(\n'perpetual_path_request', call_data), context_name, context_id)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -226,6 +226,10 @@ class GlobalVariables(object):\nself.TIME_TRACE_ENABLED = self.ADDON.getSettingBool('enable_timing')\nself.IPC_OVER_HTTP = self.ADDON.getSettingBool('enable_ipc_over_http')\n+ # enum order: AZ|ZA|Suggested|Year\n+ sort_order_types = ['az', 'za', 'su', 'yr']\n+ self.REQ_SORT_ORDER_TYPE = sort_order_types[int(g.ADDON.getSettingInt('sortordertype'))]\n+\ntry:\nos.mkdir(self.DATA_PATH)\nexcept OSError:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/actions.py",
"new_path": "resources/lib/navigation/actions.py",
"diff": "@@ -80,6 +80,7 @@ class AddonActionExecutor(object):\n# common.delete_ndb_files()\n# g.init_persistent_storage()\ng.CACHE.invalidate(self.params.get('on_disk', False))\n+ if not self.params.get('no_notification', False):\nui.show_notification(common.get_local_string(30135))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/settings_monitor.py",
"new_path": "resources/lib/services/settings_monitor.py",
"diff": "@@ -18,4 +18,10 @@ class SettingsMonitor(xbmc.Monitor):\ndef _on_change(self):\ncommon.debug('SettingsMonitor: Settings changed, reinitialize global settings')\n+ req_sort_order_type_oldvalue = g.REQ_SORT_ORDER_TYPE\n+\ng.init_globals(sys.argv)\n+\n+ if g.REQ_SORT_ORDER_TYPE != req_sort_order_type_oldvalue:\n+ # We remove the cache to allow get the new results in the chosen order\n+ common.run_plugin('plugin://plugin.video.netflix/action/purge_cache/?on_disk=True&no_notification=True')\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<setting id=\"update_running\" type=\"text\" visible=\"false\" default=\"false\"/>\n</category>\n<category label=\"30037\">\n+ <setting id=\"sortordertype\" type=\"select\" label=\"30149\" lvalues=\"30150|30151|30152|30153\" default=\"0\"/>\n<setting id=\"customview\" type=\"bool\" label=\"30038\" default=\"false\"/>\n<setting id=\"viewmodelogin\" type=\"select\" label=\"30044\" lvalues=\"535|20021|31099|31100|31101|31107|31102|20020|20445|30142\" default=\"7\" enable=\"eq(-1,true)\" visible=\"false\"/>\n<setting id=\"viewmodeloginid\" type=\"number\" label=\"30143\" visible=\"eq(-1,9) + eq(-2,true)\" enable=\"eq(-2,true)\" subsetting=\"true\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Added choice of type sorting of results |
106,046 | 08.04.2019 21:04:16 | -7,200 | b1d073f0d8e5bc84456f7dc2a2bbfc32f30c5619 | Updated translations stop confusion for hdr and dolby options | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -149,7 +149,7 @@ msgid \"Tracking\"\nmsgstr \"\"\nmsgctxt \"#30033\"\n-msgid \"Use Dolby Sound\"\n+msgid \"Enable Dolby Digital Plus (DDPlus HQ and Atmos on Premium)\"\nmsgstr \"\"\nmsgctxt \"#30034\"\n@@ -257,7 +257,7 @@ msgid \"Switch accounts\"\nmsgstr \"\"\nmsgctxt \"#30060\"\n-msgid \"Enable HEVC profiles (f.e. 4k for Android)\"\n+msgid \"Enable HEVC profiles (4k for Android/HDR/DolbyVision)\"\nmsgstr \"\"\nmsgctxt \"#30061\"\n@@ -460,8 +460,8 @@ msgctxt \"#30110\"\nmsgid \"Background services started\"\nmsgstr \"\"\n-msgctxt \"#30111\"\n-msgid \"Enable Dolby Atmos\"\n+msgctxt \"#30111\" #Not in use\n+msgid \"\"\nmsgstr \"\"\nmsgctxt \"#30112\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.fr_fr/strings.po",
"new_path": "resources/language/resource.language.fr_fr/strings.po",
"diff": "@@ -149,8 +149,8 @@ msgid \"Tracking\"\nmsgstr \"Traceur\"\nmsgctxt \"#30033\"\n-msgid \"Use Dolby Sound\"\n-msgstr \"Activer le son Dolby\"\n+msgid \"Enable Dolby Digital Plus (DDPlus HQ and Atmos on Premium)\"\n+msgstr \"Activer Dolby Digital Plus (DDPlus HQ et Atmos sur Premium)\"\nmsgctxt \"#30034\"\nmsgid \"ESN (set automatically, can be changed manually)\"\n@@ -257,8 +257,8 @@ msgid \"Switch accounts\"\nmsgstr \"Changer de compte\"\nmsgctxt \"#30060\"\n-msgid \"Enable HEVC profiles (f.e. 4k for Android)\"\n-msgstr \"Activer HEVC (par example pour la 4k sur Android)\"\n+msgid \"Enable HEVC profiles (4k for Android/HDR/DolbyVision)\"\n+msgstr \"Activer HEVC (4k sur Android/HDR/DolbyVision)\"\nmsgctxt \"#30061\"\nmsgid \"Update inside library\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.nl_nl/strings.po",
"new_path": "resources/language/resource.language.nl_nl/strings.po",
"diff": "@@ -46,7 +46,7 @@ msgstr \"Paswoord\"\nmsgctxt \"#30005\"\nmsgid \"E-mail\"\n-msgstr \"\"\n+msgstr \"E-mail\"\nmsgctxt \"#30006\"\nmsgid \"Adult verification failed\"\n@@ -66,7 +66,7 @@ msgstr \"Controleer uw inloggegevens\"\nmsgctxt \"#30010\"\nmsgid \"Genres\"\n-msgstr \"\"\n+msgstr \"Genres\"\nmsgctxt \"#30011\"\nmsgid \"Search\"\n@@ -82,7 +82,7 @@ msgstr \"Geen overeenkomsten gevonden\"\nmsgctxt \"#30014\"\nmsgid \"Account\"\n-msgstr \"\"\n+msgstr \"Account\"\nmsgctxt \"#30017\"\nmsgid \"Logout\"\n@@ -110,7 +110,7 @@ msgstr \"(tussen 0 & 10)\"\nmsgctxt \"#30023\"\nmsgid \"Expert\"\n-msgstr \"\"\n+msgstr \"Expert\"\nmsgctxt \"#30024\"\nmsgid \"SSL verification\"\n@@ -146,11 +146,7 @@ msgstr \"Titel bibliotheek aanpassen\"\nmsgctxt \"#30032\"\nmsgid \"Tracking\"\n-msgstr \"\"\n-\n-msgctxt \"#30033\"\n-msgid \"Use Dolby Sound\"\n-msgstr \"Gebruik Dolby geluid\"\n+msgstr \"Tracking\"\nmsgctxt \"#30034\"\nmsgid \"ESN (set automatically, can be changed manually)\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.pt_pt/strings.po",
"new_path": "resources/language/resource.language.pt_pt/strings.po",
"diff": "@@ -149,8 +149,8 @@ msgid \"Tracking\"\nmsgstr \"Rastreio\"\nmsgctxt \"#30033\"\n-msgid \"Use Dolby Sound\"\n-msgstr \"Usar Dolby Sound\"\n+msgid \"Enable Dolby Digital Plus (DDPlus HQ and Atmos on Premium)\"\n+msgstr \"Ativar Dolby Digital Plus (DDPlus HQ e Atmos on Premium)\"\nmsgctxt \"#30034\"\nmsgid \"ESN (set automatically, can be changed manually)\"\n@@ -257,8 +257,8 @@ msgid \"Switch accounts\"\nmsgstr \"Mudar de conta\"\nmsgctxt \"#30060\"\n-msgid \"Enable HEVC profiles (f.e. 4k for Android)\"\n-msgstr \"Activar perfis HEVC (por exemplo, 4k para Android)\"\n+msgid \"Enable HEVC profiles (4k for Android/HDR/DolbyVision)\"\n+msgstr \"Activar perfis HEVC (4k para Android/HDR/DolbyVision)\"\nmsgctxt \"#30061\"\nmsgid \"Update inside library\"\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Updated translations stop confusion for hdr and dolby options |
106,046 | 10.04.2019 20:36:59 | -7,200 | f08b3bc16bcfb0b453b26fe719ffe5c9904193a0 | Fixed menu description when the contained list is empty | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -460,8 +460,8 @@ msgctxt \"#30110\"\nmsgid \"Background services started\"\nmsgstr \"\"\n-msgctxt \"#30111\" #Not in use\n-msgid \"\"\n+msgctxt \"#30111\"\n+msgid \"There is no contents\"\nmsgstr \"\"\nmsgctxt \"#30112\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -74,7 +74,7 @@ def parse_info(videoid, item, raw_data):\ncommon.get_local_string(30087).format(\n', '.join(item.contained_titles))\nif item.contained_titles\n- else common.get_local_string(30087)\n+ else common.get_local_string(30111)\n}, {}\ninfos = {'mediatype': ('tvshow'\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed menu description when the contained list is empty |
105,975 | 11.04.2019 13:37:17 | -7,200 | cd8da70d547c547fab99bc5d87028be6f752abee | refactor perpetual_path_request() | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/paths.py",
"new_path": "resources/lib/api/paths.py",
"diff": "@@ -16,18 +16,10 @@ ART_SIZE_FHD = '_1920x1080'\nART_SIZE_SD = '_665x375'\nLENGTH_ATTRIBUTES = {\n- 'videolist': lambda r, listid:\n- len(r['lists'][listid]),\n- 'videolist_sorted': lambda r, context_name:\n- len(r[context_name][g.REQ_SORT_ORDER_TYPE]),\n- 'videolist_wid_sorted': lambda r, context_name, context_id:\n- len(r[context_name][context_id][g.REQ_SORT_ORDER_TYPE]),\n- 'seasonlist': lambda r, tvshowid:\n- len(r['videos'][tvshowid]['seasonList']),\n- 'episodelist': lambda r, seasonid:\n- len(r['seasons'][seasonid]['episodes']),\n- 'searchlist': lambda r, context_name, by_ref:\n- len(next(iter(r[context_name][by_ref].values())))}\n+ 'stdlist': lambda r, context, key: len(r[context][key]),\n+ 'stdlist_wid': lambda r, context, uid, key: len(r[context][uid][key]),\n+ 'searchlist': lambda r, context, key: len(next(r[context][key].itervalues()))\n+}\n\"\"\"Predefined lambda expressions that return the number of video results within a path response dict\"\"\"\nART_PARTIAL_PATHS = [\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/shakti.py",
"new_path": "resources/lib/api/shakti.py",
"diff": "@@ -107,16 +107,14 @@ def video_list(list_id, perpetual_range_start=None):\nand the 'length' tag never return to the actual total count of the elements\n\"\"\"\ncommon.debug('Requesting video list {}'.format(list_id))\n- return VideoList(common.make_call(\n- 'perpetual_path_request',\n- {\n- 'path_type': 'videolist',\n- 'paths':\n- build_paths(['lists', list_id, RANGE_SELECTOR, 'reference'],\n- VIDEO_LIST_PARTIAL_PATHS),\n- 'length_params1': list_id,\n+ paths = build_paths(['lists', list_id, RANGE_SELECTOR, 'reference'],\n+ VIDEO_LIST_PARTIAL_PATHS)\n+ callargs = {\n+ 'paths': paths,\n+ 'length_params': ['stdlist', ['lists', list_id]],\n'perpetual_range_start': perpetual_range_start\n- }))\n+ }\n+ return VideoList(common.make_call('perpetual_path_request', callargs))\[email protected]_execution(immediate=False)\n@@ -127,19 +125,20 @@ def video_list_sorted(context_name, context_id=None, perpetual_range_start=None)\nthis type of request allows to obtain more than ~40 results\n\"\"\"\ncommon.debug('Requesting video list sorted {}'.format(context_id))\n- call_data = {'length_params1': context_name,\n- 'perpetual_range_start': perpetual_range_start}\n+ base_path = [context_name]\n+ response_type = 'stdlist'\nif context_id:\n- call_data['path_type'] = 'videolist_wid_sorted'\n- call_data['paths'] = build_paths([context_name, context_id, g.REQ_SORT_ORDER_TYPE, RANGE_SELECTOR],\n- VIDEO_LIST_PARTIAL_PATHS)\n- call_data['length_params2'] = context_id\n- else:\n- call_data['path_type'] = 'videolist_sorted'\n- call_data['paths'] = build_paths([context_name, g.REQ_SORT_ORDER_TYPE, RANGE_SELECTOR],\n- VIDEO_LIST_PARTIAL_PATHS)\n- return VideoListSorted(common.make_call(\n- 'perpetual_path_request', call_data), context_name, context_id)\n+ base_path.append(context_id)\n+ response_type = 'stdlist_wid'\n+ base_path.append(g.REQ_SORT_ORDER_TYPE)\n+ paths = build_paths(base_path + [RANGE_SELECTOR], VIDEO_LIST_PARTIAL_PATHS)\n+ callargs = {\n+ 'paths': paths,\n+ 'length_params': [response_type, base_path],\n+ 'perpetual_range_start': perpetual_range_start\n+ }\n+ return VideoListSorted(common.make_call('perpetual_path_request', callargs),\n+ context_name, context_id)\[email protected]_execution(immediate=False)\n@@ -170,6 +169,7 @@ def genre(genre_id):\n[['genres', genre_id, 'subgenres', {'from': 0, 'to': 30},\n['id', 'name']]]))\n+\[email protected]_execution(immediate=False)\[email protected]_output(g, cache.CACHE_COMMON)\ndef seasons(videoid):\n@@ -178,16 +178,12 @@ def seasons(videoid):\nraise common.InvalidVideoId('Cannot request season list for {}'\n.format(videoid))\ncommon.debug('Requesting season list for show {}'.format(videoid))\n- return SeasonList(\n- videoid,\n- common.make_call(\n- 'perpetual_path_request',\n- {\n- 'path_type': 'seasonlist',\n- 'paths': build_paths(['videos', videoid.tvshowid],\n- SEASONS_PARTIAL_PATHS),\n- 'length_params1': videoid.tvshowid\n- }))\n+ paths = build_paths(['videos', videoid.tvshowid], SEASONS_PARTIAL_PATHS)\n+ callargs = {\n+ 'paths': paths,\n+ 'length_params': ['stdlist_wid', ['videos', videoid.tvshowid, 'seasonList']]\n+ }\n+ return SeasonList(videoid, common.make_call('perpetual_path_request', callargs))\[email protected]_execution(immediate=False)\n@@ -198,23 +194,16 @@ def episodes(videoid):\nraise common.InvalidVideoId('Cannot request episode list for {}'\n.format(videoid))\ncommon.debug('Requesting episode list for {}'.format(videoid))\n- return EpisodeList(\n- videoid,\n- common.make_call(\n- 'perpetual_path_request',\n- {\n- 'path_type': 'episodelist',\n- 'paths':\n- [['seasons', videoid.seasonid, 'summary']] +\n- build_paths(\n- ['seasons', videoid.seasonid, 'episodes',\n- RANGE_SELECTOR],\n- EPISODES_PARTIAL_PATHS) +\n- build_paths(\n- ['videos', videoid.tvshowid],\n- ART_PARTIAL_PATHS + [['title']]),\n- 'length_params1': videoid.seasonid\n- }))\n+ paths = [['seasons', videoid.seasonid, 'summary']]\n+ paths.extend(build_paths(['seasons', videoid.seasonid, 'episodes', RANGE_SELECTOR],\n+ EPISODES_PARTIAL_PATHS))\n+ paths.extend(build_paths(['videos', videoid.tvshowid],\n+ ART_PARTIAL_PATHS + [['title']]))\n+ callargs = {\n+ 'paths': paths,\n+ 'length_params': ['stdlist_wid', ['seasons', videoid.seasonid, 'episodes']]\n+ }\n+ return EpisodeList(videoid, common.make_call('perpetual_path_request', callargs))\[email protected]_execution(immediate=False)\n@@ -341,13 +330,14 @@ def search(search_term, perpetual_range_start=None):\ncommon.debug('Searching for {}'.format(search_term))\nbase_path = ['search', 'byTerm', '|' + search_term, 'titles', MAX_PATH_REQUEST_SIZE]\npaths = [base_path + [['id', 'name', 'requestId']]]\n- paths.extend(build_paths(base_path + [RANGE_SELECTOR, 'reference'], VIDEO_LIST_PARTIAL_PATHS))\n- call_data = {'path_type': 'searchlist',\n+ paths.extend(build_paths(base_path + [RANGE_SELECTOR, 'reference'],\n+ VIDEO_LIST_PARTIAL_PATHS))\n+ callargs = {\n'paths': paths,\n- 'length_params1': 'search',\n- 'length_params2': 'byReference',\n- 'perpetual_range_start': perpetual_range_start}\n- return SearchVideoList(common.make_call('perpetual_path_request', call_data))\n+ 'length_params': ['searchlist', ['search', 'byReference']],\n+ 'perpetual_range_start': perpetual_range_start\n+ }\n+ return SearchVideoList(common.make_call('perpetual_path_request', callargs))\[email protected]_execution(immediate=False)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/nfsession.py",
"new_path": "resources/lib/services/nfsession/nfsession.py",
"diff": "@@ -263,42 +263,42 @@ class NetflixSession(object):\[email protected]_return_call\n@needs_login\[email protected]_execution(immediate=True)\n- def perpetual_path_request(self, paths, path_type, length_params1=None, length_params2=None,\n- perpetual_range_start=None):\n+ def perpetual_path_request(self, paths, length_params, perpetual_range_start=None):\n\"\"\"Perform a perpetual path request against the Shakti API to retrieve\na possibly large video list. If the requested video list's size is\nlarger than MAX_PATH_REQUEST_SIZE, multiple path requests will be\nexecuted with forward shifting range selectors and the results will\nbe combined into one path response.\"\"\"\n- if length_params2 is None:\n- length_params = [length_params1]\n- else:\n- length_params = [length_params1, length_params2]\n- length = apipaths.LENGTH_ATTRIBUTES[path_type]\n+ response_type, length_args = length_params\n+ context_name = length_args[0]\n+ response_length = apipaths.LENGTH_ATTRIBUTES[response_type]\n+\n+ request_size = apipaths.MAX_PATH_REQUEST_SIZE\n+ response_size = request_size + 1\n+ # Note: when the request is made with 'genres' context,\n+ # the response strangely does not respect the number of objects\n+ # requested, returning 1 more item, i couldn't understand why\n+ if context_name == 'genres':\n+ response_size += 1\nnumber_of_requests = 2\nperpetual_range_start = int(perpetual_range_start) if perpetual_range_start else 0\nrange_start = perpetual_range_start\n- range_end = range_start + apipaths.MAX_PATH_REQUEST_SIZE\n+ range_end = range_start + request_size\nmerged_response = {}\nfor n_req in range(number_of_requests):\npath_response = self._path_request(_set_range_selector(paths, range_start, range_end))\nif len(path_response) != 0:\ncommon.merge_dicts(path_response, merged_response)\n- videos_count = length(path_response, *length_params) - 1 # has zero base\n- if videos_count >= apipaths.MAX_PATH_REQUEST_SIZE:\n- # Note: when the request is made with 'genres' context,\n- # the response strangely does not respect the number of objects\n- # requested, returning 1 more item, i couldn't understand why\n- if length_params1 == 'genres':\n- range_end += 1\n+ response_count = response_length(path_response, *length_args)\n+ if response_count >= response_size:\n+ range_start += response_size\nif n_req == (number_of_requests - 1):\n- merged_response['_perpetual_range_selector'] = {'next_start': range_end + 1}\n- common.debug('{} have other elements, added _perpetual_range_selector item'.format(path_type))\n+ merged_response['_perpetual_range_selector'] = {'next_start': range_start}\n+ common.debug('{} has other elements, added _perpetual_range_selector item'.format(response_type))\nelse:\n- range_start = range_end + 1\n- range_end = range_start + apipaths.MAX_PATH_REQUEST_SIZE\n+ range_end = range_start + request_size\nelse:\n#There are no other elements to request\nbreak\n@@ -306,10 +306,7 @@ class NetflixSession(object):\nbreak\nif perpetual_range_start > 0:\n- size = apipaths.MAX_PATH_REQUEST_SIZE + 1\n- if length_params1 == 'genres':\n- size += 1\n- previous_start = perpetual_range_start - (size * number_of_requests)\n+ previous_start = perpetual_range_start - (response_size * number_of_requests)\nif '_perpetual_range_selector' in merged_response:\nmerged_response['_perpetual_range_selector']['previous_start'] = previous_start\nelse:\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | refactor perpetual_path_request() |
106,046 | 12.04.2019 21:53:29 | -7,200 | 01b00b79d60375ce9cdda8398d58111143747b2b | Update some addon info | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<summary lang=\"en_GB\">Netflix</summary>\n<description lang=\"en_GB\">Netflix VOD Services Addon</description>\n<disclaimer lang=\"en_GB\">Some parts of this addon may not be legal in your country of residence - please check with your local laws before installing.</disclaimer>\n+ <description lang=\"it_IT\">Netflix Addon servizi VOD</description>\n+ <disclaimer lang=\"it_IT\">Alcune parti di questo addon potrebbero non essere legali nel proprio paese di residenza - si prega di verificare le leggi locali prima dell'installazione.</disclaimer>\n<assets>\n<icon>resources/icon.png</icon>\n<fanart>resources/fanart.jpg</fanart>\n<platform>all</platform>\n<license>MIT</license>\n<website>https://www.netflix.com</website>\n- <email>public at asciidisco dot com</email>\n- <forum>https://www.kodinerds.net/index.php/Thread/55612-PreRelease-Plugin-Netflix-Inputstream/</forum>\n+ <email></email>\n+ <forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\nv0.14.0 beta23 (2019-03-17)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Update some addon info |
106,046 | 12.04.2019 22:06:24 | -7,200 | 42a438e2d067b1afa909751f93b2d726bfb36faf | Version bump (beta24) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta23\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta24\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.26.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n+v0.14.0 beta24 (2019-04-12)\n+- Added pagination support of results\n+- Added choice of type sorting of results (in settings, views)\n+- Added workaround for locale+country problem es. spain-spain pt-breton etc.\n+- Updated polish translation\n+- Fixed \"check your credentials\" after login\n+- Fixed unicode decode errors with library\n+- Fixed loss of tv series and films exported\n+- Fixed wrong results with search using special characters\n+- Other fixes\n+\nv0.14.0 beta23 (2019-03-17)\n- Fixed InvalidVideoId error when try to access a profile\n- Fixed UnicodeEncodeError when play a video with some particular languages\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (beta24) |
106,046 | 14.04.2019 11:13:44 | -7,200 | 9b8b4eb903cd7a29d87402190edb909360e1a49a | Updated profiles and manifest data | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/converter.py",
"new_path": "resources/lib/services/msl/converter.py",
"diff": "@@ -144,10 +144,13 @@ def _convert_audio_track(audio_track, period, init_length, default):\ndef _convert_audio_downloadable(downloadable, adaptation_set, init_length,\nchannels_count):\n+ codec_type = 'aac'\n+ if 'ddplus-' in downloadable['content_profile'] or 'dd-' in downloadable['content_profile']:\n+ codec_type = 'ec-3'\nrepresentation = ET.SubElement(\nparent=adaptation_set,\ntag='Representation',\n- codecs='ec-3' if 'ddplus' in downloadable['content_profile'] else 'aac',\n+ codecs=codec_type,\nbandwidth=str(downloadable['bitrate'] * 1024),\nmimeType='audio/mp4')\nET.SubElement(\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/msl_handler.py",
"new_path": "resources/lib/services/msl/msl_handler.py",
"diff": "@@ -160,8 +160,8 @@ class MSLHandler(object):\n'id': id,\n'esn': esn,\n'languages' : [g.PERSISTENT_STORAGE['locale_id']],\n- 'uiVersion': 'shakti-v25d2fa21',\n- 'clientVersion': '6.0011.474.011',\n+ 'uiVersion': 'shakti-v5bca5cd3',\n+ 'clientVersion': '6.0013.315.051',\n'params': {\n'type': 'standard',\n'viewableId': [viewable_id],\n@@ -173,8 +173,9 @@ class MSLHandler(object):\n'isBranching': False,\n'useHttpsStreams': False,\n'imageSubtitleHeight': 1080,\n- 'uiVersion': 'shakti-vb45817f4',\n- 'clientVersion': '6.0011.511.011',\n+ 'uiVersion': 'shakti-v5bca5cd3',\n+ 'uiPlatform': 'SHAKTI',\n+ 'clientVersion': '6.0013.315.051',\n'supportsPreReleasePin': True,\n'supportsWatermark': True,\n'showAllSubDubTracks': False,\n@@ -215,8 +216,8 @@ class MSLHandler(object):\n'id': id,\n'esn': g.get_esn(),\n'languages': [g.PERSISTENT_STORAGE['locale_id']],\n- 'uiVersion': 'shakti-v25d2fa21',\n- 'clientVersion': '6.0011.511.011',\n+ 'uiVersion': 'shakti-v5bca5cd3',\n+ 'clientVersion': '6.0013.315.051',\n'params': [{\n'sessionId': sid,\n'clientTime': int(id / 10000),\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/profiles.py",
"new_path": "resources/lib/services/msl/profiles.py",
"diff": "@@ -11,7 +11,7 @@ HEVC = 'hevc-main-'\nHEVC_M10 = 'hevc-main10-'\nCENC_PRK = 'dash-cenc-prk'\nCENC = 'dash-cenc'\n-CENC_TL = 'dash-cenc-ctl'\n+CENC_TL = 'dash-cenc-tl'\nHDR = 'hevc-hdr-main10-'\nDV = 'hevc-dv-main10-'\nDV5 = 'hevc-dv5-main10-'\n@@ -20,6 +20,8 @@ VP9_PROFILE2 = 'vp9-profile2-'\nBASE_LEVELS = ['L30-', 'L31-', 'L40-', 'L41-', 'L50-', 'L51-']\nCENC_TL_LEVELS = ['L30-L31-', 'L31-L40-', 'L40-L41-', 'L50-L51-']\n+VP9_PROFILE0_LEVELS = ['L21-', 'L30-', 'L31-', 'L40-']\n+VP9_PROFILE2_LEVELS = ['L30-', 'L31-', 'L40-', 'L50-', 'L51-']\ndef _profile_strings(base, tails):\n@@ -35,8 +37,8 @@ PROFILES = {\n'playready-heaac-2-dash',\n# Unknown\n'BIF240', 'BIF320'],\n- 'dolbysound': ['ddplus-2.0-dash', 'ddplus-5.1-dash', 'ddplus-5.1hq-dash',\n- 'ddplus-atmos-dash'],\n+ # 'dd-5.1-elem' DD 384< Bitrate, currently inputstream fails to manage this profile\n+ 'dolbysound': ['ddplus-2.0-dash', 'ddplus-5.1-dash', 'ddplus-atmos-dash'],\n'h264': ['playready-h264mpl30-dash', 'playready-h264mpl31-dash',\n'playready-h264mpl40-dash',\n'playready-h264hpl30-dash', 'playready-h264hpl31-dash',\n@@ -60,10 +62,10 @@ PROFILES = {\ntails=[(BASE_LEVELS, CENC_PRK)]),\n'vp9profile0':\n_profile_strings(base=VP9_PROFILE0,\n- tails=[(BASE_LEVELS, CENC)]),\n+ tails=[(VP9_PROFILE0_LEVELS, CENC)]),\n'vp9profile2':\n_profile_strings(base=VP9_PROFILE2,\n- tails=[(BASE_LEVELS, CENC_PRK)])\n+ tails=[(VP9_PROFILE2_LEVELS, CENC_PRK)])\n}\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Updated profiles and manifest data |
106,046 | 15.04.2019 20:22:12 | -7,200 | d43d98c376be734d1c25e155e3b4812815fdb943 | Fixed view types for lists and content types | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -651,3 +651,19 @@ msgstr \"\"\nmsgctxt \"#30158\"\nmsgid \"Show configuration screen at addon startup\"\nmsgstr \"\"\n+\n+msgctxt \"#30159\"\n+msgid \"View for main menu\"\n+msgstr \"\"\n+\n+msgctxt \"#30160\"\n+msgid \"View for search\"\n+msgstr \"\"\n+\n+msgctxt \"#30161\"\n+msgid \"View for exported\"\n+msgstr \"\"\n+\n+msgctxt \"#30162\"\n+msgid \"Last used\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -26,20 +26,20 @@ class GlobalVariables(object):\n# pylint: disable=attribute-defined-outside-init\n# pylint: disable=invalid-name, too-many-instance-attributes\n+ # Values in the variables VIEW_* stand for a partial menu id,\n+ # contained in the settings xml, example 'profiles' stand for id 'viewmodeprofiles'\n+ VIEW_PROFILES = 'profiles'\n+ VIEW_MAINMENU = 'mainmenu'\n+ VIEW_MYLIST = 'mylist'\nVIEW_FOLDER = 'folder'\nVIEW_MOVIE = 'movie'\nVIEW_SHOW = 'show'\nVIEW_SEASON = 'season'\nVIEW_EPISODE = 'episode'\n- VIEW_GENRES = 'genres'\n- VIEW_RACOMMENDATIONS = 'folder'\n- VIEW_SEARCH = 'folder'\n+ VIEW_SEARCH = 'search'\nVIEW_EXPORTED = 'exported'\n- VIEWTYPES = [VIEW_FOLDER, VIEW_MOVIE, VIEW_SHOW, VIEW_SEASON,\n- VIEW_EPISODE, VIEW_GENRES, VIEW_RACOMMENDATIONS,\n- VIEW_SEARCH, VIEW_EXPORTED]\n-\n+ CONTENT_IMAGES = 'images'\nCONTENT_FOLDER = 'files'\nCONTENT_MOVIE = 'movies'\nCONTENT_SHOW = 'tvshows'\n@@ -54,8 +54,8 @@ class GlobalVariables(object):\nlabel_id : menu title\ndescription_id : description info text\nicon : set a default image\n- view_type : set the type of view, configurable from addon views settings\n- content_type : sets the type of content\n+ view : override the default \"partial menu id\" of view\n+ content_type : override the default content type (CONTENT_SHOW)\nshow_in_menu : show/hide menu\nExplanation of function names in the 'path' key:\n@@ -69,20 +69,15 @@ class GlobalVariables(object):\n'lolomo_contexts': ['queue'],\n'lolomo_known': True,\n'request_context_name': 'mylist',\n- 'view_type': VIEW_SHOW,\n- 'content_type': CONTENT_FOLDER,\n+ 'view': VIEW_MYLIST,\n'show_in_menu': True}),\n('continueWatching', {'path': ['video_list', 'continueWatching'],\n'lolomo_contexts': ['continueWatching'],\n'lolomo_known': True,\n- 'view_type': VIEW_SHOW,\n- 'content_type': CONTENT_FOLDER,\n'show_in_menu': True}),\n('chosenForYou', {'path': ['video_list', 'chosenForYou'],\n'lolomo_contexts': ['topTen'],\n'lolomo_known': True,\n- 'view_type': VIEW_SHOW,\n- 'content_type': CONTENT_FOLDER,\n'show_in_menu': True}),\n('recentlyAdded', {'path': ['video_list_sorted', 'recentlyAdded', '1592210'],\n'lolomo_contexts': None,\n@@ -91,34 +86,24 @@ class GlobalVariables(object):\n'label_id': 30145,\n'description_id': 30146,\n'icon': 'DefaultRecentlyAddedMovies.png',\n- 'view_type': VIEW_SHOW,\n- 'content_type': CONTENT_FOLDER,\n'show_in_menu': True}),\n('newRelease', {'path': ['video_list_sorted', 'newRelease'],\n'lolomo_contexts': ['newRelease'],\n'lolomo_known': True,\n'request_context_name': 'newrelease',\n- 'view_type': VIEW_SHOW,\n- 'content_type': CONTENT_FOLDER,\n'show_in_menu': True}),\n('currentTitles', {'path': ['video_list', 'currentTitles'],\n'lolomo_contexts': ['trendingNow'],\n'lolomo_known': True,\n- 'view_type': VIEW_SHOW,\n- 'content_type': CONTENT_FOLDER,\n'show_in_menu': True}),\n('mostViewed', {'path': ['video_list', 'mostViewed'],\n'lolomo_contexts': ['popularTitles'],\n'lolomo_known': True,\n- 'view_type': VIEW_SHOW,\n- 'content_type': CONTENT_FOLDER,\n'show_in_menu': True}),\n('netflixOriginals', {'path': ['video_list_sorted', 'netflixOriginals', '839338'],\n'lolomo_contexts': ['netflixOriginals'],\n'lolomo_known': True,\n'request_context_name': 'genres',\n- 'view_type': VIEW_SHOW,\n- 'content_type': CONTENT_FOLDER,\n'show_in_menu': True}),\n('genres', {'path': ['genres', 'genres'],\n'lolomo_contexts': ['genre'],\n@@ -127,8 +112,7 @@ class GlobalVariables(object):\n'label_id': 30010,\n'description_id': 30093,\n'icon': 'DefaultGenre.png',\n- 'view_type': VIEW_GENRES,\n- 'content_type': CONTENT_SHOW,\n+ 'content_type': CONTENT_FOLDER,\n'show_in_menu': True}),\n('recommendations', {'path': ['recommendations', 'recommendations'],\n'lolomo_contexts': ['similars', 'becauseYouAdded'],\n@@ -136,8 +120,7 @@ class GlobalVariables(object):\n'label_id': 30001,\n'description_id': 30094,\n'icon': 'DefaultUser.png',\n- 'view_type': VIEW_RACOMMENDATIONS,\n- 'content_type': CONTENT_SHOW,\n+ 'content_type': CONTENT_FOLDER,\n'show_in_menu': True}),\n('tvshows', {'path': ['genres', 'tvshows', '83'],\n'lolomo_contexts': None,\n@@ -146,8 +129,7 @@ class GlobalVariables(object):\n'label_id': 30095,\n'description_id': None,\n'icon': 'DefaultTVShows.png',\n- 'view_type': VIEW_SHOW,\n- 'content_type': CONTENT_SHOW,\n+ 'content_type': CONTENT_FOLDER,\n'show_in_menu': True}),\n('movies', {'path': ['genres', 'movies', '34399'],\n'lolomo_contexts': None,\n@@ -156,8 +138,7 @@ class GlobalVariables(object):\n'label_id': 30096,\n'description_id': None,\n'icon': 'DefaultMovies.png',\n- 'view_type': VIEW_MOVIE,\n- 'content_type': CONTENT_MOVIE,\n+ 'content_type': CONTENT_FOLDER,\n'show_in_menu': True}),\n('search', {'path': ['search', 'search'],\n'lolomo_contexts': None,\n@@ -165,8 +146,7 @@ class GlobalVariables(object):\n'label_id': 30011,\n'description_id': 30092,\n'icon': None,\n- 'view_type': VIEW_SEARCH,\n- 'content_type': CONTENT_SHOW,\n+ 'view': VIEW_SEARCH,\n'show_in_menu': True}),\n('exported', {'path': ['exported', 'exported'],\n'lolomo_contexts': None,\n@@ -174,8 +154,7 @@ class GlobalVariables(object):\n'label_id': 30048,\n'description_id': 30091,\n'icon': 'DefaultHardDisk.png',\n- 'view_type': VIEW_EXPORTED,\n- 'content_type': CONTENT_SHOW,\n+ 'view': VIEW_EXPORTED,\n'show_in_menu': True})\n])\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/listings.py",
"new_path": "resources/lib/kodi/listings.py",
"diff": "@@ -4,6 +4,7 @@ from __future__ import unicode_literals\nfrom functools import wraps\n+import collections\nimport os\nimport xbmc\nimport xbmcgui\n@@ -16,7 +17,7 @@ from .infolabels import add_info, add_art\nfrom .context_menu import generate_context_menu_items\n-def custom_viewmode(viewtype):\n+def custom_viewmode(partial_setting_id):\n\"\"\"Decorator that sets a custom viewmode if currently in\na listing of the plugin\"\"\"\n# pylint: disable=missing-docstring\n@@ -24,36 +25,46 @@ def custom_viewmode(viewtype):\n@wraps(func)\ndef set_custom_viewmode(*args, **kwargs):\n# pylint: disable=no-member\n- viewtype_override = func(*args, **kwargs)\n- view = (viewtype_override\n- if viewtype_override in g.VIEWTYPES\n- else viewtype)\n- _activate_view(view)\n+ override_partial_setting_id = func(*args, **kwargs)\n+ _activate_view(override_partial_setting_id\n+ if override_partial_setting_id else\n+ partial_setting_id)\nreturn set_custom_viewmode\nreturn decorate_viewmode\n-def _activate_view(view):\n- \"\"\"Activate the given view if the plugin is run in the foreground\n- and custom views are enabled\"\"\"\n- if (('plugin://{}'.format(g.ADDON_ID) in\n- xbmc.getInfoLabel('Container.FolderPath')) and\n- g.ADDON.getSettingBool('customview')):\n-\n- #enum order: List|Poster|IconWall|Shift|InfoWall|WideList|Wall|Banner|FanArt|Custom\n- views_id_list = [50, 51, 52, 53, 54, 55, 500, 501, 502, -1]\n-\n- view_id = views_id_list[int(g.ADDON.getSettingInt('viewmode' + view))]\n-\n+def _activate_view(partial_setting_id):\n+ \"\"\"Activate the given view if the plugin is run in the foreground\"\"\"\n+ if 'plugin://{}'.format(g.ADDON_ID) in xbmc.getInfoLabel('Container.FolderPath'):\n+ if g.ADDON.getSettingBool('customview'):\n+ # Do not change the sequence of this keys, match the return value of the enum xml menu\n+ list_views = collections.OrderedDict({\n+ '''\n+ With Kodi 19 should be implemented a method to get the id of the current skin,\n+ so we can use this list only with the default skin,\n+ the other skins partially implement the view types of the standard skin of kodi\n+ causing also alterations in the translations of the view type names.\n+ 'List': 50,\n+ 'Poster': 51,\n+ 'IconWall': 52,\n+ 'Shift': 53,\n+ 'InfoWall': 54,\n+ 'WideList': 55,\n+ 'Wall': 500,\n+ 'Banner': 501,\n+ 'FanArt': 502,'''\n+ 'LastUsed': 0, # Leave the management to kodi\n+ 'Custom': -1\n+ })\n+ # Force a custom view\n+ view_id = list_views.values()[int(g.ADDON.getSettingInt('viewmode' + partial_setting_id))]\nif view_id == -1:\n- view_id = int(g.ADDON.getSettingInt('viewmode' + view + 'id'))\n+ view_id = int(g.ADDON.getSettingInt('viewmode' + partial_setting_id + 'id'))\n+ if view_id > 0:\n+ xbmc.executebuiltin('Container.SetViewMode({})'.format(view_id))\n- if view_id != -1 and view_id != 0:\n- xbmc.executebuiltin(\n- 'Container.SetViewMode({})'.format(view_id))\n-\n-@custom_viewmode(g.VIEW_FOLDER)\n+@custom_viewmode(g.VIEW_PROFILES)\[email protected]_execution(immediate=False)\ndef build_profiles_listing(profiles):\n\"\"\"Builds the profiles list Kodi screen\"\"\"\n@@ -62,9 +73,11 @@ def build_profiles_listing(profiles):\nexcept ImportError:\nfrom html.parser import HTMLParser\nhtml_parser = HTMLParser()\n+ # The standard kodi theme does not allow to change view type if the content is \"files\" type,\n+ # so here we use \"images\" type, visually better to see\nfinalize_directory([_create_profile_item(guid, profile, html_parser)\nfor guid, profile\n- in profiles.iteritems()])\n+ in profiles.iteritems()], g.CONTENT_IMAGES)\ndef _create_profile_item(profile_guid, profile, html_parser):\n@@ -89,7 +102,7 @@ def _create_profile_item(profile_guid, profile, html_parser):\nreturn (url, list_item, True)\n-@custom_viewmode(g.VIEW_FOLDER)\n+@custom_viewmode(g.VIEW_MAINMENU)\[email protected]_execution(immediate=False)\ndef build_main_menu_listing(lolomo):\n\"\"\"\n@@ -146,13 +159,16 @@ def build_lolomo_listing(lolomo, menu_data, force_videolistbyid=False, exclude_l\nsub_menu_data['path'] = [menu_data['path'][0], sel_video_list_id]\nsub_menu_data['lolomo_known'] = False\nsub_menu_data['lolomo_contexts'] = None\n+ sub_menu_data['content_type'] = g.CONTENT_SHOW\nsub_menu_data['show_in_menu'] = False\nsub_menu_data['force_videolistbyid'] = force_videolistbyid\ng.PERSISTENT_STORAGE['sub_menus'][sel_video_list_id] = sub_menu_data\ng.PERSISTENT_STORAGE['menu_titles'][sel_video_list_id] = video_list['displayName']\ndirectory_items.append(_create_videolist_item(sel_video_list_id, video_list, sub_menu_data))\ng.PERSISTENT_STORAGE.commit()\n- finalize_directory(directory_items, g.CONTENT_FOLDER, title=g.get_menu_title(menu_data['path'][1]))\n+ finalize_directory(directory_items, menu_data.get('content_type', g.CONTENT_SHOW),\n+ title=g.get_menu_title(menu_data['path'][1]))\n+ return menu_data.get('view')\[email protected]_execution(immediate=False)\n@@ -199,7 +215,9 @@ def build_video_listing(video_list, menu_data, pathitems=None):\n# list_item_skeleton('Browse subgenres...'),\n# True))\nadd_items_previous_next_page(directory_items, pathitems, video_list.perpetual_range_selector)\n- finalize_directory(directory_items, menu_data['content_type'], title=g.get_menu_title(menu_data['path'][1]))\n+ finalize_directory(directory_items, menu_data.get('content_type', g.CONTENT_SHOW),\n+ title=g.get_menu_title(menu_data['path'][1]))\n+ return menu_data.get('view')\[email protected]_execution(immediate=False)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<category label=\"30037\">\n<setting id=\"sortordertype\" type=\"select\" label=\"30149\" lvalues=\"30150|30151|30152|30153\" default=\"0\"/>\n<setting id=\"customview\" type=\"bool\" label=\"30038\" default=\"false\"/>\n- <setting id=\"viewmodelogin\" type=\"select\" label=\"30044\" lvalues=\"535|20021|31099|31100|31101|31107|31102|20020|20445|30142\" default=\"7\" enable=\"eq(-1,true)\" visible=\"false\"/>\n- <setting id=\"viewmodeloginid\" type=\"number\" label=\"30143\" visible=\"eq(-1,9) + eq(-2,true)\" enable=\"eq(-2,true)\" subsetting=\"true\"/>\n- <setting id=\"viewmodefolder\" type=\"select\" label=\"30039\" lvalues=\"535|20021|31099|31100|31101|31107|31102|20020|20445|30142\" default=\"7\" enable=\"eq(-3,true)\"/>\n- <setting id=\"viewmodefolderid\" type=\"number\" label=\"30143\" visible=\"eq(-1,9) + eq(-4,true)\" enable=\"eq(-4,true)\" subsetting=\"true\"/>\n- <setting id=\"viewmodemovie\" type=\"select\" label=\"30040\" lvalues=\"535|20021|31099|31100|31101|31107|31102|20020|20445|30142\" default=\"8\" enable=\"eq(-5,true)\"/>\n- <setting id=\"viewmodemovieid\" type=\"number\" label=\"30143\" visible=\"eq(-1,9) + eq(-6,true)\" enable=\"eq(-6,true)\" subsetting=\"true\"/>\n- <setting id=\"viewmodeshow\" type=\"select\" label=\"30041\" lvalues=\"535|20021|31099|31100|31101|31107|31102|20020|20445|30142\" default=\"8\" enable=\"eq(-7,true)\"/>\n- <setting id=\"viewmodeshowid\" type=\"number\" label=\"30143\" visible=\"eq(-1,9) + eq(-8,true)\" enable=\"eq(-8,true)\" subsetting=\"true\"/>\n- <setting id=\"viewmodeseason\" type=\"select\" label=\"30042\" lvalues=\"535|20021|31099|31100|31101|31107|31102|20020|20445|30142\" default=\"8\" enable=\"eq(-9,true)\"/>\n- <setting id=\"viewmodeseasonid\" type=\"number\" label=\"30143\" visible=\"eq(-1,9) + eq(-10,true)\" enable=\"eq(-10,true)\" subsetting=\"true\"/>\n- <setting id=\"viewmodeepisode\" type=\"select\" label=\"30043\" lvalues=\"535|20021|31099|31100|31101|31107|31102|20020|20445|30142\" default=\"5\" enable=\"eq(-11,true)\"/>\n- <setting id=\"viewmodeepisodeid\" type=\"number\" label=\"30143\" visible=\"eq(-1,9) + eq(-12,true)\" enable=\"eq(-12,true)\" subsetting=\"true\"/>\n- <setting id=\"viewmodeexported\" type=\"select\" label=\"30074\" lvalues=\"535|20021|31099|31100|31101|31107|31102|20020|20445|30142\" default=\"8\" enable=\"eq(-13,true)\"/>\n- <setting id=\"viewmodeexportedid\" type=\"number\" label=\"30143\" visible=\"eq(-1,9) + eq(-14,true)\" enable=\"eq(-14,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodeprofiles\" type=\"select\" label=\"30044\" lvalues=\"30162|30142\" default=\"4\" enable=\"eq(-1,true)\"/>\n+ <setting id=\"viewmodeprofilesid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-2,true)\" enable=\"eq(-2,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodemainmenu\" type=\"select\" label=\"30159\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-3,true)\"/>\n+ <setting id=\"viewmodemainmenuid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-4,true)\" enable=\"eq(-4,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodefolder\" type=\"select\" label=\"30039\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-5,true)\"/>\n+ <setting id=\"viewmodefolderid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-6,true)\" enable=\"eq(-6,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodemovie\" type=\"select\" label=\"30040\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-7,true)\"/>\n+ <setting id=\"viewmodemovieid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-8,true)\" enable=\"eq(-8,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodeshow\" type=\"select\" label=\"30041\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-9,true)\"/>\n+ <setting id=\"viewmodeshowid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-10,true)\" enable=\"eq(-10,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodeseason\" type=\"select\" label=\"30042\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-11,true)\"/>\n+ <setting id=\"viewmodeseasonid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-12,true)\" enable=\"eq(-12,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodeepisode\" type=\"select\" label=\"30043\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-13,true)\"/>\n+ <setting id=\"viewmodeepisodeid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-14,true)\" enable=\"eq(-14,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodesearch\" type=\"select\" label=\"30160\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-15,true)\"/>\n+ <setting id=\"viewmodesearchid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-16,true)\" enable=\"eq(-16,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodeexported\" type=\"select\" label=\"30161\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-17,true)\"/>\n+ <setting id=\"viewmodeexportedid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-18,true)\" enable=\"eq(-18,true)\" subsetting=\"true\"/>\n</category>\n<category label=\"30078\">\n<setting id=\"BookmarkManager_enabled\" type=\"bool\" label=\"30083\" visible=\"false\" default=\"true\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed view types for lists and content types |
105,975 | 17.04.2019 21:05:38 | -7,200 | 6fafd96e925aad406621050b3871dceabac1e03e | missing fanart raises IndexError | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/pathops.py",
"new_path": "resources/lib/common/pathops.py",
"diff": "@@ -19,7 +19,7 @@ def get_path_safe(path, search_space, include_key=False, default=None):\nReturns default if any key in the path does not exist.\"\"\"\ntry:\nreturn get_path(path, search_space, include_key)\n- except KeyError:\n+ except (KeyError, IndexError):\nreturn default\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | missing fanart raises IndexError |
106,046 | 20.04.2019 10:20:33 | -7,200 | 7eb5c6ac7d83050d2a12203a4b6d132d4f25165f | Delete stream_continuity cache on purge on-disk cache | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/fileops.py",
"new_path": "resources/lib/common/fileops.py",
"diff": "@@ -61,6 +61,12 @@ def load_file(filename, mode='r'):\nfinally:\nfile_handle.close()\n+def delete_file(filename):\n+ file_path = xbmc.translatePath(os.path.join(g.DATA_PATH, filename))\n+ try:\n+ xbmcvfs.delete(file_path)\n+ finally:\n+ pass\ndef list_dir(data_path=g.DATA_PATH):\n\"\"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/actions.py",
"new_path": "resources/lib/navigation/actions.py",
"diff": "@@ -76,14 +76,9 @@ class AddonActionExecutor(object):\n\"\"\"Clear the cache. If on_disk param is supplied, also clear cached\nitems from disk\"\"\"\n# pylint: disable=unused-argument\n- #TODO: Delete all ndb file cache files and re-init persistent storage\n- # need to reload the title list and localeid etc..\n- # it would be easier to return to the selection profiles list\n- #\n- #if self.params.get('on_disk', False):\n- # common.delete_ndb_files()\n- # g.init_persistent_storage()\ng.CACHE.invalidate(self.params.get('on_disk', False))\n+ if self.params.get('on_disk', False):\n+ common.delete_file('resources.lib.services.playback.stream_continuity.ndb')\nif not self.params.get('no_notification', False):\nui.show_notification(common.get_local_string(30135))\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Delete stream_continuity cache on purge on-disk cache |
106,046 | 20.04.2019 10:42:27 | -7,200 | d1e1ecf28ebbebc71fbf8efa7214c2ae1ef25483 | Version bump (14.0) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0~beta24\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.26.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n+v0.14.0 (2019-04-20)\n+- Added initial auto-configuration at first run based on the OS type\n+- Added initial configuration to Android devices (for 4K support)\n+- Some updates to profiles and manifest data\n+- Fixed view type and content type\n+- Fixed error when fanart missing\n+- Fixed \"check your credentials\" after login (again)\n+- Other minor improvements\n+\nv0.14.0 beta24 (2019-04-12)\n- Added pagination support of results\n- Added choice of type sorting of results (in settings, views)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (14.0) |
106,046 | 20.04.2019 18:01:07 | -7,200 | c1ab45d1951baee53e0f2446d3fde05cbeb53107 | Close skip dialog after stop | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/playback/section_skipping.py",
"new_path": "resources/lib/services/playback/section_skipping.py",
"diff": "@@ -78,3 +78,7 @@ class SectionSkipper(PlaybackActionManager):\nskip_to=self.markers[section]['end'],\nlabel=common.get_local_string(\nSKIPPABLE_SECTIONS[section]))\n+\n+ def _on_playback_stopped(self):\n+ # Close any dialog remaining open\n+ xbmc.executebuiltin('Dialog.Close(all,true)')\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Close skip dialog after stop |
106,046 | 20.04.2019 19:59:33 | -7,200 | 9ae780f492e58216efaa55be998e7b9d0c03aff0 | Added accessibility to Audio Description menu to help visually impaired people | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -667,3 +667,11 @@ msgstr \"\"\nmsgctxt \"#30162\"\nmsgid \"Last used\"\nmsgstr \"\"\n+\n+msgctxt \"#30163\"\n+msgid \"Audio description\"\n+msgstr \"\"\n+\n+msgctxt \"#30164\"\n+msgid \"Browse contents with audio description.\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.it_it/strings.po",
"new_path": "resources/language/resource.language.it_it/strings.po",
"diff": "@@ -667,3 +667,11 @@ msgstr \"Vista per esportati\"\nmsgctxt \"#30162\"\nmsgid \"Last used\"\nmsgstr \"Ultima utilizzata\"\n+\n+msgctxt \"#30163\"\n+msgid \"Audio description\"\n+msgstr \"Audiodescrizione\"\n+\n+msgctxt \"#30164\"\n+msgid \"Browse contents with audio description.\"\n+msgstr \"Sfoglia i contenuti con audiodescrizione.\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -105,6 +105,14 @@ class GlobalVariables(object):\n'lolomo_known': True,\n'request_context_name': 'genres',\n'show_in_menu': True}),\n+ ('assistiveAudio', {'path': ['video_list_sorted', 'assistiveAudio', 'None'],\n+ 'lolomo_contexts': None,\n+ 'lolomo_known': False,\n+ 'request_context_name': 'assistiveAudio',\n+ 'label_id': 30163,\n+ 'description_id': 30164,\n+ 'icon': 'DefaultTVShows.png',\n+ 'show_in_menu': True}),\n('genres', {'path': ['genres', 'genres'],\n'lolomo_contexts': ['genre'],\n'lolomo_known': False,\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/directory.py",
"new_path": "resources/lib/navigation/directory.py",
"diff": "@@ -86,7 +86,7 @@ class DirectoryBuilder(object):\nmenu_data, pathitems)\nelse:\n#Dynamic IDs for common video lists\n- list_id = pathitems[2]\n+ list_id = None if pathitems[2] == 'None' else pathitems[2]\nlistings.build_video_listing(\napi.video_list_sorted(context_name=menu_data['request_context_name'],\ncontext_id=list_id,\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Added accessibility to Audio Description menu to help visually impaired people |
106,046 | 21.04.2019 09:29:10 | -7,200 | d89d8539e8302026add36a92b7a0f937baeff2be | Added missing settings to my list custom view | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -675,3 +675,7 @@ msgstr \"\"\nmsgctxt \"#30164\"\nmsgid \"Browse contents with audio description.\"\nmsgstr \"\"\n+\n+msgctxt \"#30165\"\n+msgid \"View for my list\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.it_it/strings.po",
"new_path": "resources/language/resource.language.it_it/strings.po",
"diff": "@@ -675,3 +675,7 @@ msgstr \"Audiodescrizione\"\nmsgctxt \"#30164\"\nmsgid \"Browse contents with audio description.\"\nmsgstr \"Sfoglia i contenuti con audiodescrizione.\"\n+\n+msgctxt \"#30165\"\n+msgid \"View for my list\"\n+msgstr \"Vista per la mia lista\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<category label=\"30037\">\n<setting id=\"sortordertype\" type=\"select\" label=\"30149\" lvalues=\"30150|30151|30152|30153\" default=\"0\"/>\n<setting id=\"customview\" type=\"bool\" label=\"30038\" default=\"false\"/>\n- <setting id=\"viewmodeprofiles\" type=\"select\" label=\"30044\" lvalues=\"30162|30142\" default=\"4\" enable=\"eq(-1,true)\"/>\n+ <setting id=\"viewmodeprofiles\" type=\"select\" label=\"30044\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-1,true)\"/>\n<setting id=\"viewmodeprofilesid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-2,true)\" enable=\"eq(-2,true)\" subsetting=\"true\"/>\n<setting id=\"viewmodemainmenu\" type=\"select\" label=\"30159\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-3,true)\"/>\n<setting id=\"viewmodemainmenuid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-4,true)\" enable=\"eq(-4,true)\" subsetting=\"true\"/>\n- <setting id=\"viewmodefolder\" type=\"select\" label=\"30039\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-5,true)\"/>\n- <setting id=\"viewmodefolderid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-6,true)\" enable=\"eq(-6,true)\" subsetting=\"true\"/>\n- <setting id=\"viewmodemovie\" type=\"select\" label=\"30040\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-7,true)\"/>\n- <setting id=\"viewmodemovieid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-8,true)\" enable=\"eq(-8,true)\" subsetting=\"true\"/>\n- <setting id=\"viewmodeshow\" type=\"select\" label=\"30041\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-9,true)\"/>\n- <setting id=\"viewmodeshowid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-10,true)\" enable=\"eq(-10,true)\" subsetting=\"true\"/>\n- <setting id=\"viewmodeseason\" type=\"select\" label=\"30042\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-11,true)\"/>\n- <setting id=\"viewmodeseasonid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-12,true)\" enable=\"eq(-12,true)\" subsetting=\"true\"/>\n- <setting id=\"viewmodeepisode\" type=\"select\" label=\"30043\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-13,true)\"/>\n- <setting id=\"viewmodeepisodeid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-14,true)\" enable=\"eq(-14,true)\" subsetting=\"true\"/>\n- <setting id=\"viewmodesearch\" type=\"select\" label=\"30160\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-15,true)\"/>\n- <setting id=\"viewmodesearchid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-16,true)\" enable=\"eq(-16,true)\" subsetting=\"true\"/>\n- <setting id=\"viewmodeexported\" type=\"select\" label=\"30161\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-17,true)\"/>\n- <setting id=\"viewmodeexportedid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-18,true)\" enable=\"eq(-18,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodemylist\" type=\"select\" label=\"30165\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-5,true)\"/>\n+ <setting id=\"viewmodemylistid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-6,true)\" enable=\"eq(-6,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodefolder\" type=\"select\" label=\"30039\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-7,true)\"/>\n+ <setting id=\"viewmodefolderid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-8,true)\" enable=\"eq(-8,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodemovie\" type=\"select\" label=\"30040\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-9,true)\"/>\n+ <setting id=\"viewmodemovieid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-10,true)\" enable=\"eq(-10,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodeshow\" type=\"select\" label=\"30041\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-11,true)\"/>\n+ <setting id=\"viewmodeshowid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-12,true)\" enable=\"eq(-12,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodeseason\" type=\"select\" label=\"30042\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-13,true)\"/>\n+ <setting id=\"viewmodeseasonid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-14,true)\" enable=\"eq(-14,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodeepisode\" type=\"select\" label=\"30043\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-15,true)\"/>\n+ <setting id=\"viewmodeepisodeid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-16,true)\" enable=\"eq(-16,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodesearch\" type=\"select\" label=\"30160\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-17,true)\"/>\n+ <setting id=\"viewmodesearchid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-18,true)\" enable=\"eq(-18,true)\" subsetting=\"true\"/>\n+ <setting id=\"viewmodeexported\" type=\"select\" label=\"30161\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-19,true)\"/>\n+ <setting id=\"viewmodeexportedid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-20,true)\" enable=\"eq(-20,true)\" subsetting=\"true\"/>\n</category>\n<category label=\"30078\">\n<setting id=\"BookmarkManager_enabled\" type=\"bool\" label=\"30083\" visible=\"false\" default=\"true\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Added missing settings to my list custom view |
106,046 | 21.04.2019 17:40:25 | -7,200 | da55b86e7401d020ef99d5135186e32a0a2781c3 | Updated Chrome version in user-agent | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/misc_utils.py",
"new_path": "resources/lib/common/misc_utils.py",
"diff": "@@ -83,7 +83,7 @@ def get_user_agent():\n:returns: str -- User agent string\n\"\"\"\nimport platform\n- chrome_version = 'Chrome/59.0.3071.115'\n+ chrome_version = 'Chrome/73.0.3683.103'\nbase = 'Mozilla/5.0 '\nbase += '%PL% '\nbase += 'AppleWebKit/537.36 (KHTML, like Gecko) '\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Updated Chrome version in user-agent |
106,046 | 22.04.2019 10:05:23 | -7,200 | 136c6eb0dd8daeb78e721a3b3404ac8fb6064fc4 | Fixed inputstream addon check
no crashes when is not installed | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -277,8 +277,8 @@ class GlobalVariables(object):\nif ultrahd_capable_device:\nui.show_ok_dialog(common.get_local_string(30154),\ncommon.get_local_string(30157))\n- ia_addon = xbmcaddon.Addon('inputstream.adaptive')\n- if ia_addon:\n+ ia_enabled = xbmc.getCondVisibility('System.HasAddon(inputstream.adaptive)')\n+ if ia_enabled:\nxbmc.executebuiltin('Addon.OpenSettings(inputstream.adaptive)')\nelse:\nui.show_ok_dialog(common.get_local_string(30154),\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed inputstream addon check
no crashes when is not installed |
105,975 | 26.04.2019 11:23:27 | -7,200 | 53fe016cd9868efa2098fa6abb2914161d356065 | display video lists as folders | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -34,7 +34,7 @@ def add_info(videoid, list_item, item, raw_data):\n{'infos': infos, 'quality_infos': quality_infos},\nttl=g.CACHE_METADATA_TTL, to_disk=True)\nlist_item.setInfo('video', infos)\n- if infos['mediatype'] in ['episode', 'movie']:\n+ if infos.get('mediatype') in ['episode', 'movie']:\nlist_item.setProperty('IsPlayable', 'true')\nfor stream_type, quality_infos in quality_infos.iteritems():\nlist_item.addStreamInfo(stream_type, quality_infos)\n@@ -69,7 +69,6 @@ def parse_info(videoid, item, raw_data):\nhasattr(item, 'contained_titles')):\n# Special handling for VideoLists\nreturn {\n- 'mediatype': 'video',\n'plot':\ncommon.get_local_string(30087).format(\n', '.join(item.contained_titles))\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | display video lists as folders |
106,046 | 27.04.2019 09:43:59 | -7,200 | 6a5a30bd1f6922d086fb1c843814ed73a6810b7f | Fixed particular case of keyerror when delete cookie after logout | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/cookies.py",
"new_path": "resources/lib/common/cookies.py",
"diff": "@@ -42,6 +42,7 @@ def save(account_hash, cookie_jar):\ndef delete(account_hash):\n\"\"\"Delete cookies for an account from in-memory storage and the disk\"\"\"\n# pylint: disable=broad-except\n+ if g.COOKIES.get(account_hash):\ndel g.COOKIES[account_hash]\ntry:\nxbmcvfs.delete(cookie_filename(account_hash))\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed particular case of keyerror when delete cookie after logout |
105,975 | 27.04.2019 17:46:09 | -7,200 | 2f589ee0c48b447c58681b739578fd993de074fb | Customizable main menu items | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -679,3 +679,35 @@ msgstr \"\"\nmsgctxt \"#30165\"\nmsgid \"View for my list\"\nmsgstr \"\"\n+\n+msgctxt \"#30166\"\n+msgid \"Main menu items\"\n+msgstr \"\"\n+\n+msgctxt \"#30167\"\n+msgid \"My list\"\n+msgstr \"\"\n+\n+msgctxt \"#30168\"\n+msgid \"Continue watching\"\n+msgstr \"\"\n+\n+msgctxt \"#30169\"\n+msgid \"Top picks\"\n+msgstr \"\"\n+\n+msgctxt \"#30170\"\n+msgid \"New releases\"\n+msgstr \"\"\n+\n+msgctxt \"#30171\"\n+msgid \"Trending now\"\n+msgstr \"\"\n+\n+msgctxt \"#30172\"\n+msgid \"Popular on Netflix\"\n+msgstr \"\"\n+\n+msgctxt \"#30173\"\n+msgid \"NETFLIX ORIGINALS\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -56,7 +56,6 @@ class GlobalVariables(object):\nicon : set a default image\nview : override the default \"partial menu id\" of view\ncontent_type : override the default content type (CONTENT_SHOW)\n- show_in_menu : show/hide menu\nExplanation of function names in the 'path' key:\nvideo_list: automatically gets the list_id by making a lolomo request,\n@@ -69,50 +68,41 @@ class GlobalVariables(object):\n'lolomo_contexts': ['queue'],\n'lolomo_known': True,\n'request_context_name': 'mylist',\n- 'view': VIEW_MYLIST,\n- 'show_in_menu': True}),\n+ 'view': VIEW_MYLIST}),\n('continueWatching', {'path': ['video_list', 'continueWatching'],\n'lolomo_contexts': ['continueWatching'],\n- 'lolomo_known': True,\n- 'show_in_menu': True}),\n+ 'lolomo_known': True}),\n('chosenForYou', {'path': ['video_list', 'chosenForYou'],\n'lolomo_contexts': ['topTen'],\n- 'lolomo_known': True,\n- 'show_in_menu': True}),\n+ 'lolomo_known': True}),\n('recentlyAdded', {'path': ['video_list_sorted', 'recentlyAdded', '1592210'],\n'lolomo_contexts': None,\n'lolomo_known': False,\n'request_context_name': 'genres',\n'label_id': 30145,\n'description_id': 30146,\n- 'icon': 'DefaultRecentlyAddedMovies.png',\n- 'show_in_menu': True}),\n+ 'icon': 'DefaultRecentlyAddedMovies.png'}),\n('newRelease', {'path': ['video_list_sorted', 'newRelease'],\n'lolomo_contexts': ['newRelease'],\n'lolomo_known': True,\n- 'request_context_name': 'newrelease',\n- 'show_in_menu': True}),\n+ 'request_context_name': 'newrelease'}),\n('currentTitles', {'path': ['video_list', 'currentTitles'],\n'lolomo_contexts': ['trendingNow'],\n- 'lolomo_known': True,\n- 'show_in_menu': True}),\n+ 'lolomo_known': True}),\n('mostViewed', {'path': ['video_list', 'mostViewed'],\n'lolomo_contexts': ['popularTitles'],\n- 'lolomo_known': True,\n- 'show_in_menu': True}),\n+ 'lolomo_known': True}),\n('netflixOriginals', {'path': ['video_list_sorted', 'netflixOriginals', '839338'],\n'lolomo_contexts': ['netflixOriginals'],\n'lolomo_known': True,\n- 'request_context_name': 'genres',\n- 'show_in_menu': True}),\n+ 'request_context_name': 'genres'}),\n('assistiveAudio', {'path': ['video_list_sorted', 'assistiveAudio', 'None'],\n'lolomo_contexts': None,\n'lolomo_known': False,\n'request_context_name': 'assistiveAudio',\n'label_id': 30163,\n'description_id': 30164,\n- 'icon': 'DefaultTVShows.png',\n- 'show_in_menu': True}),\n+ 'icon': 'DefaultTVShows.png'}),\n('genres', {'path': ['genres', 'genres'],\n'lolomo_contexts': ['genre'],\n'lolomo_known': False,\n@@ -120,16 +110,14 @@ class GlobalVariables(object):\n'label_id': 30010,\n'description_id': 30093,\n'icon': 'DefaultGenre.png',\n- 'content_type': CONTENT_FOLDER,\n- 'show_in_menu': True}),\n+ 'content_type': CONTENT_FOLDER}),\n('recommendations', {'path': ['recommendations', 'recommendations'],\n'lolomo_contexts': ['similars', 'becauseYouAdded'],\n'lolomo_known': False,\n'label_id': 30001,\n'description_id': 30094,\n'icon': 'DefaultUser.png',\n- 'content_type': CONTENT_FOLDER,\n- 'show_in_menu': True}),\n+ 'content_type': CONTENT_FOLDER}),\n('tvshows', {'path': ['genres', 'tvshows', '83'],\n'lolomo_contexts': None,\n'lolomo_known': False,\n@@ -137,8 +125,7 @@ class GlobalVariables(object):\n'label_id': 30095,\n'description_id': None,\n'icon': 'DefaultTVShows.png',\n- 'content_type': CONTENT_FOLDER,\n- 'show_in_menu': True}),\n+ 'content_type': CONTENT_FOLDER}),\n('movies', {'path': ['genres', 'movies', '34399'],\n'lolomo_contexts': None,\n'lolomo_known': False,\n@@ -146,24 +133,21 @@ class GlobalVariables(object):\n'label_id': 30096,\n'description_id': None,\n'icon': 'DefaultMovies.png',\n- 'content_type': CONTENT_FOLDER,\n- 'show_in_menu': True}),\n+ 'content_type': CONTENT_FOLDER}),\n('search', {'path': ['search', 'search'],\n'lolomo_contexts': None,\n'lolomo_known': False,\n'label_id': 30011,\n'description_id': 30092,\n'icon': None,\n- 'view': VIEW_SEARCH,\n- 'show_in_menu': True}),\n+ 'view': VIEW_SEARCH}),\n('exported', {'path': ['exported', 'exported'],\n'lolomo_contexts': None,\n'lolomo_known': False,\n'label_id': 30048,\n'description_id': 30091,\n'icon': 'DefaultHardDisk.png',\n- 'view': VIEW_EXPORTED,\n- 'show_in_menu': True})\n+ 'view': VIEW_EXPORTED})\n])\nMODE_DIRECTORY = 'directory'\n@@ -312,6 +296,8 @@ class GlobalVariables(object):\n# In PersistentStorage \"save on destroy\" here cause problems because often gets destroyed by various behaviors\nself.PERSISTENT_STORAGE = common.PersistentStorage(__name__, no_save_on_destroy=True)\n# If missing create necessary keys\n+ if not self.PERSISTENT_STORAGE.get('show_menus'):\n+ self.PERSISTENT_STORAGE['show_menus'] = {}\nif not self.PERSISTENT_STORAGE.get('menu_titles'):\nself.PERSISTENT_STORAGE['menu_titles'] = {}\nif not self.PERSISTENT_STORAGE.get('sub_menus'):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/listings.py",
"new_path": "resources/lib/kodi/listings.py",
"diff": "@@ -112,7 +112,8 @@ def build_main_menu_listing(lolomo):\nmylist_menu_exists = False\nfor menu_id, data in g.MAIN_MENU_ITEMS.iteritems():\n- if data['show_in_menu']:\n+ show_in_menu = g.ADDON.getSettingBool('_'.join(('show_menu', menu_id)))\n+ if show_in_menu:\nif data['lolomo_known']:\nfor list_id, user_list in lolomo.lists_by_context(data['lolomo_contexts'], break_on_first=True):\ndirectory_items.append(_create_videolist_item(list_id, user_list, data, static_lists=True))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/settings_monitor.py",
"new_path": "resources/lib/services/settings_monitor.py",
"diff": "@@ -26,3 +26,16 @@ class SettingsMonitor(xbmc.Monitor):\nif g.REQ_SORT_ORDER_TYPE != req_sort_order_type_oldvalue:\n# We remove the cache to allow get the new results in the chosen order\ncommon.run_plugin('plugin://plugin.video.netflix/action/purge_cache/?on_disk=True&no_notification=True')\n+\n+ ps_changed = False\n+ for menu_id, data in g.MAIN_MENU_ITEMS.iteritems():\n+ new_setting = bool(g.ADDON.getSettingBool('_'.join(('show_menu', menu_id))))\n+ old_setting = g.PERSISTENT_STORAGE['show_menus'].get(menu_id, True)\n+\n+ if new_setting != old_setting:\n+ g.PERSISTENT_STORAGE['show_menus'][menu_id] = new_setting\n+ ps_changed = True\n+ if ps_changed:\n+ g.PERSISTENT_STORAGE.commit()\n+ url = 'plugin://plugin.video.netflix/directory/root'\n+ xbmc.executebuiltin('Container.Update({},replace)'.format(url))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<setting id=\"last_update\" type=\"text\" visible=\"false\" default=\"1970-01-01\"/>\n<setting id=\"update_running\" type=\"text\" visible=\"false\" default=\"false\"/>\n</category>\n+ <category label=\"30166\">\n+ <setting id=\"show_menu_mylist\" type=\"bool\" label=\"30167\" default=\"true\"/>\n+ <setting id=\"show_menu_continuewatching\" type=\"bool\" label=\"30168\" default=\"true\"/>\n+ <setting id=\"show_menu_chosenforyou\" type=\"bool\" label=\"30169\" default=\"true\"/>\n+ <setting id=\"show_menu_recentlyadded\" type=\"bool\" label=\"30145\" default=\"true\"/>\n+ <setting id=\"show_menu_newrelease\" type=\"bool\" label=\"30170\" default=\"true\"/>\n+ <setting id=\"show_menu_currenttitles\" type=\"bool\" label=\"30171\" default=\"true\"/>\n+ <setting id=\"show_menu_mostviewed\" type=\"bool\" label=\"30172\" default=\"true\"/>\n+ <setting id=\"show_menu_netflixoriginals\" type=\"bool\" label=\"30173\" default=\"true\"/>\n+ <setting id=\"show_menu_assistiveaudio\" type=\"bool\" label=\"30163\" default=\"true\"/>\n+ <setting id=\"show_menu_genres\" type=\"bool\" label=\"30010\" default=\"true\"/>\n+ <setting id=\"show_menu_recommendations\" type=\"bool\" label=\"30001\" default=\"true\"/>\n+ <setting id=\"show_menu_tvshows\" type=\"bool\" label=\"30095\" default=\"true\"/>\n+ <setting id=\"show_menu_movies\" type=\"bool\" label=\"30096\" default=\"true\"/>\n+ <setting id=\"show_menu_search\" type=\"bool\" label=\"30011\" default=\"true\"/>\n+ <setting id=\"show_menu_exported\" type=\"bool\" label=\"30048\" default=\"true\"/>\n+ </category>\n<category label=\"30037\">\n<setting id=\"sortordertype\" type=\"select\" label=\"30149\" lvalues=\"30150|30151|30152|30153\" default=\"0\"/>\n<setting id=\"customview\" type=\"bool\" label=\"30038\" default=\"false\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Customizable main menu items
Co-authored-by: Stefano Gottardo <[email protected]> |
106,046 | 30.04.2019 20:22:15 | -7,200 | 1eb0a3a3415e33c7a379e4e63e21c962bcf3ba3a | Disabled hevc by default on linux | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -275,9 +275,11 @@ class GlobalVariables(object):\nself.ADDON.setSettingBool('enable_hevc_profiles', False)\nself.ADDON.setSettingBool('enable_force_hdcp', ultrahd_capable_device)\nelif system == 'linux':\n- # Some linux distributions have encountered problems with VP9, so disabled\n+ # Too many different linux systems, we can not predict all the behaviors\n+ # Some linux distributions have encountered problems with VP9,\n+ # OMSC users complain that hevc creates problems\nself.ADDON.setSettingBool('enable_vp9_profiles', False)\n- self.ADDON.setSettingBool('enable_hevc_profiles', True)\n+ self.ADDON.setSettingBool('enable_hevc_profiles', False)\nelse:\nself.ADDON.setSettingBool('enable_vp9_profiles', False)\nself.ADDON.setSettingBool('enable_hevc_profiles', False)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Disabled hevc by default on linux |
106,046 | 30.04.2019 20:35:09 | -7,200 | 4af32a4d9d2b95fe601d385130ae2d142a7be127 | Version bump (14.1) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.0\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.1\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.26.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n+v0.14.1 (2019-04-30)\n+- Added customizable main menu items\n+- Added audio description menu to help visually impaired people\n+- Disabled hevc by default on linux (prevents problems with omsc)\n+- Fixed crash on addon start when Inputstream is not installed\n+- Fixed missing settings to my list custom view\n+- No more skip dialog after stop videos\n+- Other minor improvements\n+\nv0.14.0 (2019-04-20)\n- Added initial auto-configuration at first run based on the OS type\n- Added initial configuration to Android devices (for 4K support)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (14.1) |
106,046 | 01.05.2019 12:05:39 | -7,200 | bdfc785f4400af64d8ae4f09448dc5abe098911f | Update Issue template
added rules for log | [
{
"change_type": "MODIFY",
"old_path": "ISSUE_TEMPLATE.md",
"new_path": "ISSUE_TEMPLATE.md",
"diff": "## Debug log\n-[Please include a link to your debug log (use something like [http://sprunge.us/](http://sprunge.us/) or [https://pastebin.com/](https://pastebin.com/)) or similar, please do not paste]\n+SIMPLE RULES:\n+- Before performing any operation enable Kodi debug logging [Settings->System->Logging->Enable debug logging] only after perform the operations to reproduce the issue\n+- Copy here a link to your debug log, use something like [https://paste.kodi.tv/](https://paste.kodi.tv/) or similar\n+- Do NOT paste the content of the log here\n+- Do NOT cut the log\n+- If the log file is really huge (more than 1Mb) then in Kodi settings disable the *Component-specific logging*\n## Other information\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Update Issue template
added rules for log |
106,046 | 01.05.2019 17:58:03 | -7,200 | 31683bd9b30680fec281bc866fb560e856c296fe | Updated request query parameters | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/website.py",
"new_path": "resources/lib/api/website.py",
"diff": "@@ -13,7 +13,6 @@ from .exceptions import (InvalidProfilesError, InvalidAuthURLError,\nInvalidMembershipStatusError, WebsiteParsingError)\nPAGE_ITEMS = [\n- 'gpsModel',\n'models/userInfo/data/authURL',\n'models/userInfo/data/guid',\n'models/userInfo/data/countryOfSignup',\n@@ -95,7 +94,7 @@ def _get_avatar(falkor_cache, profile):\ndef extract_userdata(content):\n\"\"\"Extract essential userdata from the reactContext of the webpage\"\"\"\ncommon.debug('Extracting userdata from webpage')\n- user_data = {'gpsModel': 'harris'}\n+ user_data = {}\nreact_context = extract_json(content, 'reactContext')\nfor path in ([path_item for path_item in path.split('/')]\nfor path in PAGE_ITEMS):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/nfsession.py",
"new_path": "resources/lib/services/nfsession/nfsession.py",
"diff": "@@ -322,7 +322,11 @@ class NetflixSession(object):\n'Content-Type': 'application/x-www-form-urlencoded',\n'Accept': 'application/json, text/javascript, */*'}\nparams = {\n- 'model': self.session_data['user_data']['gpsModel']}\n+ 'drmSystem': 'widevine',\n+ #'falcor_server' : '0.1.0', #json responses like browser\n+ 'withSize': 'false', #puts the 'size' field inside each dictionary\n+ 'materialize' : 'false' #if true, when a path that no longer exists is requested (like 'storyarts'), it is still added in an 'empty' form in the response\n+ }\ndata = 'path=' + '&path='.join(json.dumps(path, ensure_ascii=False) for path in paths)\ndata += '&authURL=' + self.auth_url\nreturn self._post(\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Updated request query parameters |
106,046 | 05.05.2019 15:07:50 | -7,200 | 861ec2621ca6902339fe7bce2ed1baff533d4886 | Speeded up a bit the loading of lists | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/paths.py",
"new_path": "resources/lib/api/paths.py",
"diff": "@@ -39,6 +39,10 @@ VIDEO_LIST_PARTIAL_PATHS = [\n{'from': 0, 'to': 10}, ['id', 'name']]\n] + ART_PARTIAL_PATHS\n+VIDEO_LIST_BASIC_PARTIAL_PATHS = [\n+ [['title', 'queue', 'watched']]\n+]\n+\nGENRE_PARTIAL_PATHS = [\n[[\"id\", \"requestId\", \"summary\", \"name\"]],\n[{\"from\": 0, \"to\": 50},\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/shakti.py",
"new_path": "resources/lib/api/shakti.py",
"diff": "@@ -11,8 +11,8 @@ import resources.lib.kodi.ui as ui\nfrom .data_types import (LoLoMo, VideoList, VideoListSorted, SeasonList, EpisodeList,\nSearchVideoList, CustomVideoList)\n-from .paths import (VIDEO_LIST_PARTIAL_PATHS, SEASONS_PARTIAL_PATHS,\n- EPISODES_PARTIAL_PATHS, ART_PARTIAL_PATHS,\n+from .paths import (VIDEO_LIST_PARTIAL_PATHS, VIDEO_LIST_BASIC_PARTIAL_PATHS,\n+ SEASONS_PARTIAL_PATHS, EPISODES_PARTIAL_PATHS, ART_PARTIAL_PATHS,\nGENRE_PARTIAL_PATHS, RANGE_SELECTOR, MAX_PATH_REQUEST_SIZE)\nfrom .exceptions import (InvalidVideoListTypeError, LoginFailedError, APIError,\nNotLoggedInError, MissingCredentialsError)\n@@ -221,6 +221,21 @@ def single_info(videoid):\nreturn common.make_call('path_request', paths)\n+def custom_video_list_basicinfo(list_id):\n+ \"\"\"Retrieve a single video list\n+ used only to know which videos are in my list without requesting additional information\n+ \"\"\"\n+ common.debug('Requesting custom video list basic info {}'.format(list_id))\n+ paths = build_paths(['lists', list_id, RANGE_SELECTOR, 'reference'],\n+ VIDEO_LIST_BASIC_PARTIAL_PATHS)\n+ callargs = {\n+ 'paths': paths,\n+ 'length_params': ['stdlist', ['lists', list_id]],\n+ 'perpetual_range_start': None\n+ }\n+ return VideoList(common.make_call('perpetual_path_request', callargs))\n+\n+\[email protected]_output(g, cache.CACHE_COMMON, fixed_identifier='my_list_items')\ndef mylist_items():\n\"\"\"Return a list of all the items currently contained in my list\"\"\"\n@@ -228,7 +243,9 @@ def mylist_items():\ntry:\nreturn [video_id\nfor video_id, video in\n- video_list_sorted(g.MAIN_MENU_ITEMS['myList']['request_context_name']).videos.iteritems()\n+ custom_video_list_basicinfo(\n+ list_id_for_type(\n+ g.MAIN_MENU_ITEMS['myList']['lolomo_contexts'][0])).videos.iteritems()\nif video['queue'].get('inQueue', False)]\nexcept InvalidVideoListTypeError:\nreturn []\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Speeded up a bit the loading of lists |
106,046 | 05.05.2019 15:17:46 | -7,200 | 877776e89ff0eb989c9d6fd13cf3b1d96a462b79 | Added sort results by menu
the query with video_list_sorted on mylist is no longer working, i hope
netflix reimplements it | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -613,7 +613,7 @@ msgid \"<< Previous page\"\nmsgstr \"\"\nmsgctxt \"#30149\"\n-msgid \"Sort results by (works on menus with paging)\"\n+msgid \"Sort results by\"\nmsgstr \"\"\nmsgctxt \"#30150\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.it_it/strings.po",
"new_path": "resources/language/resource.language.it_it/strings.po",
"diff": "@@ -613,8 +613,8 @@ msgid \"<< Previous page\"\nmsgstr \"<< Pagina precedente\"\nmsgctxt \"#30149\"\n-msgid \"Sort results by (works on menus with paging)\"\n-msgstr \"Ordina i risultati per (funziona solo per elenchi paginati)\"\n+msgid \"Sort results by\"\n+msgstr \"Ordina i risultati per\"\nmsgctxt \"#30150\"\nmsgid \"Alphabetical order (A-Z)\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/data_types.py",
"new_path": "resources/lib/api/data_types.py",
"diff": "@@ -92,7 +92,7 @@ class VideoList(object):\nclass VideoListSorted(object):\n\"\"\"A video list\"\"\"\n# pylint: disable=invalid-name\n- def __init__(self, path_response, context_name, context_id):\n+ def __init__(self, path_response, context_name, context_id, req_sort_order_type):\nself.perpetual_range_selector = path_response.get('_perpetual_range_selector')\nself.data = path_response\nself.context_name = context_name\n@@ -100,8 +100,8 @@ class VideoListSorted(object):\nand path_response[context_name].get(context_id)) or \\\n(not context_id and path_response.get(context_name)) else False\nif data_present:\n- self.data_lists = path_response[context_name][context_id][g.REQ_SORT_ORDER_TYPE] \\\n- if context_id else path_response[context_name][g.REQ_SORT_ORDER_TYPE]\n+ self.data_lists = path_response[context_name][context_id][req_sort_order_type] \\\n+ if context_id else path_response[context_name][req_sort_order_type]\nself.videos = OrderedDict(resolve_refs(self.data_lists, self.data))\nelse:\nself.data_lists = {}\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/shakti.py",
"new_path": "resources/lib/api/shakti.py",
"diff": "@@ -120,17 +120,24 @@ def video_list(list_id, perpetual_range_start=None):\[email protected]_execution(immediate=False)\[email protected]_output(g, cache.CACHE_COMMON, identify_from_kwarg_name='context_id',\nidentify_append_from_kwarg_name='perpetual_range_start')\n-def video_list_sorted(context_name, context_id=None, perpetual_range_start=None):\n+def video_list_sorted(context_name, context_id=None, perpetual_range_start=None, menu_data=None):\n\"\"\"Retrieve a single video list sorted\nthis type of request allows to obtain more than ~40 results\n\"\"\"\n- common.debug('Requesting video list sorted {}'.format(context_id))\n+ common.debug(\n+ 'Requesting video list sorted for context name: \"{}\", context id: \"{}\"'\n+ .format(context_name, context_id))\nbase_path = [context_name]\nresponse_type = 'stdlist'\nif context_id:\nbase_path.append(context_id)\nresponse_type = 'stdlist_wid'\n- base_path.append(g.REQ_SORT_ORDER_TYPE)\n+\n+ # enum order: AZ|ZA|Suggested|Year\n+ sort_order_types = ['az', 'za', 'su', 'yr']\n+ req_sort_order_type = sort_order_types[\n+ int(g.ADDON.getSettingInt('_'.join(('menu_sortorder', menu_data['path'][1]))))]\n+ base_path.append(req_sort_order_type)\npaths = build_paths(base_path + [RANGE_SELECTOR], VIDEO_LIST_PARTIAL_PATHS)\ncallargs = {\n'paths': paths,\n@@ -138,7 +145,7 @@ def video_list_sorted(context_name, context_id=None, perpetual_range_start=None)\n'perpetual_range_start': perpetual_range_start\n}\nreturn VideoListSorted(common.make_call('perpetual_path_request', callargs),\n- context_name, context_id)\n+ context_name, context_id, req_sort_order_type)\[email protected]_execution(immediate=False)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -106,7 +106,7 @@ class GlobalVariables(object):\n('genres', {'path': ['genres', 'genres'],\n'lolomo_contexts': ['genre'],\n'lolomo_known': False,\n- 'request_context_name': 'genres',\n+ 'request_context_name': 'genres', # Used for sub-menus\n'label_id': 30010,\n'description_id': 30093,\n'icon': 'DefaultGenre.png',\n@@ -198,10 +198,6 @@ class GlobalVariables(object):\nself.TIME_TRACE_ENABLED = self.ADDON.getSettingBool('enable_timing')\nself.IPC_OVER_HTTP = self.ADDON.getSettingBool('enable_ipc_over_http')\n- # enum order: AZ|ZA|Suggested|Year\n- sort_order_types = ['az', 'za', 'su', 'yr']\n- self.REQ_SORT_ORDER_TYPE = sort_order_types[int(g.ADDON.getSettingInt('sortordertype'))]\n-\ntry:\nos.mkdir(self.DATA_PATH)\nexcept OSError:\n@@ -300,6 +296,8 @@ class GlobalVariables(object):\n# If missing create necessary keys\nif not self.PERSISTENT_STORAGE.get('show_menus'):\nself.PERSISTENT_STORAGE['show_menus'] = {}\n+ if not self.PERSISTENT_STORAGE.get('menu_sortorder'):\n+ self.PERSISTENT_STORAGE['menu_sortorder'] = {}\nif not self.PERSISTENT_STORAGE.get('menu_titles'):\nself.PERSISTENT_STORAGE['menu_titles'] = {}\nif not self.PERSISTENT_STORAGE.get('sub_menus'):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/listings.py",
"new_path": "resources/lib/kodi/listings.py",
"diff": "@@ -157,11 +157,10 @@ def build_lolomo_listing(lolomo, menu_data, force_videolistbyid=False, exclude_l\n# Create a new submenu info in MAIN_MENU_ITEMS for reference when 'directory' find the menu data\nsel_video_list_id = menu_parameters.context_id if menu_parameters.context_id and not force_videolistbyid else video_list_id\nsub_menu_data = menu_data.copy()\n- sub_menu_data['path'] = [menu_data['path'][0], sel_video_list_id]\n+ sub_menu_data['path'] = [menu_data['path'][0], menu_data['path'][1], sel_video_list_id]\nsub_menu_data['lolomo_known'] = False\nsub_menu_data['lolomo_contexts'] = None\nsub_menu_data['content_type'] = g.CONTENT_SHOW\n- sub_menu_data['show_in_menu'] = False\nsub_menu_data['force_videolistbyid'] = force_videolistbyid\ng.PERSISTENT_STORAGE['sub_menus'][sel_video_list_id] = sub_menu_data\ng.PERSISTENT_STORAGE['menu_titles'][sel_video_list_id] = video_list['displayName']\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/directory.py",
"new_path": "resources/lib/navigation/directory.py",
"diff": "@@ -82,7 +82,8 @@ class DirectoryBuilder(object):\nif menu_data.get('request_context_name',None) and g.is_known_menu_context(pathitems[2]):\nlistings.build_video_listing(\napi.video_list_sorted(context_name=menu_data['request_context_name'],\n- perpetual_range_start=self.perpetual_range_start),\n+ perpetual_range_start=self.perpetual_range_start,\n+ menu_data=menu_data),\nmenu_data, pathitems)\nelse:\n#Dynamic IDs for common video lists\n@@ -90,7 +91,8 @@ class DirectoryBuilder(object):\nlistings.build_video_listing(\napi.video_list_sorted(context_name=menu_data['request_context_name'],\ncontext_id=list_id,\n- perpetual_range_start=self.perpetual_range_start),\n+ perpetual_range_start=self.perpetual_range_start,\n+ menu_data=menu_data),\nmenu_data, pathitems)\n_handle_endofdirectory(self.dir_update_listing)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/settings_monitor.py",
"new_path": "resources/lib/services/settings_monitor.py",
"diff": "@@ -19,23 +19,38 @@ class SettingsMonitor(xbmc.Monitor):\ndef _on_change(self):\ncommon.debug('SettingsMonitor: Settings changed, reinitialize global settings')\n- req_sort_order_type_oldvalue = g.REQ_SORT_ORDER_TYPE\ng.init_globals(sys.argv)\n- if g.REQ_SORT_ORDER_TYPE != req_sort_order_type_oldvalue:\n- # We remove the cache to allow get the new results in the chosen order\n- common.run_plugin('plugin://plugin.video.netflix/action/purge_cache/?on_disk=True&no_notification=True')\n-\nps_changed = False\n- for menu_id, data in g.MAIN_MENU_ITEMS.iteritems():\n- new_setting = bool(g.ADDON.getSettingBool('_'.join(('show_menu', menu_id))))\n- old_setting = g.PERSISTENT_STORAGE['show_menus'].get(menu_id, True)\n-\n- if new_setting != old_setting:\n- g.PERSISTENT_STORAGE['show_menus'][menu_id] = new_setting\n+ show_menu_changed = False\n+ sort_order_type_changed = False\n+\n+ for menu_id, menu_data in g.MAIN_MENU_ITEMS.iteritems():\n+ #Check settings changes in show menu\n+ show_menu_new_setting = bool(g.ADDON.getSettingBool('_'.join(('show_menu', menu_id))))\n+ show_menu_old_setting = g.PERSISTENT_STORAGE['show_menus'].get(menu_id, True)\n+ if show_menu_new_setting != show_menu_old_setting:\n+ g.PERSISTENT_STORAGE['show_menus'][menu_id] = show_menu_new_setting\n+ show_menu_changed = True\n+ ps_changed = True\n+ # Check settings changes in sort order of menu\n+ if menu_data.get('request_context_name'):\n+ menu_sortorder_new_setting = int(\n+ g.ADDON.getSettingInt('_'.join(('menu_sortorder', menu_data['path'][1]))))\n+ menu_sortorder_old_setting = g.PERSISTENT_STORAGE['menu_sortorder'].get(menu_id, 0)\n+ if menu_sortorder_new_setting != menu_sortorder_old_setting:\n+ g.PERSISTENT_STORAGE['menu_sortorder'][menu_id] = menu_sortorder_new_setting\n+ sort_order_type_changed = True\nps_changed = True\n+\nif ps_changed:\ng.PERSISTENT_STORAGE.commit()\n+\n+ if sort_order_type_changed:\n+ # We remove the cache to allow get the new results in the chosen order\n+ common.run_plugin('plugin://plugin.video.netflix/action/purge_cache/?on_disk=True&no_notification=True')\n+\n+ if show_menu_changed:\nurl = 'plugin://plugin.video.netflix/directory/root'\nxbmc.executebuiltin('Container.Update({},replace)'.format(url))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "</category>\n<category label=\"30166\">\n<setting id=\"show_menu_mylist\" type=\"bool\" label=\"30167\" default=\"true\"/>\n+ <setting id=\"menu_sortorder_mylist\" type=\"select\" label=\"30149\" lvalues=\"30150|30151|30152|30153\" visible=\"false\" subsetting=\"true\" default=\"0\"/> <!-- is currently (05-05-2019) no longer supported by the netflix server-->\n<setting id=\"show_menu_continuewatching\" type=\"bool\" label=\"30168\" default=\"true\"/>\n<setting id=\"show_menu_chosenforyou\" type=\"bool\" label=\"30169\" default=\"true\"/>\n<setting id=\"show_menu_recentlyadded\" type=\"bool\" label=\"30145\" default=\"true\"/>\n+ <setting id=\"menu_sortorder_recentlyadded\" type=\"select\" label=\"30149\" lvalues=\"30150|30151|30152|30153\" visible=\"eq(-1,true)\" subsetting=\"true\" default=\"0\"/>\n<setting id=\"show_menu_newrelease\" type=\"bool\" label=\"30170\" default=\"true\"/>\n+ <setting id=\"menu_sortorder_newrelease\" type=\"select\" label=\"30149\" lvalues=\"30150|30151|30152|30153\" visible=\"eq(-1,true)\" subsetting=\"true\" default=\"0\"/>\n<setting id=\"show_menu_currenttitles\" type=\"bool\" label=\"30171\" default=\"true\"/>\n<setting id=\"show_menu_mostviewed\" type=\"bool\" label=\"30172\" default=\"true\"/>\n<setting id=\"show_menu_netflixoriginals\" type=\"bool\" label=\"30173\" default=\"true\"/>\n+ <setting id=\"menu_sortorder_netflixoriginals\" type=\"select\" label=\"30149\" lvalues=\"30150|30151|30152|30153\" visible=\"eq(-1,true)\" subsetting=\"true\" default=\"0\"/>\n<setting id=\"show_menu_assistiveaudio\" type=\"bool\" label=\"30163\" default=\"true\"/>\n+ <setting id=\"menu_sortorder_assistiveaudio\" type=\"select\" label=\"30149\" lvalues=\"30150|30151|30152|30153\" visible=\"eq(-1,true)\" subsetting=\"true\" default=\"0\"/>\n<setting id=\"show_menu_genres\" type=\"bool\" label=\"30010\" default=\"true\"/>\n+ <setting id=\"menu_sortorder_genres\" type=\"select\" label=\"30149\" lvalues=\"30150|30151|30152|30153\" visible=\"eq(-1,true)\" subsetting=\"true\" default=\"0\"/>\n<setting id=\"show_menu_recommendations\" type=\"bool\" label=\"30001\" default=\"true\"/>\n<setting id=\"show_menu_tvshows\" type=\"bool\" label=\"30095\" default=\"true\"/>\n+ <setting id=\"menu_sortorder_tvshows\" type=\"select\" label=\"30149\" lvalues=\"30150|30151|30152|30153\" visible=\"eq(-1,true)\" subsetting=\"true\" default=\"0\"/>\n<setting id=\"show_menu_movies\" type=\"bool\" label=\"30096\" default=\"true\"/>\n+ <setting id=\"menu_sortorder_movies\" type=\"select\" label=\"30149\" lvalues=\"30150|30151|30152|30153\" visible=\"eq(-1,true)\" subsetting=\"true\" default=\"0\"/>\n<setting id=\"show_menu_search\" type=\"bool\" label=\"30011\" default=\"true\"/>\n<setting id=\"show_menu_exported\" type=\"bool\" label=\"30048\" default=\"true\"/>\n</category>\n<category label=\"30037\">\n- <setting id=\"sortordertype\" type=\"select\" label=\"30149\" lvalues=\"30150|30151|30152|30153\" default=\"0\"/>\n<setting id=\"customview\" type=\"bool\" label=\"30038\" default=\"false\"/>\n<setting id=\"viewmodeprofiles\" type=\"select\" label=\"30044\" lvalues=\"30162|30142\" default=\"0\" enable=\"eq(-1,true)\"/>\n<setting id=\"viewmodeprofilesid\" type=\"number\" label=\"30143\" visible=\"eq(-1,1) + eq(-2,true)\" enable=\"eq(-2,true)\" subsetting=\"true\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Added sort results by menu
the query with video_list_sorted on mylist is no longer working, i hope
netflix reimplements it |
106,046 | 05.05.2019 15:37:35 | -7,200 | bc7d933036695e2c240ba6328012753bc8894c47 | Added sort order to the lists of sub-menus and to mylist | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/listings.py",
"new_path": "resources/lib/kodi/listings.py",
"diff": "@@ -167,7 +167,7 @@ def build_lolomo_listing(lolomo, menu_data, force_videolistbyid=False, exclude_l\ndirectory_items.append(_create_videolist_item(sel_video_list_id, video_list, sub_menu_data))\ng.PERSISTENT_STORAGE.commit()\nfinalize_directory(directory_items, menu_data.get('content_type', g.CONTENT_SHOW),\n- title=g.get_menu_title(menu_data['path'][1]))\n+ title=g.get_menu_title(menu_data['path'][1]), sort_type='sort_label')\nreturn menu_data.get('view')\n@@ -215,8 +215,12 @@ def build_video_listing(video_list, menu_data, pathitems=None):\n# list_item_skeleton('Browse subgenres...'),\n# True))\nadd_items_previous_next_page(directory_items, pathitems, video_list.perpetual_range_selector)\n+ # At the moment it is not possible to make a query with results sorted for the 'mylist', so we adding the sort order of kodi\n+ sort_type = 'sort_nothing'\n+ if menu_data['path'][1]=='myList':\n+ sort_type='sort_label'\nfinalize_directory(directory_items, menu_data.get('content_type', g.CONTENT_SHOW),\n- title=g.get_menu_title(menu_data['path'][1]))\n+ title=g.get_menu_title(menu_data['path'][1]), sort_type=sort_type)\nreturn menu_data.get('view')\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Added sort order to the lists of sub-menus and to mylist |
106,046 | 07.05.2019 21:31:32 | -7,200 | 8777e02a19c3763819d39178b2695dea0a49a03d | Fixed "KeyError: 'lists'" when 'My list' is empty | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/shakti.py",
"new_path": "resources/lib/api/shakti.py",
"diff": "@@ -240,7 +240,9 @@ def custom_video_list_basicinfo(list_id):\n'length_params': ['stdlist', ['lists', list_id]],\n'perpetual_range_start': None\n}\n- return VideoList(common.make_call('perpetual_path_request', callargs))\n+ # When the list is empty the server returns an empty response\n+ path_response = common.make_call('perpetual_path_request', callargs)\n+ return {} if not path_response else VideoList(path_response)\[email protected]_output(g, cache.CACHE_COMMON, fixed_identifier='my_list_items')\n@@ -248,12 +250,12 @@ def mylist_items():\n\"\"\"Return a list of all the items currently contained in my list\"\"\"\ncommon.debug('Try to perform a request to get the id list of the videos in my list')\ntry:\n- return [video_id\n- for video_id, video in\n- custom_video_list_basicinfo(\n- list_id_for_type(\n- g.MAIN_MENU_ITEMS['myList']['lolomo_contexts'][0])).videos.iteritems()\n+ mylist_items = []\n+ video_list = custom_video_list_basicinfo(list_id_for_type(g.MAIN_MENU_ITEMS['myList']['lolomo_contexts'][0]))\n+ if video_list:\n+ mylist_items = [video_id for video_id, video in video_list.videos.iteritems()\nif video['queue'].get('inQueue', False)]\n+ return mylist_items\nexcept InvalidVideoListTypeError:\nreturn []\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed "KeyError: 'lists'" when 'My list' is empty |
106,046 | 19.05.2019 11:00:44 | -7,200 | 3182a070e12c693c63f3abb5cbf96e5da99e4c6d | Fixed folder title on top of screen | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/listings.py",
"new_path": "resources/lib/kodi/listings.py",
"diff": "@@ -157,11 +157,12 @@ def build_lolomo_listing(lolomo, menu_data, force_videolistbyid=False, exclude_l\n# Create a new submenu info in MAIN_MENU_ITEMS for reference when 'directory' find the menu data\nsel_video_list_id = menu_parameters.context_id if menu_parameters.context_id and not force_videolistbyid else video_list_id\nsub_menu_data = menu_data.copy()\n- sub_menu_data['path'] = [menu_data['path'][0], menu_data['path'][1], sel_video_list_id]\n+ sub_menu_data['path'] = [menu_data['path'][0], sel_video_list_id, sel_video_list_id]\nsub_menu_data['lolomo_known'] = False\nsub_menu_data['lolomo_contexts'] = None\nsub_menu_data['content_type'] = g.CONTENT_SHOW\nsub_menu_data['force_videolistbyid'] = force_videolistbyid\n+ sub_menu_data['main_menu'] = menu_data['main_menu'] if menu_data.get('main_menu') else menu_data.copy()\ng.PERSISTENT_STORAGE['sub_menus'][sel_video_list_id] = sub_menu_data\ng.PERSISTENT_STORAGE['menu_titles'][sel_video_list_id] = video_list['displayName']\ndirectory_items.append(_create_videolist_item(sel_video_list_id, video_list, sub_menu_data))\n@@ -202,12 +203,13 @@ def build_subgenre_listing(subgenre_list, menu_data):\ndirectory_items = []\nfor index, subgenre_data in subgenre_list.lists:\n# Create a new submenu info in MAIN_MENU_ITEMS for reference when 'directory' find the menu data\n- sel_video_list_id = str(subgenre_data['id'])\n+ sel_video_list_id = unicode(subgenre_data['id'])\nsub_menu_data = menu_data.copy()\n- sub_menu_data['path'] = [menu_data['path'][0], menu_data['path'][1], sel_video_list_id]\n+ sub_menu_data['path'] = [menu_data['path'][0], sel_video_list_id, sel_video_list_id]\nsub_menu_data['lolomo_known'] = False\nsub_menu_data['lolomo_contexts'] = None\nsub_menu_data['content_type'] = g.CONTENT_SHOW\n+ sub_menu_data['main_menu'] = menu_data['main_menu'] if menu_data.get('main_menu') else menu_data.copy()\ng.PERSISTENT_STORAGE['sub_menus'][sel_video_list_id] = sub_menu_data\ng.PERSISTENT_STORAGE['menu_titles'][sel_video_list_id] = subgenre_data['name']\ndirectory_items.append(_create_subgenre_item(sel_video_list_id, subgenre_data, sub_menu_data))\n@@ -236,8 +238,18 @@ def build_video_listing(video_list, menu_data, pathitems=None, genre_id=None):\nin video_list.videos.iteritems()]\n# If genre_id exists add possibility to browse lolomos subgenres\nif genre_id:\n+ menu_id = 'subgenre_' + genre_id\n+ sub_menu_data = menu_data.copy()\n+ sub_menu_data['path'] = [menu_data['path'][0], menu_id, genre_id]\n+ sub_menu_data['lolomo_known'] = False\n+ sub_menu_data['lolomo_contexts'] = None\n+ sub_menu_data['content_type'] = g.CONTENT_SHOW\n+ sub_menu_data['main_menu'] = menu_data['main_menu'] if menu_data.get('main_menu') else menu_data.copy()\n+ g.PERSISTENT_STORAGE['sub_menus'][menu_id] = sub_menu_data\n+ g.PERSISTENT_STORAGE['menu_titles'][menu_id] = common.get_local_string(30089)\n+ g.PERSISTENT_STORAGE.commit()\ndirectory_items.insert(0,\n- (common.build_url(['genres', menu_data['path'][1], genre_id],\n+ (common.build_url(['genres', menu_id, genre_id],\nmode=g.MODE_DIRECTORY),\nlist_item_skeleton(common.get_local_string(30089),\nicon='DefaultVideoPlaylist.png',\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/directory.py",
"new_path": "resources/lib/navigation/directory.py",
"diff": "@@ -79,11 +79,15 @@ class DirectoryBuilder(object):\nmenu_data = g.MAIN_MENU_ITEMS.get(pathitems[1])\nif not menu_data:\nmenu_data = g.PERSISTENT_STORAGE['sub_menus'][pathitems[1]]\n+ mainmenu_data = menu_data.copy()\n+ # If the menu is a sub-menu, we get the parameters of the main menu\n+ if menu_data.get('main_menu'):\n+ mainmenu_data = menu_data['main_menu']\nif menu_data.get('request_context_name', None) and g.is_known_menu_context(pathitems[2]):\nlistings.build_video_listing(\napi.video_list_sorted(context_name=menu_data['request_context_name'],\nperpetual_range_start=self.perpetual_range_start,\n- menu_data=menu_data),\n+ menu_data=mainmenu_data),\nmenu_data, pathitems)\nelse:\n# Dynamic IDs for common video lists\n@@ -92,7 +96,7 @@ class DirectoryBuilder(object):\napi.video_list_sorted(context_name=menu_data['request_context_name'],\ncontext_id=list_id,\nperpetual_range_start=self.perpetual_range_start,\n- menu_data=menu_data),\n+ menu_data=mainmenu_data),\nmenu_data, pathitems, self.params.get('genre_id'))\n_handle_endofdirectory(self.dir_update_listing)\n@@ -114,7 +118,9 @@ class DirectoryBuilder(object):\[email protected]_execution(immediate=False)\ndef genres(self, pathitems):\n\"\"\"Show video lists for a genre\"\"\"\n- menu_data = g.MAIN_MENU_ITEMS[pathitems[1]]\n+ menu_data = g.MAIN_MENU_ITEMS.get(pathitems[1])\n+ if not menu_data:\n+ menu_data = g.PERSISTENT_STORAGE['sub_menus'][pathitems[1]]\n# pathitems indexes: 0 function name, 1 menu id, 2 optional id\nif len(pathitems) < 3:\nlolomo = api.root_lists()\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed folder title on top of screen |
106,046 | 19.05.2019 11:12:43 | -7,200 | 09cf57d7701798f3ebe49248a68f94f5dfa0077c | Fixed subgenre folder icon | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/listings.py",
"new_path": "resources/lib/kodi/listings.py",
"diff": "@@ -252,7 +252,7 @@ def build_video_listing(video_list, menu_data, pathitems=None, genre_id=None):\n(common.build_url(['genres', menu_id, genre_id],\nmode=g.MODE_DIRECTORY),\nlist_item_skeleton(common.get_local_string(30089),\n- icon='DefaultVideoPlaylist.png',\n+ icon='DefaultVideoPlaylists.png',\ndescription=common.get_local_string(30088)),\nTrue))\nadd_items_previous_next_page(directory_items, pathitems, video_list.perpetual_range_selector, genre_id)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed subgenre folder icon |
106,046 | 19.05.2019 14:23:48 | -7,200 | 1658ef9bda2185f43d1f1ae2faf389070652ebf0 | Added a class to get kodi version | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/misc_utils.py",
"new_path": "resources/lib/common/misc_utils.py",
"diff": "@@ -10,6 +10,7 @@ from functools import wraps\nfrom time import clock\nimport gzip\nimport base64\n+import re\nfrom StringIO import StringIO\nimport xbmc\n@@ -299,3 +300,29 @@ def get_system_platform():\nelif xbmc.getCondVisibility('system.platform.ios'):\nplatform = \"ios\"\nreturn platform\n+\n+\n+class GetKodiVersion(object):\n+ \"\"\"Get the kodi version, git date, stage name\"\"\"\n+\n+ def __init__(self):\n+ # Examples of some types of supported strings:\n+ # 10.1 Git:Unknown PRE-11.0 Git:Unknown 11.0-BETA1 Git:20111222-22ad8e4\n+ # 0422-f2643566d0 19.0-ALPHA1 Git:20190419-c963b64487\n+ build_version_str = xbmc.getInfoLabel('System.BuildVersion')\n+ re_kodi_version = re.search('\\\\d+\\\\.\\\\d+?(?=(\\\\s|-))', build_version_str)\n+ if re_kodi_version:\n+ self.version = re_kodi_version.group(0)\n+ else:\n+ self.version = 'Unknown'\n+ re_git_date = re.search('(Git:)(\\\\d+?(?=(-|$)))', build_version_str)\n+ if re_git_date and len(re_git_date.groups()) >= 2:\n+ self.date = int(re_git_date.group(2))\n+ else:\n+ self.date = 0\n+ re_stage = re.search('(\\\\d+\\\\.\\\\d+-)(.+)(?=\\\\s)', build_version_str)\n+ if not re_stage:\n+ re_stage = re.search('^(.+)(-\\\\d+\\\\.\\\\d+)', build_version_str)\n+ self.stage = re_stage.group(1) if re_stage else ''\n+ else:\n+ self.stage = re_stage.group(2) if re_stage else ''\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Added a class to get kodi version |
105,991 | 19.05.2019 23:53:16 | -7,200 | 5c05d25484f5e52c22fe5952108360514eb8bbfd | Fix sort order for MyList
Series and Movies are not separated anymore. Better for navigation with remote using keys 1-9 | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/listings.py",
"new_path": "resources/lib/kodi/listings.py",
"diff": "@@ -260,7 +260,7 @@ def build_video_listing(video_list, menu_data, pathitems=None, genre_id=None):\n# so we adding the sort order of kodi\nsort_type = 'sort_nothing'\nif menu_data['path'][1] == 'myList':\n- sort_type = 'sort_label'\n+ sort_type = 'sort_label_ignore_folders'\nfinalize_directory(directory_items, menu_data.get('content_type', g.CONTENT_SHOW),\ntitle=g.get_menu_title(menu_data['path'][1]), sort_type=sort_type)\nreturn menu_data.get('view')\n@@ -399,6 +399,8 @@ def add_sort_methods(sort_type):\nxbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_NONE)\nif sort_type == 'sort_label':\nxbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_LABEL)\n+ if sort_type == 'sort_label_ignore_folders':\n+ xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_LABEL_IGNORE_FOLDERS)\nif sort_type == 'sort_episodes':\nxbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_EPISODE)\nxbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_LABEL)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix sort order for MyList
Series and Movies are not separated anymore. Better for navigation with remote using keys 1-9 |
106,046 | 21.05.2019 20:45:59 | -7,200 | 91999154f7e7f1c9c1c7d56bed77119c36b9a72c | Version bump (14.2) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.1\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.2\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.26.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n+v0.14.2 (2019-05-21)\n+- Added genres and sub-genres browseable\n+- Added customizable sort order by menu in settings\n+- Speedup a bit the loading of lists\n+- Updated french/polish/italian languages\n+- Updated request query parameters\n+- Fixed sort order to MyList and lolomo lists\n+\nv0.14.1 (2019-04-30)\n- Added customizable main menu items\n- Added audio description menu to help visually impaired people\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (14.2) |
106,046 | 24.05.2019 22:16:51 | -7,200 | f61f1a635e51fd08b53c0863680621aeaf03f3be | Version bump (14.3) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.2\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.14.3\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.26.0\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n+v0.14.3 (2019-05-24)\n+- Fixed error when playing from kodi library\n+\nv0.14.2 (2019-05-21)\n- Added genres and sub-genres browseable\n- Added customizable sort order by menu in settings\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (14.3) |
106,046 | 01.06.2019 12:27:40 | -7,200 | e8d5db9502c30c2d7cef8eefc090bf152d8bbf90 | Remember audio/subtitle preferences also for movie | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -345,7 +345,7 @@ msgid \"Force support of HDCP 2.2 (enable 4K content)\"\nmsgstr \"\"\nmsgctxt \"#30082\"\n-msgid \"Save audio / subtitle settings for TV shows\"\n+msgid \"Remember audio / subtitle preferences\"\nmsgstr \"\"\nmsgctxt \"#30083\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.it_it/strings.po",
"new_path": "resources/language/resource.language.it_it/strings.po",
"diff": "@@ -345,8 +345,8 @@ msgid \"Force support of HDCP 2.2 (enable 4K content)\"\nmsgstr \"Forza il supporto per HDCP 2.2 (abilita contenuti 4K)\"\nmsgctxt \"#30082\"\n-msgid \"Save audio / subtitle settings for TV shows\"\n-msgstr \"Salva impostazioni audio/sottotitoli per i programmi tv\"\n+msgid \"Remember audio / subtitle preferences\"\n+msgstr \"Ricorda preferenze audio/sottotitoli\"\nmsgctxt \"#30083\"\nmsgid \"Save bookmarks for library items / mark as watched\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/playback/stream_continuity.py",
"new_path": "resources/lib/services/playback/stream_continuity.py",
"diff": "@@ -38,7 +38,7 @@ class StreamContinuityManager(PlaybackActionManager):\ndef __init__(self):\nsuper(StreamContinuityManager, self).__init__()\nself.storage = common.PersistentStorage(__name__)\n- self.current_show = None\n+ self.current_videoid = None\nself.current_streams = {}\nself.player = xbmc.Player()\nself.did_restore = False\n@@ -46,12 +46,15 @@ class StreamContinuityManager(PlaybackActionManager):\n@property\ndef show_settings(self):\n\"\"\"Stored stream settings for the current show\"\"\"\n- return self.storage.get(self.current_show, {})\n+ return self.storage.get(self.current_videoid, {})\ndef _initialize(self, data):\nif 'tvshowid' in data['videoid']:\nself.did_restore = False\n- self.current_show = data['videoid']['tvshowid']\n+ self.current_videoid = data['videoid']['tvshowid']\n+ elif 'movieid' in data['videoid']:\n+ self.did_restore = False\n+ self.current_videoid = data['videoid']['movieid']\nelse:\nself.enabled = False\n@@ -98,8 +101,9 @@ class StreamContinuityManager(PlaybackActionManager):\ncommon.debug('Save changed stream {} for {}'.format(stream, stype))\nnew_show_settings = self.show_settings.copy()\nnew_show_settings[stype] = stream\n- self.storage[self.current_show] = new_show_settings\n+ self.storage[self.current_videoid] = new_show_settings\n+ self.storage.commit()\ndef __repr__(self):\n- return ('enabled={}, current_show={}'\n- .format(self.enabled, self.current_show))\n+ return ('enabled={}, current_videoid={}'\n+ .format(self.enabled, self.current_videoid))\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Remember audio/subtitle preferences also for movie |
105,991 | 01.06.2019 15:19:48 | -7,200 | 4a3de522da692be42ffa946ac5b805ce605c9c81 | Implemented STRM resume workaround | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -719,3 +719,11 @@ msgstr \"\"\nmsgctxt \"#30175\"\nmsgid \"Movie genres\"\nmsgstr \"\"\n+\n+msgctxt \"#30176\"\n+msgid \"Enable STRM resume workaround (only library)\"\n+msgstr \"\"\n+\n+msgctxt \"#30177\"\n+msgid \"Ask to resume the video\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.it_it/strings.po",
"new_path": "resources/language/resource.language.it_it/strings.po",
"diff": "@@ -719,3 +719,11 @@ msgstr \"Generi di Serie Tv\"\nmsgctxt \"#30175\"\nmsgid \"Movie genres\"\nmsgstr \"Generi di Film\"\n+\n+msgctxt \"#30176\"\n+msgid \"Enable STRM resume workaround (only library)\"\n+msgstr \"Abilita STRM workaround 'riprendi da' (solo libreria)\"\n+\n+msgctxt \"#30177\"\n+msgid \"Ask to resume the video\"\n+msgstr \"Chiedi per riprendere un video\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/misc_utils.py",
"new_path": "resources/lib/common/misc_utils.py",
"diff": "@@ -285,6 +285,14 @@ def make_list(arg):\nelse []))\n+def convert_seconds_to_hms_str(time):\n+ h = int(time // 3600)\n+ time %= 3600\n+ m = int(time // 60)\n+ s = int(time % 60)\n+ return '{:02d}:{:02d}:{:02d}'.format(h, m, s)\n+\n+\ndef get_system_platform():\nplatform = \"unknown\"\nif xbmc.getCondVisibility('system.platform.linux') and not xbmc.getCondVisibility('system.platform.android'):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -35,6 +35,7 @@ def add_info(videoid, list_item, item, raw_data):\nttl=g.CACHE_METADATA_TTL, to_disk=True)\nlist_item.setInfo('video', infos)\nif infos.get('mediatype') in ['episode', 'movie']:\n+ list_item.setProperty('isFolder', 'false')\nlist_item.setProperty('IsPlayable', 'true')\nfor stream_type, quality_infos in quality_infos.iteritems():\nlist_item.addStreamInfo(stream_type, quality_infos)\n@@ -224,6 +225,8 @@ def add_info_from_library(videoid, list_item):\ninfos.update(details)\nlist_item.setInfo('video', infos)\nlist_item.setArt(art)\n+ # Workaround for resuming strm files from library\n+ infos['resume'] = resume\nreturn infos, art\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/ui/dialogs.py",
"new_path": "resources/lib/kodi/ui/dialogs.py",
"diff": "@@ -86,6 +86,15 @@ def ask_for_confirmation(title, message):\nreturn xbmcgui.Dialog().yesno(heading=title, line1=message)\n+def ask_for_resume(resume_position):\n+ \"\"\"Ask the user for resuming a video\"\"\"\n+ return xbmcgui.Dialog().contextmenu(\n+ [\n+ common.get_local_string(12022).format(common.convert_seconds_to_hms_str(resume_position)),\n+ common.get_local_string(12023)\n+ ])\n+\n+\ndef show_backend_not_ready():\nreturn xbmcgui.Dialog().ok(common.get_local_string(30105),\nline1=common.get_local_string(30138))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/player.py",
"new_path": "resources/lib/navigation/player.py",
"diff": "\"\"\"Handle playback requests\"\"\"\nfrom __future__ import unicode_literals\n+import xbmc\nimport xbmcplugin\nimport xbmcgui\nimport inputstreamhelper\n@@ -54,13 +55,30 @@ def play(videoid):\nlist_item = get_inputstream_listitem(videoid)\ninfos, art = infolabels.add_info_for_playback(videoid, list_item)\n+\n+ # Workaround for resuming strm files from library\n+ resume_position = infos.get('resume', {}).get('position') \\\n+ if xbmc.getInfoLabel('Container.PluginName') != g.ADDON.getAddonInfo('id') \\\n+ and g.ADDON.getSettingBool('ResumeManager_enabled') else None\n+ if resume_position:\n+ index_selected = ui.ask_for_resume(resume_position) if g.ADDON.getSettingBool('ResumeManager_dialog') else None\n+ if index_selected == -1:\n+ xbmcplugin.setResolvedUrl(\n+ handle=g.PLUGIN_HANDLE,\n+ succeeded=False,\n+ listitem=list_item)\n+ return\n+ if index_selected == 1:\n+ resume_position = None\n+\ncommon.debug('Sending initialization signal')\ncommon.send_signal(common.Signals.PLAYBACK_INITIATED, {\n'videoid': videoid.to_dict(),\n'infos': infos,\n'art': art,\n'timeline_markers': get_timeline_markers(metadata[0]),\n- 'upnext_info': get_upnext_info(videoid, (infos, art), metadata)})\n+ 'upnext_info': get_upnext_info(videoid, (infos, art), metadata),\n+ 'resume_position': resume_position})\nxbmcplugin.setResolvedUrl(\nhandle=g.PLUGIN_HANDLE,\nsucceeded=True,\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/playback/controller.py",
"new_path": "resources/lib/services/playback/controller.py",
"diff": "@@ -12,6 +12,7 @@ from resources.lib.globals import g\nimport resources.lib.common as common\nfrom .action_manager import PlaybackActionManager\n+from .resume_manager import ResumeManager\nfrom .section_skipping import SectionSkipper\nfrom .stream_continuity import StreamContinuityManager\nfrom .upnext import UpNextNotifier\n@@ -41,6 +42,7 @@ class PlaybackController(xbmc.Monitor):\nself.tracking = True\nself.active_player_id = None\nself.action_managers = [\n+ ResumeManager(),\nSectionSkipper(),\nStreamContinuityManager(),\nUpNextNotifier()\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "resources/lib/services/playback/resume_manager.py",
"diff": "+# -*- coding: utf-8 -*-\n+\n+\"\"\"Force resume when item played from the library\"\"\"\n+\n+import xbmc\n+\n+import resources.lib.common as common\n+\n+from .action_manager import PlaybackActionManager\n+\n+\n+class ResumeManager(PlaybackActionManager):\n+ \"\"\"\n+ Checks if a resume action must be done\n+ \"\"\"\n+\n+ def __init__(self):\n+ super(ResumeManager, self).__init__()\n+ self.resume_position = None\n+ self.enabled = True\n+\n+ def __str__(self):\n+ return 'enabled={}'.format(self.enabled)\n+\n+ def _initialize(self, data):\n+ self.resume_position = data.get('resume_position')\n+\n+ def _on_playback_started(self, player_state):\n+ if self.resume_position:\n+ common.info('ResumeManager forced resume point to {}'.format(self.resume_position))\n+ xbmc.Player().seekTime(int(self.resume_position))\n+\n+ def _on_tick(self, player_state):\n+ pass\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/playback/stream_continuity.py",
"new_path": "resources/lib/services/playback/stream_continuity.py",
"diff": "@@ -42,6 +42,7 @@ class StreamContinuityManager(PlaybackActionManager):\nself.current_streams = {}\nself.player = xbmc.Player()\nself.did_restore = False\n+ self.resume = {}\n@property\ndef show_settings(self):\n@@ -49,6 +50,7 @@ class StreamContinuityManager(PlaybackActionManager):\nreturn self.storage.get(self.current_videoid, {})\ndef _initialize(self, data):\n+ self.resume = data.get('resume', {})\nif 'tvshowid' in data['videoid']:\nself.did_restore = False\nself.current_videoid = data['videoid']['tvshowid']\n@@ -59,7 +61,7 @@ class StreamContinuityManager(PlaybackActionManager):\nself.enabled = False\ndef _on_playback_started(self, player_state):\n- xbmc.sleep(1000)\n+ xbmc.sleep(500)\nfor stype in STREAMS:\nself._set_current_stream(stype, player_state)\nself._restore_stream(stype)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<setting id=\"auto_skip_credits\" type=\"bool\" label=\"30079\" default=\"false\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n<setting id=\"pause_on_skip\" type=\"bool\" label=\"30080\" default=\"false\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n<setting id=\"UpNextNotifier_enabled\" type=\"bool\" label=\"30129\" default=\"true\"/>\n+ <setting id=\"ResumeManager_enabled\" type=\"bool\" label=\"30176\" default=\"true\"/>\n+ <setting id=\"ResumeManager_dialog\" type=\"bool\" label=\"30177\" default=\"true\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n</category>\n<category label=\"30023\">\n<setting label=\"30115\" type=\"lsep\"/>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Implemented STRM resume workaround
Co-authored-by: Stefano Gottardo <[email protected]> |
106,046 | 01.06.2019 18:26:53 | -7,200 | 2277ae96d3f28e6257ae73dfd5a9183843997ec2 | Fixed visible menu of non-existing subgenres | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/listings.py",
"new_path": "resources/lib/kodi/listings.py",
"diff": "@@ -237,7 +237,7 @@ def build_video_listing(video_list, menu_data, pathitems=None, genre_id=None):\nfor videoid_value, video\nin video_list.videos.iteritems()]\n# If genre_id exists add possibility to browse lolomos subgenres\n- if genre_id:\n+ if genre_id and genre_id != 'None':\nmenu_id = 'subgenre_' + genre_id\nsub_menu_data = menu_data.copy()\nsub_menu_data['path'] = [menu_data['path'][0], menu_id, genre_id]\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed visible menu of non-existing subgenres |
106,046 | 01.06.2019 18:57:19 | -7,200 | 3c54bed54cac40d8cb2e2f1f1ee95044cabb4604 | Added UpNext addon settings shortcut in settings | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -727,3 +727,7 @@ msgstr \"\"\nmsgctxt \"#30177\"\nmsgid \"Ask to resume the video\"\nmsgstr \"\"\n+\n+msgctxt \"#30178\"\n+msgid \"Open UpNext Addon settings\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.it_it/strings.po",
"new_path": "resources/language/resource.language.it_it/strings.po",
"diff": "@@ -727,3 +727,7 @@ msgstr \"Abilita STRM workaround 'riprendi da' (solo libreria)\"\nmsgctxt \"#30177\"\nmsgid \"Ask to resume the video\"\nmsgstr \"Chiedi per riprendere un video\"\n+\n+msgctxt \"#30178\"\n+msgid \"Open UpNext Addon settings\"\n+msgstr \"Apri impostazioni UpNext Addon\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<setting id=\"auto_skip_credits\" type=\"bool\" label=\"30079\" default=\"false\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n<setting id=\"pause_on_skip\" type=\"bool\" label=\"30080\" default=\"false\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n<setting id=\"UpNextNotifier_enabled\" type=\"bool\" label=\"30129\" default=\"true\"/>\n+ <setting id=\"is_settings_upnext\" type=\"action\" label=\"30178\" action=\"Addon.OpenSettings(service.upnext)\" enable=\"System.HasAddon(service.upnext)\" option=\"close\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n<setting id=\"ResumeManager_enabled\" type=\"bool\" label=\"30176\" default=\"true\"/>\n<setting id=\"ResumeManager_dialog\" type=\"bool\" label=\"30177\" default=\"true\" visible=\"eq(-1,true)\" subsetting=\"true\"/>\n</category>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Added UpNext addon settings shortcut in settings |
106,046 | 02.06.2019 12:09:11 | -7,200 | 7b48ded4acc53bb91e1040659ee92ce8675b7daf | Added some infos to MPD | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/converter.py",
"new_path": "resources/lib/services/msl/converter.py",
"diff": "@@ -103,11 +103,13 @@ def _convert_video_downloadable(downloadable, adaptation_set,\nrepresentation = ET.SubElement(\nparent=adaptation_set,\ntag='Representation',\n+ id=str(downloadable['urls'][0]['cdn_id']),\nwidth=str(downloadable['res_w']),\nheight=str(downloadable['res_h']),\nbandwidth=str(downloadable['bitrate'] * 1024),\nnflxContentProfile=str(downloadable['content_profile']),\ncodecs=_determine_video_codec(downloadable['content_profile']),\n+ frameRate=str(downloadable['framerate_value'] / downloadable['framerate_scale']),\nmimeType='video/mp4')\n_add_base_url(representation, downloadable['urls'][0]['url'])\n_add_segment_base(representation, init_length)\n@@ -150,6 +152,7 @@ def _convert_audio_downloadable(downloadable, adaptation_set, init_length,\nrepresentation = ET.SubElement(\nparent=adaptation_set,\ntag='Representation',\n+ id=str(downloadable['urls'][0]['cdn_id']),\ncodecs=codec_type,\nbandwidth=str(downloadable['bitrate'] * 1024),\nmimeType='audio/mp4')\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Added some infos to MPD |
106,046 | 02.06.2019 14:31:47 | -7,200 | 581fcb6b4087d94ae7bcbe2ef3c8df45fcc654bd | Added 'supplemental' videoid | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/videoid.py",
"new_path": "resources/lib/common/videoid.py",
"diff": "@@ -15,16 +15,13 @@ class InvalidVideoId(Exception):\nclass VideoId(object):\n\"\"\"Universal representation of a video id. Video IDs can be of multiple\ntypes:\n- - movie: a single identifier only for movieid, all other values must be\n- None\n- - show: a single identifier only for tvshowid, all other values must be\n- None\n- - season: identifiers for seasonid and tvshowid, all other values must\n- be None\n- - episode: identifiers for episodeid, seasonid and tvshowid, all other\n- values must be None\n- - unspecified: a single identifier only for videoid, all other values\n- must be None\"\"\"\n+ - supplemental: a single identifier only for supplementalid, all other values must be None\n+ - movie: a single identifier only for movieid, all other values must be None\n+ - show: a single identifier only for tvshowid, all other values must be None\n+ - season: identifiers for seasonid and tvshowid, all other values must be None\n+ - episode: identifiers for episodeid, seasonid and tvshowid, all other values must be None\n+ - unspecified: a single identifier only for videoid, all other values must be None\"\"\"\n+ SUPPLEMENTAL = 'supplemental'\nMOVIE = 'movie'\nSHOW = 'show'\nSEASON = 'season'\n@@ -33,16 +30,17 @@ class VideoId(object):\nTV_TYPES = [SHOW, SEASON, EPISODE]\nVALIDATION_MASKS = {\n- 0b10000: UNSPECIFIED,\n- 0b01000: MOVIE,\n- 0b00001: SHOW,\n- 0b00011: SEASON,\n- 0b00111: EPISODE\n+ 0b100000: UNSPECIFIED,\n+ 0b010000: SUPPLEMENTAL,\n+ 0b001000: MOVIE,\n+ 0b000001: SHOW,\n+ 0b000011: SEASON,\n+ 0b000111: EPISODE\n}\ndef __init__(self, **kwargs):\nself._id_values = _get_unicode_kwargs(kwargs)\n- # debug('VideoId validation values: ' + str(self._id_values))\n+ # debug('VideoId validation values: {}'.format(self._id_values))\nself._validate()\nself._menu_parameters = MenuIdParameters(id_values=self._assigned_id_values()[0])\n@@ -51,7 +49,7 @@ class VideoId(object):\n# Example: ('39c9a88a-a56e-4c8a-921c-3c1f86c0ebb9_62682962X28X6548X1551537755876', None, None, None, None)\n# This result in a VALIDATION_MASKS 'unspecified'. Because text data is on index 0, and others are None\nfor index, value in enumerate(self._id_values):\n- validation_mask |= (value is not None) << (4-index)\n+ validation_mask |= (value is not None) << (5-index)\ntry:\nself._mediatype = VideoId.VALIDATION_MASKS[validation_mask]\nexcept KeyError:\n@@ -66,6 +64,8 @@ class VideoId(object):\nreturn cls(tvshowid=_path_attr(pathitems, 1),\nseasonid=_path_attr(pathitems, 3),\nepisodeid=_path_attr(pathitems, 5))\n+ elif pathitems[0] == VideoId.SUPPLEMENTAL:\n+ return cls(supplementalid=pathitems[1])\nreturn cls(videoid=pathitems[0])\n@classmethod\n@@ -78,9 +78,11 @@ class VideoId(object):\nreturn cls(movieid=video_id)\nelif mediatype == VideoId.SHOW:\nreturn cls(tvshowid=video_id)\n+ elif mediatype == VideoId.SUPPLEMENTAL:\n+ return cls(supplementalid=video_id)\nelse:\nraise InvalidVideoId(\n- 'Can only construct a VideoId from a show or movie item')\n+ 'Can only construct a VideoId from a show/movie/supplemental item')\n@property\ndef value(self):\n@@ -97,30 +99,35 @@ class VideoId(object):\n\"\"\"The videoid value, if it exists\"\"\"\nreturn self._id_values[0]\n+ @property\n+ def supplementalid(self):\n+ \"\"\"The supplemental value, if it exists\"\"\"\n+ return self._id_values[1]\n+\n@property\ndef movieid(self):\n\"\"\"The movieid value, if it exists\"\"\"\n- return self._id_values[1]\n+ return self._id_values[2]\n@property\ndef episodeid(self):\n\"\"\"The episodeid value, if it exists\"\"\"\n- return self._id_values[2]\n+ return self._id_values[3]\n@property\ndef seasonid(self):\n\"\"\"The seasonid value, if it exists\"\"\"\n- return self._id_values[3]\n+ return self._id_values[4]\n@property\ndef tvshowid(self):\n\"\"\"The tvshowid value, if it exists\"\"\"\n- return self._id_values[4]\n+ return self._id_values[5]\n@property\ndef mediatype(self):\n\"\"\"The mediatype this VideoId instance represents.\n- Either movie, show, season, episode or unspecified\"\"\"\n+ Either movie, show, season, episode, supplemental or unspecified\"\"\"\nreturn self._mediatype\ndef to_path(self):\n@@ -130,6 +137,8 @@ class VideoId(object):\nreturn [self.videoid]\nif self.movieid:\nreturn [self.MOVIE, self.movieid]\n+ if self.supplementalid:\n+ return [self.SUPPLEMENTAL, self.supplementalid]\npathitems = [self.SHOW, self.tvshowid]\nif self.seasonid:\n@@ -150,8 +159,8 @@ class VideoId(object):\ninstance\"\"\"\nresult = {'mediatype': self.mediatype}\nresult.update({prop: self.__getattribute__(prop)\n- for prop in ['videoid', 'movieid', 'tvshowid',\n- 'seasonid', 'episodeid']\n+ for prop in ['videoid', 'supplementalid', 'movieid',\n+ 'tvshowid', 'seasonid', 'episodeid']\nif self.__getattribute__(prop) is not None})\nreturn result\n@@ -209,13 +218,13 @@ class VideoId(object):\ndef _get_unicode_kwargs(kwargs):\n- # Example of return value: (None, '70084801', None, None, None) this is a movieid\n+ # Example of return value: (None, None, '70084801', None, None, None, None) this is a movieid\nreturn tuple((unicode(kwargs[idpart])\nif kwargs.get(idpart)\nelse None)\nfor idpart\n- in ['videoid', 'movieid', 'episodeid', 'seasonid',\n- 'tvshowid'])\n+ in ['videoid', 'supplementalid', 'movieid',\n+ 'episodeid', 'seasonid', 'tvshowid'])\ndef _path_attr(pathitems, index):\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Added 'supplemental' videoid |
106,046 | 02.06.2019 14:36:36 | -7,200 | fe65156515a0d68e1dfcfe5acd5fd35e1553addd | Implemented trailers list to tvshow/movie by context menu | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -731,3 +731,11 @@ msgstr \"\"\nmsgctxt \"#30178\"\nmsgid \"Open UpNext Addon settings\"\nmsgstr \"\"\n+\n+msgctxt \"#30179\"\n+msgid \"Show the trailers\"\n+msgstr \"\"\n+\n+msgctxt \"#30180\"\n+msgid \"No trailers available\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.it_it/strings.po",
"new_path": "resources/language/resource.language.it_it/strings.po",
"diff": "@@ -731,3 +731,11 @@ msgstr \"Chiedi per riprendere un video\"\nmsgctxt \"#30178\"\nmsgid \"Open UpNext Addon settings\"\nmsgstr \"Apri impostazioni UpNext Addon\"\n+\n+msgctxt \"#30179\"\n+msgid \"Show the trailers\"\n+msgstr \"Mostra i trailers\"\n+\n+msgctxt \"#30180\"\n+msgid \"No trailers available\"\n+msgstr \"Nessun trailer disponibile\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/data_types.py",
"new_path": "resources/lib/api/data_types.py",
"diff": "@@ -94,6 +94,7 @@ class VideoListSorted(object):\n\"\"\"A video list\"\"\"\n# pylint: disable=invalid-name\ndef __init__(self, path_response, context_name, context_id, req_sort_order_type):\n+ # common.debug('VideoListSorted data: {}'.format(path_response))\nself.perpetual_range_selector = path_response.get('_perpetual_range_selector')\nself.data = path_response\nself.context_name = context_name\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/paths.py",
"new_path": "resources/lib/api/paths.py",
"diff": "@@ -77,6 +77,10 @@ INFO_MAPPINGS = {\n# 'playcount': 'watched'\n}\n+TRAILER_PARTIAL_PATHS = [\n+ [['availability', 'summary', 'synopsis', 'title', 'trackId', 'delivery']]\n+] + ART_PARTIAL_PATHS\n+\nINFO_TRANSFORMATIONS = {\n'rating': lambda r: r / 10,\n'playcount': lambda w: int(w)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/shakti.py",
"new_path": "resources/lib/api/shakti.py",
"diff": "@@ -13,7 +13,8 @@ from .data_types import (LoLoMo, VideoList, VideoListSorted, SeasonList, Episode\nSearchVideoList, CustomVideoList, SubgenreList)\nfrom .paths import (VIDEO_LIST_PARTIAL_PATHS, VIDEO_LIST_BASIC_PARTIAL_PATHS,\nSEASONS_PARTIAL_PATHS, EPISODES_PARTIAL_PATHS, ART_PARTIAL_PATHS,\n- GENRE_PARTIAL_PATHS, RANGE_SELECTOR, MAX_PATH_REQUEST_SIZE)\n+ GENRE_PARTIAL_PATHS, RANGE_SELECTOR, MAX_PATH_REQUEST_SIZE,\n+ TRAILER_PARTIAL_PATHS)\nfrom .exceptions import (InvalidVideoListTypeError, LoginFailedError, APIError,\nNotLoggedInError, MissingCredentialsError)\n@@ -220,6 +221,22 @@ def episodes(videoid):\nreturn EpisodeList(videoid, common.make_call('perpetual_path_request', callargs))\[email protected]_execution(immediate=False)\[email protected]_output(g, cache.CACHE_COMMON)\n+def supplemental_video_list(videoid, supplemental_type):\n+ \"\"\"Retrieve a supplemental video list\"\"\"\n+ if videoid.mediatype != common.VideoId.SHOW and videoid.mediatype != common.VideoId.MOVIE:\n+ raise common.InvalidVideoId('Cannot request supplemental list for {}'\n+ .format(videoid))\n+ common.debug('Requesting supplemental ({}) list for {}'\n+ .format(supplemental_type, videoid))\n+ callargs = build_paths(\n+ ['videos', videoid.value, supplemental_type,\n+ {\"from\": 0, \"to\": 35}], TRAILER_PARTIAL_PATHS)\n+ return VideoListSorted(common.make_call('path_request', callargs),\n+ 'videos', videoid.value, supplemental_type)\n+\n+\[email protected]_execution(immediate=False)\[email protected]_output(g, cache.CACHE_COMMON)\ndef single_info(videoid):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/context_menu.py",
"new_path": "resources/lib/kodi/context_menu.py",
"diff": "@@ -36,6 +36,9 @@ CONTEXT_MENU_ACTIONS = {\n'remove_from_list': {\n'label': common.get_local_string(30020),\n'url': ctx_item_url(['my_list', 'remove'])},\n+ 'trailer': {\n+ 'label': common.get_local_string(30179),\n+ 'url': ctx_item_url(['trailer'])},\n}\n@@ -43,9 +46,14 @@ def generate_context_menu_items(videoid):\n\"\"\"Generate context menu items for a listitem\"\"\"\nitems = _generate_library_ctx_items(videoid)\n- if videoid.mediatype != common.VideoId.SEASON:\n+ if videoid.mediatype != common.VideoId.SEASON and \\\n+ videoid.mediatype != common.VideoId.SUPPLEMENTAL:\nitems.insert(0, _ctx_item('rate', videoid))\n+ if videoid.mediatype != common.VideoId.SUPPLEMENTAL and \\\n+ videoid.mediatype in [common.VideoId.MOVIE, common.VideoId.SHOW]:\n+ items.insert(0, _ctx_item('trailer', videoid))\n+\nif videoid.mediatype in [common.VideoId.MOVIE, common.VideoId.SHOW] \\\nand g.PERSISTENT_STORAGE.get('profile_have_mylist_menu', False):\nlist_action = ('remove_from_list'\n@@ -57,6 +65,8 @@ def generate_context_menu_items(videoid):\ndef _generate_library_ctx_items(videoid):\n+ if videoid.mediatype == common.VideoId.SUPPLEMENTAL:\n+ return []\nlibrary_actions = (['remove', 'update']\nif library.is_in_library(videoid)\nelse ['export'])\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -34,7 +34,9 @@ def add_info(videoid, list_item, item, raw_data):\n{'infos': infos, 'quality_infos': quality_infos},\nttl=g.CACHE_METADATA_TTL, to_disk=True)\nlist_item.setInfo('video', infos)\n- if infos.get('mediatype') in ['episode', 'movie']:\n+ if videoid.mediatype == common.VideoId.EPISODE or \\\n+ videoid.mediatype == common.VideoId.MOVIE or \\\n+ videoid.mediatype == common.VideoId.SUPPLEMENTAL:\nlist_item.setProperty('isFolder', 'false')\nlist_item.setProperty('IsPlayable', 'true')\nfor stream_type, quality_infos in quality_infos.iteritems():\n@@ -78,7 +80,8 @@ def parse_info(videoid, item, raw_data):\n}, {}\ninfos = {'mediatype': ('tvshow'\n- if videoid.mediatype == common.VideoId.SHOW\n+ if videoid.mediatype == common.VideoId.SHOW or\n+ videoid.mediatype == common.VideoId.SUPPLEMENTAL\nelse videoid.mediatype)}\nif videoid.mediatype in common.VideoId.TV_TYPES:\ninfos['tvshowtitle'] = raw_data['videos'][videoid.tvshowid]['title']\n@@ -175,7 +178,8 @@ def assign_art(videoid, boxart_large, boxart_small, poster, interesting_moment,\n'fanart': _best_art([fanart, interesting_moment, boxart_large,\nboxart_small]),\n'thumb': ((interesting_moment\n- if videoid.mediatype == common.VideoId.EPISODE else '')\n+ if videoid.mediatype == common.VideoId.EPISODE or\n+ videoid.mediatype == common.VideoId.SUPPLEMENTAL else '')\nor boxart_large or boxart_small)}\nart['landscape'] = art['thumb']\nif videoid.mediatype != common.VideoId.UNSPECIFIED:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/listings.py",
"new_path": "resources/lib/kodi/listings.py",
"diff": "@@ -339,6 +339,33 @@ def _create_episode_item(seasonid, episodeid_value, episode, episode_list):\nreturn (url, list_item, False)\n+@custom_viewmode(g.VIEW_SHOW)\[email protected]_execution(immediate=False)\n+def build_supplemental_listing(video_list, pathitems=None):\n+ \"\"\"Build a supplemental listing (eg. trailers)\"\"\"\n+ directory_items = [_create_supplemental_item(videoid_value, video, video_list)\n+ for videoid_value, video\n+ in video_list.videos.iteritems()]\n+ finalize_directory(directory_items, g.CONTENT_SHOW, 'sort_label',\n+ title='Trailers')\n+\n+\[email protected]_execution(immediate=False)\n+def _create_supplemental_item(videoid_value, video, video_list):\n+ \"\"\"Create a tuple that can be added to a Kodi directory that represents\n+ a video as listed in a videolist\"\"\"\n+ videoid = common.VideoId(\n+ **{'supplementalid': videoid_value})\n+ list_item = list_item_skeleton(video['title'])\n+ add_info(videoid, list_item, video, video_list.data)\n+ add_art(videoid, list_item, video)\n+ url = common.build_url(videoid=videoid,\n+ mode=g.MODE_PLAY)\n+ # replaceItems still look broken because it does not remove the default ctx menu, i hope in the future Kodi fix this\n+ list_item.addContextMenuItems(generate_context_menu_items(videoid), replaceItems=True)\n+ return (url, list_item, False)\n+\n+\ndef list_item_skeleton(label, icon=None, fanart=None, description=None, customicon=None):\n\"\"\"Create a rudimentary list item skeleton with icon and fanart\"\"\"\n# pylint: disable=unexpected-keyword-arg\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/actions.py",
"new_path": "resources/lib/navigation/actions.py",
"diff": "\"\"\"Navigation handler for actions\"\"\"\nfrom __future__ import unicode_literals\n+import xbmc\n+\nfrom resources.lib.globals import g\nimport resources.lib.common as common\nimport resources.lib.api.shakti as api\n@@ -71,6 +73,18 @@ class AddonActionExecutor(object):\n_sync_library(videoid, operation)\ncommon.refresh_container()\n+ @common.inject_video_id(path_offset=1)\n+ @common.time_execution(immediate=False)\n+ def trailer(self, videoid):\n+ \"\"\"Get the trailer list\"\"\"\n+ video_list = api.supplemental_video_list(videoid, 'trailers')\n+ if video_list.videos:\n+ url = common.build_url(['supplemental', videoid.value, videoid.mediatype, 'trailers'],\n+ mode=g.MODE_DIRECTORY)\n+ xbmc.executebuiltin('Container.Update({})'.format(url))\n+ else:\n+ ui.show_notification(common.get_local_string(30180))\n+\[email protected]_execution(immediate=False)\ndef purge_cache(self, pathitems=None):\n\"\"\"Clear the cache. If on_disk param is supplied, also clear cached\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/directory.py",
"new_path": "resources/lib/navigation/directory.py",
"diff": "@@ -167,6 +167,15 @@ class DirectoryBuilder(object):\nui.show_notification(common.get_local_string(30013))\nxbmcplugin.endOfDirectory(g.PLUGIN_HANDLE, succeeded=False)\n+ @common.time_execution(immediate=False)\n+ def supplemental(self, pathitems):\n+ \"\"\"Show supplemental videos (eg. trailers) of a tvshow/movie\"\"\"\n+ # pathitems indexes: 0 function name, 1 videoid value, 2 videoid mediatype, 3 supplemental_type\n+ videoid = common.VideoId.from_path([pathitems[2], pathitems[1]])\n+ listings.build_supplemental_listing(api.supplemental_video_list(videoid, pathitems[3]),\n+ pathitems)\n+ _handle_endofdirectory(self.dir_update_listing)\n+\ndef _ask_search_term_and_redirect():\nsearch_term = ui.ask_for_search_term()\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/converter.py",
"new_path": "resources/lib/services/msl/converter.py",
"diff": "@@ -19,11 +19,12 @@ def convert_to_dash(manifest):\nroot = _mpd_manifest_root(duration)\nperiod = ET.SubElement(root, 'Period', start='PT0S', duration=duration)\n- protection = _protection_info(manifest)\n+ protection = _protection_info(manifest) if manifest['hasDrmStreams'] else None\n+ drm_streams = manifest['hasDrmStreams']\nfor video_track in manifest['video_tracks']:\n_convert_video_track(\n- video_track, period, init_length, protection)\n+ video_track, period, init_length, protection, drm_streams)\n_fix_locale_languages(manifest['audio_tracks'])\n_fix_locale_languages(manifest['timedtexttracks'])\n@@ -31,7 +32,7 @@ def convert_to_dash(manifest):\ndefault_audio_language_index = _get_default_audio_language(manifest)\nfor index, audio_track in enumerate(manifest['audio_tracks']):\n_convert_audio_track(audio_track, period, init_length,\n- default=(index == default_audio_language_index))\n+ (index == default_audio_language_index), drm_streams)\ndefault_subtitle_language_index = _get_default_subtitle_language(manifest)\nfor index, text_track in enumerate(manifest['timedtexttracks']):\n@@ -66,14 +67,17 @@ def _protection_info(manifest):\nreturn {'pssh': pssh, 'keyid': keyid}\n-def _convert_video_track(video_track, period, init_length, protection):\n+def _convert_video_track(video_track, period, init_length, protection, drm_streams):\nadaptation_set = ET.SubElement(\nparent=period,\ntag='AdaptationSet',\nmimeType='video/mp4',\ncontentType='video')\n+ if protection:\n_add_protection_info(adaptation_set, **protection)\nfor downloadable in video_track['streams']:\n+ if downloadable['isDrm'] != drm_streams:\n+ continue\n_convert_video_downloadable(\ndownloadable, adaptation_set, init_length)\n@@ -123,7 +127,7 @@ def _determine_video_codec(content_profile):\nreturn 'h264'\n-def _convert_audio_track(audio_track, period, init_length, default):\n+def _convert_audio_track(audio_track, period, init_length, default, drm_streams):\nchannels_count = {'1.0': '1', '2.0': '2', '5.1': '6', '7.1': '8'}\nimpaired = 'true' if audio_track['trackType'] == 'ASSISTIVE' else 'false'\noriginal = 'true' if audio_track['isNative'] else 'false'\n@@ -139,6 +143,8 @@ def _convert_audio_track(audio_track, period, init_length, default):\noriginal=original,\ndefault=default)\nfor downloadable in audio_track['streams']:\n+ if downloadable['isDrm'] != drm_streams:\n+ continue\n_convert_audio_downloadable(\ndownloadable, adaptation_set, init_length,\nchannels_count[downloadable['channels']])\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Implemented trailers list to tvshow/movie by context menu |
106,046 | 02.06.2019 14:39:21 | -7,200 | 76a391d8734b7e27bf2148b878fd0c6ce8261a38 | website: fixed "Check your credentials" after login
the reactContext json content of userdata the tag 'altText' contained a tab char | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/website.py",
"new_path": "resources/lib/api/website.py",
"diff": "@@ -164,6 +164,7 @@ def extract_json(content, name):\njson_str = json_str.replace('\\\"', '\\\\\"') # Escape double-quotes\njson_str = json_str.replace('\\\\s', '\\\\\\\\s') # Escape \\s\njson_str = json_str.replace('\\\\n', '\\\\\\\\n') # Escape line feed\n+ json_str = json_str.replace('\\\\t', '\\\\\\\\t') # Escape tab\njson_str = json_str.decode('unicode_escape') # finally decoding...\nreturn json.loads(json_str)\nexcept Exception:\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | website: fixed "Check your credentials" after login
the reactContext json content of userdata the tag 'altText' contained a tab char |
106,046 | 02.06.2019 21:25:21 | -7,200 | fac12731d34c4cd3a8ea2643f62412a326c02a75 | Fixed broken audio without drm | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/msl/converter.py",
"new_path": "resources/lib/services/msl/converter.py",
"diff": "@@ -143,8 +143,9 @@ def _convert_audio_track(audio_track, period, init_length, default, drm_streams)\noriginal=original,\ndefault=default)\nfor downloadable in audio_track['streams']:\n- if downloadable['isDrm'] != drm_streams:\n- continue\n+ # Some audio stream has no drm\n+ # if downloadable['isDrm'] != drm_streams:\n+ # continue\n_convert_audio_downloadable(\ndownloadable, adaptation_set, init_length,\nchannels_count[downloadable['channels']])\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed broken audio without drm |
106,046 | 07.06.2019 23:19:30 | -7,200 | 28ad1d1faecf177ed0d635d817b7ccb5f48a3a27 | Use different cache bucket to supplemental video list
prevents conflicts with videoid objects from other lists | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/shakti.py",
"new_path": "resources/lib/api/shakti.py",
"diff": "@@ -222,7 +222,7 @@ def episodes(videoid):\[email protected]_execution(immediate=False)\[email protected]_output(g, cache.CACHE_COMMON)\[email protected]_output(g, cache.CACHE_SUPPLEMENTAL)\ndef supplemental_video_list(videoid, supplemental_type):\n\"\"\"Retrieve a supplemental video list\"\"\"\nif videoid.mediatype != common.VideoId.SHOW and videoid.mediatype != common.VideoId.MOVIE:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/cache.py",
"new_path": "resources/lib/cache.py",
"diff": "@@ -26,12 +26,13 @@ import xbmcvfs\nCACHE_COMMON = 'cache_common'\nCACHE_GENRES = 'cache_genres'\n+CACHE_SUPPLEMENTAL = 'cache_supplemental'\nCACHE_METADATA = 'cache_metadata'\nCACHE_INFOLABELS = 'cache_infolabels'\nCACHE_ARTINFO = 'cache_artinfo'\nCACHE_LIBRARY = 'library'\n-BUCKET_NAMES = [CACHE_COMMON, CACHE_GENRES, CACHE_METADATA,\n+BUCKET_NAMES = [CACHE_COMMON, CACHE_GENRES, CACHE_SUPPLEMENTAL, CACHE_METADATA,\nCACHE_INFOLABELS, CACHE_ARTINFO, CACHE_LIBRARY]\nBUCKET_LOCKED = 'LOCKED_BY_{:04d}_AT_{}'\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Use different cache bucket to supplemental video list
prevents conflicts with videoid objects from other lists |
106,046 | 08.06.2019 11:55:36 | -7,200 | 9b08d2e4b1784168355153ff7640a2816a7d3c7e | Fixed the sequence of profiles | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/website.py",
"new_path": "resources/lib/api/website.py",
"diff": "@@ -5,10 +5,12 @@ from __future__ import unicode_literals\nimport json\nimport traceback\nfrom re import compile as recompile, DOTALL, sub\n+from collections import OrderedDict\nimport resources.lib.common as common\nfrom resources.lib.globals import g\n+from .paths import resolve_refs\nfrom .exceptions import (InvalidProfilesError, InvalidAuthURLError,\nInvalidMembershipStatusError, WebsiteParsingError)\n@@ -62,24 +64,23 @@ def extract_profiles(falkor_cache):\nprofiles = {}\nactive_profile = None\ntry:\n- for guid, profile in falkor_cache.get('profiles', {}).items():\n- profiles[guid], is_active = _parse_profile(profile, falkor_cache)\n- if is_active:\n+ profiles_list = OrderedDict(resolve_refs(falkor_cache['profilesList'], falkor_cache))\n+ for guid, profile in profiles_list.items():\n+ common.debug('Parsing profile {}'.format(guid))\n+ avatar_url = _get_avatar(falkor_cache, profile)\n+ profile = profile['summary']['value']\n+ profile['avatar'] = avatar_url\n+ if profile.get('isActive'):\nactive_profile = guid\n+ profiles[list(profiles_list.keys()).index(guid)] = (guid, profile)\nexcept Exception:\ncommon.error(traceback.format_exc())\n+ common.error('Falkor cache: {}'.format(falkor_cache))\nraise InvalidProfilesError\nreturn profiles, active_profile\n-def _parse_profile(profile, falkor_cache):\n- _profile = profile['summary']['value']\n- common.debug('Parsing profile {}'.format(_profile['guid']))\n- _profile['avatar'] = _get_avatar(falkor_cache, profile)\n- return _profile, _profile['isActive']\n-\n-\ndef _get_avatar(falkor_cache, profile):\ntry:\nprofile['avatar']['value'].extend(AVATAR_SUBPATH)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/listings.py",
"new_path": "resources/lib/kodi/listings.py",
"diff": "@@ -75,9 +75,10 @@ def build_profiles_listing(profiles):\nhtml_parser = HTMLParser()\n# The standard kodi theme does not allow to change view type if the content is \"files\" type,\n# so here we use \"images\" type, visually better to see\n- finalize_directory([_create_profile_item(guid, profile, html_parser)\n- for guid, profile\n- in profiles.iteritems()], g.CONTENT_IMAGES)\n+ directory_items = []\n+ for index, (guid, profile) in sorted(profiles.items()):\n+ directory_items.append(_create_profile_item(guid, profile, html_parser))\n+ finalize_directory(directory_items, g.CONTENT_IMAGES)\ndef _create_profile_item(profile_guid, profile, html_parser):\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed the sequence of profiles |
106,046 | 08.06.2019 20:28:38 | -7,200 | cce9cc2e0fe456fa6d146d007c5ca2947e817a40 | Fixed errors when export a season to library | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/api/shakti.py",
"new_path": "resources/lib/api/shakti.py",
"diff": "@@ -330,9 +330,10 @@ def update_my_list(videoid, operation):\[email protected]_execution(immediate=False)\ndef metadata(videoid):\n\"\"\"Retrieve additional metadata for the given VideoId\"\"\"\n- if videoid.mediatype != common.VideoId.EPISODE:\n- return _metadata(videoid.value), None\n-\n+ if videoid.mediatype == common.VideoId.MOVIE:\n+ return _metadata(videoid), None\n+ if videoid.mediatype == common.VideoId.SEASON:\n+ return _metadata(videoid.derive_parent(None)), None\ntry:\nreturn _episode_metadata(videoid)\nexcept KeyError as exc:\n@@ -351,7 +352,7 @@ def metadata(videoid):\[email protected]_execution(immediate=False)\ndef _episode_metadata(videoid):\n- show_metadata = _metadata(videoid.tvshowid)\n+ show_metadata = _metadata(videoid)\nepisode_metadata, season_metadata = common.find_episode_metadata(\nvideoid, show_metadata)\nreturn episode_metadata, season_metadata, show_metadata\n@@ -364,13 +365,14 @@ def _metadata(video_id):\n\"\"\"Retrieve additional metadata for a video.This is a separate method from\nmetadata(videoid) to work around caching issues when new episodes are added\nto a show by Netflix.\"\"\"\n- common.debug('Requesting metdata for {}'.format(video_id))\n+ common.debug('Requesting metadata for {}'.format(video_id))\n+ # Always use params 'movieid' to all videoid identifier\nreturn common.make_call(\n'get',\n{\n'component': 'metadata',\n'req_type': 'api',\n- 'params': {'movieid': video_id}\n+ 'params': {'movieid': video_id.value}\n})['video']\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/library.py",
"new_path": "resources/lib/kodi/library.py",
"diff": "@@ -171,7 +171,7 @@ def _create_tv_tasks(videoid, metadata):\nreturn _compile_show_tasks(videoid, metadata[0])\nelif videoid.mediatype == common.VideoId.SEASON:\nreturn _compile_season_tasks(videoid, metadata[0],\n- common.find(videoid.seasonid, 'id',\n+ common.find(int(videoid.seasonid), 'id',\nmetadata[0]['seasons']))\nreturn [_create_episode_task(videoid, *metadata)]\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed errors when export a season to library |
106,046 | 08.06.2019 20:29:20 | -7,200 | c9e030b4288cf79a324359fce00df396e1a3c160 | Do not raise error when trying to convert a empty response to json | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/nfsession.py",
"new_path": "resources/lib/services/nfsession/nfsession.py",
"diff": "@@ -390,7 +390,7 @@ class NetflixSession(object):\ncommon.debug('Request returned statuscode {}'\n.format(response.status_code))\nresponse.raise_for_status()\n- return (_raise_api_error(response.json())\n+ return (_raise_api_error(response.json() if response.content else {})\nif URLS[component]['is_api_call']\nelse response.content)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Do not raise error when trying to convert a empty response to json |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.