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,979
09.03.2017 14:51:14
-3,600
5356f32f540542f5d62d3e93ea4692613a90ee42
chore(docs): Added documentation to the netflix service methods
[ { "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.10.5\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.10.6\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.10.5\n+# Addon version: 0.10.6\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.10.5\n+# Addon version: 0.10.6\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixHttpRequestHandler.py", "new_path": "resources/lib/NetflixHttpRequestHandler.py", "diff": "@@ -25,8 +25,10 @@ methods = [x for x, y in NetflixHttpSubRessourceHandler.__dict__.items() if type\nsub_res_handler = NetflixHttpSubRessourceHandler(kodi_helper=kodi_helper, netflix_session=netflix_session)\nclass NetflixHttpRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n+ \"\"\" Represents the callable internal server that dispatches requests to Netflix\"\"\"\ndef do_GET(self):\n+ \"\"\"GET request handler (we only need this, as we only do GET requests internally)\"\"\"\nurl = urlparse(self.path)\nparams = parse_qs(url.query)\nmethod = params.get('method', [None])[0]\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "new_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "diff": "# Created on: 07.03.2017\nclass NetflixHttpSubRessourceHandler:\n+ \"\"\" Represents the callable internal server routes & translates/executes them to requests for Netflix\"\"\"\ndef __init__ (self, kodi_helper, netflix_session):\n+ \"\"\"Sets up credentials & video_list_cache cache\n+ Assigns the netflix_session/kodi_helper instacnes\n+ Does the initial login if we have user data\n+\n+ Parameters\n+ ----------\n+ kodi_helper : :obj:`KodiHelper`\n+ instance of the KodiHelper class\n+\n+ netflix_session : :obj:`NetflixSession`\n+ instance of the NetflixSession class\n+ \"\"\"\nself.kodi_helper = kodi_helper\nself.netflix_session = netflix_session\nself.credentials = self.kodi_helper.get_credentials()\nself.video_list_cache = {}\n+ # check if we have stored credentials, if so, do the login before the user requests it\n+ # if that is done, we cache the profiles\nif self.credentials['email'] != '' and self.credentials['password'] != '':\nif self.netflix_session.is_logged_in(account=self.credentials):\nself.netflix_session.refresh_session_data(account=self.credentials)\nelse:\nself.netflix_session.login(account=self.credentials)\nself.profiles = self.netflix_session.profiles\n- #self._prefetch_user_video_lists()\nelse:\nself.profiles = []\n- def _prefetch_user_video_lists (self):\n- for profile_id in self.profiles:\n- self.switch_profile({'profile_id': [profile_id]})\n- self.video_list_cache[profile_id] = self.fetch_video_list_ids({})\n-\ndef is_logged_in (self, params):\n+ \"\"\"Existing login proxy function\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`Requests.Response`\n+ Response of the remote call\n+ \"\"\"\nif self.credentials['email'] == '' or self.credentials['password'] == '':\nreturn False\nreturn self.netflix_session.is_logged_in(account=self.credentials)\ndef logout (self, params):\n+ \"\"\"Logout proxy function\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`Requests.Response`\n+ Response of the remote call\n+ \"\"\"\nself.profiles = []\nself.credentials = {'email': '', 'password': ''}\nreturn self.netflix_session.logout()\ndef login (self, params):\n+ \"\"\"Logout proxy function\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`Requests.Response`\n+ Response of the remote call\n+ \"\"\"\nemail = params.get('email', [''])[0]\npassword = params.get('password', [''])[0]\nif email != '' and password != '':\n@@ -47,12 +92,48 @@ class NetflixHttpSubRessourceHandler:\nreturn None\ndef list_profiles (self, params):\n+ \"\"\"Returns the cached list of profiles\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`dict` of :obj:`str`\n+ List of profiles\n+ \"\"\"\nreturn self.profiles\ndef get_esn (self, params):\n+ \"\"\"ESN getter function\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`str`\n+ Exracted ESN\n+ \"\"\"\nreturn self.netflix_session.esn\ndef fetch_video_list_ids (self, params):\n+ \"\"\"Video list ids proxy function (caches video lists)\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`list`\n+ Transformed response of the remote call\n+ \"\"\"\ncached_list = self.video_list_cache.get(self.netflix_session.user_data['guid'], None)\nif cached_list != None:\nself.kodi_helper.log('Serving cached list for user: ' + self.netflix_session.user_data['guid'])\n@@ -63,6 +144,18 @@ class NetflixHttpSubRessourceHandler:\nreturn self.netflix_session.parse_video_list_ids(response_data=video_list_ids_raw)\ndef fetch_video_list (self, params):\n+ \"\"\"Video list proxy function\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`list`\n+ Transformed response of the remote call\n+ \"\"\"\nlist_id = params.get('list_id', [''])[0]\nraw_video_list = self.netflix_session.fetch_video_list(list_id=list_id)\nif 'error' in raw_video_list:\n@@ -73,12 +166,36 @@ class NetflixHttpSubRessourceHandler:\nreturn []\ndef fetch_episodes_by_season (self, params):\n+ \"\"\"Episodes for season proxy function\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`list`\n+ Transformed response of the remote call\n+ \"\"\"\nraw_episode_list = self.netflix_session.fetch_episodes_by_season(season_id=params.get('season_id')[0])\nif 'error' in raw_episode_list:\nreturn raw_episode_list\nreturn self.netflix_session.parse_episodes_by_season(response_data=raw_episode_list)\ndef fetch_seasons_for_show (self, params):\n+ \"\"\"Season for show proxy function\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`list`\n+ Transformed response of the remote call\n+ \"\"\"\nshow_id = params.get('show_id', [''])[0]\nraw_season_list = self.netflix_session.fetch_seasons_for_show(id=show_id)\nif 'error' in raw_season_list:\n@@ -89,30 +206,114 @@ class NetflixHttpSubRessourceHandler:\nreturn self.netflix_session.parse_seasons(id=show_id, response_data=raw_season_list)\ndef rate_video (self, params):\n+ \"\"\"Video rating proxy function\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`Requests.Response`\n+ Response of the remote call\n+ \"\"\"\nvideo_id = params.get('video_id', [''])[0]\nrating = params.get('rating', [''])[0]\nreturn self.netflix_session.rate_video(video_id=video_id, rating=rating)\ndef remove_from_list (self, params):\n+ \"\"\"Remove from my list proxy function\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`Requests.Response`\n+ Response of the remote call\n+ \"\"\"\nvideo_id = params.get('video_id', [''])[0]\nreturn self.netflix_session.remove_from_list(video_id=video_id)\ndef add_to_list (self, params):\n+ \"\"\"Add to my list proxy function\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`Requests.Response`\n+ Response of the remote call\n+ \"\"\"\nvideo_id = params.get('video_id', [''])[0]\nreturn self.netflix_session.add_to_list(video_id=video_id)\ndef fetch_metadata (self, params):\n+ \"\"\"Metadata proxy function\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`Requests.Response`\n+ Response of the remote call\n+ \"\"\"\nvideo_id = params.get('video_id', [''])[0]\nreturn self.netflix_session.fetch_metadata(id=video_id)\ndef switch_profile (self, params):\n+ \"\"\"Switch profile proxy function\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`Requests.Response`\n+ Response of the remote call\n+ \"\"\"\nprofile_id = params.get('profile_id', [''])[0]\nreturn self.netflix_session.switch_profile(profile_id=profile_id, account=self.credentials)\ndef get_user_data (self, params):\n+ \"\"\"User data getter function\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`str`\n+ Exracted User Data\n+ \"\"\"\nreturn self.netflix_session.user_data\ndef search (self, params):\n+ \"\"\"Search proxy function\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`list`\n+ Transformed response of the remote call\n+ \"\"\"\nterm = params.get('term', [''])[0]\nhas_search_results = False\nraw_search_results = self.netflix_session.fetch_search_results(search_str=term)\n" }, { "change_type": "MODIFY", "old_path": "service.py", "new_path": "service.py", "diff": "@@ -12,6 +12,7 @@ from resources.lib.KodiHelper import KodiHelper\nfrom resources.lib.MSLHttpRequestHandler import MSLHttpRequestHandler\nfrom resources.lib.NetflixHttpRequestHandler import NetflixHttpRequestHandler\n+# helper function to select an unused port on the host machine\ndef select_unused_port():\nsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\nsock.bind(('localhost', 0))\n@@ -22,10 +23,12 @@ def select_unused_port():\naddon = Addon()\nkodi_helper = KodiHelper()\n+# pick & store a port for the MSL service\nmsl_port = select_unused_port()\naddon.setSetting('msl_service_port', str(msl_port))\nkodi_helper.log(msg='[MSL] Picked Port: ' + str(msl_port))\n+# pick & store a port for the internal Netflix HTTP proxy service\nns_port = select_unused_port()\naddon.setSetting('netflix_service_port', str(ns_port))\nkodi_helper.log(msg='[NS] Picked Port: ' + str(ns_port))\n@@ -46,25 +49,30 @@ nd_server.timeout = 1\nif __name__ == '__main__':\nmonitor = xbmc.Monitor()\n+ # start thread for MLS servie\nmsl_thread = threading.Thread(target=msl_server.serve_forever)\nmsl_thread.daemon = True\nmsl_thread.start()\n+ # start thread for Netflix HTTP service\nnd_thread = threading.Thread(target=nd_server.serve_forever)\nnd_thread.daemon = True\nnd_thread.start()\n+ # kill the services if kodi monitor tells us to\nwhile not monitor.abortRequested():\nif monitor.waitForAbort(5):\nmsl_server.shutdown()\nnd_server.shutdown()\nbreak\n+ # MSL service shutdown sequence\nmsl_server.server_close()\nmsl_server.socket.close()\nmsl_server.shutdown()\nkodi_helper.log(msg='Stopped MSL Service')\n+ # Netflix service shutdown sequence\nnd_server.server_close()\nnd_server.socket.close()\nnd_server.shutdown()\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(docs): Added documentation to the netflix service methods
105,979
10.03.2017 10:55:01
-3,600
e614de8431e084df6d0317cf75abd8260c5ffa17
fix(main-menue): Removed sending of root lolomo as it would need to be refreshed at every request
[ { "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.11.0\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.1\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.0\n+# Addon version: 0.11.1\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.0\n+# Addon version: 0.11.1\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -1294,12 +1294,6 @@ class NetflixSession:\n'authURL': self.user_data['authURL']\n}\n- # check if we have a root lolomo for that user within our cookies\n- for cookie in self.session.cookies:\n- if cookie.name == 'lhpuuidh-browse-' + self.user_data['guid']:\n- value = unquote(cookie.value)\n- payload['lolomoid'] = value[value.rfind(':')+1:];\n-\nresponse = self._session_get(component='video_list_ids', params=payload, type='api')\nreturn self._process_response(response=response, component=self._get_api_url_for(component='video_list_ids'))\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(main-menue): Removed sending of root lolomo as it would need to be refreshed at every request
105,979
10.03.2017 15:54:45
-3,600
dfc7738380f5ce833063ce74e2c0ab9b82b84eae
fix(kids-profiles): Reenables Kids profiles after NEtflix API changes
[ { "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.11.1\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.2\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.1\n+# Addon version: 0.11.2\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.1\n+# Addon version: 0.11.2\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "new_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "diff": "@@ -23,6 +23,7 @@ class NetflixHttpSubRessourceHandler:\nself.netflix_session = netflix_session\nself.credentials = self.kodi_helper.get_credentials()\nself.video_list_cache = {}\n+ self.lolomo = None\n# check if we have stored credentials, if so, do the login before the user requests it\n# if that is done, we cache the profiles\n@@ -67,6 +68,7 @@ class NetflixHttpSubRessourceHandler:\n\"\"\"\nself.profiles = []\nself.credentials = {'email': '', 'password': ''}\n+ self.lolomo = None\nreturn self.netflix_session.logout()\ndef login (self, params):\n@@ -143,6 +145,24 @@ class NetflixHttpSubRessourceHandler:\nreturn video_list_ids_raw\nreturn self.netflix_session.parse_video_list_ids(response_data=video_list_ids_raw)\n+ def fetch_video_list_ids_for_kids (self, params):\n+ \"\"\"Video list ids proxy function (thanks to Netflix that we need to use a different API for Kids profiles)\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`list`\n+ Transformed response of the remote call\n+ \"\"\"\n+ if self.lolomo == None:\n+ self.lolomo = self.netflix_session.get_lolomo_for_kids()\n+ response = self.netflix_session.fetch_lists_for_kids(lolomo=self.lolomo)\n+ return response\n+\ndef fetch_video_list (self, params):\n\"\"\"Video list proxy function\n@@ -284,6 +304,7 @@ class NetflixHttpSubRessourceHandler:\nResponse of the remote call\n\"\"\"\nprofile_id = params.get('profile_id', [''])[0]\n+ self.lolomo = None\nreturn self.netflix_session.switch_profile(profile_id=profile_id, account=self.credentials)\ndef get_user_data (self, params):\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -32,7 +32,8 @@ class NetflixSession:\n'adult_pin': '/pin/service',\n'metadata': '/metadata',\n'set_video_rating': '/setVideoRating',\n- 'update_my_list': '/playlistop'\n+ 'update_my_list': '/playlistop',\n+ 'kids': '/Kids'\n}\n\"\"\":obj:`dict` of :obj:`str` List of all static endpoints for HTML/JSON POST/GET requests\"\"\"\n@@ -449,13 +450,13 @@ class NetflixSession:\nvideo_lists = response_data['lists']\nfor video_list_id in video_lists.keys():\nvideo_list = video_lists[video_list_id]\n+ if video_list.get('context', False) != False:\nif video_list['context'] == 'genre':\nvideo_list_ids['genres'].update(self.parse_video_list_ids_entry(id=video_list_id, entry=video_list))\nelif video_list['context'] == 'similars' or video_list['context'] == 'becauseYouAdded':\nvideo_list_ids['recommendations'].update(self.parse_video_list_ids_entry(id=video_list_id, entry=video_list))\nelse:\nvideo_list_ids['user'].update(self.parse_video_list_ids_entry(id=video_list_id, entry=video_list))\n-\nreturn video_list_ids\ndef parse_video_list_ids_entry (self, id, entry):\n@@ -1330,6 +1331,48 @@ class NetflixSession:\nresponse = self._path_request(paths=paths)\nreturn self._process_response(response=response, component='Search results')\n+ def get_lolomo_for_kids (self):\n+ \"\"\"Fetches the lolomo ID for Kids profiles\n+\n+ Returns\n+ -------\n+ :obj:`str`\n+ Kids Lolomo ID\n+ \"\"\"\n+ response = self._session_get(component='kids')\n+ for cookie in response.cookies:\n+ if cookie.name.find('lhpuuidh-browse-' + self.user_data['guid']) != -1 and cookie.name.rfind('-T') == -1:\n+ start = unquote(cookie.value).rfind(':')\n+ return unquote(cookie.value)[start+1:]\n+ return None\n+\n+ def fetch_lists_for_kids (self, lolomo, list_from=0, list_to=50):\n+ \"\"\"Fetches the JSON which contains the contents of a the video list for kids users\n+\n+ Parameters\n+ ----------\n+ lolomo : :obj:`str`\n+ Lolomo ID for the Kids profile\n+\n+ list_from : :obj:`int`\n+ Start entry for pagination\n+\n+ list_to : :obj:`int`\n+ Last entry for pagination\n+\n+ Returns\n+ -------\n+ :obj:`dict` of :obj:`dict` of :obj:`str`\n+ Raw Netflix API call response or api call error\n+ \"\"\"\n+ paths = [\n+ ['lists', lolomo, {'from': list_from, 'to': list_to}, ['displayName', 'context', 'genreId', 'id', 'index', 'length']]\n+ ]\n+\n+ response = self._path_request(paths=paths)\n+ res = self._process_response(response=response, component='Kids lists')\n+ return self.parse_video_list_ids(response_data=res['value'])\n+\ndef fetch_video_list (self, list_id, list_from=0, list_to=20):\n\"\"\"Fetches the JSON which contains the contents of a given video list\n@@ -2178,9 +2221,9 @@ class NetflixSession:\n'profileName',\n'isActive',\n'isFirstUse',\n- 'isAccountOwner'\n+ 'isAccountOwner',\n+ 'isKids'\n]\n-\n# values are accessible via dict (sloppy parsing successfull)\nif type(netflix_page_data) == dict:\nfor profile_id in netflix_page_data.get('profiles'):\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(kids-profiles): Reenables Kids profiles after NEtflix API changes
105,979
16.03.2017 16:20:20
-3,600
ac8e4930d5a58324df62285b0c5c440833784ad4
feat(core): Add license, adapt to API changes, fix issues with KIDS profiles, fix issues with prefetching and network unavailability, fix issues with cached lists between profiles
[ { "change_type": "ADD", "old_path": null, "new_path": "LICENSE.txt", "diff": "+MIT License\n+\n+Copyright (c) 2017 Sebastian Golasch\n+\n+Permission is hereby granted, free of charge, to any person obtaining a copy\n+of this software and associated documentation files (the \"Software\"), to deal\n+in the Software without restriction, including without limitation the rights\n+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+copies of the Software, and to permit persons to whom the Software is\n+furnished to do so, subject to the following conditions:\n+\n+The above copyright notice and this permission notice shall be included in all\n+copies or substantial portions of the Software.\n+\n+THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n+SOFTWARE.\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.11.2\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.3\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n</assets>\n<platform>all</platform>\n<license>MIT</license>\n- <forum>http://www.kodinerds.net/</forum>\n+ <forum>http://www.kodinerds.net/index.php/Thread/55607-Inputstream-Agile-Betatest-Netflix/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n+ <news>v0.11.3 (2017-3-16)\n+ - Added spanish and slowenian language files\n+ - Added license file\n+ - Adapted to latest API changes from Netflix\n+ - Fixed issues with entering KIDS profiles\n+ - Fixed prefetching started before network was available\n+ - Fixed issues with cached lists when switching profiles</news>\n</extension>\n</addon>\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.2\n+# Addon version: 0.11.3\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.2\n+# Addon version: 0.11.3\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Slovak/strings.po", "new_path": "resources/language/Slovak/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.2\n+# Addon version: 0.11.3\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Spanish/strings.po", "new_path": "resources/language/Spanish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.2\n+# Addon version: 0.11.3\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "new_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "diff": "# Module: NetflixHttpSubRessourceHandler\n# Created on: 07.03.2017\n+from urllib2 import urlopen, URLError\n+\nclass NetflixHttpSubRessourceHandler:\n\"\"\" Represents the callable internal server routes & translates/executes them to requests for Netflix\"\"\"\n@@ -22,19 +24,29 @@ class NetflixHttpSubRessourceHandler:\nself.kodi_helper = kodi_helper\nself.netflix_session = netflix_session\nself.credentials = self.kodi_helper.get_credentials()\n+ self.profiles = []\n+ self.prefetch_login()\nself.video_list_cache = {}\nself.lolomo = None\n- # check if we have stored credentials, if so, do the login before the user requests it\n- # if that is done, we cache the profiles\n+ def prefetch_login (self):\n+ \"\"\"Check if we have stored credentials.\n+ If so, do the login before the user requests it\n+ If that is done, we cache the profiles\n+ \"\"\"\n+ if self._network_availble():\nif self.credentials['email'] != '' and self.credentials['password'] != '':\nif self.netflix_session.is_logged_in(account=self.credentials):\nself.netflix_session.refresh_session_data(account=self.credentials)\n+ self.profiles = self.netflix_session.profiles\nelse:\nself.netflix_session.login(account=self.credentials)\nself.profiles = self.netflix_session.profiles\nelse:\nself.profiles = []\n+ else:\n+ sleep(1)\n+ self.prefetch_login()\ndef is_logged_in (self, params):\n\"\"\"Existing login proxy function\n@@ -366,3 +378,16 @@ class NetflixHttpSubRessourceHandler:\nif 'error' in raw_search_contents:\nreturn raw_search_contents\nreturn self.netflix_session.parse_video_list(response_data=raw_search_contents)\n+\n+ def _network_availble(self):\n+ \"\"\"Check if the network is available\n+ Returns\n+ -------\n+ bool\n+ Network can be accessed\n+ \"\"\"\n+ try:\n+ urlopen('http://216.58.192.142', timeout=1)\n+ return True\n+ except URLError as err:\n+ return False\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -150,12 +150,12 @@ class NetflixSession:\nList of all the serialized data pulled out of the pagws <script/> tags\n\"\"\"\nscripts = page_soup.find_all('script', attrs={'src': None});\n- self.log('Trying sloppy inline data parser')\n+ self.log(msg='Trying sloppy inline data parser')\ninline_data = self._sloppy_parse_inline_data(scripts=scripts)\nif self._verfify_auth_and_profiles_data(data=inline_data) != False:\n- self.log('Sloppy inline data parsing successfull')\n+ self.log(msg='Sloppy inline data parsing successfull')\nreturn inline_data\n- self.log('Sloppy inline parser failed, trying JS parser')\n+ self.log(msg='Sloppy inline parser failed, trying JS parser')\nreturn self._accurate_parse_inline_data(scripts=scripts)\ndef is_logged_in (self, account):\n@@ -769,7 +769,7 @@ class NetflixSession:\n'synopsis': video['synopsis'],\n'regular_synopsis': video['regularSynopsis'],\n'type': video['summary']['type'],\n- 'rating': video['userRating']['average'],\n+ 'rating': video['userRating'].get('average', 0) if video['userRating'].get('average', None) != None else video['userRating'].get('predicted', 0),\n'episode_count': season_info['episode_count'],\n'seasons_label': season_info['seasons_label'],\n'seasons_count': season_info['seasons_count'],\n@@ -1248,7 +1248,7 @@ class NetflixSession:\n'mpaa': str(episode['maturity']['rating']['board']) + ' ' + str(episode['maturity']['rating']['value']),\n'maturity': episode['maturity'],\n'playcount': (0, 1)[episode['watched']],\n- 'rating': episode['userRating']['average'],\n+ 'rating': episode['userRating'].get('average', 0) if episode['userRating'].get('average', None) != None else episode['userRating'].get('predicted', 0),\n'thumb': episode['info']['interestingMoments']['url'],\n'fanart': episode['interestingMoment']['_1280x720']['jpg']['url'],\n'poster': episode['boxarts']['_1280x720']['jpg']['url'],\n@@ -1935,7 +1935,7 @@ class NetflixSession:\nstart = time()\nresponse = self.session.post(url=url, data=data, params=params, headers=headers, verify=self.verify_ssl)\nend = time()\n- self.log('[POST] Request for \"' + url + '\" took ' + str(end - start) + ' seconds')\n+ self.log(msg='[POST] Request for \"' + url + '\" took ' + str(end - start) + ' seconds')\nreturn response\ndef _session_get (self, component, type='document', params={}):\n@@ -1960,8 +1960,12 @@ class NetflixSession:\nurl = self._get_document_url_for(component=component) if type == 'document' else self._get_api_url_for(component=component)\nstart = time()\nresponse = self.session.get(url=url, verify=self.verify_ssl, params=params)\n+ for cookie in response.cookies:\n+ if cookie.name.find('lhpuuidh-browse-' + self.user_data['guid']) != -1 and cookie.name.rfind('-T') == -1:\n+ start = unquote(cookie.value).rfind(':')\n+ return unquote(cookie.value)[start+1:]\nend = time()\n- self.log('[GET] Request for \"' + url + '\" took ' + str(end - start) + ' seconds')\n+ self.log(msg='[GET] Request for \"' + url + '\" took ' + str(end - start) + ' seconds')\nreturn response\ndef _sloppy_parse_user_and_api_data (self, key, contents):\n@@ -2333,5 +2337,5 @@ class NetflixSession:\nself.esn = self._parse_esn_data(netflix_page_data=netflix_page_data)\nself.api_data = self._parse_api_base_data(netflix_page_data=netflix_page_data)\nself.profiles = self._parse_profile_data(netflix_page_data=netflix_page_data)\n- self.log('Found ESN \"' + self.esn + '\"')\n+ self.log(msg='Found ESN \"' + self.esn + '\"')\nreturn netflix_page_data\n" }, { "change_type": "MODIFY", "old_path": "service.py", "new_path": "service.py", "diff": "import threading\nimport SocketServer\n-import xbmc\nimport socket\n+from xbmc import Monitor\nfrom xbmcaddon import Addon\nfrom resources.lib.KodiHelper import KodiHelper\nfrom resources.lib.MSLHttpRequestHandler import MSLHttpRequestHandler\n@@ -47,7 +47,7 @@ nd_server.server_activate()\nnd_server.timeout = 1\nif __name__ == '__main__':\n- monitor = xbmc.Monitor()\n+ monitor = Monitor()\n# start thread for MLS servie\nmsl_thread = threading.Thread(target=msl_server.serve_forever)\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
feat(core): Add license, adapt to API changes, fix issues with KIDS profiles, fix issues with prefetching and network unavailability, fix issues with cached lists between profiles
105,979
16.03.2017 16:36:29
-3,600
0ecc215ce1942ce4304b6d4514d190af7ae7e7d8
feat(NetflixHTTPSubResourceHandler): Fixed issue with missing sleep declaration in network check
[ { "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.11.3\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.4\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n<license>MIT</license>\n<forum>http://www.kodinerds.net/index.php/Thread/55607-Inputstream-Agile-Betatest-Netflix/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n- <news>v0.11.3 (2017-3-16)\n- - Added spanish and slowenian language files\n- - Added license file\n- - Adapted to latest API changes from Netflix\n- - Fixed issues with entering KIDS profiles\n- - Fixed prefetching started before network was available\n- - Fixed issues with cached lists when switching profiles</news>\n+ <news>v0.11.4 (2017-3-16)\n+ - Fixed issue with missing sleep declaration in network check</news>\n</extension>\n</addon>\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.3\n+# Addon version: 0.11.4\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.3\n+# Addon version: 0.11.4\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Slovak/strings.po", "new_path": "resources/language/Slovak/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.3\n+# Addon version: 0.11.4\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Spanish/strings.po", "new_path": "resources/language/Spanish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.3\n+# Addon version: 0.11.4\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "new_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "diff": "# Created on: 07.03.2017\nfrom urllib2 import urlopen, URLError\n+from time import sleep\nclass NetflixHttpSubRessourceHandler:\n\"\"\" Represents the callable internal server routes & translates/executes them to requests for Netflix\"\"\"\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
feat(NetflixHTTPSubResourceHandler): Fixed issue with missing sleep declaration in network check
105,979
16.03.2017 17:55:52
-3,600
a950dc6e550a9da3c1cf459378914d359bc277dc
fix(debug): Removes debugging code
[ { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -1960,10 +1960,6 @@ class NetflixSession:\nurl = self._get_document_url_for(component=component) if type == 'document' else self._get_api_url_for(component=component)\nstart = time()\nresponse = self.session.get(url=url, verify=self.verify_ssl, params=params)\n- for cookie in response.cookies:\n- if cookie.name.find('lhpuuidh-browse-' + self.user_data['guid']) != -1 and cookie.name.rfind('-T') == -1:\n- start = unquote(cookie.value).rfind(':')\n- return unquote(cookie.value)[start+1:]\nend = time()\nself.log(msg='[GET] Request for \"' + url + '\" took ' + str(end - start) + ' seconds')\nreturn response\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(debug): Removes debugging code
105,979
17.03.2017 10:10:52
-3,600
4992e07aa489c7b2da627ab57769c4b0b03c6e62
chore(performance): Speeds up display of main menu, genre and recommendation list
[ { "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.11.5\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.6\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n<license>MIT</license>\n<forum>http://www.kodinerds.net/index.php/Thread/55607-Inputstream-Agile-Betatest-Netflix/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n- <news>v0.11.5 (2017-3-16)\n- - Remove flawed debugging code</news>\n+ <news>v0.11.5 (2017-3-17)\n+ - Speed up display of main menu, genre and recommendation list</news>\n</extension>\n</addon>\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.5\n+# Addon version: 0.11.6\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.5\n+# Addon version: 0.11.6\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Slovak/strings.po", "new_path": "resources/language/Slovak/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.5\n+# Addon version: 0.11.6\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Spanish/strings.po", "new_path": "resources/language/Spanish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.5\n+# Addon version: 0.11.6\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "new_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "diff": "@@ -154,28 +154,11 @@ class NetflixHttpSubRessourceHandler:\nself.kodi_helper.log('Serving cached list for user: ' + self.netflix_session.user_data['guid'])\nreturn cached_list\nvideo_list_ids_raw = self.netflix_session.fetch_video_list_ids()\n+\nif 'error' in video_list_ids_raw:\nreturn video_list_ids_raw\nreturn self.netflix_session.parse_video_list_ids(response_data=video_list_ids_raw)\n- def fetch_video_list_ids_for_kids (self, params):\n- \"\"\"Video list ids proxy function (thanks to Netflix that we need to use a different API for Kids profiles)\n-\n- Parameters\n- ----------\n- params : :obj:`dict` of :obj:`str`\n- Request params\n-\n- Returns\n- -------\n- :obj:`list`\n- Transformed response of the remote call\n- \"\"\"\n- if self.lolomo == None:\n- self.lolomo = self.netflix_session.get_lolomo_for_kids()\n- response = self.netflix_session.fetch_lists_for_kids(lolomo=self.lolomo)\n- return response\n-\ndef fetch_video_list (self, params):\n\"\"\"Video list proxy function\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -446,6 +446,11 @@ class NetflixSession:\nfor key in self.video_list_keys:\nvideo_list_ids[key] = {}\n+ # check if the list items are hidden behind a `value` sub key\n+ # this is the case when we fetch the lists via POST, not via a GET preflight request\n+ if 'value' in response_data.keys():\n+ response_data = response_data['value']\n+\n# subcatogorize the lists by their context\nvideo_lists = response_data['lists']\nfor video_list_id in video_lists.keys():\n@@ -1270,8 +1275,9 @@ class NetflixSession:\nresponse = self._session_get(component='browse')\nreturn BeautifulSoup(response.text, 'html.parser')\n- def fetch_video_list_ids (self, list_from=0, list_to=50):\n+ def fetch_video_list_ids_via_preflight (self, list_from=0, list_to=50):\n\"\"\"Fetches the JSON with detailed information based on the lists on the landing page (browse page) of Netflix\n+ via the preflight (GET) request\nParameters\n----------\n@@ -1298,14 +1304,11 @@ class NetflixSession:\nresponse = self._session_get(component='video_list_ids', params=payload, type='api')\nreturn self._process_response(response=response, component=self._get_api_url_for(component='video_list_ids'))\n- def fetch_search_results (self, search_str, list_from=0, list_to=10):\n- \"\"\"Fetches the JSON which contains the results for the given search query\n+ def fetch_video_list_ids (self, list_from=0, list_to=50):\n+ \"\"\"Fetches the JSON with detailed information based on the lists on the landing page (browse page) of Netflix\nParameters\n----------\n- search_str : :obj:`str`\n- String to query Netflix search for\n-\nlist_from : :obj:`int`\nStart entry for pagination\n@@ -1317,42 +1320,20 @@ class NetflixSession:\n:obj:`dict` of :obj:`dict` of :obj:`str`\nRaw Netflix API call response or api call error\n\"\"\"\n- # properly encode the search string\n- encoded_search_string = quote(search_str)\n-\npaths = [\n- ['search', encoded_search_string, 'titles', {'from': list_from, 'to': list_to}, ['summary', 'title']],\n- ['search', encoded_search_string, 'titles', {'from': list_from, 'to': list_to}, 'boxarts', '_342x192', 'jpg'],\n- ['search', encoded_search_string, 'titles', ['id', 'length', 'name', 'trackIds', 'requestId']],\n- ['search', encoded_search_string, 'suggestions', 0, 'relatedvideos', {'from': list_from, 'to': list_to}, ['summary', 'title']],\n- ['search', encoded_search_string, 'suggestions', 0, 'relatedvideos', {'from': list_from, 'to': list_to}, 'boxarts', '_342x192', 'jpg'],\n- ['search', encoded_search_string, 'suggestions', 0, 'relatedvideos', ['id', 'length', 'name', 'trackIds', 'requestId']]\n+ ['lolomo', {'from': list_from, 'to': list_to}, ['displayName', 'context', 'id', 'index', 'length']]\n]\n- response = self._path_request(paths=paths)\n- return self._process_response(response=response, component='Search results')\n-\n- def get_lolomo_for_kids (self):\n- \"\"\"Fetches the lolomo ID for Kids profiles\n- Returns\n- -------\n- :obj:`str`\n- Kids Lolomo ID\n- \"\"\"\n- response = self._session_get(component='kids')\n- for cookie in response.cookies:\n- if cookie.name.find('lhpuuidh-browse-' + self.user_data['guid']) != -1 and cookie.name.rfind('-T') == -1:\n- start = unquote(cookie.value).rfind(':')\n- return unquote(cookie.value)[start+1:]\n- return None\n+ response = self._path_request(paths=paths)\n+ return self._process_response(response=response, component='Video list ids')\n- def fetch_lists_for_kids (self, lolomo, list_from=0, list_to=50):\n- \"\"\"Fetches the JSON which contains the contents of a the video list for kids users\n+ def fetch_search_results (self, search_str, list_from=0, list_to=10):\n+ \"\"\"Fetches the JSON which contains the results for the given search query\nParameters\n----------\n- lolomo : :obj:`str`\n- Lolomo ID for the Kids profile\n+ search_str : :obj:`str`\n+ String to query Netflix search for\nlist_from : :obj:`int`\nStart entry for pagination\n@@ -1365,13 +1346,19 @@ class NetflixSession:\n:obj:`dict` of :obj:`dict` of :obj:`str`\nRaw Netflix API call response or api call error\n\"\"\"\n+ # properly encode the search string\n+ encoded_search_string = quote(search_str)\n+\npaths = [\n- ['lists', lolomo, {'from': list_from, 'to': list_to}, ['displayName', 'context', 'genreId', 'id', 'index', 'length']]\n+ ['search', encoded_search_string, 'titles', {'from': list_from, 'to': list_to}, ['summary', 'title']],\n+ ['search', encoded_search_string, 'titles', {'from': list_from, 'to': list_to}, 'boxarts', '_342x192', 'jpg'],\n+ ['search', encoded_search_string, 'titles', ['id', 'length', 'name', 'trackIds', 'requestId']],\n+ ['search', encoded_search_string, 'suggestions', 0, 'relatedvideos', {'from': list_from, 'to': list_to}, ['summary', 'title']],\n+ ['search', encoded_search_string, 'suggestions', 0, 'relatedvideos', {'from': list_from, 'to': list_to}, 'boxarts', '_342x192', 'jpg'],\n+ ['search', encoded_search_string, 'suggestions', 0, 'relatedvideos', ['id', 'length', 'name', 'trackIds', 'requestId']]\n]\n-\nresponse = self._path_request(paths=paths)\n- res = self._process_response(response=response, component='Kids lists')\n- return self.parse_video_list_ids(response_data=res['value'])\n+ return self._process_response(response=response, component='Search results')\ndef fetch_video_list (self, list_id, list_from=0, list_to=20):\n\"\"\"Fetches the JSON which contains the contents of a given video list\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(performance): Speeds up display of main menu, genre and recommendation list
105,979
18.03.2017 14:03:53
-3,600
f39c97e81f2353c24fb7401af97655855dbe0e16
fix(http-service): Call HTTP service on 127.0.0.1 instead of localhost to get rid of request delays on windows. Fixes
[ { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.7\n+# Addon version: 0.11.8\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.7\n+# Addon version: 0.11.8\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Slovak/strings.po", "new_path": "resources/language/Slovak/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.7\n+# Addon version: 0.11.8\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Spanish/strings.po", "new_path": "resources/language/Spanish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.7\n+# Addon version: 0.11.8\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -509,7 +509,7 @@ class Navigation:\nstr\nUrl + Port\n\"\"\"\n- return 'http://localhost:' + str(self.kodi_helper.addon.getSetting('netflix_service_port'))\n+ return 'http://127.0.0.1:' + str(self.kodi_helper.addon.getSetting('netflix_service_port'))\ndef call_netflix_service (self, params):\n\"\"\"Makes a GET request to the internal Netflix HTTP proxy and returns the result\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(http-service): Call HTTP service on 127.0.0.1 instead of localhost to get rid of request delays on windows. Fixes #21
105,979
18.03.2017 20:36:40
-3,600
3dea5f5254715c91af6320a8b656f7d6836c3665
fix(kodi-interface): Get rid of annoying 'has left several classes in memory that we couldn't clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE' log entry
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -31,23 +31,27 @@ class KodiHelper:\nbase_url : :obj:`str`\nPlugin base url\n\"\"\"\n+ addon = self.get_addon()\nself.plugin_handle = plugin_handle\nself.base_url = base_url\n- self.addon = Addon()\n- self.plugin = self.addon.getAddonInfo('name')\n- self.version = self.addon.getAddonInfo('version')\n- self.base_data_path = xbmc.translatePath(self.addon.getAddonInfo('profile'))\n+ self.plugin = addon.getAddonInfo('name')\n+ self.version = addon.getAddonInfo('version')\n+ self.base_data_path = xbmc.translatePath(addon.getAddonInfo('profile'))\nself.home_path = xbmc.translatePath('special://home')\n- self.plugin_path = self.addon.getAddonInfo('path')\n+ self.plugin_path = addon.getAddonInfo('path')\nself.cookie_path = self.base_data_path + 'COOKIE'\nself.data_path = self.base_data_path + 'DATA'\nself.config_path = join(self.base_data_path, 'config')\nself.msl_data_path = xbmc.translatePath('special://profile/addon_data/service.msl').decode('utf-8') + '/'\n- self.verb_log = self.addon.getSetting('logging') == 'true'\n- self.default_fanart = self.addon.getAddonInfo('fanart')\n+ self.verb_log = addon.getSetting('logging') == 'true'\n+ self.default_fanart = addon.getAddonInfo('fanart')\nself.library = None\nself.setup_memcache()\n+ def get_addon (self):\n+ \"\"\"Returns a fresh addon instance\"\"\"\n+ return Addon()\n+\ndef refresh (self):\n\"\"\"Refresh the current list\"\"\"\nreturn xbmc.executebuiltin('Container.Refresh')\n@@ -171,7 +175,7 @@ class KodiHelper:\nbool\nSetting could be set or not\n\"\"\"\n- return self.addon.setSetting(key, value)\n+ return self.get_addon().setSetting(key, value)\ndef get_credentials (self):\n\"\"\"Returns the users stored credentials\n@@ -182,8 +186,8 @@ class KodiHelper:\nThe users stored account data\n\"\"\"\nreturn {\n- 'email': self.addon.getSetting('email'),\n- 'password': self.addon.getSetting('password')\n+ 'email': self.get_addon().getSetting('email'),\n+ 'password': self.get_addon().getSetting('password')\n}\ndef get_dolby_setting(self):\n@@ -191,7 +195,7 @@ class KodiHelper:\nReturns if the dolby sound is enabled\n:return: True|False\n\"\"\"\n- return self.addon.getSetting('enable_dolby_sound') == 'true'\n+ return self.get_addon().getSetting('enable_dolby_sound') == 'true'\ndef get_custom_library_settings (self):\n\"\"\"Returns the settings in regards to the custom library folder(s)\n@@ -202,8 +206,8 @@ class KodiHelper:\nThe users library settings\n\"\"\"\nreturn {\n- 'enablelibraryfolder': self.addon.getSetting('enablelibraryfolder'),\n- 'customlibraryfolder': self.addon.getSetting('customlibraryfolder')\n+ 'enablelibraryfolder': self.get_addon().getSetting('enablelibraryfolder'),\n+ 'customlibraryfolder': self.get_addon().getSetting('customlibraryfolder')\n}\ndef get_ssl_verification_setting (self):\n@@ -214,7 +218,7 @@ class KodiHelper:\nbool\nVerify or not\n\"\"\"\n- return self.addon.getSetting('ssl_verification') == 'true'\n+ return self.get_addon().getSetting('ssl_verification') == 'true'\ndef set_main_menu_selection (self, type):\n\"\"\"Persist the chosen main menu entry in memory\n@@ -640,6 +644,7 @@ class KodiHelper:\nbool\nList could be build\n\"\"\"\n+ addon = self.get_addon()\ninputstream_addon = self.get_inputstream_addon()\nif inputstream_addon == None:\nself.show_missing_inputstream_addon_notification()\n@@ -650,12 +655,12 @@ class KodiHelper:\nself.track_event('playVideo')\n# check esn in settings\n- settings_esn = str(self.addon.getSetting('esn'))\n+ settings_esn = str(addon.getSetting('esn'))\nif len(settings_esn) == 0:\n- self.addon.setSetting('esn', str(esn))\n+ addon.setSetting('esn', str(esn))\n# inputstream addon properties\n- msl_service_url = 'http://localhost:' + str(self.addon.getSetting('msl_service_port'))\n+ msl_service_url = 'http://localhost:' + str(addon.getSetting('msl_service_port'))\nplay_item = xbmcgui.ListItem(path=msl_service_url + '/manifest?id=' + video_id)\nplay_item.setProperty(inputstream_addon + '.license_type', 'com.widevine.alpha')\nplay_item.setProperty(inputstream_addon + '.manifest_type', 'mpd')\n@@ -868,7 +873,7 @@ class KodiHelper:\n:obj:`str`\nRequested string or empty string\n\"\"\"\n- src = xbmc if string_id < 30000 else self.addon\n+ src = xbmc if string_id < 30000 else self.get_addon()\nlocString = src.getLocalizedString(string_id)\nif isinstance(locString, unicode):\nlocString = locString.encode('utf-8')\n@@ -916,14 +921,15 @@ class KodiHelper:\n:param event: the string idetifier of the event\n:return: None\n\"\"\"\n+ addon = self.get_addon()\n# Check if tracking is enabled\n- enable_tracking = (self.addon.getSetting('enable_tracking') == 'true')\n+ enable_tracking = (addon.getSetting('enable_tracking') == 'true')\nif enable_tracking:\n#Get or Create Tracking id\n- tracking_id = self.addon.getSetting('tracking_id')\n+ tracking_id = addon.getSetting('tracking_id')\nif tracking_id is '':\ntracking_id = str(uuid4())\n- self.addon.setSetting('tracking_id', tracking_id)\n+ addon.setSetting('tracking_id', tracking_id)\n# Send the tracking event\ntracker = Tracker.create('UA-46081640-5', client_id=tracking_id)\ntracker.send('event', event)\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -509,7 +509,7 @@ class Navigation:\nstr\nUrl + Port\n\"\"\"\n- return 'http://127.0.0.1:' + str(self.kodi_helper.addon.getSetting('netflix_service_port'))\n+ return 'http://127.0.0.1:' + str(self.kodi_helper.get_addon().getSetting('netflix_service_port'))\ndef call_netflix_service (self, params):\n\"\"\"Makes a GET request to the internal Netflix HTTP proxy and returns the result\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(kodi-interface): Get rid of annoying 'has left several classes in memory that we couldn't clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE' log entry
105,979
21.03.2017 09:00:39
-3,600
670180adc840475c8cd87fcf860b260ed582666e
chore(readme): Add disclaimer
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "## Netflix Plugin for Kodi 18\n+###Disclaimer\n+-------------\n+This plugin is not officially commisioned/supported by Netflix.\n+The trademark \"Netflix\" is registered by \"Netflix, Inc.\"\n+\n###Prerequisites\n----------------\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(readme): Add disclaimer
106,029
29.03.2017 22:46:22
-7,200
f583b2d28ebdfa61283f68995b729e1f17aa5148
feat(msl): Adds subtiles to dash manifest
[ { "change_type": "MODIFY", "old_path": "resources/lib/MSL.py", "new_path": "resources/lib/MSL.py", "diff": "@@ -152,9 +152,13 @@ class MSL:\n# Audio\n'heaac-2-dash',\n+\n+ #subtiltes\n'dfxp-ls-sdh',\n- 'simplesdh',\n- 'nflx-cmisc',\n+ #'simplesdh',\n+ #'nflx-cmisc',\n+\n+ #unkown\n'BIF240',\n'BIF320'\n],\n@@ -349,6 +353,26 @@ class MSL:\nsegment_base = ET.SubElement(rep, 'SegmentBase', indexRange=\"0-\"+str(init_length), indexRangeExact=\"true\")\nET.SubElement(segment_base, 'Initialization', range='0-'+str(init_length))\n+ # Multiple Adaption Set for subtiles\n+ for text_track in manifest['textTracks']:\n+ print text_track\n+ if 'downloadables' not in text_track or text_track['downloadables'] is None:\n+ continue\n+ subtiles_adaption_set = ET.SubElement(period, 'AdaptationSet',\n+ lang=text_track['bcp47'],\n+ contentType='text',\n+ mimeType='text/vtt')\n+ for downloadable in text_track['downloadables']:\n+ rep = ET.SubElement(subtiles_adaption_set, 'Representation',\n+ bandwidth='0',\n+ nflxProfile=downloadable['contentProfile']\n+ )\n+ print downloadable['urls']\n+ ET.SubElement(rep, 'BaseURL').text = self.__get_base_url(downloadable['urls'])\n+\n+\n+\n+\nxml = ET.tostring(root, encoding='utf-8', method='xml')\nxml = xml.replace('\\n', '').replace('\\r', '')\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
feat(msl): Adds subtiles to dash manifest
106,029
29.03.2017 22:54:16
-7,200
27a18564ddbf17c7897981d732f5570d5eefa19e
fix(msl): Changes mimeType of subtitles to ttml
[ { "change_type": "MODIFY", "old_path": "resources/lib/MSL.py", "new_path": "resources/lib/MSL.py", "diff": "@@ -361,7 +361,7 @@ class MSL:\nsubtiles_adaption_set = ET.SubElement(period, 'AdaptationSet',\nlang=text_track['bcp47'],\ncontentType='text',\n- mimeType='text/vtt')\n+ mimeType='text/ttml')\nfor downloadable in text_track['downloadables']:\nrep = ET.SubElement(subtiles_adaption_set, 'Representation',\nbandwidth='0',\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(msl): Changes mimeType of subtitles to ttml
106,029
07.04.2017 14:07:13
-7,200
23d980f2ecee8f5aa875e38d3fd64a547bc71d08
fix(msl): If mastertoken is expired it gets renewed
[ { "change_type": "MODIFY", "old_path": "resources/lib/MSL.py", "new_path": "resources/lib/MSL.py", "diff": "@@ -10,6 +10,8 @@ import os\nimport pprint\nimport random\nfrom StringIO import StringIO\n+\n+from datetime import datetime\nimport requests\nimport zlib\n@@ -583,6 +585,18 @@ class MSL:\ndef __load_msl_data(self):\nmsl_data = json.JSONDecoder().decode(self.load_file(self.kodi_helper.msl_data_path, 'msl_data.json'))\n+ #Check expire date of the token\n+ master_token = json.JSONDecoder().decode(base64.standard_b64decode(msl_data['tokens']['mastertoken']['tokendata']))\n+ valid_until = datetime.utcfromtimestamp(int(master_token['expiration']))\n+ present = datetime.now()\n+ difference = valid_until - present\n+ difference = difference.total_seconds() / 60 / 60\n+ # If token expires in less then 10 hours or is expires renew it\n+ if difference < 10:\n+ self.__load_rsa_keys()\n+ self.__perform_key_handshake()\n+ return\n+\nself.__set_master_token(msl_data['tokens']['mastertoken'])\nself.encryption_key = base64.standard_b64decode(msl_data['encryption_key'])\nself.sign_key = base64.standard_b64decode(msl_data['sign_key'])\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(msl): If mastertoken is expired it gets renewed
106,029
09.04.2017 20:36:10
-7,200
0345351fac6664b768036a87c3e504a9729b5816
fix(msl): Correct transformation of subtitle entries in dash manifest
[ { "change_type": "MODIFY", "old_path": "resources/lib/MSL.py", "new_path": "resources/lib/MSL.py", "diff": "@@ -355,27 +355,22 @@ class MSL:\nsegment_base = ET.SubElement(rep, 'SegmentBase', indexRange=\"0-\"+str(init_length), indexRangeExact=\"true\")\nET.SubElement(segment_base, 'Initialization', range='0-'+str(init_length))\n- # Multiple Adaption Set for subtiles\n+ # Multiple Adaption Sets for subtiles\nfor text_track in manifest['textTracks']:\n- print text_track\nif 'downloadables' not in text_track or text_track['downloadables'] is None:\ncontinue\nsubtiles_adaption_set = ET.SubElement(period, 'AdaptationSet',\nlang=text_track['bcp47'],\n+ codecs='stpp',\ncontentType='text',\n- mimeType='text/ttml')\n+ mimeType='application/ttml+xml')\nfor downloadable in text_track['downloadables']:\nrep = ET.SubElement(subtiles_adaption_set, 'Representation',\n- bandwidth='0',\nnflxProfile=downloadable['contentProfile']\n)\n- print downloadable['urls']\nET.SubElement(rep, 'BaseURL').text = self.__get_base_url(downloadable['urls'])\n-\n-\n-\nxml = ET.tostring(root, encoding='utf-8', method='xml')\nxml = xml.replace('\\n', '').replace('\\r', '')\nreturn xml\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(msl): Correct transformation of subtitle entries in dash manifest
105,979
10.04.2017 17:56:50
-7,200
f90037610f9ddd2ebf8b954ead528bd8a191387f
chore(i18n): Fixes transalations for swedish & portuguese
[ { "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.11.10\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.11\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n<license>MIT</license>\n<forum>http://www.kodinerds.net/index.php/Thread/55607-Inputstream-Agile-Betatest-Netflix/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n- <news>v0.11.8 (2017-3-17)\n+ <news>v0.11.11 (2017-4-10)\n+ - Portugese translations\n+ - Swedish translations\n+\n+ v0.11.10 (2017-4-10)\n+ - Adds subtitle support\n+ - Polish translations\n+\n+ v0.11.9 (2017-4-5)\n+ - Fix issues with persisted msl manifests\n+\n+ v0.11.8 (2017-3-17)\n- Fix 1 sec delay per request on windows (see https://github.com/asciidisco/plugin.video.netflix/issues/21 for details)\nv0.11.7 (2017-3-17)\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.10\n+# Addon version: 0.11.11\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.10\n+# Addon version: 0.11.11\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Polish/strings.po", "new_path": "resources/language/Polish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.10\n+# Addon version: 0.11.11\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "RENAME", "old_path": "resources/language/Portuguese", "new_path": "resources/language/Portugese/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.10\n+# Addon version: 0.11.11\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n@@ -14,7 +14,7 @@ msgstr \"\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n-\"Language: pt_BR\\n\"\n+\"Language: pt\\n\"\n\"Plural-Forms: nplurals=2; plural=(n != 1)\\n\"\nmsgctxt \"Addon Summary\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Slovak/strings.po", "new_path": "resources/language/Slovak/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.10\n+# Addon version: 0.11.11\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Spanish/strings.po", "new_path": "resources/language/Spanish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.10\n+# Addon version: 0.11.11\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(i18n): Fixes transalations for swedish & portuguese
105,979
29.06.2017 14:28:05
-7,200
6f5adf6901bd63668d8b069d9064b72c26fb1b6c
fix(esn): Fixes inline paramter parsing & dynamic ESn loading
[ { "change_type": "MODIFY", "old_path": "resources/language/Dutch/strings.po", "new_path": "resources/language/Dutch/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.11\n+# Addon version: 0.11.12\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.11\n+# Addon version: 0.11.12\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.11\n+# Addon version: 0.11.12\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Polish/strings.po", "new_path": "resources/language/Polish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.11\n+# Addon version: 0.11.12\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Portugese/strings.po", "new_path": "resources/language/Portugese/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.11\n+# Addon version: 0.11.12\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Slovak/strings.po", "new_path": "resources/language/Slovak/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.11\n+# Addon version: 0.11.12\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Spanish/strings.po", "new_path": "resources/language/Spanish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.11\n+# Addon version: 0.11.12\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Swedish/strings.po", "new_path": "resources/language/Swedish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.11\n+# Addon version: 0.11.12\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -7,7 +7,9 @@ import xbmcplugin\nimport xbmcgui\nimport xbmc\nimport json\n-from os.path import join\n+from MSL import MSL\n+from os import remove\n+from os.path import join, isfile\nfrom urllib import urlencode\nfrom xbmcaddon import Addon\nfrom uuid import uuid4\n@@ -190,6 +192,31 @@ class KodiHelper:\n'password': self.get_addon().getSetting('password')\n}\n+ def get_esn(self):\n+ \"\"\"\n+ Returns the esn from settings\n+ \"\"\"\n+ return self.get_addon().getSetting('esn')\n+\n+ def set_esn(self, esn):\n+ \"\"\"\n+ Returns the esn from settings\n+ \"\"\"\n+ stored_esn = self.get_esn()\n+ if not stored_esn:\n+ self.set_setting('esn', esn)\n+ self.delete_manifest_data()\n+ return esn\n+ return stored_esn\n+\n+ def delete_manifest_data(self):\n+ if isfile(self.msl_data_path + 'msl_data.json'):\n+ remove(self.msl_data_path + 'msl_data.json')\n+ if isfile(self.msl_data_path + 'manifest.json'):\n+ remove(self.msl_data_path + 'manifest.json')\n+ msl = MSL(kodi_helper=self)\n+ msl.save_msl_data()\n+\ndef get_dolby_setting(self):\n\"\"\"\nReturns if the dolby sound is enabled\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/MSL.py", "new_path": "resources/lib/MSL.py", "diff": "@@ -42,7 +42,7 @@ class MSL:\nlast_drm_context = ''\nlast_playback_context = ''\n#esn = \"NFCDCH-LX-CQE0NU6PA5714R25VPLXVU2A193T36\"\n- esn = \"WWW-BROWSE-D7GW1G4NPXGR1F0X1H3EQGY3V1F5WE\"\n+ #esn = \"WWW-BROWSE-D7GW1G4NPXGR1F0X1H3EQGY3V1F5WE\"\n#esn = \"NFCDIE-02-DCH84Q2EK3N6VFVQJ0NLRQ27498N0F\"\ncurrent_message_id = 0\nsession = requests.session()\n@@ -406,6 +406,7 @@ class MSL:\n}\ndef __generate_msl_request_data(self, data):\n+ self.__load_msl_data()\nheader_encryption_envelope = self.__encrypt(self.__generate_msl_header())\nheader = {\n'headerdata': base64.standard_b64encode(header_encryption_envelope),\n@@ -453,9 +454,10 @@ class MSL:\n:return: The base64 encoded JSON String of the header\n\"\"\"\nself.current_message_id = self.rndm.randint(0, pow(2, 52))\n+ esn = self.kodi_helper.get_esn()\nheader_data = {\n- 'sender': self.esn,\n+ 'sender': esn,\n'handshake': is_handshake,\n'nonreplayable': False,\n'capabilities': {\n@@ -507,10 +509,11 @@ class MSL:\n:param plaintext:\n:return: Serialized JSON String of the encryption Envelope\n\"\"\"\n+ esn = self.kodi_helper.get_esn()\niv = get_random_bytes(16)\nencryption_envelope = {\n'ciphertext': '',\n- 'keyid': self.esn + '_' + str(self.sequence_number),\n+ 'keyid': esn + '_' + str(self.sequence_number),\n'sha256': 'AA==',\n'iv': base64.standard_b64encode(iv)\n}\n@@ -535,11 +538,12 @@ class MSL:\ndef __perform_key_handshake(self):\nheader = self.__generate_msl_header(is_key_request=True, is_handshake=True, compressionalgo=\"\", encrypt=False)\n+ esn = self.kodi_helper.get_esn()\nrequest = {\n'entityauthdata': {\n'scheme': 'NONE',\n'authdata': {\n- 'identity': self.esn\n+ 'identity': esn\n}\n},\n'headerdata': base64.standard_b64encode(header),\n@@ -596,6 +600,10 @@ class MSL:\nself.encryption_key = base64.standard_b64decode(msl_data['encryption_key'])\nself.sign_key = base64.standard_b64decode(msl_data['sign_key'])\n+\n+ def save_msl_data(self):\n+ self.__save_msl_data()\n+\ndef __save_msl_data(self):\n\"\"\"\nSaves the keys and tokens in json file\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "new_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "diff": "@@ -40,6 +40,7 @@ class NetflixHttpSubRessourceHandler:\nself.profiles = self.netflix_session.profiles\nelse:\nself.profiles = []\n+ self.kodi_helper.set_esn(self.netflix_session.esn)\ndef is_logged_in (self, params):\n\"\"\"Existing login proxy function\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -1884,11 +1884,10 @@ class NetflixSession:\nUser Agent for platform\n\"\"\"\nimport platform\n- if platform == 'linux' or platform == 'linux2':\n- return 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'\n- elif platform == 'darwin':\n+ self.log(msg='Building User Agent for platform:' + str(platform.system()))\n+ if platform.system() == 'Darwin':\nreturn 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'\n- elif platform == 'win32':\n+ elif platform.system() == 'Windows':\nreturn 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'\nelse:\nreturn 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'\n@@ -2207,7 +2206,6 @@ class NetflixSession:\nimportant_fields = [\n'profileName',\n'isActive',\n- 'isFirstUse',\n'isAccountOwner',\n'isKids'\n]\n@@ -2220,7 +2218,7 @@ class NetflixSession:\nprofile.update({important_field: netflix_page_data['profiles'][profile_id]['summary'][important_field]})\navatar_base = netflix_page_data['nf'].get(netflix_page_data['profiles'][profile_id]['summary']['avatarName'], False);\navatar = 'https://secure.netflix.com/ffe/profiles/avatars_v2/320x320/PICON_029.png' if avatar_base == False else avatar_base['images']['byWidth']['320']['value']\n- profile.update({'avatar': avatar})\n+ profile.update({'avatar': avatar, 'isFirstUse': False})\nprofiles.update({profile_id: profile})\nreturn profiles\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(esn): Fixes inline paramter parsing & dynamic ESn loading
105,979
29.06.2017 17:04:45
-7,200
e26743797e47b57c47e61f0fda2c25a9adc344fe
fix(esn): Fixes ESN loading for ARM
[ { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -1884,12 +1884,13 @@ class NetflixSession:\nUser Agent for platform\n\"\"\"\nimport platform\n- self.log(msg='Building User Agent for platform:' + str(platform.system()))\n+ self.log(msg='Building User Agent for platform: ' + str(platform.system()) + ' - ' + str(platform.machine()))\nif platform.system() == 'Darwin':\nreturn 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'\n- elif platform.system() == 'Windows':\n+ if platform.system() == 'Windows':\nreturn 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'\n- else:\n+ if platform.machine().startswith('arm'):\n+ return 'Mozilla/5.0 (X11; CrOS armv7l 7647.78.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36'\nreturn 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'\ndef _session_post (self, component, type='document', data={}, headers={}, params={}):\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(esn): Fixes ESN loading for ARM
105,979
29.06.2017 19:12:19
-7,200
e9b625adff4b36a0ed4ee47eb32d27d06ec85c06
fix(esn): Fixes ESN/Handshake race condition when user is not valid on Kodi startup
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -196,6 +196,8 @@ class KodiHelper:\n\"\"\"\nReturns the esn from settings\n\"\"\"\n+ self.log(msg='Is FILE: ' + str(isfile(self.msl_data_path + 'msl_data.json')))\n+ self.log(msg=self.get_addon().getSetting('esn'))\nreturn self.get_addon().getSetting('esn')\ndef set_esn(self, esn):\n@@ -203,7 +205,7 @@ class KodiHelper:\nReturns the esn from settings\n\"\"\"\nstored_esn = self.get_esn()\n- if not stored_esn:\n+ if not stored_esn and esn:\nself.set_setting('esn', esn)\nself.delete_manifest_data()\nreturn esn\n@@ -215,6 +217,7 @@ class KodiHelper:\nif isfile(self.msl_data_path + 'manifest.json'):\nremove(self.msl_data_path + 'manifest.json')\nmsl = MSL(kodi_helper=self)\n+ msl.perform_key_handshake()\nmsl.save_msl_data()\ndef get_dolby_setting(self):\n@@ -671,6 +674,7 @@ class KodiHelper:\nbool\nList could be build\n\"\"\"\n+ self.set_esn(esn)\naddon = self.get_addon()\ninputstream_addon = self.get_inputstream_addon()\nif inputstream_addon == None:\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/MSL.py", "new_path": "resources/lib/MSL.py", "diff": "@@ -71,12 +71,17 @@ class MSL:\nelif self.file_exists(self.kodi_helper.msl_data_path, 'rsa_key.bin'):\nself.kodi_helper.log(msg='RSA Keys do already exist load old ones')\nself.__load_rsa_keys()\n+ if self.kodi_helper.get_esn():\nself.__perform_key_handshake()\nelse:\nself.kodi_helper.log(msg='Create new RSA Keys')\n# Create new Key Pair and save\nself.rsa_key = RSA.generate(2048)\nself.__save_rsa_keys()\n+ if self.kodi_helper.get_esn():\n+ self.__perform_key_handshake()\n+\n+ def perform_key_handshake(self):\nself.__perform_key_handshake()\ndef load_manifest(self, viewable_id):\n@@ -510,6 +515,7 @@ class MSL:\n:return: Serialized JSON String of the encryption Envelope\n\"\"\"\nesn = self.kodi_helper.get_esn()\n+\niv = get_random_bytes(16)\nencryption_envelope = {\n'ciphertext': '',\n@@ -539,6 +545,7 @@ class MSL:\ndef __perform_key_handshake(self):\nheader = self.__generate_msl_header(is_key_request=True, is_handshake=True, compressionalgo=\"\", encrypt=False)\nesn = self.kodi_helper.get_esn()\n+\nrequest = {\n'entityauthdata': {\n'scheme': 'NONE',\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(esn): Fixes ESN/Handshake race condition when user is not valid on Kodi startup
105,979
02.07.2017 21:24:26
-7,200
0b40c0a42d38965219d8d4c63fe40053b037841f
fix(esn): Fixes unicode problems
[ { "change_type": "MODIFY", "old_path": "addon.xml", "new_path": "addon.xml", "diff": "<license>MIT</license>\n<forum>http://www.kodinerds.net/index.php/Thread/55607-Inputstream-Agile-Betatest-Netflix/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n- <news>v0.11.12 (2017-6-29)\n+ <news>v0.11.12 (2017-07-02)\n- Fix missing isFirstUse inline setting\n- Fix dynamic ESN loading for widevine\n+ - Fix unicode decoding problems\nv0.11.11 (2017-4-10)\n- Portugese translations\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -775,7 +775,9 @@ class KodiHelper:\nif 'mpaa' in entry_keys:\ninfos.update({'mpaa': entry['mpaa']})\nelse:\n- infos.update({'mpaa': str(entry['maturity']['board']) + '-' + str(entry['maturity']['value'])})\n+ if entry.get('maturity', None) is not None:\n+ if entry['maturity']['board'] is not None and entry['maturity']['value'] is not None:\n+ infos.update({'mpaa': str(entry['maturity']['board'].encode('utf-8')) + '-' + str(entry['maturity']['value'].encode('utf-8'))})\nif 'rating' in entry_keys:\ninfos.update({'rating': int(entry['rating']) * 2})\nif 'synopsis' in entry_keys:\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -1250,7 +1250,7 @@ class NetflixSession:\n'title': episode['info']['title'],\n'year': episode['info']['releaseYear'],\n'genres': self.parse_genres_for_video(video=episode, genres=genres),\n- 'mpaa': str(episode['maturity']['rating']['board']) + ' ' + str(episode['maturity']['rating']['value']),\n+ 'mpaa': str(episode['maturity']['rating']['board']).encode('utf-8') + ' ' + str(episode['maturity']['rating']['value']).encode('utf-8'),\n'maturity': episode['maturity'],\n'playcount': (0, 1)[episode['watched']],\n'rating': episode['userRating'].get('average', 0) if episode['userRating'].get('average', None) != None else episode['userRating'].get('predicted', 0),\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(esn): Fixes unicode problems
105,979
02.07.2017 21:46:30
-7,200
303bb46c923aaa8c71dddcb53f38c2acf39e3504
chore(debug): Adds HTML debug output
[ { "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.11.12\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.13\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n<license>MIT</license>\n<forum>http://www.kodinerds.net/index.php/Thread/55607-Inputstream-Agile-Betatest-Netflix/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n- <news>v0.11.12 (2017-07-02)\n+ <news>v0.11.13 (2017-07-02)\n+ - Update number of requested list items (see https://github.com/asciidisco/plugin.video.netflix/issues/42 for details)\n+\n+ v0.11.12 (2017-07-02)\n- Fix missing isFirstUse inline setting\n- Fix dynamic ESN loading for widevine\n- Fix unicode decoding problems\nv0.11.9 (2017-4-5)\n- Fix issues with persisted msl manifests\n-\n- v0.11.8 (2017-3-17)\n- - Fix 1 sec delay per request on windows (see https://github.com/asciidisco/plugin.video.netflix/issues/21 for details)</news>\n+ </news>\n</extension>\n</addon>\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -149,7 +149,9 @@ class NetflixSession:\n:obj:`list` of :obj:`dict`\nList of all the serialized data pulled out of the pagws <script/> tags\n\"\"\"\n- scripts = page_soup.find_all('script', attrs={'src': None});\n+ scripts = page_soup.find_all('script', attrs={'src': None})\n+ self.log(msg='Debug output for HTML contents:')\n+ self.log(msg=page_soup)\nself.log(msg='Trying sloppy inline data parser')\ninline_data = self._sloppy_parse_inline_data(scripts=scripts)\nif self._verfify_auth_and_profiles_data(data=inline_data) != False:\n@@ -1360,7 +1362,7 @@ class NetflixSession:\nresponse = self._path_request(paths=paths)\nreturn self._process_response(response=response, component='Search results')\n- def fetch_video_list (self, list_id, list_from=0, list_to=20):\n+ def fetch_video_list (self, list_id, list_from=0, list_to=26):\n\"\"\"Fetches the JSON which contains the contents of a given video list\nParameters\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(debug): Adds HTML debug output
105,979
02.07.2017 23:47:33
-7,200
8416be9e6d04a977eeb70522c2400fa2143f3da9
fix(netflix.api): Fixes further unicode decoding problems
[ { "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.11.13\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.14\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n<license>MIT</license>\n<forum>http://www.kodinerds.net/index.php/Thread/55607-Inputstream-Agile-Betatest-Netflix/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n- <news>v0.11.13 (2017-07-02)\n+ <news>v0.11.14 (2017-07-02)\n+ - Fix issue with Unicode escaping\n+\n+ v0.11.13 (2017-07-02)\n- Update number of requested list items (see https://github.com/asciidisco/plugin.video.netflix/issues/42 for details)\nv0.11.12 (2017-07-02)\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Dutch/strings.po", "new_path": "resources/language/Dutch/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.12\n+# Addon version: 0.11.14\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.12\n+# Addon version: 0.11.14\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.12\n+# Addon version: 0.11.14\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Polish/strings.po", "new_path": "resources/language/Polish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.12\n+# Addon version: 0.11.14\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Portugese/strings.po", "new_path": "resources/language/Portugese/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.12\n+# Addon version: 0.11.14\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Slovak/strings.po", "new_path": "resources/language/Slovak/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.12\n+# Addon version: 0.11.14\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Spanish/strings.po", "new_path": "resources/language/Spanish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.12\n+# Addon version: 0.11.14\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Swedish/strings.po", "new_path": "resources/language/Swedish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.12\n+# Addon version: 0.11.14\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -150,8 +150,6 @@ class NetflixSession:\nList of all the serialized data pulled out of the pagws <script/> tags\n\"\"\"\nscripts = page_soup.find_all('script', attrs={'src': None})\n- self.log(msg='Debug output for HTML contents:')\n- self.log(msg=page_soup)\nself.log(msg='Trying sloppy inline data parser')\ninline_data = self._sloppy_parse_inline_data(scripts=scripts)\nif self._verfify_auth_and_profiles_data(data=inline_data) != False:\n@@ -1242,6 +1240,11 @@ class NetflixSession:\n},\n}\n\"\"\"\n+ mpaa = ''\n+ if episode.get('maturity', None) is not None:\n+ if episode['maturity'].get('board', None) is not None and episode['maturity'].get('value', None) is not None:\n+ mpaa = str(episode['maturity'].get('board', '').encode('utf-8')) + '-' + str(episode['maturity'].get('value', '').encode('utf-8'))\n+\nreturn {\nepisode['summary']['id']: {\n'id': episode['summary']['id'],\n@@ -1252,7 +1255,7 @@ class NetflixSession:\n'title': episode['info']['title'],\n'year': episode['info']['releaseYear'],\n'genres': self.parse_genres_for_video(video=episode, genres=genres),\n- 'mpaa': str(episode['maturity']['rating']['board']).encode('utf-8') + ' ' + str(episode['maturity']['rating']['value']).encode('utf-8'),\n+ 'mpaa': mpaa,\n'maturity': episode['maturity'],\n'playcount': (0, 1)[episode['watched']],\n'rating': episode['userRating'].get('average', 0) if episode['userRating'].get('average', None) != None else episode['userRating'].get('predicted', 0),\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(netflix.api): Fixes further unicode decoding problems
105,979
19.07.2017 17:23:50
-7,200
687fae8469b0113ec7a7572026aa5b0324cfe98f
chore(readme): Fix inputstream repo link
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -12,7 +12,7 @@ Prerequisites\n- Kodi 18 [nightlybuild](http://mirrors.kodi.tv/nightlies/)\n- Libwidevine 1.4.8.962 (A german description how to get/install it, can be found [here](https://www.kodinerds.net/index.php/Thread/51486-Kodi-17-Inputstream-HowTo-AddOns-f%C3%BCr-Kodi-17-ab-Beta-6-aktuelle-Git-builds-Updat/))\n-- Inputstream.adaptive [v2.0.4](https://github.com/liberty-developer/inputstream.adaptive)\n+- Inputstream.adaptive [v2.0.4](https://github.com/peak3d/inputstream.adaptive)\nFAQ\n---\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(readme): Fix inputstream repo link
105,996
19.07.2017 17:38:51
-7,200
eae6850e82683605d0426dd36a34020919301798
calculate android esn
[ { "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.11.14\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.15\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -2299,11 +2299,29 @@ class NetflixSession:\n:obj:`str` of :obj:`str\nESN, something like: NFCDCH-MC-D7D6F54LOPY8J416T72MQXX3RD20ME\n\"\"\"\n- esn = ''\n+ # we generate an esn from device strings for android\n+ import subprocess\n+ manufacturer = subprocess.check_output([\"/system/bin/getprop\", \"ro.product.manufacturer\"])\n+\n+ if manufacturer :\n+ esn = 'NFANDROID1-PRV-'\n+ input = subprocess.check_output([\"/system/bin/getprop\", \"ro.nrdp.modelgroup\"])\n+ if not input:\n+ esn = esn + 'T-L3-'\n+ else:\n+ esn = esn + input.strip(' \\t\\n\\r') + '-'\n+ esn = esn + '{:5}'.format(manufacturer.strip(' \\t\\n\\r').upper())\n+ input = subprocess.check_output([\"/system/bin/getprop\" ,\"ro.product.model\"])\n+ esn = esn + input.strip(' \\t\\n\\r').replace(' ', '=').upper()\n+ self.log(msg='Android generated ESN:' + esn)\n+ return esn\n+\n# values are accessible via dict (sloppy parsing successfull)\nif type(netflix_page_data) == dict:\nreturn netflix_page_data.get('esn', '')\n+ esn = ''\n+\n# values are stored in lists (returned from JS parser)\nfor item in netflix_page_data:\nif 'esnGeneratorModel' in dict(item).keys():\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
calculate android esn
105,979
19.07.2017 21:29:55
-7,200
c6e56c0365952da48fa6678c83497fecdb5d73e6
fix(netflix-session): Fix error on nix devices reteieving the esn+
[ { "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.11.15\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.16\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n<license>MIT</license>\n<forum>http://www.kodinerds.net/index.php/Thread/55607-Inputstream-Agile-Betatest-Netflix/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n- <news>v0.11.15 (2017-07-19)\n- - Fix issue with Slovak, Polich &amp; Swedish language filed\n+ <news>v0.11.16 (2017-07-19)\n+ - Fix error on *nix devices\n+\n+ v0.11.15 (2017-07-19)\n+ - Fix issue with Slovak, Polish &amp; Swedish language files\n- Add calculation of ESN for Android\n- Logout in settings now also deletes Manifest data\n- Add hidden ESN field in config &amp; delete Manifest data if it doesn't fit the public one\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Dutch/strings.po", "new_path": "resources/language/Dutch/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.15\n+# Addon version: 0.11.16\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.15\n+# Addon version: 0.11.16\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.15\n+# Addon version: 0.11.16\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Polish/strings.po", "new_path": "resources/language/Polish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.15\n+# Addon version: 0.11.16\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Portugese/strings.po", "new_path": "resources/language/Portugese/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.15\n+# Addon version: 0.11.16\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Slovak/strings.po", "new_path": "resources/language/Slovak/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.15\n+# Addon version: 0.11.16\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Spanish/strings.po", "new_path": "resources/language/Spanish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.15\n+# Addon version: 0.11.16\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Swedish/strings.po", "new_path": "resources/language/Swedish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.15\n+# Addon version: 0.11.16\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -205,18 +205,6 @@ class KodiHelper:\nReturns the esn from settings\n\"\"\"\nstored_esn = self.get_esn()\n- hidden_esn = self.get_addon().getSetting('hidden_esn')\n- if hidden_esn == '' and esn:\n- self.set_setting('esn', esn)\n- self.set_setting('hidden_esn', esn)\n- self.delete_manifest_data()\n- return esn\n-\n- if hidden_esn != stored_esn:\n- self.set_setting('hidden_esn', stored_esn)\n- self.delete_manifest_data()\n- return stored_esn\n-\nif not stored_esn and esn:\nself.set_setting('esn', esn)\nself.delete_manifest_data()\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -2301,8 +2301,8 @@ class NetflixSession:\n\"\"\"\n# we generate an esn from device strings for android\nimport subprocess\n+ try:\nmanufacturer = subprocess.check_output([\"/system/bin/getprop\", \"ro.product.manufacturer\"])\n-\nif manufacturer:\nesn = 'NFANDROID1-PRV-'\ninput = subprocess.check_output([\"/system/bin/getprop\", \"ro.nrdp.modelgroup\"])\n@@ -2315,6 +2315,8 @@ class NetflixSession:\nesn = esn + input.strip(' \\t\\n\\r').replace(' ', '=').upper()\nself.log(msg='Android generated ESN:' + esn)\nreturn esn\n+ except OSError as e:\n+ self.log(msg='Ignoring exception for non Android devices')\n# values are accessible via dict (sloppy parsing successfull)\nif type(netflix_page_data) == dict:\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(netflix-session): Fix error on nix devices reteieving the esn+
105,979
25.07.2017 14:56:54
-7,200
be17806c978ab9aaccb106d4bd50114fe5ace5ff
chore(readme): Add bitcoin address
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "## Netflix Plugin for Kodi 18\n+<span class=\"badge-bitcoin\"><a href=\"https://blockchain.info/address/1DHGftMkFXXsDY7UnqQuatWwxQzKVu88sF\" title=\"Donate to this project using Bitcoin\"><img src=\"https://img.shields.io/badge/bitcoin-donate-yellow.svg\" alt=\"Bitcoin donate button\" /></a></span>\n+\nDisclaimer\n-------------\nThis plugin is not officially commisioned/supported by Netflix.\n@@ -60,6 +62,12 @@ If something doesn't work for you, please:\n- Libwedevine version\n- A Kodi debug log that represents your issue\n+Donate\n+------\n+\n+If you like this project feel free to buy us some cups of coffee.\n+Our bitcoin address is: 1DHGftMkFXXsDY7UnqQuatWwxQzKVu88sF\n+\nLicence\n-------\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(readme): Add bitcoin address
105,979
26.07.2017 16:14:08
-7,200
68cf7c159a9a24dbb5097598782085b7b652542d
feat(inputstream): Adds content lookup mime type & same user agent as for json requests for inputstream
[ { "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.11.16\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.17\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Dutch/strings.po", "new_path": "resources/language/Dutch/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.16\n+# Addon version: 0.11.17\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.16\n+# Addon version: 0.11.17\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.16\n+# Addon version: 0.11.17\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Polish/strings.po", "new_path": "resources/language/Polish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.16\n+# Addon version: 0.11.17\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Portugese/strings.po", "new_path": "resources/language/Portugese/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.16\n+# Addon version: 0.11.17\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Slovak/strings.po", "new_path": "resources/language/Slovak/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.16\n+# Addon version: 0.11.17\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Spanish/strings.po", "new_path": "resources/language/Spanish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.16\n+# Addon version: 0.11.17\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Swedish/strings.po", "new_path": "resources/language/Swedish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.16\n+# Addon version: 0.11.17\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -13,6 +13,7 @@ from os.path import join, isfile\nfrom urllib import urlencode\nfrom xbmcaddon import Addon\nfrom uuid import uuid4\n+from utils import get_user_agent_for_current_platform\nfrom UniversalAnalytics import Tracker\ntry:\nimport cPickle as pickle\n@@ -693,6 +694,9 @@ class KodiHelper:\n# inputstream addon properties\nmsl_service_url = 'http://localhost:' + str(addon.getSetting('msl_service_port'))\nplay_item = xbmcgui.ListItem(path=msl_service_url + '/manifest?id=' + video_id)\n+ play_item.setContentLookup(False)\n+ play_item.setMimeType('application/dash+xml')\n+ play_item.setProperty(inputstream_addon + '.stream_headers', 'user-agent=' + get_user_agent_for_current_platform())\nplay_item.setProperty(inputstream_addon + '.license_type', 'com.widevine.alpha')\nplay_item.setProperty(inputstream_addon + '.manifest_type', 'mpd')\nplay_item.setProperty(inputstream_addon + '.license_key', msl_service_url + '/license?id=' + video_id + '||b{SSM}!b{SID}|')\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -10,7 +10,7 @@ from urllib import quote, unquote\nfrom time import time\nfrom base64 import urlsafe_b64encode\nfrom bs4 import BeautifulSoup, SoupStrainer\n-from utils import noop\n+from utils import noop, get_user_agent_for_current_platform\ntry:\nimport cPickle as pickle\nexcept:\n@@ -103,7 +103,7 @@ class NetflixSession:\n# start session, fake chrome on the current platform (so that we get a proper widevine esn) & enable gzip\nself.session = session()\nself.session.headers.update({\n- 'User-Agent': self._get_user_agent_for_current_platform(),\n+ 'User-Agent': get_user_agent_for_current_platform(),\n'Accept-Encoding': 'gzip'\n})\n@@ -1880,24 +1880,6 @@ class NetflixSession:\n\"\"\"\nreturn urlsafe_b64encode(account['email'])\n- def _get_user_agent_for_current_platform (self):\n- \"\"\"Determines the user agent string for the current platform (to retrieve a valid ESN)\n-\n- Returns\n- -------\n- :obj:`str`\n- User Agent for platform\n- \"\"\"\n- import platform\n- self.log(msg='Building User Agent for platform: ' + str(platform.system()) + ' - ' + str(platform.machine()))\n- if platform.system() == 'Darwin':\n- return 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'\n- if platform.system() == 'Windows':\n- return 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'\n- if platform.machine().startswith('arm'):\n- return 'Mozilla/5.0 (X11; CrOS armv7l 7647.78.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36'\n- return 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'\n-\ndef _session_post (self, component, type='document', data={}, headers={}, params={}):\n\"\"\"Executes a get request using requests for the current session & measures the duration of that request\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/utils.py", "new_path": "resources/lib/utils.py", "diff": "# Module: utils\n# Created on: 13.01.2017\n+import platform\n+\n# Takes everything, does nothing, classic no operation function\ndef noop (**kwargs):\nreturn True\n@@ -27,3 +29,20 @@ def log(f, name=None):\nreturn result\nwrapped.__doc__ = f.__doc__\nreturn wrapped\n+\n+def _get_user_agent_for_current_platform():\n+ \"\"\"Determines the user agent string for the current platform (to retrieve a valid ESN)\n+\n+ Returns\n+ -------\n+ :obj:`str`\n+ User Agent for platform\n+ \"\"\"\n+ system = platform.system()\n+ if system == 'Darwin':\n+ return 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'\n+ if system == 'Windows':\n+ return 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'\n+ if platform.machine().startswith('arm'):\n+ return 'Mozilla/5.0 (X11; CrOS armv7l 7647.78.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'\n+ return 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
feat(inputstream): Adds content lookup mime type & same user agent as for json requests for inputstream
105,979
26.07.2017 18:06:31
-7,200
59e3df2c2d68cb452d2a0d84eb3fd3be4988fb9f
fix(utils): Fixes falsly named function
[ { "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.11.17\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.18\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Dutch/strings.po", "new_path": "resources/language/Dutch/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.17\n+# Addon version: 0.11.18\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.17\n+# Addon version: 0.11.18\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.17\n+# Addon version: 0.11.18\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Polish/strings.po", "new_path": "resources/language/Polish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.17\n+# Addon version: 0.11.18\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Portugese/strings.po", "new_path": "resources/language/Portugese/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.17\n+# Addon version: 0.11.18\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Slovak/strings.po", "new_path": "resources/language/Slovak/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.17\n+# Addon version: 0.11.18\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Spanish/strings.po", "new_path": "resources/language/Spanish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.17\n+# Addon version: 0.11.18\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Swedish/strings.po", "new_path": "resources/language/Swedish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.17\n+# Addon version: 0.11.18\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/utils.py", "new_path": "resources/lib/utils.py", "diff": "@@ -30,7 +30,7 @@ def log(f, name=None):\nwrapped.__doc__ = f.__doc__\nreturn wrapped\n-def _get_user_agent_for_current_platform():\n+def get_user_agent_for_current_platform():\n\"\"\"Determines the user agent string for the current platform (to retrieve a valid ESN)\nReturns\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(utils): Fixes falsly named function
106,009
31.07.2017 10:08:19
-7,200
7afec310e04492b290523718b7f7ef8df0ef7ccf
add infoLabels to inputstream's listitem
[ { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "import urllib\nimport urllib2\nimport json\n+import ast\nfrom xbmcaddon import Addon\nfrom urlparse import parse_qsl\nfrom utils import noop, log\n@@ -105,7 +106,7 @@ class Navigation:\n# display the lists (recommendations, genres, etc.)\nreturn self.show_user_list(type=params['type'])\nelif params['action'] == 'play_video':\n- self.play_video(video_id=params['video_id'], start_offset=params.get('start_offset', -1))\n+ self.play_video(video_id=params['video_id'], start_offset=params.get('start_offset', -1), infoLabels=params['infoLabels'])\nelif params['action'] == 'user-items' and params['type'] == 'search':\n# if the user requested a search, ask for the term\nterm = self.kodi_helper.show_search_term_dialog()\n@@ -115,7 +116,7 @@ class Navigation:\nreturn True\n@log\n- def play_video (self, video_id, start_offset):\n+ def play_video (self, video_id, start_offset, infoLabels):\n\"\"\"Starts video playback\nNote: This is just a dummy, inputstream is needed to play the vids\n@@ -127,9 +128,16 @@ class Navigation:\nstart_offset : :obj:`str`\nOffset to resume playback from (in seconds)\n+\n+ infoLabels : :obj:`str`\n+ the listitem's infoLabels\n\"\"\"\n+ try:\n+ infoLabels = ast.literal_eval(infoLabels)\n+ except:\n+ infoLabels= {}\nesn = self.call_netflix_service({'method': 'get_esn'})\n- return self.kodi_helper.play_item(esn=esn, video_id=video_id, start_offset=start_offset)\n+ return self.kodi_helper.play_item(esn=esn, video_id=video_id, start_offset=start_offset, infoLabels=infoLabels)\n@log\ndef show_search_results (self, term):\n@@ -176,6 +184,9 @@ class Navigation:\n----------\nseason_id : :obj:`str`\nID of the season episodes should be displayed for\n+\n+ tvshowtitle : :obj:`str`\n+ title of the show (for listitems' infolabels)\n\"\"\"\nuser_data = self.call_netflix_service({'method': 'get_user_data'})\nepisode_list = self.call_netflix_service({'method': 'fetch_episodes_by_season', 'season_id': season_id, 'guid': user_data['guid'], 'cache': True})\n@@ -200,6 +211,8 @@ class Navigation:\nshow_id : :obj:`str`\nID of the show seasons should be displayed for\n+ tvshowtitle : :obj:`str`\n+ title of the show (for listitems' infolabels)\nReturns\n-------\nbool\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
add infoLabels to inputstream's listitem
106,043
02.08.2017 19:07:26
-10,800
ff2b5ac70453c86580956b4e0f6b16bb514c9566
updates fetched from Aciidisco updated code based on AciiDisco (19/7/2017)
[ { "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.11.14\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.18\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n<license>MIT</license>\n<forum>http://www.kodinerds.net/index.php/Thread/55607-Inputstream-Agile-Betatest-Netflix/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n- <news>v0.11.14 (2017-07-02)\n+ <news>v0.11.16 (2017-07-19)\n+ - Fix error on *nix devices\n+\n+ v0.11.15 (2017-07-19)\n+ - Fix issue with Slovak, Polish &amp; Swedish language files\n+ - Add calculation of ESN for Android\n+ - Logout in settings now also deletes Manifest data\n+ - Add hidden ESN field in config &amp; delete Manifest data if it doesn't fit the public one\n+\n+ v0.11.14 (2017-07-02)\n- Fix issue with Unicode escaping\nv0.11.13 (2017-07-02)\nv0.11.10 (2017-4-10)\n- Adds subtitle support\n- Polish translations\n-\n- v0.11.9 (2017-4-5)\n- - Fix issues with persisted msl manifests\n</news>\n</extension>\n</addon>\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Dutch/strings.po", "new_path": "resources/language/Dutch/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.14\n+# Addon version: 0.11.18\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.14\n+# Addon version: 0.11.18\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.14\n+# Addon version: 0.11.18\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Hebrew/strings.po", "new_path": "resources/language/Hebrew/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.14\n+# Addon version: 0.11.18\n# Addon Provider: libdev + jojo + asciidisco\n# Translated by: Itayshechter\nmsgid \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Portugese/strings.po", "new_path": "resources/language/Portugese/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.14\n+# Addon version: 0.11.18\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Spanish/strings.po", "new_path": "resources/language/Spanish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.14\n+# Addon version: 0.11.18\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -13,6 +13,7 @@ from os.path import join, isfile\nfrom urllib import urlencode\nfrom xbmcaddon import Addon\nfrom uuid import uuid4\n+from utils import get_user_agent_for_current_platform\nfrom UniversalAnalytics import Tracker\ntry:\nimport cPickle as pickle\n@@ -693,6 +694,9 @@ class KodiHelper:\n# inputstream addon properties\nmsl_service_url = 'http://localhost:' + str(addon.getSetting('msl_service_port'))\nplay_item = xbmcgui.ListItem(path=msl_service_url + '/manifest?id=' + video_id)\n+ play_item.setContentLookup(False)\n+ play_item.setMimeType('application/dash+xml')\n+ play_item.setProperty(inputstream_addon + '.stream_headers', 'user-agent=' + get_user_agent_for_current_platform())\nplay_item.setProperty(inputstream_addon + '.license_type', 'com.widevine.alpha')\nplay_item.setProperty(inputstream_addon + '.manifest_type', 'mpd')\nplay_item.setProperty(inputstream_addon + '.license_key', msl_service_url + '/license?id=' + video_id + '||b{SSM}!b{SID}|')\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "new_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "diff": "@@ -74,6 +74,8 @@ class NetflixHttpSubRessourceHandler:\n\"\"\"\nself.profiles = []\nself.credentials = {'email': '', 'password': ''}\n+ # delete esn data\n+ self.kodi_helper.delete_manifest_data()\nreturn self.netflix_session.logout()\ndef login (self, params):\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -10,7 +10,7 @@ from urllib import quote, unquote\nfrom time import time\nfrom base64 import urlsafe_b64encode\nfrom bs4 import BeautifulSoup, SoupStrainer\n-from utils import noop\n+from utils import noop, get_user_agent_for_current_platform\ntry:\nimport cPickle as pickle\nexcept:\n@@ -103,7 +103,7 @@ class NetflixSession:\n# start session, fake chrome on the current platform (so that we get a proper widevine esn) & enable gzip\nself.session = session()\nself.session.headers.update({\n- 'User-Agent': self._get_user_agent_for_current_platform(),\n+ 'User-Agent': get_user_agent_for_current_platform(),\n'Accept-Encoding': 'gzip'\n})\n@@ -1880,24 +1880,6 @@ class NetflixSession:\n\"\"\"\nreturn urlsafe_b64encode(account['email'])\n- def _get_user_agent_for_current_platform (self):\n- \"\"\"Determines the user agent string for the current platform (to retrieve a valid ESN)\n-\n- Returns\n- -------\n- :obj:`str`\n- User Agent for platform\n- \"\"\"\n- import platform\n- self.log(msg='Building User Agent for platform: ' + str(platform.system()) + ' - ' + str(platform.machine()))\n- if platform.system() == 'Darwin':\n- return 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'\n- if platform.system() == 'Windows':\n- return 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'\n- if platform.machine().startswith('arm'):\n- return 'Mozilla/5.0 (X11; CrOS armv7l 7647.78.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36'\n- return 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'\n-\ndef _session_post (self, component, type='document', data={}, headers={}, params={}):\n\"\"\"Executes a get request using requests for the current session & measures the duration of that request\n@@ -2299,11 +2281,31 @@ class NetflixSession:\n:obj:`str` of :obj:`str\nESN, something like: NFCDCH-MC-D7D6F54LOPY8J416T72MQXX3RD20ME\n\"\"\"\n- esn = ''\n+ # we generate an esn from device strings for android\n+ import subprocess\n+ try:\n+ manufacturer = subprocess.check_output([\"/system/bin/getprop\", \"ro.product.manufacturer\"])\n+ if manufacturer:\n+ esn = 'NFANDROID1-PRV-'\n+ input = subprocess.check_output([\"/system/bin/getprop\", \"ro.nrdp.modelgroup\"])\n+ if not input:\n+ esn = esn + 'T-L3-'\n+ else:\n+ esn = esn + input.strip(' \\t\\n\\r') + '-'\n+ esn = esn + '{:5}'.format(manufacturer.strip(' \\t\\n\\r').upper())\n+ input = subprocess.check_output([\"/system/bin/getprop\" ,\"ro.product.model\"])\n+ esn = esn + input.strip(' \\t\\n\\r').replace(' ', '=').upper()\n+ self.log(msg='Android generated ESN:' + esn)\n+ return esn\n+ except OSError as e:\n+ self.log(msg='Ignoring exception for non Android devices')\n+\n# values are accessible via dict (sloppy parsing successfull)\nif type(netflix_page_data) == dict:\nreturn netflix_page_data.get('esn', '')\n+ esn = ''\n+\n# values are stored in lists (returned from JS parser)\nfor item in netflix_page_data:\nif 'esnGeneratorModel' in dict(item).keys():\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/utils.py", "new_path": "resources/lib/utils.py", "diff": "# Module: utils\n# Created on: 13.01.2017\n+import platform\n+\n# Takes everything, does nothing, classic no operation function\ndef noop (**kwargs):\nreturn True\n@@ -27,3 +29,20 @@ def log(f, name=None):\nreturn result\nwrapped.__doc__ = f.__doc__\nreturn wrapped\n+\n+def get_user_agent_for_current_platform():\n+ \"\"\"Determines the user agent string for the current platform (to retrieve a valid ESN)\n+\n+ Returns\n+ -------\n+ :obj:`str`\n+ User Agent for platform\n+ \"\"\"\n+ system = platform.system()\n+ if system == 'Darwin':\n+ return 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'\n+ if system == 'Windows':\n+ return 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'\n+ if platform.machine().startswith('arm'):\n+ return 'Mozilla/5.0 (X11; CrOS armv7l 7647.78.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'\n+ return 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'\n" }, { "change_type": "MODIFY", "old_path": "resources/settings.xml", "new_path": "resources/settings.xml", "diff": "<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 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=\"netflix_service_port\" value=\"8001\" visible=\"false\"/>\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
updates fetched from Aciidisco updated code based on AciiDisco (19/7/2017)
106,008
11.06.2017 13:59:21
-7,200
885d0084883d67d0c9a58669baebb25f097b47dc
Tweak use of in memory cache. Previously we used to load the cache once to check if the requested item was in there, and then another time to actually load it. Combine both functions into one for less overhead.
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -282,22 +282,6 @@ class KodiHelper:\n\"\"\"Invalidates the memory cache\"\"\"\nxbmcgui.Window(xbmcgui.getCurrentWindowId()).setProperty('memcache', pickle.dumps({}))\n- def has_cached_item (self, cache_id):\n- \"\"\"Checks if the requested item is in memory cache\n-\n- Parameters\n- ----------\n- cache_id : :obj:`str`\n- ID of the cache entry\n-\n- Returns\n- -------\n- bool\n- Item is cached\n- \"\"\"\n- cached_items = pickle.loads(xbmcgui.Window(xbmcgui.getCurrentWindowId()).getProperty('memcache'))\n- return cache_id in cached_items.keys()\n-\ndef get_cached_item (self, cache_id):\n\"\"\"Returns an item from the in memory cache\n@@ -312,9 +296,8 @@ class KodiHelper:\nContents of the requested cache item or none\n\"\"\"\ncached_items = pickle.loads(xbmcgui.Window(xbmcgui.getCurrentWindowId()).getProperty('memcache'))\n- if self.has_cached_item(cache_id) != True:\n- return None\n- return cached_items[cache_id]\n+\n+ return cached_items.get(cache_id)\ndef add_cached_item (self, cache_id, contents):\n\"\"\"Adds an item to the in memory cache\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -541,9 +541,14 @@ class Navigation:\n\"\"\"\nurl_values = urllib.urlencode(params)\n# check for cached items\n- if self.kodi_helper.has_cached_item(cache_id=url_values) and params.get('cache', False) == True:\n- self.log(msg='Fetching item from cache: (cache_id=' + url_values + ')')\n- return self.kodi_helper.get_cached_item(cache_id=url_values)\n+ if params.get('cache', False) == True:\n+ cached_value = self.kodi_helper.get_cached_item(cache_id=url_values)\n+\n+ # Cache lookup successful?\n+ if cached_value != None:\n+ self.log(msg='Fetched item from cache: (cache_id=' + url_values + ')')\n+ return cached_value\n+\nurl = self.get_netflix_service_url()\nfull_url = url + '?' + url_values\ndata = urllib2.urlopen(full_url).read()\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Tweak use of in memory cache. Previously we used to load the cache once to check if the requested item was in there, and then another time to actually load it. Combine both functions into one for less overhead. Signed-off-by: s.golasch <[email protected]>
106,005
07.08.2017 15:53:21
-7,200
a91acab543cb2ed17672e46f5171af92172b5a28
fix(navigation): fixes problems with play back files from library
[ { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -106,7 +106,7 @@ class Navigation:\n# display the lists (recommendations, genres, etc.)\nreturn self.show_user_list(type=params['type'])\nelif params['action'] == 'play_video':\n- self.play_video(video_id=params['video_id'], start_offset=params.get('start_offset', -1), infoLabels=params['infoLabels'])\n+ self.play_video(video_id=params['video_id'], start_offset=params.get('start_offset', -1), infoLabels=params.get('infoLabels', {}))\nelif params['action'] == 'user-items' and params['type'] == 'search':\n# if the user requested a search, ask for the term\nterm = self.kodi_helper.show_search_term_dialog()\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(navigation): fixes problems with play back files from library
106,008
12.08.2017 12:27:07
-7,200
b108343b62349ba094a6e213d338debaff21f275
Remove duplicated work from NetflixSession.parse_seasons(). Instead of recomputing the sorting order for the seasons list for every season in this list, we now figure out the sorting order once.
[ { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -1074,14 +1074,29 @@ class NetflixSession:\n}\n}\n\"\"\"\n- seasons = {}\nraw_seasons = response_data['value']\n+ videos = raw_seasons['videos']\n+\n+ # get art video key\n+ video = {}\n+ for key, video_candidate in videos.iteritems():\n+ if not self._is_size_key(key):\n+ video = video_candidate\n+\n+ # get season index\n+ sorting = {}\n+ for idx, season_list_entry in video['seasonList'].iteritems():\n+ if self._is_size_key(key=idx) == False and idx != 'summary':\n+ sorting[int(season_list_entry[1])] = int(idx)\n+\n+ seasons = {}\n+\nfor season in raw_seasons['seasons']:\nif self._is_size_key(key=season) == False:\n- seasons.update(self.parse_season_entry(season=raw_seasons['seasons'][season], videos=raw_seasons['videos']))\n+ seasons.update(self.parse_season_entry(season=raw_seasons['seasons'][season], video=video, sorting=sorting))\nreturn seasons\n- def parse_season_entry (self, season, videos):\n+ def parse_season_entry (self, season, video, sorting):\n\"\"\"Parse a season list entry e.g. rip out the parts we need\nParameters\n@@ -1107,16 +1122,6 @@ class NetflixSession:\n}\n}\n\"\"\"\n- # get art video key\n- video_key = ''\n- for key in videos.keys():\n- if self._is_size_key(key=key) == False:\n- video_key = key\n- # get season index\n- sorting = {}\n- for idx in videos[video_key]['seasonList']:\n- if self._is_size_key(key=idx) == False and idx != 'summary':\n- sorting[int(videos[video_key]['seasonList'][idx][1])] = int(idx)\nreturn {\nseason['summary']['id']: {\n'idx': sorting[season['summary']['id']],\n@@ -1124,10 +1129,10 @@ class NetflixSession:\n'text': season['summary']['name'],\n'shortName': season['summary']['shortName'],\n'boxarts': {\n- 'small': videos[video_key]['boxarts']['_342x192']['jpg']['url'],\n- 'big': videos[video_key]['boxarts']['_1280x720']['jpg']['url']\n+ 'small': video['boxarts']['_342x192']['jpg']['url'],\n+ 'big': video['boxarts']['_1280x720']['jpg']['url']\n},\n- 'interesting_moment': videos[video_key]['interestingMoment']['_665x375']['jpg']['url'],\n+ 'interesting_moment': video['interestingMoment']['_665x375']['jpg']['url'],\n}\n}\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Remove duplicated work from NetflixSession.parse_seasons(). Instead of recomputing the sorting order for the seasons list for every season in this list, we now figure out the sorting order once.
106,008
12.08.2017 12:27:40
-7,200
385854355a756f1689ef897443876e4f75ace542
Rename NetflixSession.parse_season_entry() to _parse_season_entry()... ... to indicate that this method is only used internally.
[ { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -1093,10 +1093,10 @@ class NetflixSession:\nfor season in raw_seasons['seasons']:\nif self._is_size_key(key=season) == False:\n- seasons.update(self.parse_season_entry(season=raw_seasons['seasons'][season], video=video, sorting=sorting))\n+ seasons.update(self._parse_season_entry(season=raw_seasons['seasons'][season], video=video, sorting=sorting))\nreturn seasons\n- def parse_season_entry (self, season, video, sorting):\n+ def _parse_season_entry (self, season, video, sorting):\n\"\"\"Parse a season list entry e.g. rip out the parts we need\nParameters\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Rename NetflixSession.parse_season_entry() to _parse_season_entry()... ... to indicate that this method is only used internally.
105,979
15.08.2017 19:59:47
-7,200
cf165e89c263a2b63a0921b399bed9b227c678b6
fix(list): Issue with rendering lists that contain entries with uncommon characters
[ { "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.11.20\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.21\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n<license>MIT</license>\n<forum>http://www.kodinerds.net/index.php/Thread/55607-Inputstream-Agile-Betatest-Netflix/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n- <news>v0.11.20 (2017-08-07)\n- - Fixes issues with playback from within the Kodi library\n+ <news>v0.11.21 (2017-08-15)\n+ - Fixes issues with badly encoded TV-Show titles\n+ - Adds Hebrew translations\n+ - Slightly improves list rendering performance\n</news>\n</extension>\n</addon>\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Dutch/strings.po", "new_path": "resources/language/Dutch/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.20\n+# Addon version: 0.11.21\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.20\n+# Addon version: 0.11.21\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.20\n+# Addon version: 0.11.21\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Hebrew/strings.po", "new_path": "resources/language/Hebrew/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.20\n+# Addon version: 0.11.21\n# Addon Provider: libdev + jojo + asciidisco\n# Translated by: Itayshechter\nmsgid \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Italian/strings.po", "new_path": "resources/language/Italian/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.20\n+# Addon version: 0.11.21\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Polish/strings.po", "new_path": "resources/language/Polish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.20\n+# Addon version: 0.11.21\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Portugese/strings.po", "new_path": "resources/language/Portugese/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.20\n+# Addon version: 0.11.21\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Slovak/strings.po", "new_path": "resources/language/Slovak/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.20\n+# Addon version: 0.11.21\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Spanish/strings.po", "new_path": "resources/language/Spanish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.20\n+# Addon version: 0.11.21\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Swedish/strings.po", "new_path": "resources/language/Swedish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.20\n+# Addon version: 0.11.21\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -7,6 +7,7 @@ import xbmcplugin\nimport xbmcgui\nimport xbmc\nimport json\n+import base64\nfrom MSL import MSL\nfrom os import remove\nfrom os.path import join, isfile\n@@ -464,7 +465,7 @@ class KodiHelper:\nisFolder = True\nparams = {'action': actions[video['type']], 'show_id': video_list_id}\nif 'tvshowtitle' in infos:\n- params['tvshowtitle'] = infos.get('tvshowtitle', '').encode('utf-8')\n+ params['tvshowtitle'] = base64.urlsafe_b64encode(infos.get('tvshowtitle', '').encode('utf-8'))\nurl = build_url(params)\nxbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=li, isFolder=isFolder)\n@@ -585,7 +586,7 @@ class KodiHelper:\nli = self._generate_context_menu_items(entry=season, li=li)\nparams = {'action': 'episode_list', 'season_id': season['id']}\nif 'tvshowtitle' in infos:\n- params['tvshowtitle'] = infos.get('tvshowtitle', '').encode('utf-8')\n+ params['tvshowtitle'] = base64.urlsafe_b64encode(infos.get('tvshowtitle', '').encode('utf-8'))\nurl = build_url(params)\nxbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=li, isFolder=True)\n@@ -806,7 +807,7 @@ class KodiHelper:\nquality = {'width': '1920', 'height': '1080'}\nli.addStreamInfo('video', quality)\nif 'tvshowtitle' in entry_keys:\n- infos.update({'tvshowtitle': entry.get('tvshowtitle', '').encode('utf-8')})\n+ infos.update({'tvshowtitle': base64.urlsafe_b64decode(entry.get('tvshowtitle', '')).decode('utf-8')})\nli.setInfo('video', infos)\nreturn li, infos\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(list): Issue with rendering lists that contain entries with uncommon characters
105,996
24.08.2017 20:15:27
-7,200
e6eac6e603802a1d6bc3e7a95a4469e65a2d3fd2
Implement impaired key for audio tracks
[ { "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.11.21\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.22\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/MSL.py", "new_path": "resources/lib/MSL.py", "diff": "@@ -337,7 +337,8 @@ class MSL:\naudio_adaption_set = ET.SubElement(period, 'AdaptationSet',\nlang=audio_track['bcp47'],\ncontentType='audio',\n- mimeType='audio/mp4')\n+ mimeType='audio/mp4',\n+ impaired='true' if audio_track['trackType'] == 'ASSISTIVE' else 'false')\nfor downloadable in audio_track['downloadables']:\ncodec = 'aac'\nprint downloadable\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Implement impaired key for audio tracks
106,035
24.08.2017 16:04:39
18,000
2cbe716c5df3636ebaa7b25d8a799a2be6f9c7a1
do not use proxy for localhost
[ { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -8,7 +8,7 @@ import urllib2\nimport json\nimport ast\nfrom xbmcaddon import Addon\n-from urlparse import parse_qsl\n+from urlparse import parse_qsl,urlparse\nfrom utils import noop, log\nclass Navigation:\n@@ -558,6 +558,9 @@ class Navigation:\nurl = self.get_netflix_service_url()\nfull_url = url + '?' + url_values\n+ # don't use proxy for localhost\n+ if (urlparse(url).hostname in ('localhost','127.0.0.1','::1')):\n+ urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler({})))\ndata = urllib2.urlopen(full_url).read()\nparsed_json = json.loads(data)\nresult = parsed_json.get('result', None)\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
do not use proxy for localhost
105,996
27.08.2017 18:33:53
-7,200
0666f9fa706bbcfdc11610722d2e113cfebce7e7
Add DRM robustness level into manifest
[ { "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.11.22\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.23\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/MSL.py", "new_path": "resources/lib/MSL.py", "diff": "@@ -301,6 +301,9 @@ class MSL:\n# Content Protection\nprotection = ET.SubElement(video_adaption_set, 'ContentProtection',\nschemeIdUri='urn:uuid:EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED')\n+\n+ ET.SubElement(protection, 'widevine:license', robustness_level='HW_SECURE_CODECS_REQUIRED')\n+\nif pssh is not '':\nET.SubElement(protection, 'cenc:pssh').text = pssh\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Add DRM robustness level into manifest
105,979
28.08.2017 14:25:24
-7,200
01f2bcd464cabfcd2475634a63b478084a8af917
chore(readme): Bump widevine version
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -14,7 +14,7 @@ Prerequisites\n- Kodi 18 [nightlybuild](http://mirrors.kodi.tv/nightlies/)\n- Inputstream.adaptive [>=v2.0.4](https://github.com/peak3d/inputstream.adaptive) (should be included in your Kodi 18 installation)\n-- Libwidevine 1.4.8.962 (A german description how to get/install it, can be found [here](https://www.kodinerds.net/index.php/Thread/51486-Kodi-17-Inputstream-HowTo-AddOns-f%C3%BCr-Kodi-17-ab-Beta-6-aktuelle-Git-builds-Updat/))\n+- Libwidevine 1.4.8.970 (A german description how to get/install it, can be found [here](https://www.kodinerds.net/index.php/Thread/51486-Kodi-17-Inputstream-HowTo-AddOns-f%C3%BCr-Kodi-17-ab-Beta-6-aktuelle-Git-builds-Updat/))\nNote: The link to download the Widevine Libary for none ARM Systems can be found in the [Firefox Sources](https://hg.mozilla.org/mozilla-central/raw-file/31465a03c03d1eec31cd4dd5d6b803724dcb29cd/toolkit/content/gmp-sources/widevinecdm.json) & needs to be placed in the `cdm` folder in [special://home](http://kodi.wiki/view/Special_protocol).\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(readme): Bump widevine version
106,018
02.09.2017 15:13:04
-7,200
0c9fe45c71f504487cf0c35d4dc8683be4c08eb0
fix custom library path
[ { "change_type": "MODIFY", "old_path": "resources/lib/Library.py", "new_path": "resources/lib/Library.py", "diff": "# Created on: 13.01.2017\nimport os\n+import xbmcgui\n+import xbmcvfs\nfrom shutil import rmtree\nfrom utils import noop\ntry:\n@@ -46,11 +48,19 @@ class Library:\nself.db_filepath = os.path.join(self.base_data_path, self.db_filename)\nself.log = log_fn\n+ # debug dialog\n+ #dialog = xbmcgui.Dialog()\n+ #dialog.ok(\"Library path\", self.custom_library_folder)\n+\n# check for local library folder & set up the paths\nlib_path = self.base_data_path if self.enable_custom_library_folder != 'true' else self.custom_library_folder\nself.movie_path = os.path.join(lib_path, self.movies_label)\nself.tvshow_path = os.path.join(lib_path, self.series_label)\n+ # debug dialog\n+ #dialog = xbmcgui.Dialog()\n+ #dialog.ok(\"Media paths\", self.movie_path,self.tvshow_path)\n+\n# check if we need to setup the base folder structure & do so if needed\nself.setup_local_netflix_library(source={\nself.movies_label: self.movie_path,\n@@ -69,8 +79,11 @@ class Library:\nDicitionary with directories to be created\n\"\"\"\nfor label in source:\n- if not os.path.exists(source[label]):\n- os.makedirs(source[label])\n+ if not xbmcvfs.exists(source[label]):\n+ # debug dialog\n+ #dialog = xbmcgui.Dialog()\n+ #dialog.ok(\"Missing path to create\", source[label])\n+ xbmcvfs.mkdir(source[label])\ndef write_strm_file(self, path, url):\n\"\"\"Writes the stream file that Kodi can use to integrate it into the DB\n@@ -83,7 +96,7 @@ class Library:\nurl : :obj:`str`\nStream url\n\"\"\"\n- with open(path, 'w+') as f:\n+ f = xbmcvfs.File(path, 'w')\nf.write(url)\nf.close()\n@@ -101,7 +114,7 @@ class Library:\nParsed contents of the db file\n\"\"\"\n# if the db doesn't exist, create it\n- if not os.path.isfile(filename):\n+ if not xbmcvfs.exists(filename):\ndata = {self.movies_label: {}, self.series_label: {}}\nself.log('Setup local library DB')\nself._update_local_db(filename=filename, db=data)\n@@ -130,9 +143,9 @@ class Library:\nbool\nUpdate has been successfully executed\n\"\"\"\n- if not os.path.isdir(os.path.dirname(filename)):\n+ if not xbmcvfs.exists(os.path.dirname(filename)):\nreturn False\n- with open(filename, 'w') as f:\n+ xbmcvfs.File(filename, 'w')\nf.truncate()\npickle.dump(db, f)\nreturn True\n@@ -243,10 +256,10 @@ class Library:\nfolder = alt_title\ndirname = os.path.join(self.movie_path, folder)\nfilename = os.path.join(dirname, movie_meta + '.strm')\n- if os.path.exists(filename):\n+ if xbmcvfs.exists(filename):\nreturn\n- if not os.path.exists(dirname):\n- os.makedirs(dirname)\n+ if not xbmcvfs.exists(dirname):\n+ xbmcvfs.mkdirs(dirname)\nif self.movie_exists(title=title, year=year) == False:\nself.db[self.movies_label][movie_meta] = {'alt_title': alt_title}\nself._update_local_db(filename=self.db_filepath, db=self.db)\n@@ -275,8 +288,8 @@ class Library:\nshow_meta = '%s' % (title)\nfolder = alt_title\nshow_dir = os.path.join(self.tvshow_path, folder)\n- if not os.path.exists(show_dir):\n- os.makedirs(show_dir)\n+ if not xbmcvfs.exists(show_dir):\n+ xbmcvfs.mkdirs(show_dir)\nif self.show_exists(title) == False:\nself.db[self.series_label][show_meta] = {'seasons': [], 'episodes': [], 'alt_title': alt_title}\nfor episode in episodes:\n@@ -322,7 +335,7 @@ class Library:\n# create strm file\nfilename = episode_meta + '.strm'\nfilepath = os.path.join(show_dir, filename)\n- if os.path.exists(filepath):\n+ if xbmcvfs.exists(filepath):\nreturn\nself.write_strm_file(path=filepath, url=build_url({'action': 'play_video', 'video_id': video_id}))\n@@ -347,7 +360,7 @@ class Library:\ndel self.db[self.movies_label][movie_meta]\nself._update_local_db(filename=self.db_filepath, db=self.db)\ndirname = os.path.join(self.movie_path, folder)\n- if os.path.exists(dirname):\n+ if xbmcvfs.exists(dirname):\nrmtree(dirname)\nreturn True\nreturn False\n@@ -369,7 +382,7 @@ class Library:\ndel self.db[self.series_label][title]\nself._update_local_db(filename=self.db_filepath, db=self.db)\nshow_dir = os.path.join(self.tvshow_path, folder)\n- if os.path.exists(show_dir):\n+ if xbmcvfs.exists(show_dir):\nrmtree(show_dir)\nreturn True\nreturn False\n@@ -399,11 +412,11 @@ class Library:\nseason_list.append(season_entry)\nself.db[self.series_label][show_meta]['seasons'] = season_list\nshow_dir = os.path.join(self.tvshow_path, self.db[self.series_label][show_meta]['alt_title'])\n- if os.path.exists(show_dir):\n- show_files = [f for f in os.listdir(show_dir) if os.path.isfile(os.path.join(show_dir, f))]\n+ if xbmcvfs.exists(show_dir):\n+ show_files = [f for f in xbmcvfs.listdir(show_dir) if xbmcvfs.exists(os.path.join(show_dir, f))]\nfor filename in show_files:\nif 'S%02dE' % (season) in filename:\n- os.remove(os.path.join(show_dir, filename))\n+ xbmcvfs.delete(os.path.join(show_dir, filename))\nelse:\nepisodes_list.append(filename.replace('.strm', ''))\nself.db[self.series_label][show_meta]['episodes'] = episodes_list\n@@ -434,10 +447,13 @@ class Library:\nepisode_meta = 'S%02dE%02d' % (season, episode)\nshow_dir = os.path.join(self.tvshow_path, self.db[self.series_label][show_meta]['alt_title'])\nif os.path.exists(os.path.join(show_dir, episode_meta + '.strm')):\n- os.remove(os.path.join(show_dir, episode_meta + '.strm'))\n+ xbmcvfs.remove(os.path.join(show_dir, episode_meta + '.strm'))\nfor episode_entry in self.db[self.series_label][show_meta]['episodes']:\nif episode_meta != episode_entry:\nepisodes_list.append(episode_entry)\nself.db[self.series_label][show_meta]['episodes'] = episodes_list\nself._update_local_db(filename=self.db_filepath, db=self.db)\nreturn True\n+\n+\n+\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix custom library path
106,018
02.09.2017 22:55:09
-7,200
5607dd83a00138dc788b4ce2465a2c243b6cb3d6
fix missing / prevent from export error by charset
[ { "change_type": "MODIFY", "old_path": "resources/lib/Library.py", "new_path": "resources/lib/Library.py", "diff": "@@ -255,7 +255,7 @@ class Library:\nmovie_meta = '%s (%d)' % (title, year)\nfolder = alt_title\ndirname = os.path.join(self.movie_path, folder)\n- filename = os.path.join(dirname, movie_meta + '.strm')\n+ filename = os.path.join(dirname, movie_meta.encode('utf8') + '.strm')\nif xbmcvfs.exists(filename):\nreturn\nif not xbmcvfs.exists(dirname):\n@@ -333,7 +333,7 @@ class Library:\nself.db[self.series_label][title]['episodes'].append(episode_meta)\n# create strm file\n- filename = episode_meta + '.strm'\n+ filename = episode_meta.encode('utf8') + '.strm'\nfilepath = os.path.join(show_dir, filename)\nif xbmcvfs.exists(filepath):\nreturn\n@@ -446,8 +446,8 @@ class Library:\nshow_meta = '%s' % (title)\nepisode_meta = 'S%02dE%02d' % (season, episode)\nshow_dir = os.path.join(self.tvshow_path, self.db[self.series_label][show_meta]['alt_title'])\n- if os.path.exists(os.path.join(show_dir, episode_meta + '.strm')):\n- xbmcvfs.remove(os.path.join(show_dir, episode_meta + '.strm'))\n+ if xbmcvfs.exists(os.path.join(show_dir, episode_meta.encode('utf8') + '.strm')):\n+ xbmcvfs.remove(os.path.join(show_dir, episode_meta.encode('utf8') + '.strm'))\nfor episode_entry in self.db[self.series_label][show_meta]['episodes']:\nif episode_meta != episode_entry:\nepisodes_list.append(episode_entry)\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix missing / prevent from export error by charset
106,018
04.09.2017 13:23:32
-7,200
17af167a9045b4504e674b83371af46c8cda45c2
fix handling of local db / cleanup
[ { "change_type": "MODIFY", "old_path": "resources/lib/Library.py", "new_path": "resources/lib/Library.py", "diff": "@@ -48,19 +48,11 @@ class Library:\nself.db_filepath = os.path.join(self.base_data_path, self.db_filename)\nself.log = log_fn\n- # debug dialog\n- #dialog = xbmcgui.Dialog()\n- #dialog.ok(\"Library path\", self.custom_library_folder)\n-\n# check for local library folder & set up the paths\nlib_path = self.base_data_path if self.enable_custom_library_folder != 'true' else self.custom_library_folder\nself.movie_path = os.path.join(lib_path, self.movies_label)\nself.tvshow_path = os.path.join(lib_path, self.series_label)\n- # debug dialog\n- #dialog = xbmcgui.Dialog()\n- #dialog.ok(\"Media paths\", self.movie_path,self.tvshow_path)\n-\n# check if we need to setup the base folder structure & do so if needed\nself.setup_local_netflix_library(source={\nself.movies_label: self.movie_path,\n@@ -80,9 +72,6 @@ class Library:\n\"\"\"\nfor label in source:\nif not xbmcvfs.exists(source[label]):\n- # debug dialog\n- #dialog = xbmcgui.Dialog()\n- #dialog.ok(\"Missing path to create\", source[label])\nxbmcvfs.mkdir(source[label])\ndef write_strm_file(self, path, url):\n@@ -114,7 +103,7 @@ class Library:\nParsed contents of the db file\n\"\"\"\n# if the db doesn't exist, create it\n- if not xbmcvfs.exists(filename):\n+ if not os.path.isfile(filename):\ndata = {self.movies_label: {}, self.series_label: {}}\nself.log('Setup local library DB')\nself._update_local_db(filename=filename, db=data)\n@@ -143,9 +132,9 @@ class Library:\nbool\nUpdate has been successfully executed\n\"\"\"\n- if not xbmcvfs.exists(os.path.dirname(filename)):\n+ if not os.path.isdir(os.path.dirname(filename)):\nreturn False\n- xbmcvfs.File(filename, 'w')\n+ with open(filename, 'w') as f:\nf.truncate()\npickle.dump(db, f)\nreturn True\n@@ -166,7 +155,7 @@ class Library:\nbool\nMovie exists in DB\n\"\"\"\n- movie_meta = '%s (%d)' % (title, year)\n+ movie_meta = ('%s (%d)' % (title, year)).encode('utf8')\nreturn movie_meta in self.db[self.movies_label]\ndef show_exists (self, title):\n@@ -182,7 +171,7 @@ class Library:\nbool\nShow exists in DB\n\"\"\"\n- show_meta = '%s' % (title)\n+ show_meta = ('%s' % (title)).encode('utf8')\nreturn show_meta in self.db[self.series_label]\ndef season_exists (self, title, season):\n@@ -252,10 +241,10 @@ class Library:\nFunction to generate the stream url\n\"\"\"\n- movie_meta = '%s (%d)' % (title, year)\n+ movie_meta = ('%s (%d)' % (title, year)).encode('utf8')\nfolder = alt_title\ndirname = os.path.join(self.movie_path, folder)\n- filename = os.path.join(dirname, movie_meta.encode('utf8') + '.strm')\n+ filename = os.path.join(dirname, movie_meta + '.strm')\nif xbmcvfs.exists(filename):\nreturn\nif not xbmcvfs.exists(dirname):\n@@ -285,7 +274,7 @@ class Library:\nbuild_url : :obj:`fn`\nFunction to generate the stream url\n\"\"\"\n- show_meta = '%s' % (title)\n+ show_meta = ('%s' % (title)).encode('utf8')\nfolder = alt_title\nshow_dir = os.path.join(self.tvshow_path, folder)\nif not xbmcvfs.exists(show_dir):\n@@ -328,12 +317,12 @@ class Library:\nself.db[self.series_label][title]['seasons'].append(season)\n# add episode\n- episode_meta = 'S%02dE%02d' % (season, episode)\n+ episode_meta = ('S%02dE%02d' % (season, episode)).encode('utf8')\nif self.episode_exists(title=title, season=season, episode=episode) == False:\nself.db[self.series_label][title]['episodes'].append(episode_meta)\n# create strm file\n- filename = episode_meta.encode('utf8') + '.strm'\n+ filename = (episode_meta + '.strm').encode('utf8')\nfilepath = os.path.join(show_dir, filename)\nif xbmcvfs.exists(filepath):\nreturn\n@@ -355,13 +344,15 @@ class Library:\nbool\nDelete successfull\n\"\"\"\n- movie_meta = '%s (%d)' % (title, year)\n+ movie_meta = ('%s (%d)' % (title, year)).encode('utf8')\nfolder = self.db[self.movies_label][movie_meta]['alt_title']\ndel self.db[self.movies_label][movie_meta]\nself._update_local_db(filename=self.db_filepath, db=self.db)\ndirname = os.path.join(self.movie_path, folder)\n+ filename = os.path.join(self.movie_path, folder, movie_meta + '.strm')\nif xbmcvfs.exists(dirname):\n- rmtree(dirname)\n+ xbmcvfs.delete(filename)\n+ xbmcvfs.rmdir(dirname)\nreturn True\nreturn False\n@@ -378,12 +369,15 @@ class Library:\nbool\nDelete successfull\n\"\"\"\n- folder = self.db[self.series_label][title]['alt_title']\n+ folder = self.db[self.series_label][title]['alt_title'].encode('utf8')\ndel self.db[self.series_label][title]\nself._update_local_db(filename=self.db_filepath, db=self.db)\nshow_dir = os.path.join(self.tvshow_path, folder)\nif xbmcvfs.exists(show_dir):\n- rmtree(show_dir)\n+ show_files = xbmcvfs.listdir(show_dir)[1]\n+ for filename in show_files:\n+ xbmcvfs.delete(os.path.join(show_dir, filename))\n+ xbmcvfs.rmdir(show_dir)\nreturn True\nreturn False\n@@ -406,7 +400,7 @@ class Library:\nseason = int(season)\nseason_list = []\nepisodes_list = []\n- show_meta = '%s' % (title)\n+ show_meta = ('%s' % (title)).encode('utf8')\nfor season_entry in self.db[self.series_label][show_meta]['seasons']:\nif season_entry != season:\nseason_list.append(season_entry)\n@@ -443,17 +437,14 @@ class Library:\nDelete successfull\n\"\"\"\nepisodes_list = []\n- show_meta = '%s' % (title)\n- episode_meta = 'S%02dE%02d' % (season, episode)\n+ show_meta = ('%s' % (title)).encode('utf8')\n+ episode_meta = ('S%02dE%02d' % (season, episode)).encode('utf8')\nshow_dir = os.path.join(self.tvshow_path, self.db[self.series_label][show_meta]['alt_title'])\n- if xbmcvfs.exists(os.path.join(show_dir, episode_meta.encode('utf8') + '.strm')):\n- xbmcvfs.remove(os.path.join(show_dir, episode_meta.encode('utf8') + '.strm'))\n+ if xbmcvfs.exists(os.path.join(show_dir, episode_meta + '.strm')):\n+ xbmcvfs.delete(os.path.join(show_dir, episode_meta + '.strm'))\nfor episode_entry in self.db[self.series_label][show_meta]['episodes']:\nif episode_meta != episode_entry:\nepisodes_list.append(episode_entry)\nself.db[self.series_label][show_meta]['episodes'] = episodes_list\nself._update_local_db(filename=self.db_filepath, db=self.db)\nreturn True\n-\n-\n-\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix handling of local db / cleanup
106,018
06.09.2017 22:08:26
-7,200
2f473048e3f61ec23cb5843c0cc2dea3a96dd31d
optional changeable export name / fix export name abort
[ { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "@@ -160,3 +160,7 @@ msgstr \"\"\nmsgctxt \"#30035\"\nmsgid \"Inputstream Addon Settings...\"\nmsgstr \"\"\n+\n+msgctxt \"#30036\"\n+msgid \"Always use the original title on export\"\n+msgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -48,6 +48,7 @@ class KodiHelper:\nself.config_path = join(self.base_data_path, 'config')\nself.msl_data_path = xbmc.translatePath('special://profile/addon_data/service.msl').decode('utf-8') + '/'\nself.verb_log = addon.getSetting('logging') == 'true'\n+ self.custom_export_name = addon.getSetting('customexportname')\nself.default_fanart = addon.getAddonInfo('fanart')\nself.library = None\nself.setup_memcache()\n@@ -98,8 +99,12 @@ class KodiHelper:\n:obj:`str`\nTitle to persist\n\"\"\"\n+ if self.custom_export_name != 'true':\ndlg = xbmcgui.Dialog()\n- return dlg.input(heading=self.get_local_string(string_id=30031), defaultt=original_title, type=xbmcgui.INPUT_ALPHANUM)\n+ custom_title = dlg.input(heading=self.get_local_string(string_id=30031), defaultt=original_title, type=xbmcgui.INPUT_ALPHANUM) or original_title\n+ return custom_title\n+ else:\n+ return original_title\ndef show_password_dialog (self):\n\"\"\"Asks the user for its Netflix password\n" }, { "change_type": "MODIFY", "old_path": "resources/settings.xml", "new_path": "resources/settings.xml", "diff": "<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=\"customexportname\" type=\"bool\" label=\"30036\" default=\"false\"/>\n</category>\n<category label=\"30023\">\n<setting id=\"enable_dolby_sound\" type=\"bool\" label=\"30033\" default=\"true\"/>\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
optional changeable export name / fix export name abort
105,980
08.09.2017 00:42:11
-3,600
d629f708eb43faf827640c14c20da0812f620650
NetflixSession: HTML-unescape profile name profile name strings are HTML-escaped, unescape them for display
[ { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -11,6 +11,7 @@ from time import time\nfrom base64 import urlsafe_b64encode\nfrom bs4 import BeautifulSoup, SoupStrainer\nfrom utils import noop, get_user_agent_for_current_platform\n+import HTMLParser\ntry:\nimport cPickle as pickle\nexcept:\n@@ -2210,6 +2211,9 @@ class NetflixSession:\nif self._is_size_key(key=profile_id) == False and type(netflix_page_data['profiles'][profile_id]) == dict and netflix_page_data['profiles'][profile_id].get('avatar', False) != False:\nprofile = {'id': profile_id}\nfor important_field in important_fields:\n+ if important_field == 'profileName':\n+ profile.update({important_field: HTMLParser.HTMLParser().unescape(netflix_page_data['profiles'][profile_id]['summary'][important_field]).encode('utf8')})\n+ else:\nprofile.update({important_field: netflix_page_data['profiles'][profile_id]['summary'][important_field]})\navatar_base = netflix_page_data['nf'].get(netflix_page_data['profiles'][profile_id]['summary']['avatarName'], False);\navatar = 'https://secure.netflix.com/ffe/profiles/avatars_v2/320x320/PICON_029.png' if avatar_base == False else avatar_base['images']['byWidth']['320']['value']\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
NetflixSession: HTML-unescape profile name profile name strings are HTML-escaped, unescape them for display
106,018
07.09.2017 19:15:15
-7,200
20651ef5e06651868146fa4973d52bec151d2587
add fanart image as folder icon
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -376,7 +376,7 @@ class KodiHelper:\nlabel = video_list_ids['user'][video_list_id]['displayName']\nif category == 'netflixOriginals':\nlabel = label.capitalize()\n- li = xbmcgui.ListItem(label=label)\n+ li = xbmcgui.ListItem(label=label, iconImage=self.default_fanart)\nli.setProperty('fanart_image', self.default_fanart)\n# determine action route\naction = actions['default']\n@@ -401,7 +401,7 @@ class KodiHelper:\naction = actions[type]\n# determine if the item should be selected\npreselect_items.append((False, True)[type == self.get_main_menu_selection()])\n- li_rec = xbmcgui.ListItem(label=i18n_ids[type])\n+ li_rec = xbmcgui.ListItem(label=i18n_ids[type], iconImage=self.default_fanart)\nli_rec.setProperty('fanart_image', self.default_fanart)\nurl_rec = build_url({'action': action, 'type': type})\nxbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url_rec, listitem=li_rec, isFolder=True)\n@@ -410,7 +410,7 @@ class KodiHelper:\naction = actions['default']\nif 'search' in actions.keys():\naction = actions[type]\n- li_rec = xbmcgui.ListItem(label=self.get_local_string(30011))\n+ li_rec = xbmcgui.ListItem(label=self.get_local_string(30011), iconImage=self.default_fanart)\nli_rec.setProperty('fanart_image', self.default_fanart)\nurl_rec = build_url({'action': action, 'type': 'search'})\nxbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url_rec, listitem=li_rec, isFolder=True)\n@@ -453,7 +453,7 @@ class KodiHelper:\n\"\"\"\nfor video_list_id in video_list:\nvideo = video_list[video_list_id]\n- li = xbmcgui.ListItem(label=video['title'])\n+ li = xbmcgui.ListItem(label=video['title'], iconImage=self.default_fanart)\n# add some art to the item\nli = self._generate_art_info(entry=video, li=li)\n# add list item info\n@@ -556,7 +556,7 @@ class KodiHelper:\nList could be build\n\"\"\"\nfor video_list_id in video_list_ids:\n- li = xbmcgui.ListItem(video_list_ids[video_list_id]['displayName'])\n+ li = xbmcgui.ListItem(video_list_ids[video_list_id]['displayName'], iconImage=self.default_fanart)\nli.setProperty('fanart_image', self.default_fanart)\nurl = build_url({'action': action, 'video_list_id': video_list_id})\nxbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=li, isFolder=True)\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
add fanart image as folder icon
106,018
07.09.2017 21:45:35
-7,200
6042b37b712a25632ea5c61fca4814fdb965e5e4
return false if search input is empty or aborted
[ { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -110,7 +110,7 @@ class Navigation:\nelif params['action'] == 'user-items' and params['type'] == 'search':\n# if the user requested a search, ask for the term\nterm = self.kodi_helper.show_search_term_dialog()\n- return self.show_search_results(term=term)\n+ return self.show_search_results(term=term) or False\nelse:\nraise ValueError('Invalid paramstring: {0}!'.format(paramstring))\nreturn True\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
return false if search input is empty or aborted
106,018
09.09.2017 11:18:16
-7,200
351b46163beef4690316836c42cd19dc5276c028
make custom views available
[ { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "@@ -164,3 +164,35 @@ msgstr \"\"\nmsgctxt \"#30036\"\nmsgid \"Always use the original title on export\"\nmsgstr \"\"\n+\n+msgctxt \"#30037\"\n+msgid \"Views\"\n+msgstr \"\"\n+\n+msgctxt \"#30038\"\n+msgid \"Enable custom views\"\n+msgstr \"\"\n+\n+msgctxt \"#30039\"\n+msgid \"View for folders\"\n+msgstr \"\"\n+\n+msgctxt \"#30040\"\n+msgid \"View for movies\"\n+msgstr \"\"\n+\n+msgctxt \"#30041\"\n+msgid \"View for shows\"\n+msgstr \"\"\n+\n+msgctxt \"#30042\"\n+msgid \"View for seasons\"\n+msgstr \"\"\n+\n+msgctxt \"#30043\"\n+msgid \"View for episodes\"\n+msgstr \"\"\n+\n+msgctxt \"#30044\"\n+msgid \"View for profiles\"\n+msgstr \"\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "resources/settings.xml", "new_path": "resources/settings.xml", "diff": "<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=\"customexportname\" type=\"bool\" label=\"30036\" default=\"false\"/>\n</category>\n+ <category label=\"30037\">\n+ <setting id=\"customview\" type=\"bool\" label=\"30038\" default=\"false\"/>\n+ <setting id=\"viewmodelogin\" type=\"number\" label=\"30044\" enable=\"eq(-1,true)\" default=\"501\"/>\n+ <setting id=\"viewmodefolder\" type=\"number\" label=\"30039\" enable=\"eq(-2,true)\" default=\"501\"/>\n+ <setting id=\"viewmodemovie\" type=\"number\" label=\"30040\" enable=\"eq(-3,true)\" default=\"504\"/>\n+ <setting id=\"viewmodeshow\" type=\"number\" label=\"30041\" enable=\"eq(-4,true)\" default=\"504\"/>\n+ <setting id=\"viewmodeseason\" type=\"number\" label=\"30042\" enable=\"eq(-5,true)\" default=\"504\"/>\n+ <setting id=\"viewmodeepisode\" type=\"number\" label=\"30043\" enable=\"eq(-6,true)\" default=\"55\"/>\n+ </category>\n<category label=\"30023\">\n<setting id=\"enable_dolby_sound\" type=\"bool\" label=\"30033\" default=\"true\"/>\n<setting id=\"ssl_verification\" type=\"bool\" label=\"30024\" default=\"true\"/>\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
make custom views available
106,027
09.09.2017 18:51:42
-7,200
d3d8ba02b135af22a9e0cc9e7edc539144387eba
show_video_list pagination
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -425,7 +425,7 @@ class KodiHelper:\nxbmc.executebuiltin('ActivateWindowAndFocus(%s, %s)' % (str(xbmcgui.Window(xbmcgui.getCurrentWindowId()).getFocusId()), str(preselected_list_item)))\nreturn True\n- def build_video_listing (self, video_list, actions, type, build_url):\n+ def build_video_listing (self, video_list, actions, type, build_url, has_more=False, start=0, current_video_list_id=\"\"):\n\"\"\"Builds the video lists (my list, continue watching, etc.) contents Kodi screen\nParameters\n@@ -469,6 +469,11 @@ class KodiHelper:\nurl = build_url(params)\nxbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=li, isFolder=isFolder)\n+ if has_more:\n+ li_more = xbmcgui.ListItem(label=\"[COLOR cyan][B]-- NEXT PAGE --[/B][/COLOR]\")\n+ more_url=build_url({\"action\":\"video_list\",\"type\":type,\"start\":str(start),\"video_list_id\":current_video_list_id})\n+ xbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=more_url, listitem=li_more, isFolder=True)\n+\nxbmcplugin.addSortMethod(handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_LABEL)\nxbmcplugin.addSortMethod(handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_TITLE)\nxbmcplugin.addSortMethod(handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_VIDEO_YEAR)\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -16,6 +16,8 @@ try:\nexcept:\nimport pickle\n+FETCH_VIDEO_REQUEST_COUNT = 26\n+\nclass NetflixSession:\n\"\"\"Helps with login/session management of Netflix users & API data fetching\"\"\"\n@@ -1372,7 +1374,7 @@ class NetflixSession:\nresponse = self._path_request(paths=paths)\nreturn self._process_response(response=response, component='Search results')\n- def fetch_video_list (self, list_id, list_from=0, list_to=26):\n+ def fetch_video_list (self, list_id, list_from=0, list_to=FETCH_VIDEO_REQUEST_COUNT):\n\"\"\"Fetches the JSON which contains the contents of a given video list\nParameters\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
show_video_list pagination
106,027
09.09.2017 19:15:56
-7,200
707b413a0e7a35a790fd8ac9375403aed39dcf5d
added unsorted
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -478,6 +478,7 @@ class KodiHelper:\nmore_url=build_url({\"action\":\"video_list\",\"type\":type,\"start\":str(start),\"video_list_id\":current_video_list_id})\nxbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=more_url, listitem=li_more, isFolder=True)\n+ xbmcplugin.addSortMethod(handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_UNSORTED)\nxbmcplugin.addSortMethod(handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_LABEL)\nxbmcplugin.addSortMethod(handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_TITLE)\nxbmcplugin.addSortMethod(handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_VIDEO_YEAR)\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -263,7 +263,7 @@ class Navigation:\nuser_data = self.call_netflix_service({'method': 'get_user_data'})\nfor i in range(0,4):\n- items = self.call_netflix_service({'method': 'fetch_video_list', 'list_id': video_list_id, 'list_from':start, 'list_to':end, 'guid': user_data['guid'] ,'cache': False})\n+ items = self.call_netflix_service({'method': 'fetch_video_list', 'list_id': video_list_id, 'list_from':start, 'list_to':end, 'guid': user_data['guid'] ,'cache': True})\nif self._is_dirty_response(response=items) and i == 0:\nself.kodi_helper.log(\"show_video_list response is dirty\")\nreturn False\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
added unsorted
106,018
10.09.2017 20:51:30
-7,200
2921a26d348fbb9818d883f787548e27486d14ce
make export/remove more failsave by removing special chars
[ { "change_type": "MODIFY", "old_path": "resources/lib/Library.py", "new_path": "resources/lib/Library.py", "diff": "import os\nimport xbmcgui\nimport xbmcvfs\n+import re\nfrom shutil import rmtree\nfrom utils import noop\ntry:\n@@ -155,7 +156,8 @@ class Library:\nbool\nMovie exists in DB\n\"\"\"\n- movie_meta = ('%s (%d)' % (title, year)).encode('utf8')\n+ title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ movie_meta = '%s (%d)' % (title, year)\nreturn movie_meta in self.db[self.movies_label]\ndef show_exists (self, title):\n@@ -171,7 +173,8 @@ class Library:\nbool\nShow exists in DB\n\"\"\"\n- show_meta = ('%s' % (title)).encode('utf8')\n+ title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ show_meta = '%s' % (title)\nreturn show_meta in self.db[self.series_label]\ndef season_exists (self, title, season):\n@@ -190,6 +193,7 @@ class Library:\nbool\nSeason of show exists in DB\n\"\"\"\n+ title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\nif self.show_exists(title) == False:\nreturn False\nshow_entry = self.db[self.series_label][title]\n@@ -214,6 +218,7 @@ class Library:\nbool\nEpisode of show exists in DB\n\"\"\"\n+ title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\nif self.show_exists(title) == False:\nreturn False\nshow_entry = self.db[self.series_label][title]\n@@ -240,9 +245,9 @@ class Library:\nbuild_url : :obj:`fn`\nFunction to generate the stream url\n\"\"\"\n-\n- movie_meta = ('%s (%d)' % (title, year)).encode('utf8')\n- folder = alt_title\n+ title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ movie_meta = '%s (%d)' % (title, year)\n+ folder = re.sub(r'[^a-zA-Z0-9\\s]','',(alt_title.encode('utf-8')))\ndirname = os.path.join(self.movie_path, folder)\nfilename = os.path.join(dirname, movie_meta + '.strm')\nif xbmcvfs.exists(filename):\n@@ -274,8 +279,9 @@ class Library:\nbuild_url : :obj:`fn`\nFunction to generate the stream url\n\"\"\"\n- show_meta = ('%s' % (title)).encode('utf8')\n- folder = alt_title\n+ title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ show_meta = '%s' % (title)\n+ folder = re.sub(r'[^a-zA-Z0-9\\s]','',(alt_title.encode('utf-8')))\nshow_dir = os.path.join(self.tvshow_path, folder)\nif not xbmcvfs.exists(show_dir):\nxbmcvfs.mkdirs(show_dir)\n@@ -311,18 +317,19 @@ class Library:\n\"\"\"\nseason = int(season)\nepisode = int(episode)\n+ title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n# add season\nif self.season_exists(title=title, season=season) == False:\nself.db[self.series_label][title]['seasons'].append(season)\n# add episode\n- episode_meta = ('S%02dE%02d' % (season, episode)).encode('utf8')\n+ episode_meta = 'S%02dE%02d' % (season, episode)\nif self.episode_exists(title=title, season=season, episode=episode) == False:\nself.db[self.series_label][title]['episodes'].append(episode_meta)\n# create strm file\n- filename = (episode_meta + '.strm').encode('utf8')\n+ filename = episode_meta + '.strm'\nfilepath = os.path.join(show_dir, filename)\nif xbmcvfs.exists(filepath):\nreturn\n@@ -344,8 +351,9 @@ class Library:\nbool\nDelete successfull\n\"\"\"\n- movie_meta = ('%s (%d)' % (title, year)).encode('utf8')\n- folder = self.db[self.movies_label][movie_meta]['alt_title']\n+ title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ movie_meta = '%s (%d)' % (title, year)\n+ folder = re.sub(r'[^a-zA-Z0-9\\s]','',self.db[self.movies_label][movie_meta]['alt_title'].encode('utf-8'))\ndel self.db[self.movies_label][movie_meta]\nself._update_local_db(filename=self.db_filepath, db=self.db)\ndirname = os.path.join(self.movie_path, folder)\n@@ -369,7 +377,8 @@ class Library:\nbool\nDelete successfull\n\"\"\"\n- folder = self.db[self.series_label][title]['alt_title'].encode('utf8')\n+ title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ folder = re.sub(r'[^a-zA-Z0-9\\s]','',self.db[self.series_label][title]['alt_title'].encode('utf-8'))\ndel self.db[self.series_label][title]\nself._update_local_db(filename=self.db_filepath, db=self.db)\nshow_dir = os.path.join(self.tvshow_path, folder)\n@@ -397,10 +406,11 @@ class Library:\nbool\nDelete successfull\n\"\"\"\n+ title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\nseason = int(season)\nseason_list = []\nepisodes_list = []\n- show_meta = ('%s' % (title)).encode('utf8')\n+ show_meta = '%s' % (title)\nfor season_entry in self.db[self.series_label][show_meta]['seasons']:\nif season_entry != season:\nseason_list.append(season_entry)\n@@ -436,9 +446,10 @@ class Library:\nbool\nDelete successfull\n\"\"\"\n+ title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\nepisodes_list = []\n- show_meta = ('%s' % (title)).encode('utf8')\n- episode_meta = ('S%02dE%02d' % (season, episode)).encode('utf8')\n+ show_meta = '%s' % (title)\n+ episode_meta = 'S%02dE%02d' % (season, episode)\nshow_dir = os.path.join(self.tvshow_path, self.db[self.series_label][show_meta]['alt_title'])\nif xbmcvfs.exists(os.path.join(show_dir, episode_meta + '.strm')):\nxbmcvfs.delete(os.path.join(show_dir, episode_meta + '.strm'))\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
make export/remove more failsave by removing special chars
106,018
11.09.2017 12:25:55
-7,200
dcf193aae5872da8e054915a07034a9721c18247
Optimize: make export/remove more failsave by removing special chars
[ { "change_type": "MODIFY", "old_path": "resources/lib/Library.py", "new_path": "resources/lib/Library.py", "diff": "@@ -156,7 +156,7 @@ class Library:\nbool\nMovie exists in DB\n\"\"\"\n- title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ title=re.sub(r'[?|$|!|:|#]',r'',title)\nmovie_meta = '%s (%d)' % (title, year)\nreturn movie_meta in self.db[self.movies_label]\n@@ -173,7 +173,7 @@ class Library:\nbool\nShow exists in DB\n\"\"\"\n- title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ title=re.sub(r'[?|$|!|:|#]',r'',title)\nshow_meta = '%s' % (title)\nreturn show_meta in self.db[self.series_label]\n@@ -193,7 +193,7 @@ class Library:\nbool\nSeason of show exists in DB\n\"\"\"\n- title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ title=re.sub(r'[?|$|!|:|#]',r'',title)\nif self.show_exists(title) == False:\nreturn False\nshow_entry = self.db[self.series_label][title]\n@@ -218,7 +218,7 @@ class Library:\nbool\nEpisode of show exists in DB\n\"\"\"\n- title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ title=re.sub(r'[?|$|!|:|#]',r'',title)\nif self.show_exists(title) == False:\nreturn False\nshow_entry = self.db[self.series_label][title]\n@@ -245,9 +245,9 @@ class Library:\nbuild_url : :obj:`fn`\nFunction to generate the stream url\n\"\"\"\n- title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ title=re.sub(r'[?|$|!|:|#]',r'',title)\nmovie_meta = '%s (%d)' % (title, year)\n- folder = re.sub(r'[^a-zA-Z0-9\\s]','',(alt_title.encode('utf-8')))\n+ folder = re.sub(r'[?|$|!|:|#]',r'',alt_title)\ndirname = os.path.join(self.movie_path, folder)\nfilename = os.path.join(dirname, movie_meta + '.strm')\nif xbmcvfs.exists(filename):\n@@ -279,9 +279,9 @@ class Library:\nbuild_url : :obj:`fn`\nFunction to generate the stream url\n\"\"\"\n- title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ title=re.sub(r'[?|$|!|:|#]',r'',title)\nshow_meta = '%s' % (title)\n- folder = re.sub(r'[^a-zA-Z0-9\\s]','',(alt_title.encode('utf-8')))\n+ folder = re.sub(r'[?|$|!|:|#]',r'',alt_title.encode('utf-8'))\nshow_dir = os.path.join(self.tvshow_path, folder)\nif not xbmcvfs.exists(show_dir):\nxbmcvfs.mkdirs(show_dir)\n@@ -317,7 +317,7 @@ class Library:\n\"\"\"\nseason = int(season)\nepisode = int(episode)\n- title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ title=re.sub(r'[?|$|!|:|#]',r'',title)\n# add season\nif self.season_exists(title=title, season=season) == False:\n@@ -351,9 +351,9 @@ class Library:\nbool\nDelete successfull\n\"\"\"\n- title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ title=re.sub(r'[?|$|!|:|#]',r'',title)\nmovie_meta = '%s (%d)' % (title, year)\n- folder = re.sub(r'[^a-zA-Z0-9\\s]','',self.db[self.movies_label][movie_meta]['alt_title'].encode('utf-8'))\n+ folder = re.sub(r'[?|$|!|:|#]',r'',self.db[self.movies_label][movie_meta]['alt_title'])\ndel self.db[self.movies_label][movie_meta]\nself._update_local_db(filename=self.db_filepath, db=self.db)\ndirname = os.path.join(self.movie_path, folder)\n@@ -377,8 +377,8 @@ class Library:\nbool\nDelete successfull\n\"\"\"\n- title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n- folder = re.sub(r'[^a-zA-Z0-9\\s]','',self.db[self.series_label][title]['alt_title'].encode('utf-8'))\n+ title=re.sub(r'[?|$|!|:|#]',r'',title)\n+ folder = re.sub(r'[?|$|!|:|#]',r'',self.db[self.series_label][title]['alt_title'].encode('utf-8'))\ndel self.db[self.series_label][title]\nself._update_local_db(filename=self.db_filepath, db=self.db)\nshow_dir = os.path.join(self.tvshow_path, folder)\n@@ -406,7 +406,7 @@ class Library:\nbool\nDelete successfull\n\"\"\"\n- title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ title=re.sub(r'[?|$|!|:|#]',r'',title.encode('utf-8'))\nseason = int(season)\nseason_list = []\nepisodes_list = []\n@@ -446,7 +446,7 @@ class Library:\nbool\nDelete successfull\n\"\"\"\n- title=re.sub(r'[^a-zA-Z0-9\\s]','',title.encode('utf-8'))\n+ title=re.sub(r'[?|$|!|:|#]',r'',title.encode('utf-8'))\nepisodes_list = []\nshow_meta = '%s' % (title)\nepisode_meta = 'S%02dE%02d' % (season, episode)\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Optimize: make export/remove more failsave by removing special chars
106,027
11.09.2017 13:11:39
-7,200
662f18eb1cdbbb8422c475db70311f050e7d95c8
i18n for pagination
[ { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "@@ -164,3 +164,7 @@ msgstr \"\"\nmsgctxt \"#30036\"\nmsgid \"Always use the original title on export\"\nmsgstr \"\"\n+\n+msgctxt \"#30045\"\n+msgid \"[COLOR cyan][B]-- NEXT PAGE --[/B][/COLOR]\"\n+msgstr \"\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -474,7 +474,7 @@ class KodiHelper:\nxbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=li, isFolder=isFolder)\nif has_more:\n- li_more = xbmcgui.ListItem(label=\"[COLOR cyan][B]-- NEXT PAGE --[/B][/COLOR]\")\n+ li_more = xbmcgui.ListItem(label=self.get_local_string(30045))\nmore_url=build_url({\"action\":\"video_list\",\"type\":type,\"start\":str(start),\"video_list_id\":current_video_list_id})\nxbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=more_url, listitem=li_more, isFolder=True)\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
i18n for pagination
106,018
12.09.2017 16:40:33
-7,200
f67a89276722d92f4bb0b2f893add2cdb69f26f7
add progress dialog for export/remove
[ { "change_type": "MODIFY", "old_path": "resources/lib/Library.py", "new_path": "resources/lib/Library.py", "diff": "@@ -7,13 +7,17 @@ import os\nimport xbmcgui\nimport xbmcvfs\nimport re\n+import time\nfrom shutil import rmtree\nfrom utils import noop\n+from resources.lib.KodiHelper import KodiHelper\ntry:\nimport cPickle as pickle\nexcept:\nimport pickle\n+kodi_helper = KodiHelper()\n+\nclass Library:\n\"\"\"Exports Netflix shows & movies to a local library folder\"\"\"\n@@ -250,14 +254,21 @@ class Library:\nfolder = re.sub(r'[?|$|!|:|#]',r'',alt_title)\ndirname = os.path.join(self.movie_path, folder)\nfilename = os.path.join(dirname, movie_meta + '.strm')\n+ progress=xbmcgui.DialogProgress()\n+ progress.create(kodi_helper.get_local_string(650),movie_meta)\nif xbmcvfs.exists(filename):\nreturn\nif not xbmcvfs.exists(dirname):\nxbmcvfs.mkdirs(dirname)\nif self.movie_exists(title=title, year=year) == False:\n+ progress.update(50)\n+ time.sleep(0.5)\nself.db[self.movies_label][movie_meta] = {'alt_title': alt_title}\nself._update_local_db(filename=self.db_filepath, db=self.db)\nself.write_strm_file(path=filename, url=build_url({'action': 'play_video', 'video_id': video_id}))\n+ progress.update(100)\n+ time.sleep(1)\n+ progress.close()\ndef add_show (self, title, alt_title, episodes, build_url):\n\"\"\"Adds a show to the local db, generates & persists the strm files\n@@ -283,13 +294,24 @@ class Library:\nshow_meta = '%s' % (title)\nfolder = re.sub(r'[?|$|!|:|#]',r'',alt_title.encode('utf-8'))\nshow_dir = os.path.join(self.tvshow_path, folder)\n+ progress=xbmcgui.DialogProgress()\n+ progress.create(kodi_helper.get_local_string(650),show_meta)\n+ count = 1\nif not xbmcvfs.exists(show_dir):\nxbmcvfs.mkdirs(show_dir)\nif self.show_exists(title) == False:\nself.db[self.series_label][show_meta] = {'seasons': [], 'episodes': [], 'alt_title': alt_title}\n+ episode_count_total = len(episodes)\n+ step=round(100.0/episode_count_total,1)\n+ percent=step\nfor episode in episodes:\n+ progress.update(int(percent), show_meta, kodi_helper.get_local_string(20373)+\": \"+str(episode['season']), kodi_helper.get_local_string(20359)+\": \"+str(episode['episode']))\nself._add_episode(show_dir=show_dir, title=title, season=episode['season'], episode=episode['episode'], video_id=episode['id'], build_url=build_url)\n+ percent=percent+step\n+ time.sleep(0.05)\nself._update_local_db(filename=self.db_filepath, db=self.db)\n+ time.sleep(1)\n+ progress.close()\nreturn show_dir\ndef _add_episode (self, title, show_dir, season, episode, video_id, build_url):\n@@ -354,6 +376,10 @@ class Library:\ntitle=re.sub(r'[?|$|!|:|#]',r'',title)\nmovie_meta = '%s (%d)' % (title, year)\nfolder = re.sub(r'[?|$|!|:|#]',r'',self.db[self.movies_label][movie_meta]['alt_title'])\n+ progress=xbmcgui.DialogProgress()\n+ progress.create(kodi_helper.get_local_string(1210),movie_meta)\n+ progress.update(50)\n+ time.sleep(0.5)\ndel self.db[self.movies_label][movie_meta]\nself._update_local_db(filename=self.db_filepath, db=self.db)\ndirname = os.path.join(self.movie_path, folder)\n@@ -363,6 +389,8 @@ class Library:\nxbmcvfs.rmdir(dirname)\nreturn True\nreturn False\n+ time.sleep(1)\n+ progress.close()\ndef remove_show (self, title):\n\"\"\"Removes the DB entry & the strm files for the show given\n@@ -379,16 +407,27 @@ class Library:\n\"\"\"\ntitle=re.sub(r'[?|$|!|:|#]',r'',title)\nfolder = re.sub(r'[?|$|!|:|#]',r'',self.db[self.series_label][title]['alt_title'].encode('utf-8'))\n+ progress=xbmcgui.DialogProgress()\n+ progress.create(kodi_helper.get_local_string(1210),title)\n+ time.sleep(0.5)\ndel self.db[self.series_label][title]\nself._update_local_db(filename=self.db_filepath, db=self.db)\nshow_dir = os.path.join(self.tvshow_path, folder)\nif xbmcvfs.exists(show_dir):\nshow_files = xbmcvfs.listdir(show_dir)[1]\n+ episode_count_total = len(show_files)\n+ step=round(100.0/episode_count_total,1)\n+ percent=100-step\nfor filename in show_files:\n+ progress.update(int(percent))\nxbmcvfs.delete(os.path.join(show_dir, filename))\n+ percent=percent-step\n+ time.sleep(0.05)\nxbmcvfs.rmdir(show_dir)\nreturn True\nreturn False\n+ time.sleep(1)\n+ progress.close()\ndef remove_season (self, title, season):\n\"\"\"Removes the DB entry & the strm files for a season of a show given\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
add progress dialog for export/remove
106,015
12.09.2017 17:07:03
25,200
1d1d657635ca516eb1766fb7ba0572567baee414
Add more specific warning when the InputStream addon is disabled
[ { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "@@ -200,3 +200,7 @@ msgstr \"\"\nmsgctxt \"#30045\"\nmsgid \"[COLOR cyan][B]-- NEXT PAGE --[/B][/COLOR]\"\nmsgstr \"\"\n+\n+msgctxt \"#30046\"\n+msgid \"Inputstream addon is not enabled\"\n+msgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -158,6 +158,18 @@ class KodiHelper:\ndialog.notification(self.get_local_string(string_id=30028), self.get_local_string(string_id=30029), xbmcgui.NOTIFICATION_ERROR, 5000)\nreturn True\n+ def show_disabled_inputstream_addon_notification (self):\n+ \"\"\"Shows notification that the inputstream addon isn't enabled.\n+ Returns\n+ -------\n+ bool\n+ Dialog shown\n+ \"\"\"\n+ dialog = xbmcgui.Dialog()\n+ dialog.notification(self.get_local_string(string_id=30028), self.get_local_string(string_id=30046), xbmcgui.NOTIFICATION_ERROR, 5000)\n+ return True\n+\n+\ndef show_no_search_results_notification (self):\n\"\"\"Shows notification that no search results could be found\n@@ -698,11 +710,15 @@ class KodiHelper:\n\"\"\"\nself.set_esn(esn)\naddon = self.get_addon()\n- inputstream_addon = self.get_inputstream_addon()\n+ (inputstream_addon, inputstream_enabled) = self.get_inputstream_addon()\nif inputstream_addon == None:\nself.show_missing_inputstream_addon_notification()\nself.log(msg='Inputstream addon not found')\nreturn False\n+ if not inputstream_enabled:\n+ self.show_disabled_inputstream_addon_notification()\n+ self.log(msg='Inputstream addon not enabled')\n+ return False\n# track play event\nself.track_event('playVideo')\n@@ -946,12 +962,13 @@ class KodiHelper:\ndef get_inputstream_addon (self):\n\"\"\"Checks if the inputstream addon is installed & enabled.\n- Returns the type of the inputstream addon used or None if not found\n+ Returns the type of the inputstream addon used and if it's enabled,\n+ or None if not found.\nReturns\n-------\n- :obj:`str` or None\n- Inputstream addon or None\n+ :obj:`tuple` of obj:`str` and bool, or None\n+ Inputstream addon and if it's enabled, or None\n\"\"\"\ntype = 'inputstream.adaptive'\npayload = {\n@@ -966,8 +983,7 @@ class KodiHelper:\nresponse = xbmc.executeJSONRPC(json.dumps(payload))\ndata = json.loads(response)\nif not 'error' in data.keys():\n- if data['result']['addon']['enabled'] == True:\n- return type\n+ return (type, data['result']['addon']['enabled'])\nreturn None\ndef set_library (self, library):\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -592,6 +592,6 @@ class Navigation:\ndef open_settings(self, url):\n\"\"\"Opens a foreign settings dialog\"\"\"\n- is_addon = self.kodi_helper.get_inputstream_addon()\n+ (is_addon, _) = self.kodi_helper.get_inputstream_addon()\nurl = is_addon if url == 'is' else url\nreturn Addon(url).openSettings()\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Add more specific warning when the InputStream addon is disabled
106,018
13.09.2017 23:06:06
-7,200
4f321e819080eb784a72bf6bdabfeafa9cdf74c1
fix: set viewmode
[ { "change_type": "MODIFY", "old_path": "resources/settings.xml", "new_path": "resources/settings.xml", "diff": "</category>\n<category label=\"30037\">\n<setting id=\"customview\" type=\"bool\" label=\"30038\" default=\"false\"/>\n- <setting id=\"viewmodelogin\" type=\"number\" label=\"30044\" enable=\"eq(-1,true)\" default=\"501\"/>\n+ <setting id=\"viewmodelogin\" type=\"number\" label=\"30044\" enable=\"eq(-1,true)\" default=\"501\" visible=\"false\"/>\n<setting id=\"viewmodefolder\" type=\"number\" label=\"30039\" enable=\"eq(-2,true)\" default=\"501\"/>\n<setting id=\"viewmodemovie\" type=\"number\" label=\"30040\" enable=\"eq(-3,true)\" default=\"504\"/>\n<setting id=\"viewmodeshow\" type=\"number\" label=\"30041\" enable=\"eq(-4,true)\" default=\"504\"/>\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix: set viewmode
106,018
20.09.2017 05:17:34
-7,200
edb0e17afc08f1372daa6b5f92bcb19a9ad3172c
fix no search result message
[ { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -161,7 +161,8 @@ class Navigation:\nuser_data = self.call_netflix_service({'method': 'get_user_data'})\nsearch_contents = self.call_netflix_service({'method': 'search', 'term': term, 'guid': user_data['guid'], 'cache': True})\n# check for any errors\n- if self._is_dirty_response(response=search_contents):\n+ if self._is_dirty_response(response=search_contents) or len(search_contents) == 0:\n+ self.kodi_helper.show_no_search_results_notification()\nreturn False\nactions = {'movie': 'play_video', 'show': 'season_list'}\nreturn self.kodi_helper.build_search_result_listing(video_list=search_contents, actions=actions, build_url=self.build_url)\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix no search result message
106,018
20.09.2017 21:45:51
-7,200
844c357d69e0511d30666280e988b84e565ce063
add exported folder and function updatedb from exported content
[ { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "@@ -204,3 +204,19 @@ msgstr \"\"\nmsgctxt \"#30046\"\nmsgid \"Inputstream addon is not enabled\"\nmsgstr \"\"\n+\n+msgctxt \"#30047\"\n+msgid \"Finally remove?\"\n+msgstr \"\"\n+\n+msgctxt \"#30048\"\n+msgid \"Exported\"\n+msgstr \"\"\n+\n+msgctxt \"#30049\"\n+msgid \"Update DB\"\n+msgstr \"\"\n+\n+msgctxt \"#30050\"\n+msgid \"Update successful\"\n+msgstr \"\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -55,6 +55,7 @@ class KodiHelper:\nself.msl_data_path = xbmc.translatePath('special://profile/addon_data/service.msl').decode('utf-8') + '/'\nself.verb_log = addon.getSetting('logging') == 'true'\nself.custom_export_name = addon.getSetting('customexportname')\n+ self.show_update_db = addon.getSetting('show_update_db')\nself.default_fanart = addon.getAddonInfo('fanart')\nself.library = None\nself.setup_memcache()\n@@ -193,6 +194,31 @@ class KodiHelper:\ndialog.notification(self.get_local_string(string_id=30010), self.get_local_string(string_id=30012))\nreturn True\n+ def show_finally_remove (self, title, type, year):\n+ \"\"\"Ask user for yes / no\n+\n+ Returns\n+ -------\n+ bool\n+ Answer yes/no\n+ \"\"\"\n+ dialog = xbmcgui.Dialog()\n+ if year == '0000':\n+ return dialog.yesno(self.get_local_string(string_id=30047),title)\n+ return dialog.yesno(self.get_local_string(string_id=30047),title+' ('+str(year)+')')\n+\n+ def show_local_db_updated (self):\n+ \"\"\"Shows notification that local db was updated\n+\n+ Returns\n+ -------\n+ bool\n+ Dialog shown\n+ \"\"\"\n+ dialog = xbmcgui.Dialog()\n+ dialog.notification(self.get_local_string(string_id=15101), self.get_local_string(string_id=30050))\n+ return True\n+\ndef set_setting (self, key, value):\n\"\"\"Public interface for the addons setSetting method\n@@ -449,6 +475,22 @@ class KodiHelper:\nurl_rec = build_url({'action': action, 'type': 'search'})\nxbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url_rec, listitem=li_rec, isFolder=True)\n+ # add exported as subfolder\n+ action = actions['default']\n+ if 'exported' in actions.keys():\n+ action = actions[type]\n+ li_rec = xbmcgui.ListItem(label=self.get_local_string(30048), iconImage=self.default_fanart)\n+ li_rec.setProperty('fanart_image', self.default_fanart)\n+ url_rec = build_url({'action': action, 'type': 'exported'})\n+ xbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url_rec, listitem=li_rec, isFolder=True)\n+\n+ if self.show_update_db == 'true':\n+ # add updatedb as subfolder\n+ li_rec = xbmcgui.ListItem(label=self.get_local_string(30049), iconImage=self.default_fanart)\n+ li_rec.setProperty('fanart_image', self.default_fanart)\n+ url_rec = build_url({'action': 'updatedb'})\n+ xbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url_rec, listitem=li_rec, isFolder=True)\n+\n# no srting & close\nxbmcplugin.addSortMethod(handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_UNSORTED)\nxbmcplugin.endOfDirectory(self.plugin_handle)\n@@ -526,6 +568,42 @@ class KodiHelper:\nself.set_custom_view(view)\nreturn True\n+ def build_video_listing_exported (self, content, build_url):\n+ \"\"\"Build list of exported movies / shows\n+\n+ Parameters\n+ ----------\n+ content : :obj:`dict` of :obj:`str`\n+ List of video lists\n+\n+ Returns\n+ -------\n+ bool\n+ List could be build\n+ \"\"\"\n+ action = ['remove_from_library', self.get_local_string(30030), 'remove']\n+ listing = content\n+ for video in listing[0]:\n+ li = xbmcgui.ListItem(label=str(video)+' ('+str(self.library.get_exported_movie_year (title=video))+')', iconImage=self.default_fanart)\n+ li.setProperty('fanart_image', self.default_fanart)\n+ isFolder = False\n+ year = self.library.get_exported_movie_year (title=video)\n+ url = build_url({'action': 'removeexported', 'title': str(video), 'year': str(year), 'type': 'movie'})\n+ xbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=li, isFolder=isFolder)\n+ for video in listing[2]:\n+ li = xbmcgui.ListItem(label=str(video), iconImage=self.default_fanart)\n+ li.setProperty('fanart_image', self.default_fanart)\n+ isFolder = False\n+ year = '0000'\n+ url = build_url({'action': 'removeexported', 'title': str(video), 'year': str(year), 'type': 'show'})\n+ xbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=li, isFolder=isFolder)\n+\n+ xbmcplugin.addSortMethod(handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_UNSORTED)\n+ xbmcplugin.addSortMethod(handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_TITLE)\n+ xbmcplugin.endOfDirectory(self.plugin_handle)\n+ self.set_custom_view(VIEW_FOLDER)\n+ return True\n+\ndef build_search_result_listing (self, video_list, actions, build_url):\n\"\"\"Builds the search results list Kodi screen\n@@ -1014,4 +1092,3 @@ class KodiHelper:\n# Send the tracking event\ntracker = Tracker.create('UA-46081640-5', client_id=tracking_id)\ntracker.send('event', event)\n-\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/Library.py", "new_path": "resources/lib/Library.py", "diff": "@@ -498,3 +498,73 @@ class Library:\nself.db[self.series_label][show_meta]['episodes'] = episodes_list\nself._update_local_db(filename=self.db_filepath, db=self.db)\nreturn True\n+\n+ def list_exported_media (self):\n+ \"\"\"Return List of exported movies\n+\n+ Returns\n+ -------\n+ obj:`dict`\n+ Contents of export folder\n+ \"\"\"\n+\n+ if xbmcvfs.exists(self.movie_path):\n+ movies = xbmcvfs.listdir(self.movie_path)\n+ if xbmcvfs.exists(self.tvshow_path):\n+ shows = xbmcvfs.listdir(self.tvshow_path)\n+ return movies+shows\n+\n+ def get_exported_movie_year (self, title):\n+ \"\"\"Return year of given exported movie\n+\n+ Returns\n+ -------\n+ obj:`int`\n+ year of given movie\n+ \"\"\"\n+ folder = os.path.join(self.movie_path, title)\n+ if xbmcvfs.exists(folder):\n+ file = xbmcvfs.listdir(folder)\n+ year = str(file[1]).split(\"(\",1)[1].split(\")\",1)[0]\n+ return int(year)\n+\n+ def updatedb_from_exported (self):\n+ \"\"\"Adds movies and shows from exported media to the local db\n+\n+ Returns\n+ -------\n+ bool\n+ Process finished\n+ \"\"\"\n+ if xbmcvfs.exists(self.movie_path):\n+ movies = xbmcvfs.listdir(self.movie_path)\n+ for video in movies[0]:\n+ folder = os.path.join(self.movie_path, video)\n+ file = xbmcvfs.listdir(folder)\n+ year = int(str(file[1]).split(\"(\",1)[1].split(\")\",1)[0])\n+ alt_title = unicode(video.decode('utf-8'))\n+ title = unicode(video.decode('utf-8'))\n+ movie_meta = '%s (%d)' % (title, year)\n+ if self.movie_exists(title=title, year=year) == False:\n+ self.db[self.movies_label][movie_meta] = {'alt_title': alt_title}\n+ self._update_local_db(filename=self.db_filepath, db=self.db)\n+\n+ if xbmcvfs.exists(self.tvshow_path):\n+ shows = xbmcvfs.listdir(self.tvshow_path)\n+ for video in shows[0]:\n+ show_dir = os.path.join(self.tvshow_path, video)\n+ title = unicode(video.decode('utf-8'))\n+ alt_title = unicode(video.decode('utf-8'))\n+ show_meta = '%s' % (title)\n+ if self.show_exists(title) == False:\n+ self.db[self.series_label][show_meta] = {'seasons': [], 'episodes': [], 'alt_title': alt_title}\n+ episodes = xbmcvfs.listdir(show_dir)\n+ for episode in episodes[1]:\n+ file=str(episode).split(\".\")[0]\n+ season=int(str(file).split(\"S\")[1].split(\"E\")[0])\n+ episode=int(str(file).split(\"E\")[1])\n+ episode_meta = 'S%02dE%02d' % (season, episode)\n+ if self.episode_exists(title=title, season=season, episode=episode) == False:\n+ self.db[self.series_label][title]['episodes'].append(episode_meta)\n+ self._update_local_db(filename=self.db_filepath, db=self.db)\n+ return True\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -106,7 +106,21 @@ class Navigation:\nelif params['action'] == 'remove':\n# adds a title to the users list on Netflix\nreturn self.remove_from_library(video_id=params['id'])\n- elif params['action'] == 'user-items' and params['type'] != 'search':\n+ elif params['action'] == 'removeexported':\n+ # adds a title to the users list on Netflix\n+ term = self.kodi_helper.show_finally_remove(title=params['title'], type=params['type'], year=params['year'])\n+ if params['type'] == 'movie' and str(term) == '1':\n+ self.library.remove_movie(title=params['title'].decode('utf-8'), year=int(params['year']))\n+ if params['type'] == 'show' and str(term) == '1':\n+ self.library.remove_show(title=params['title'].decode('utf-8'))\n+ self.kodi_helper.refresh()\n+ return True\n+ elif params['action'] == 'updatedb':\n+ # adds a title to the users list on Netflix\n+ self.library.updatedb_from_exported()\n+ self.kodi_helper.show_local_db_updated()\n+ return True\n+ elif params['action'] == 'user-items' and params['type'] != 'search' and params['type'] != 'exported':\n# display the lists (recommendations, genres, etc.)\nreturn self.show_user_list(type=params['type'])\nelif params['action'] == 'play_video':\n@@ -115,6 +129,11 @@ class Navigation:\n# if the user requested a search, ask for the term\nterm = self.kodi_helper.show_search_term_dialog()\nreturn self.show_search_results(term=term) or False\n+ elif params['action'] == 'user-items' and params['type'] == 'exported':\n+ # update local db from exported media\n+ self.library.updatedb_from_exported()\n+ # list exported movies/shows\n+ return self.kodi_helper.build_video_listing_exported(content=self.library.list_exported_media(),build_url=self.build_url)\nelse:\nraise ValueError('Invalid paramstring: {0}!'.format(paramstring))\nxbmc.executebuiltin('Container.Refresh')\n@@ -291,7 +310,7 @@ class Navigation:\n# defines an order for the user list, as Netflix changes the order at every request\nuser_list_order = ['queue', 'continueWatching', 'topTen', 'netflixOriginals', 'trendingNow', 'newRelease', 'popularTitles']\n# define where to route the user\n- actions = {'recommendations': 'user-items', 'genres': 'user-items', 'search': 'user-items', 'default': 'video_list'}\n+ actions = {'recommendations': 'user-items', 'genres': 'user-items', 'search': 'user-items', 'exported': 'user-items', 'default': 'video_list'}\nreturn self.kodi_helper.build_main_menu_listing(video_list_ids=video_list_ids, user_list_order=user_list_order, actions=actions, build_url=self.build_url)\n@log\n" }, { "change_type": "MODIFY", "old_path": "resources/settings.xml", "new_path": "resources/settings.xml", "diff": "<setting id=\"tracking_id\" value=\"\" visible=\"false\"/>\n<setting id=\"msl_service_port\" value=\"8000\" visible=\"false\"/>\n<setting id=\"netflix_service_port\" value=\"8001\" visible=\"false\"/>\n+ <setting id=\"show_update_db\" type=\"bool\" default=\"false\" visible=\"false\"/>\n</category>\n</settings>\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
add exported folder and function updatedb from exported content
106,018
20.09.2017 21:54:22
-7,200
69352a5eebd56ea4246b1b047afb4b907362d03e
Enable metacaching
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -746,6 +746,11 @@ class KodiHelper:\n# set infoLabels\nif len(infoLabels) > 0:\nplay_item.setInfo('video', infoLabels)\n+ if len(infoLabels) == 0:\n+ infoLabels = self.library.read_metadata_file(video_id=video_id)\n+ art = self.library.read_artdata_file(video_id=video_id)\n+ play_item.setArt(art)\n+ play_item.setInfo('video', infoLabels)\nreturn xbmcplugin.setResolvedUrl(self.plugin_handle, True, listitem=play_item)\ndef _generate_art_info (self, entry, li):\n@@ -765,6 +770,14 @@ class KodiHelper:\nKodi list item instance\n\"\"\"\nart = {'fanart': self.default_fanart}\n+ #Cleanup art\n+ art.update({\n+ 'landscape': '',\n+ 'thumb': '',\n+ 'fanart': '',\n+ 'poster': ''\n+ })\n+\nif 'boxarts' in dict(entry).keys():\nart.update({\n'poster': entry['boxarts']['big'],\n@@ -784,6 +797,7 @@ class KodiHelper:\nif 'poster' in dict(entry).keys():\nart.update({'poster': entry['poster']})\nli.setArt(art)\n+ self.library.write_artdata_file(video_id=str(entry['id']), content=art)\nreturn li\ndef _generate_entry_info (self, entry, li, base_info={}):\n@@ -807,6 +821,26 @@ class KodiHelper:\n\"\"\"\ninfos = base_info\nentry_keys = entry.keys()\n+ # Cleanup item info\n+ infos.update({\n+ 'writer': '',\n+ 'director': '',\n+ 'genre': '',\n+ 'mpaa': '',\n+ 'rating': '',\n+ 'plot': '',\n+ 'plot': '',\n+ 'duration': '',\n+ 'season': '',\n+ 'title': '',\n+ 'tvshowtitle': '',\n+ 'mediatype': '',\n+ 'playcount': '',\n+ 'episode': '',\n+ 'year': '',\n+ 'tvshowtitle': ''\n+ })\n+\nif 'cast' in entry_keys and len(entry['cast']) > 0:\ninfos.update({'cast': entry['cast']})\nif 'creators' in entry_keys and len(entry['creators']) > 0:\n@@ -865,6 +899,7 @@ class KodiHelper:\nif 'tvshowtitle' in entry_keys:\ninfos.update({'tvshowtitle': base64.urlsafe_b64decode(entry.get('tvshowtitle', '')).decode('utf-8')})\nli.setInfo('video', infos)\n+ self.library.write_metadata_file(video_id=str(entry['id']), content=infos)\nreturn li, infos\ndef _generate_context_menu_items (self, entry, li):\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/Library.py", "new_path": "resources/lib/Library.py", "diff": "@@ -27,6 +27,9 @@ class Library:\nmovies_label = 'movies'\n\"\"\"str: Label to identify movies\"\"\"\n+ metadata_label = 'metadata'\n+ \"\"\"str: Label to identify metadata\"\"\"\n+\ndb_filename = 'lib.ndb'\n\"\"\"str: (File)Name of the store for the database dump that contains all shows/movies added to the library\"\"\"\n@@ -57,11 +60,13 @@ class Library:\nlib_path = self.base_data_path if self.enable_custom_library_folder != 'true' else self.custom_library_folder\nself.movie_path = os.path.join(lib_path, self.movies_label)\nself.tvshow_path = os.path.join(lib_path, self.series_label)\n+ self.metadata_path = os.path.join(lib_path, self.metadata_label)\n# check if we need to setup the base folder structure & do so if needed\nself.setup_local_netflix_library(source={\nself.movies_label: self.movie_path,\n- self.series_label: self.tvshow_path\n+ self.series_label: self.tvshow_path,\n+ self.metadata_label: self.metadata_path\n})\n# load the local db\n@@ -79,7 +84,7 @@ class Library:\nif not xbmcvfs.exists(source[label]):\nxbmcvfs.mkdir(source[label])\n- def write_strm_file(self, path, url):\n+ def write_strm_file(self, path, url, title_player):\n\"\"\"Writes the stream file that Kodi can use to integrate it into the DB\nParameters\n@@ -89,11 +94,90 @@ class Library:\nurl : :obj:`str`\nStream url\n+\n+ title_player : :obj:`str`\n+ Video fallback title for m3u\n+\n\"\"\"\nf = xbmcvfs.File(path, 'w')\n+ f.write('#EXTINF:-1,'+title_player.encode('utf-8')+'\\n')\nf.write(url)\nf.close()\n+ def write_metadata_file(self, video_id, content):\n+ \"\"\"Writes the metadata file that caches grabbed content from netflix\n+\n+ Parameters\n+ ----------\n+ video_id : :obj:`str`\n+ ID of video\n+\n+ content :\n+ Unchanged metadata from netflix\n+ \"\"\"\n+ meta_file = os.path.join(self.metadata_path, video_id+'.meta')\n+ if not xbmcvfs.exists(meta_file):\n+ f = xbmcvfs.File(meta_file, 'wb')\n+ pickle.dump(content,f)\n+ f.close()\n+\n+ def read_metadata_file(self, video_id):\n+ \"\"\"Reads the metadata file that caches grabbed content from netflix\n+\n+ Parameters\n+ ----------\n+ video_id : :obj:`str`\n+ ID of video\n+\n+ content :\n+ Unchanged metadata from cache file\n+ \"\"\"\n+ meta_file = os.path.join(self.metadata_path, str(video_id)+'.meta')\n+ if xbmcvfs.exists(meta_file):\n+ f = xbmcvfs.File(meta_file, 'rb')\n+ content = f.read()\n+ f.close()\n+ meta_data = pickle.loads(content)\n+ return meta_data\n+ return\n+\n+ def read_artdata_file(self, video_id):\n+ \"\"\"Reads the artdata file that caches grabbed content from netflix\n+\n+ Parameters\n+ ----------\n+ video_id : :obj:`str`\n+ ID of video\n+\n+ content :\n+ Unchanged artdata from cache file\n+ \"\"\"\n+ meta_file = os.path.join(self.metadata_path, str(video_id)+'.art')\n+ if xbmcvfs.exists(meta_file):\n+ f = xbmcvfs.File(meta_file, 'rb')\n+ content = f.read()\n+ f.close()\n+ meta_data = pickle.loads(content)\n+ return meta_data\n+ return\n+\n+ def write_artdata_file(self, video_id, content):\n+ \"\"\"Writes the art data file that caches grabbed content from netflix\n+\n+ Parameters\n+ ----------\n+ video_id : :obj:`str`\n+ ID of video\n+\n+ content :\n+ Unchanged artdata from netflix\n+ \"\"\"\n+ meta_file = os.path.join(self.metadata_path, video_id+'.art')\n+ if not xbmcvfs.exists(meta_file):\n+ f = xbmcvfs.File(meta_file, 'wb')\n+ pickle.dump(content,f)\n+ f.close()\n+\ndef _load_local_db (self, filename):\n\"\"\"Loads the local db file and parses it, creates one if not existent\n@@ -265,7 +349,7 @@ class Library:\ntime.sleep(0.5)\nself.db[self.movies_label][movie_meta] = {'alt_title': alt_title}\nself._update_local_db(filename=self.db_filepath, db=self.db)\n- self.write_strm_file(path=filename, url=build_url({'action': 'play_video', 'video_id': video_id}))\n+ self.write_strm_file(path=filename, url=build_url({'action': 'play_video', 'video_id': video_id}), title_player=movie_meta)\nprogress.update(100)\ntime.sleep(1)\nprogress.close()\n@@ -355,7 +439,7 @@ class Library:\nfilepath = os.path.join(show_dir, filename)\nif xbmcvfs.exists(filepath):\nreturn\n- self.write_strm_file(path=filepath, url=build_url({'action': 'play_video', 'video_id': video_id}))\n+ self.write_strm_file(path=filepath, url=build_url({'action': 'play_video', 'video_id': video_id}),title_player=title+' - '+episode_meta)\ndef remove_movie (self, title, year):\n\"\"\"Removes the DB entry & the strm file for the movie given\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Enable metacaching
106,018
21.09.2017 08:59:38
-7,200
dcd0f2a70baa48ea76558a8332600f5cb010889d
only refresh if an action was done
[ { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -111,6 +111,7 @@ class Navigation:\nterm = self.kodi_helper.show_finally_remove(title=params['title'], type=params['type'], year=params['year'])\nif params['type'] == 'movie' and str(term) == '1':\nself.library.remove_movie(title=params['title'].decode('utf-8'), year=int(params['year']))\n+ self.kodi_helper.refresh()\nif params['type'] == 'show' and str(term) == '1':\nself.library.remove_show(title=params['title'].decode('utf-8'))\nself.kodi_helper.refresh()\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
only refresh if an action was done
106,035
15.09.2017 15:31:56
18,000
f00276ef9345088c8031e638ccec19435bc86b2e
fix service issues: crashing on network error session clearing on logoff logged-in detection
[ { "change_type": "MODIFY", "old_path": "resources/lib/MSL.py", "new_path": "resources/lib/MSL.py", "diff": "@@ -9,6 +9,7 @@ import json\nimport os\nimport pprint\nimport random\n+import sys\nfrom StringIO import StringIO\nfrom datetime import datetime\n@@ -192,8 +193,15 @@ class MSL:\nmanifest_request_data['profiles'].append('ddplus-5.1-dash')\nrequest_data = self.__generate_msl_request_data(manifest_request_data)\n+\n+ try:\nresp = self.session.post(self.endpoints['manifest'], request_data)\n+ except:\n+ resp = None\n+ exc = sys.exc_info()\n+ self.kodi_helper.log(msg='[MSL][POST] Error {} {}'.format(exc[0],exc[1]))\n+ if resp:\ntry:\n# if the json() does not fail we have an error because the manifest response is a chuncked json response\nresp.json()\n@@ -206,6 +214,7 @@ class MSL:\nself.kodi_helper.log(msg='Parsed chunked Response: ' + json.dumps(resp))\ndata = self.__decrypt_payload_chunk(resp['payloads'][0])\nreturn self.__tranform_to_dash(data)\n+ return False\ndef get_license(self, challenge, sid):\n\"\"\"\n@@ -232,8 +241,14 @@ class MSL:\n}\nrequest_data = self.__generate_msl_request_data(license_request_data)\n+ try:\nresp = self.session.post(self.endpoints['license'], request_data)\n+ except:\n+ resp = None\n+ exc = sys.exc_info()\n+ self.kodi_helper.log(msg='[MSL][POST] Error {} {}'.format(exc[0],exc[1]))\n+ if resp:\ntry:\n# If is valid json the request for the licnese failed\nresp.json()\n@@ -248,6 +263,7 @@ class MSL:\nelse:\nself.kodi_helper.log(msg='Error getting license: ' + json.dumps(data))\nreturn False\n+ return False\ndef __decrypt_payload_chunk(self, payloadchunk):\npayloadchunk = json.JSONDecoder().decode(payloadchunk)\n@@ -563,8 +579,14 @@ class MSL:\nself.kodi_helper.log(msg='Key Handshake Request:')\nself.kodi_helper.log(msg=json.dumps(request))\n+ try:\nresp = self.session.post(self.endpoints['manifest'], json.dumps(request, sort_keys=True))\n- if resp.status_code == 200:\n+ except:\n+ resp = None\n+ exc = sys.exc_info()\n+ self.kodi_helper.log(msg='[MSL][POST] Error {} {}'.format(exc[0],exc[1]))\n+\n+ if resp and resp.status_code == 200:\nresp = resp.json()\nif 'errordata' in resp:\nself.kodi_helper.log(msg='Key Exchange failed')\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "new_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "diff": "@@ -31,15 +31,14 @@ class NetflixHttpSubRessourceHandler:\nIf so, do the login before the user requests it\nIf that is done, we cache the profiles\n\"\"\"\n+ self.profiles = []\nif self.credentials['email'] != '' and self.credentials['password'] != '':\nif self.netflix_session.is_logged_in(account=self.credentials):\n- self.netflix_session.refresh_session_data(account=self.credentials)\n+ if self.netflix_session.refresh_session_data(account=self.credentials):\nself.profiles = self.netflix_session.profiles\nelse:\n- self.netflix_session.login(account=self.credentials)\n+ if self.netflix_session.login(account=self.credentials):\nself.profiles = self.netflix_session.profiles\n- else:\n- self.profiles = []\nself.kodi_helper.set_esn(self.netflix_session.esn)\ndef is_logged_in (self, params):\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix service issues: - crashing on network error - session clearing on logoff - logged-in detection
106,018
22.09.2017 22:59:42
-7,200
4bfef66f17dea32c312c43a167b4472c5a068358
Make netflix metarequest failsave
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -219,6 +219,18 @@ class KodiHelper:\ndialog.notification(self.get_local_string(string_id=15101), self.get_local_string(string_id=30050))\nreturn True\n+ def show_no_metadata_notification (self):\n+ \"\"\"Shows notification that no metadata is available\n+\n+ Returns\n+ -------\n+ bool\n+ Dialog shown\n+ \"\"\"\n+ dialog = xbmcgui.Dialog()\n+ dialog.notification(self.get_local_string(string_id=14116), self.get_local_string(string_id=195))\n+ return True\n+\ndef set_setting (self, key, value):\n\"\"\"Public interface for the addons setSetting method\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -133,6 +133,7 @@ class Navigation:\nelif params['action'] == 'user-items' and params['type'] == 'exported':\n# update local db from exported media\nself.library.updatedb_from_exported()\n+ self.library.updatedb_from_exported()\n# list exported movies/shows\nreturn self.kodi_helper.build_video_listing_exported(content=self.library.list_exported_media(),build_url=self.build_url)\nelse:\n@@ -372,6 +373,9 @@ class Navigation:\nAlternative title (for the folder written to disc)\n\"\"\"\nmetadata = self.call_netflix_service({'method': 'fetch_metadata', 'video_id': video_id})\n+ if \"error\" in metadata:\n+ self.kodi_helper.show_no_metadata_notification()\n+ return False\n# check for any errors\nif self._is_dirty_response(response=metadata):\nreturn False\n@@ -393,11 +397,14 @@ class Navigation:\n\"\"\"Removes an item from the local library\nParameters\n- ----------\n+ ---------\nvideo_id : :obj:`str`\nID of the movie or show\n\"\"\"\nmetadata = self.call_netflix_service({'method': 'fetch_metadata', 'video_id': video_id})\n+ if \"error\" in metadata:\n+ self.kodi_helper.show_no_metadata_notification()\n+ return False\n# check for any errors\nif self._is_dirty_response(response=metadata):\nreturn False\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Make netflix metarequest failsave
106,018
25.09.2017 03:56:48
-7,200
921939ce487a8933bb633fc30bcbcc6d1c0f431a
Extend export and cache image
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -64,6 +64,17 @@ class KodiHelper:\n\"\"\"Returns a fresh addon instance\"\"\"\nreturn Addon()\n+ def check_folder_path (self, path):\n+ \"\"\"Check if folderpath ends with path delimator - If not correct it (makes sure xbmcvfs.exists is working correct)\n+ \"\"\"\n+ if '/' in path and not str(path).endswith('/'):\n+ path = path + '/'\n+ return path\n+\n+ if '\\\\' in path and not str(path).endswith('\\\\'):\n+ path = path + '\\\\'\n+ return path\n+\ndef refresh (self):\n\"\"\"Refresh the current list\"\"\"\nreturn xbmc.executebuiltin('Container.Refresh')\n@@ -584,18 +595,33 @@ class KodiHelper:\naction = ['remove_from_library', self.get_local_string(30030), 'remove']\nlisting = content\nfor video in listing[0]:\n- li = xbmcgui.ListItem(label=str(video)+' ('+str(self.library.get_exported_movie_year (title=video))+')', iconImage=self.default_fanart)\n+ year = self.library.get_exported_movie_year (title=video)\n+ li = xbmcgui.ListItem(label=str(video)+' ('+str(year)+')', iconImage=self.default_fanart)\nli.setProperty('fanart_image', self.default_fanart)\nisFolder = False\n- year = self.library.get_exported_movie_year (title=video)\nurl = build_url({'action': 'removeexported', 'title': str(video), 'year': str(year), 'type': 'movie'})\n+ art = {}\n+ image = self.library.get_previewimage(video)\n+ art.update({\n+ 'landscape': image,\n+ 'thumb': image\n+ })\n+ li.setArt(art)\nxbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=li, isFolder=isFolder)\n+\nfor video in listing[2]:\nli = xbmcgui.ListItem(label=str(video), iconImage=self.default_fanart)\nli.setProperty('fanart_image', self.default_fanart)\nisFolder = False\nyear = '0000'\n- url = build_url({'action': 'removeexported', 'title': str(video), 'year': str(year), 'type': 'show'})\n+ url = build_url({'action': 'removeexported', 'title': str(str(video)), 'year': str(year), 'type': 'show'})\n+ art = {}\n+ image = self.library.get_previewimage(video)\n+ art.update({\n+ 'landscape': image,\n+ 'thumb': image\n+ })\n+ li.setArt(art)\nxbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=li, isFolder=isFolder)\nxbmcplugin.addSortMethod(handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_UNSORTED)\n@@ -863,6 +889,9 @@ class KodiHelper:\n'thumb': entry['boxarts']['small'],\n'fanart': entry['boxarts']['big']\n})\n+ # Download image for exported listing\n+ self.library.download_image_file(title=entry['title'].encode('utf-8'), url=str(entry['boxarts']['big']))\n+\nif 'interesting_moment' in dict(entry).keys():\nart.update({\n'poster': entry['interesting_moment'],\n@@ -907,7 +936,6 @@ class KodiHelper:\n'mpaa': '',\n'rating': '',\n'plot': '',\n- 'plot': '',\n'duration': '',\n'season': '',\n'title': '',\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/Library.py", "new_path": "resources/lib/Library.py", "diff": "@@ -8,7 +8,8 @@ import xbmcgui\nimport xbmcvfs\nimport re\nimport time\n-from shutil import rmtree\n+import requests\n+import threading\nfrom utils import noop\nfrom resources.lib.KodiHelper import KodiHelper\ntry:\n@@ -30,6 +31,9 @@ class Library:\nmetadata_label = 'metadata'\n\"\"\"str: Label to identify metadata\"\"\"\n+ imagecache_label = 'imagecache'\n+ \"\"\"str: Label to identify imagecache\"\"\"\n+\ndb_filename = 'lib.ndb'\n\"\"\"str: (File)Name of the store for the database dump that contains all shows/movies added to the library\"\"\"\n@@ -61,12 +65,14 @@ class Library:\nself.movie_path = os.path.join(lib_path, self.movies_label)\nself.tvshow_path = os.path.join(lib_path, self.series_label)\nself.metadata_path = os.path.join(lib_path, self.metadata_label)\n+ self.imagecache_path = os.path.join(lib_path, self.imagecache_label)\n# check if we need to setup the base folder structure & do so if needed\nself.setup_local_netflix_library(source={\nself.movies_label: self.movie_path,\nself.series_label: self.tvshow_path,\n- self.metadata_label: self.metadata_path\n+ self.metadata_label: self.metadata_path,\n+ self.imagecache_label: self.imagecache_path\n})\n# load the local db\n@@ -81,7 +87,7 @@ class Library:\nDicitionary with directories to be created\n\"\"\"\nfor label in source:\n- if not xbmcvfs.exists(source[label]):\n+ if not xbmcvfs.exists(kodi_helper.check_folder_path(source[label])):\nxbmcvfs.mkdir(source[label])\ndef write_strm_file(self, path, url, title_player):\n@@ -336,7 +342,7 @@ class Library:\ntitle=re.sub(r'[?|$|!|:|#]',r'',title)\nmovie_meta = '%s (%d)' % (title, year)\nfolder = re.sub(r'[?|$|!|:|#]',r'',alt_title)\n- dirname = os.path.join(self.movie_path, folder)\n+ dirname = kodi_helper.check_folder_path(os.path.join(self.movie_path, folder))\nfilename = os.path.join(dirname, movie_meta + '.strm')\nprogress=xbmcgui.DialogProgress()\nprogress.create(kodi_helper.get_local_string(650),movie_meta)\n@@ -377,7 +383,7 @@ class Library:\ntitle=re.sub(r'[?|$|!|:|#]',r'',title)\nshow_meta = '%s' % (title)\nfolder = re.sub(r'[?|$|!|:|#]',r'',alt_title.encode('utf-8'))\n- show_dir = os.path.join(self.tvshow_path, folder)\n+ show_dir = kodi_helper.check_folder_path(os.path.join(self.tvshow_path, folder))\nprogress=xbmcgui.DialogProgress()\nprogress.create(kodi_helper.get_local_string(650),show_meta)\ncount = 1\n@@ -466,7 +472,7 @@ class Library:\ntime.sleep(0.5)\ndel self.db[self.movies_label][movie_meta]\nself._update_local_db(filename=self.db_filepath, db=self.db)\n- dirname = os.path.join(self.movie_path, folder)\n+ dirname = kodi_helper.check_folder_path(os.path.join(self.movie_path, folder))\nfilename = os.path.join(self.movie_path, folder, movie_meta + '.strm')\nif xbmcvfs.exists(dirname):\nxbmcvfs.delete(filename)\n@@ -496,7 +502,7 @@ class Library:\ntime.sleep(0.5)\ndel self.db[self.series_label][title]\nself._update_local_db(filename=self.db_filepath, db=self.db)\n- show_dir = os.path.join(self.tvshow_path, folder)\n+ show_dir = kodi_helper.check_folder_path(os.path.join(self.tvshow_path, folder))\nif xbmcvfs.exists(show_dir):\nshow_files = xbmcvfs.listdir(show_dir)[1]\nepisode_count_total = len(show_files)\n@@ -538,7 +544,7 @@ class Library:\nif season_entry != season:\nseason_list.append(season_entry)\nself.db[self.series_label][show_meta]['seasons'] = season_list\n- show_dir = os.path.join(self.tvshow_path, self.db[self.series_label][show_meta]['alt_title'])\n+ show_dir = kodi_helper.check_folder_path(os.path.join(self.tvshow_path, self.db[self.series_label][show_meta]['alt_title']))\nif xbmcvfs.exists(show_dir):\nshow_files = [f for f in xbmcvfs.listdir(show_dir) if xbmcvfs.exists(os.path.join(show_dir, f))]\nfor filename in show_files:\n@@ -573,7 +579,7 @@ class Library:\nepisodes_list = []\nshow_meta = '%s' % (title)\nepisode_meta = 'S%02dE%02d' % (season, episode)\n- show_dir = os.path.join(self.tvshow_path, self.db[self.series_label][show_meta]['alt_title'])\n+ show_dir = kodi_helper.check_folder_path(os.path.join(self.tvshow_path, self.db[self.series_label][show_meta]['alt_title']))\nif xbmcvfs.exists(os.path.join(show_dir, episode_meta + '.strm')):\nxbmcvfs.delete(os.path.join(show_dir, episode_meta + '.strm'))\nfor episode_entry in self.db[self.series_label][show_meta]['episodes']:\n@@ -591,10 +597,11 @@ class Library:\nobj:`dict`\nContents of export folder\n\"\"\"\n-\n- if xbmcvfs.exists(self.movie_path):\n+ movies = (['',''])\n+ shows = (['',''])\n+ if xbmcvfs.exists(kodi_helper.check_folder_path(self.movie_path)):\nmovies = xbmcvfs.listdir(self.movie_path)\n- if xbmcvfs.exists(self.tvshow_path):\n+ if xbmcvfs.exists(kodi_helper.check_folder_path(self.tvshow_path)):\nshows = xbmcvfs.listdir(self.tvshow_path)\nreturn movies+shows\n@@ -606,7 +613,8 @@ class Library:\nobj:`int`\nyear of given movie\n\"\"\"\n- folder = os.path.join(self.movie_path, title)\n+ year = '0000'\n+ folder = kodi_helper.check_folder_path(os.path.join(self.movie_path, title))\nif xbmcvfs.exists(folder):\nfile = xbmcvfs.listdir(folder)\nyear = str(file[1]).split(\"(\",1)[1].split(\")\",1)[0]\n@@ -620,7 +628,7 @@ class Library:\nbool\nProcess finished\n\"\"\"\n- if xbmcvfs.exists(self.movie_path):\n+ if xbmcvfs.exists(kodi_helper.check_folder_path(self.movie_path)):\nmovies = xbmcvfs.listdir(self.movie_path)\nfor video in movies[0]:\nfolder = os.path.join(self.movie_path, video)\n@@ -633,7 +641,7 @@ class Library:\nself.db[self.movies_label][movie_meta] = {'alt_title': alt_title}\nself._update_local_db(filename=self.db_filepath, db=self.db)\n- if xbmcvfs.exists(self.tvshow_path):\n+ if xbmcvfs.exists(kodi_helper.check_folder_path(self.tvshow_path)):\nshows = xbmcvfs.listdir(self.tvshow_path)\nfor video in shows[0]:\nshow_dir = os.path.join(self.tvshow_path, video)\n@@ -652,3 +660,58 @@ class Library:\nself.db[self.series_label][title]['episodes'].append(episode_meta)\nself._update_local_db(filename=self.db_filepath, db=self.db)\nreturn True\n+\n+ def download_image_file(self, title, url):\n+ \"\"\"Writes thumb image which is shown in exported\n+\n+ Parameters\n+ ----------\n+ title : :obj:`str`\n+ Filename based on title\n+\n+ url : :obj:`str`\n+ Image url\n+\n+ Returns\n+ -------\n+ bool\n+ Download triggered\n+ \"\"\"\n+ title=re.sub(r'[?|$|!|:|#]',r'',title)\n+ imgfile = title+'.jpg'\n+ file = os.path.join(self.imagecache_path, imgfile)\n+ folder_movies = kodi_helper.check_folder_path(os.path.join(self.movie_path, title))\n+ folder_tvshows = kodi_helper.check_folder_path(os.path.join(self.tvshow_path, title))\n+ if not xbmcvfs.exists(file) and (xbmcvfs.exists(folder_movies) or xbmcvfs.exists(folder_tvshows)):\n+ thread = threading.Thread(target=self.fetch_url, args=(url,file))\n+ thread.start()\n+ return True\n+\n+ def fetch_url(self, url, file):\n+ f = xbmcvfs.File(file, 'wb')\n+ f.write(requests.get(url).content)\n+ f.write(url)\n+ f.close()\n+\n+ def get_previewimage(self, title):\n+ \"\"\"Load thumb image which is shown in exported\n+\n+ Parameters\n+ ----------\n+ title : :obj:`str`\n+ Filename based on title\n+\n+ url : :obj:`str`\n+ Image url\n+\n+ Returns\n+ -------\n+ obj:`int`\n+ image of given title if exists\n+ \"\"\"\n+ title=re.sub(r'[?|$|!|:|#]',r'',title)\n+ imgfile = title+'.jpg'\n+ file = os.path.join(self.imagecache_path, imgfile)\n+ if xbmcvfs.exists(file):\n+ return file\n+ return kodi_helper.default_fanart\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Extend export and cache image
106,018
25.09.2017 06:20:15
-7,200
9aba4f6f34b4c29b970e00e3558d0f1dcb80490d
Small download fix
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -890,6 +890,7 @@ class KodiHelper:\n'fanart': entry['boxarts']['big']\n})\n# Download image for exported listing\n+ if 'title' in entry:\nself.library.download_image_file(title=entry['title'].encode('utf-8'), url=str(entry['boxarts']['big']))\nif 'interesting_moment' in dict(entry).keys():\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Small download fix
106,018
27.09.2017 13:08:59
-7,200
35d76e6d7985bd9776da46fd643d6aeaf3414ebf
Fix changes of netflix
[ { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -968,9 +968,9 @@ class NetflixSession:\nQuality of the video\n\"\"\"\nquality = '720'\n- if video['videoQuality']['hasHD']:\n+ if video['delivery']['hasHD']:\nquality = '1080'\n- if video['videoQuality']['hasUltraHD']:\n+ if video['delivery']['hasUltraHD']:\nquality = '4000'\nreturn quality\n@@ -1399,7 +1399,7 @@ class NetflixSession:\nRaw Netflix API call response or api call error\n\"\"\"\npaths = [\n- ['lists', list_id, {'from': list_from, 'to': list_to}, ['summary', 'title', 'synopsis', 'regularSynopsis', 'evidence', 'queue', 'episodeCount', 'info', 'maturity', 'runtime', 'seasonCount', 'releaseYear', 'userRating', 'numSeasonsLabel', 'bookmarkPosition', 'watched', 'videoQuality']],\n+ ['lists', list_id, {'from': list_from, 'to': list_to}, ['summary', 'title', 'synopsis', 'regularSynopsis', 'evidence', 'queue', 'episodeCount', 'info', 'maturity', 'runtime', 'seasonCount', 'releaseYear', 'userRating', 'numSeasonsLabel', 'bookmarkPosition', 'watched', 'delivery']],\n['lists', list_id, {'from': list_from, 'to': list_to}, 'cast', {'from': 0, 'to': 15}, ['id', 'name']],\n['lists', list_id, {'from': list_from, 'to': list_to}, 'cast', 'summary'],\n['lists', list_id, {'from': list_from, 'to': list_to}, 'genres', {'from': 0, 'to': 5}, ['id', 'name']],\n@@ -1434,7 +1434,7 @@ class NetflixSession:\n\"\"\"\npaths = []\nfor video_id in video_ids:\n- paths.append(['videos', video_id, ['summary', 'title', 'synopsis', 'regularSynopsis', 'evidence', 'queue', 'episodeCount', 'info', 'maturity', 'runtime', 'seasonCount', 'releaseYear', 'userRating', 'numSeasonsLabel', 'bookmarkPosition', 'watched', 'videoQuality']])\n+ paths.append(['videos', video_id, ['summary', 'title', 'synopsis', 'regularSynopsis', 'evidence', 'queue', 'episodeCount', 'info', 'maturity', 'runtime', 'seasonCount', 'releaseYear', 'userRating', 'numSeasonsLabel', 'bookmarkPosition', 'watched', 'delivery']])\npaths.append(['videos', video_id, 'cast', {'from': 0, 'to': 15}, ['id', 'name']])\npaths.append(['videos', video_id, 'cast', 'summary'])\npaths.append(['videos', video_id, 'genres', {'from': 0, 'to': 5}, ['id', 'name']])\n@@ -1553,7 +1553,7 @@ class NetflixSession:\nRaw Netflix API call response or api call error\n\"\"\"\npaths = [\n- ['seasons', season_id, 'episodes', {'from': list_from, 'to': list_to}, ['summary', 'queue', 'info', 'maturity', 'userRating', 'bookmarkPosition', 'creditOffset', 'watched', 'videoQuality']],\n+ ['seasons', season_id, 'episodes', {'from': list_from, 'to': list_to}, ['summary', 'queue', 'info', 'maturity', 'userRating', 'bookmarkPosition', 'creditOffset', 'watched', 'delivery']],\n#['videos', season_id, 'cast', {'from': 0, 'to': 15}, ['id', 'name']],\n#['videos', season_id, 'cast', 'summary'],\n#['videos', season_id, 'genres', {'from': 0, 'to': 5}, ['id', 'name']],\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Fix changes of netflix
106,035
27.09.2017 14:46:57
18,000
a391c1c027debd2c37866972c4d1846bdf6209ec
Improve search and error handling
[ { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "@@ -220,3 +220,11 @@ msgstr \"\"\nmsgctxt \"#30050\"\nmsgid \"Update successful\"\nmsgstr \"\"\n+\n+msgctxt \"#30051\"\n+msgid \"Request Error\"\n+msgstr \"\"\n+\n+msgctxt \"#30052\"\n+msgid \"Unable to complete the request at this time\"\n+msgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -101,7 +101,7 @@ class KodiHelper:\ndlg = xbmcgui.Dialog()\nterm = dlg.input(self.get_local_string(string_id=30003), type=xbmcgui.INPUT_ALPHANUM)\nif len(term) == 0:\n- term = ' '\n+ term = None\nreturn term\ndef show_add_to_library_title_dialog (self, original_title):\n@@ -157,6 +157,18 @@ class KodiHelper:\ndialog.notification(self.get_local_string(string_id=30008), self.get_local_string(string_id=30009), xbmcgui.NOTIFICATION_ERROR, 5000)\nreturn True\n+ def show_request_error_notification (self):\n+ \"\"\"Shows notification that a request error occured\n+\n+ Returns\n+ -------\n+ bool\n+ Dialog shown\n+ \"\"\"\n+ dialog = xbmcgui.Dialog()\n+ dialog.notification(self.get_local_string(string_id=30051), self.get_local_string(string_id=30052), xbmcgui.NOTIFICATION_ERROR, 5000)\n+ return True\n+\ndef show_missing_inputstream_addon_notification (self):\n\"\"\"Shows notification that the inputstream addon couldn't be found\n@@ -642,6 +654,50 @@ class KodiHelper:\nself.set_custom_view(VIEW_FOLDER)\nreturn True\n+ def build_search_result_folder (self, build_url, term):\n+ \"\"\"Add search result folder\n+\n+ Parameters\n+ ----------\n+ build_url : :obj:`fn`\n+ Function to build the subsequent routes\n+\n+ term : :obj:`str`\n+ Search term\n+\n+ Returns\n+ -------\n+ :obj:`str`\n+ Search result folder URL\n+ \"\"\"\n+ # add search result as subfolder\n+ li_rec = xbmcgui.ListItem(label='({})'.format(term), iconImage=self.default_fanart)\n+ li_rec.setProperty('fanart_image', self.default_fanart)\n+ url_rec = build_url({'action': 'search_result', 'term': term})\n+ xbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url_rec, listitem=li_rec, isFolder=True)\n+ xbmcplugin.addSortMethod(handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_UNSORTED)\n+ xbmcplugin.endOfDirectory(self.plugin_handle)\n+ self.set_custom_view(VIEW_FOLDER)\n+ return url_rec\n+\n+ def set_location (self, url, replace=False):\n+ \"\"\"Set URL location\n+\n+ Parameters\n+ ----------\n+ url : :obj:`str`\n+ Window URL\n+\n+ ret : bool\n+ Return to location prior to activation\n+\n+ Returns\n+ -------\n+ bool\n+ Window was activated\n+ \"\"\"\n+ return xbmc.executebuiltin('Container.Update({},{})'.format(url,str(replace)))\n+\ndef build_search_result_listing (self, video_list, actions, build_url):\n\"\"\"Builds the search results list Kodi screen\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Improve search and error handling
106,029
28.09.2017 00:15:36
-7,200
4d9d492004c3503ad57c99a336a951818702e906
feat(chore): Version bump to 0.11.25
[ { "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.11.24\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.11.25\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n<license>MIT</license>\n<forum>http://www.kodinerds.net/index.php/Thread/55607-Inputstream-Agile-Betatest-Netflix/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n- <news>v0.11.24 (2017-09-11)\n-- Polish translation - update\n-- return false if search input is empty or aborted\n-- add fanart image as folder icon\n-- HTML-unescape profile name\n-- changeable export name / fix export name abort\n-- pagination for long list entries\n-- fix custom library path\n+ <news>v0.11.25 (2017-09-28)\n+- Polish, Hebrew, German translation - update\n+- Export improments\n+- Better missing/disabled Inputstream addon detection\n+- Fixed no search result notification\n+- Metadata caching\n+- Background service improvements\n+- Netflic API fixes\n+\n</news>\n</extension>\n</addon>\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Dutch/strings.po", "new_path": "resources/language/Dutch/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.24\n+# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.24\n+# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.23\n+# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Hebrew/strings.po", "new_path": "resources/language/Hebrew/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.24\n+# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\n# Translated by: Itayshechter\nmsgid \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Italian/strings.po", "new_path": "resources/language/Italian/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.24\n+# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Polish/strings.po", "new_path": "resources/language/Polish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.24\n+# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Portugese/strings.po", "new_path": "resources/language/Portugese/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.24\n+# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Slovak/strings.po", "new_path": "resources/language/Slovak/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.24\n+# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Spanish/strings.po", "new_path": "resources/language/Spanish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.24\n+# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Swedish/strings.po", "new_path": "resources/language/Swedish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.24\n+# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
feat(chore): Version bump to 0.11.25
106,018
28.09.2017 08:39:18
-7,200
1875521bf38c32fc18bc08ae956de24bb48f3fba
Fix unicode bug in check_folder_path
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -67,10 +67,19 @@ class KodiHelper:\ndef check_folder_path (self, path):\n\"\"\"Check if folderpath ends with path delimator - If not correct it (makes sure xbmcvfs.exists is working correct)\n\"\"\"\n+ if isinstance(path, unicode):\n+ check = path.encode('ascii','ignore')\n+ if '/' in check and not str(check).endswith('/'):\n+ end = u'/'\n+ path = path + end\n+ return path\n+ if '\\\\' in check and not str(check).endswith('\\\\'):\n+ end = u'\\\\'\n+ path = path + end\n+ return path\nif '/' in path and not str(path).endswith('/'):\npath = path + '/'\nreturn path\n-\nif '\\\\' in path and not str(path).endswith('\\\\'):\npath = path + '\\\\'\nreturn path\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Fix unicode bug in check_folder_path
106,018
09.10.2017 19:20:42
-7,200
c802583044dbd24d3efd78b4c8f9100f66cf603e
Enable autologin
[ { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "@@ -228,3 +228,27 @@ msgstr \"\"\nmsgctxt \"#30052\"\nmsgid \"Unable to complete the request at this time\"\nmsgstr \"\"\n+\n+msgctxt \"#30053\"\n+msgid \"Auto Login\"\n+msgstr \"\"\n+\n+msgctxt \"#30054\"\n+msgid \"Enable Auto Login\"\n+msgstr \"\"\n+\n+msgctxt \"#30055\"\n+msgid \"Profile\"\n+msgstr \"\"\n+\n+msgctxt \"#30056\"\n+msgid \"ID\"\n+msgstr \"\"\n+\n+msgctxt \"#30057\"\n+msgid \"Select profile in profile listing -> context menu\"\n+msgstr \"\"\n+\n+msgctxt \"#30058\"\n+msgid \"Auto Login enabled!\"\n+msgstr \"\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -263,6 +263,18 @@ class KodiHelper:\ndialog.notification(self.get_local_string(string_id=14116), self.get_local_string(string_id=195))\nreturn True\n+ def show_autologin_enabled (self):\n+ \"\"\"Shows notification that auto login is enabled\n+\n+ Returns\n+ -------\n+ bool\n+ Dialog shown\n+ \"\"\"\n+ dialog = xbmcgui.Dialog()\n+ dialog.notification(self.get_local_string(string_id=14116), self.get_local_string(string_id=30058))\n+ return True\n+\ndef set_setting (self, key, value):\n\"\"\"Public interface for the addons setSetting method\n@@ -273,6 +285,15 @@ class KodiHelper:\n\"\"\"\nreturn self.get_addon().setSetting(key, value)\n+ def get_setting (self, key):\n+ \"\"\"Public interface to the addons getSetting method\n+\n+ Returns\n+ -------\n+ Returns setting key\n+ \"\"\"\n+ return self.get_addon().getSetting(key)\n+\ndef get_credentials (self):\n\"\"\"Returns the users stored credentials\n@@ -423,6 +444,24 @@ class KodiHelper:\nif view != -1:\nxbmc.executebuiltin('Container.SetViewMode(%s)' % view)\n+ def save_autologin_data(self, autologin_user, autologin_id):\n+ \"\"\"Write autologin data to settings\n+\n+ Parameters\n+ ----------\n+ autologin_user : :obj:`str`\n+ Profile name from netflix\n+\n+ autologin_id : :obj:`str`\n+ Profile id from netflix\n+ \"\"\"\n+ self.set_setting ('autologin_user', autologin_user)\n+ self.set_setting ('autologin_id', autologin_id)\n+ self.set_setting ('autologin_enable', 'True')\n+ self.show_autologin_enabled()\n+ self.invalidate_memcache()\n+ xbmc.executebuiltin('Container.Refresh')\n+\ndef build_profiles_listing (self, profiles, action, build_url):\n\"\"\"Builds the profiles list Kodi screen\n@@ -444,8 +483,10 @@ class KodiHelper:\n\"\"\"\nfor profile in profiles:\nurl = build_url({'action': action, 'profile_id': profile['id']})\n+ url_save_autologin = build_url({'action': 'save_autologin', 'autologin_id': profile['id'], 'autologin_user': profile['profileName']})\nli = xbmcgui.ListItem(label=profile['profileName'], iconImage=profile['avatar'])\nli.setProperty('fanart_image', self.default_fanart)\n+ li.addContextMenuItems([(self.get_local_string(30053), 'RunPlugin('+url_save_autologin+')',)])\nxbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=li, isFolder=True)\nxbmcplugin.addSortMethod(handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_LABEL)\nxbmcplugin.endOfDirectory(self.plugin_handle)\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -74,7 +74,15 @@ class Navigation:\nreturn False\nif 'action' not in params.keys():\n# show the profiles\n+ if self.kodi_helper.get_setting ('autologin_enable') == 'true':\n+ profile_id = self.kodi_helper.get_setting ('autologin_id')\n+ if profile_id != '':\n+ self.call_netflix_service({'method': 'switch_profile', 'profile_id': profile_id})\n+ return self.show_video_lists()\nreturn self.show_profiles()\n+ elif params['action'] == 'save_autologin':\n+ # save profile id and name to settings for autologin\n+ return self.kodi_helper.save_autologin_data(autologin_id=params['autologin_id'],autologin_user=params['autologin_user'])\nelif params['action'] == 'video_lists':\n# list lists that contain other lists (starting point with recommendations, search, etc.)\nreturn self.show_video_lists()\n" }, { "change_type": "MODIFY", "old_path": "resources/settings.xml", "new_path": "resources/settings.xml", "diff": "<setting id=\"netflix_service_port\" value=\"8001\" visible=\"false\"/>\n<setting id=\"show_update_db\" type=\"bool\" default=\"false\" visible=\"false\"/>\n</category>\n+ <category label=\"30053\">\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+ </category>\n</settings>\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Enable autologin
106,018
09.10.2017 19:28:50
-7,200
b6831819d476fd2ec82ec3331c4cc6768d591273
Get metadata from kodidb for indexed media
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -8,6 +8,7 @@ import xbmcgui\nimport xbmc\nimport json\nimport base64\n+import re\nfrom MSL import MSL\nfrom os import remove\nfrom os.path import join, isfile\n@@ -932,6 +933,22 @@ class KodiHelper:\nart = self.library.read_artdata_file(video_id=video_id)\nplay_item.setArt(art)\nplay_item.setInfo('video', infoLabels)\n+\n+ # check for content in kodi db\n+ if str(infoLabels) != \"None\":\n+ if infoLabels['mediatype'] == 'episode':\n+ id = self.showtitle_to_id(title=infoLabels['tvshowtitle'])\n+ details = self.get_show_content_by_id(showid=id, showseason=infoLabels['season'], showepisode=infoLabels['episode'])\n+ if details != False:\n+ play_item.setInfo('video', details[0])\n+ play_item.setArt(details[1])\n+ if infoLabels['mediatype'] != 'episode':\n+ id = self.movietitle_to_id(title=infoLabels['title'])\n+ details = self.get_movie_content_by_id(movieid=id)\n+ if details != False:\n+ play_item.setInfo('video', details[0])\n+ play_item.setArt(details[1])\n+\nreturn xbmcplugin.setResolvedUrl(self.plugin_handle, True, listitem=play_item)\ndef _generate_art_info (self, entry, li):\n@@ -1205,6 +1222,133 @@ class KodiHelper:\nreturn (type, data['result']['addon']['enabled'])\nreturn None\n+ def movietitle_to_id(self, title):\n+ query = {\n+ \"jsonrpc\": \"2.0\",\n+ \"method\": \"VideoLibrary.GetMovies\",\n+ \"params\": {\n+ \"properties\": [\"title\"]\n+ },\n+ \"id\": \"libMovies\"\n+ }\n+ try:\n+ json_result = json.loads(xbmc.executeJSONRPC(json.dumps(query, encoding='utf-8')))\n+ if 'result' in json_result and 'movies' in json_result['result']:\n+ json_result = json_result['result']['movies']\n+ for movie in json_result:\n+ # Switch to ascii/lowercase and remove special chars and spaces\n+ # to make sure best possible compare is possible\n+ titledb = movie['title'].encode('ascii','ignore')\n+ titledb = re.sub(r'[?|$|!|:|#|\\.|\\,|\\'| ]',r'',titledb).lower().replace('-','')\n+ if '(' in titledb:\n+ titledb = titledb.split('(')[0]\n+ titlegiven = title.encode('ascii','ignore')\n+ titlegiven = re.sub(r'[?|$|!|:|#|\\.|\\,|\\'| ]',r'',titlegiven).lower().replace('-','')\n+ if '(' in titlegiven:\n+ titlegiven = titlegiven.split('(')[0]\n+ if titledb == titlegiven:\n+ return movie['movieid']\n+ return '-1'\n+ except Exception:\n+ return '-1'\n+\n+ def showtitle_to_id(self, title):\n+ query = {\n+ \"jsonrpc\": \"2.0\",\n+ \"method\": \"VideoLibrary.GetTVShows\",\n+ \"params\": {\n+ \"properties\": [\"title\",\"genre\"]\n+ },\n+ \"id\": \"libTvShows\"\n+ }\n+ try:\n+ json_result = json.loads(xbmc.executeJSONRPC(json.dumps(query, encoding='utf-8')))\n+ if 'result' in json_result and 'tvshows' in json_result['result']:\n+ json_result = json_result['result']['tvshows']\n+ for tvshow in json_result:\n+ # Switch to ascii/lowercase and remove special chars and spaces\n+ # to make sure best possible compare is possible\n+ titledb = tvshow['label'].encode('ascii','ignore')\n+ titledb = re.sub(r'[?|$|!|:|#|\\.|\\,|\\'| ]',r'',titledb).lower().replace('-','')\n+ if '(' in titledb:\n+ titledb = titledb.split('(')[0]\n+ titlegiven = title.encode('ascii','ignore')\n+ titlegiven = re.sub(r'[?|$|!|:|#|\\.|\\,|\\'| ]',r'',titlegiven).lower().replace('-','')\n+ if '(' in titlegiven:\n+ titlegiven = titlegiven.split('(')[0]\n+ if titledb == titlegiven:\n+ return tvshow['tvshowid'],tvshow['genre']\n+ return '-1',''\n+ except Exception:\n+ return '-1',''\n+\n+ def get_show_content_by_id(self, showid, showseason, showepisode):\n+ showseason = int(showseason)\n+ showepisode = int(showepisode)\n+ query = {\n+ \"jsonrpc\": \"2.0\",\n+ \"method\": \"VideoLibrary.GetEpisodes\",\n+ \"params\": {\n+ \"properties\": [\"season\", \"episode\", \"plot\", \"fanart\", \"art\"],\n+ \"tvshowid\": int(showid[0])\n+ },\n+ \"id\": \"1\"\n+ }\n+ try:\n+ json_result = json.loads(xbmc.executeJSONRPC(json.dumps(query, encoding='utf-8')))\n+ if 'result' in json_result and 'episodes' in json_result['result']:\n+ json_result = json_result['result']['episodes']\n+ for episode in json_result:\n+ if episode['season'] == showseason and episode['episode'] == showepisode:\n+ infos = {}\n+ if 'plot' in episode and len(episode['plot']) > 0:\n+ infos.update({'plot': episode['plot'], 'genre': showid[1]})\n+ art = {}\n+ if 'fanart' in episode and len(episode['fanart']) > 0:\n+ art.update({'fanart': episode['fanart']})\n+ if 'art' in episode and len(episode['art']['season.poster']) > 0:\n+ art.update({'thumb': episode['art']['season.poster']})\n+ return infos,art\n+ return False\n+ except Exception:\n+ return False\n+\n+ def get_movie_content_by_id(self, movieid):\n+ query = {\n+ \"jsonrpc\": \"2.0\",\n+ \"method\": \"VideoLibrary.GetMovieDetails\",\n+ \"params\": {\n+ \"movieid\": movieid,\n+ \"properties\": [\n+ \"genre\",\n+ \"plot\",\n+ \"fanart\",\n+ \"thumbnail\",\n+ \"art\"]\n+ },\n+ \"id\": \"libMovies\"\n+ }\n+ try:\n+ json_result = json.loads(xbmc.executeJSONRPC(json.dumps(query, encoding='utf-8')))\n+ if 'result' in json_result and 'moviedetails' in json_result['result']:\n+ json_result = json_result['result']['moviedetails']\n+ infos = {}\n+ if 'genre' in json_result and len(json_result['genre']) > 0:\n+ infos.update({'genre': json_result['genre']})\n+ if 'plot' in json_result and len(json_result['plot']) > 0:\n+ infos.update({'plot': json_result['plot']})\n+ art = {}\n+ if 'fanart' in json_result and len(json_result['fanart']) > 0:\n+ art.update({'fanart': json_result['fanart']})\n+ if 'thumbnail' in json_result and len(json_result['thumbnail']) > 0:\n+ art.update({'thumb': json_result['thumbnail']})\n+ if 'art' in json_result and len(json_result['art']['poster']) > 0:\n+ art.update({'poster': json_result['art']['poster']})\n+ return infos,art\n+ return False\n+ except Exception:\n+ return False\n+\ndef set_library (self, library):\n\"\"\"Adds an instance of the Library class\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Get metadata from kodidb for indexed media
105,979
10.10.2017 11:28:23
-7,200
db1733f57e0d1d2dcec2c4dc9fb033f82115aa42
feat(settings): Encrypt credentials
[ { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "@@ -252,3 +252,7 @@ msgstr \"\"\nmsgctxt \"#30058\"\nmsgid \"Auto Login enabled!\"\nmsgstr \"\"\n+\n+msgctxt \"#30059\"\n+msgid \"Switch accounts\"\n+msgstr \"\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -8,13 +8,16 @@ import xbmcgui\nimport xbmc\nimport json\nimport base64\n+import hashlib\n+from Cryptodome import Random\n+from Cryptodome.Cipher import AES\nfrom MSL import MSL\nfrom os import remove\nfrom os.path import join, isfile\nfrom urllib import urlencode\nfrom xbmcaddon import Addon\nfrom uuid import uuid4\n-from utils import get_user_agent_for_current_platform\n+from utils import get_user_agent_for_current_platform, uniq_id\nfrom UniversalAnalytics import Tracker\ntry:\nimport cPickle as pickle\n@@ -57,6 +60,8 @@ class KodiHelper:\nself.custom_export_name = addon.getSetting('customexportname')\nself.show_update_db = addon.getSetting('show_update_db')\nself.default_fanart = addon.getAddonInfo('fanart')\n+ self.bs = 32\n+ self.crypt_key = uniq_id()\nself.library = None\nself.setup_memcache()\n@@ -302,11 +307,66 @@ class KodiHelper:\n:obj:`dict` of :obj:`str`\nThe users stored account data\n\"\"\"\n+ addon = self.get_addon()\n+ email = addon.getSetting('email')\n+ password = addon.getSetting('password')\n+\n+ # soft migration for existing credentials\n+ # base64 can't contain `@` chars\n+ if '@' in email:\n+ addon.setSetting('email', self.encode(raw=email))\n+ addon.setSetting('password', self.encode(raw=password))\nreturn {\n'email': self.get_addon().getSetting('email'),\n'password': self.get_addon().getSetting('password')\n}\n+ # if everything is fine, we decode the values\n+ if '' != email or '' != password:\n+ return {\n+ 'email': self.decode(enc=email),\n+ 'password': self.decode(enc=password)\n+ }\n+\n+ # if email is empty, we return an empty map\n+ return {\n+ 'email': '',\n+ 'password': ''\n+ }\n+\n+ def encode(self, raw):\n+ \"\"\"\n+ Encodes data\n+\n+ :param data: Data to be encoded\n+ :type data: str\n+ :returns: string -- Encoded data\n+ \"\"\"\n+ raw = self._pad(raw)\n+ iv = Random.new().read(AES.block_size)\n+ cipher = AES.new(self.crypt_key, AES.MODE_CBC, iv)\n+ return base64.b64encode(iv + cipher.encrypt(raw))\n+\n+ def decode(self, enc):\n+ \"\"\"\n+ Decodes data\n+\n+ :param data: Data to be decoded\n+ :type data: str\n+ :returns: string -- Decoded data\n+ \"\"\"\n+ enc = base64.b64decode(enc)\n+ iv = enc[:AES.block_size]\n+ cipher = AES.new(self.crypt_key, AES.MODE_CBC, iv)\n+ return self._unpad(cipher.decrypt(enc[AES.block_size:])).decode('utf-8')\n+\n+ def _pad(self, s):\n+ return s + (self.bs - len(s) % self.bs) * chr(self.bs - len(s) % self.bs)\n+\n+ @staticmethod\n+ def _unpad(s):\n+ return s[:-ord(s[len(s)-1:])]\n+\ndef get_esn(self):\n\"\"\"\nReturns the esn from settings\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -57,6 +57,10 @@ class Navigation:\nif 'action' in params.keys() and params['action'] == 'logout':\nreturn self._check_response(self.call_netflix_service({'method': 'logout'}))\n+ # switch user account\n+ if 'action' in params.keys() and params['action'] == 'switch_account':\n+ return self.switch_account()\n+\n# check login & try to relogin if necessary\naccount = self.kodi_helper.get_credentials()\nif account['email'] != '' and account['password'] != '':\n@@ -439,6 +443,27 @@ class Navigation:\nis_logged_in = self._check_response(self.call_netflix_service({'method': 'is_logged_in'}))\nreturn True if is_logged_in else self._check_response(self.call_netflix_service({'method': 'login', 'email': account['email'], 'password': account['password']}))\n+ def switch_account(self):\n+ \"\"\"Deletes all current account data & prompts with dialogs for new ones\"\"\"\n+ self._check_response(self.call_netflix_service({'method': 'logout'}))\n+ self.kodi_helper.set_setting(key='email', value='')\n+ self.kodi_helper.set_setting(key='password', value='')\n+ raw_email = self.kodi_helper.show_email_dialog()\n+ raw_password = self.kodi_helper.show_password_dialog()\n+ encoded_email = self.kodi_helper.encode(raw=raw_email)\n+ encoded_password = self.kodi_helper.encode(raw=raw_password)\n+ self.kodi_helper.set_setting(key='email', value=encoded_email)\n+ self.kodi_helper.set_setting(key='password', value=encoded_password)\n+ account = {\n+ 'email': raw_email,\n+ 'password': raw_password,\n+ }\n+ if self.establish_session(account=account) != True:\n+ self.kodi_helper.set_setting(key='email', value='')\n+ self.kodi_helper.set_setting(key='password', value='')\n+ return self.kodi_helper.show_login_failed_notification()\n+ return True\n+\n@log\ndef before_routing_action(self, params):\n\"\"\"Executes actions before the actual routing takes place:\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/utils.py", "new_path": "resources/lib/utils.py", "diff": "# Module: utils\n# Created on: 13.01.2017\n+import time\n+import hashlib\nimport platform\n+import xbmc\n+\n# Takes everything, does nothing, classic no operation function\ndef noop (**kwargs):\n@@ -46,3 +50,34 @@ def get_user_agent_for_current_platform():\nif platform.machine().startswith('arm'):\nreturn 'Mozilla/5.0 (X11; CrOS armv7l 7647.78.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'\nreturn 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'\n+\n+def uniq_id(delay=1):\n+ \"\"\"\n+ Returns a unique id based on the devices MAC address\n+\n+ :param delay: Retry delay in sec\n+ :type delay: int\n+ :returns: string -- Unique secret\n+ \"\"\"\n+ mac_addr = __get_mac_address(delay=delay)\n+ if ':' in mac_addr and delay == 2:\n+ return hashlib.sha256(str(mac_addr).encode()).digest()\n+ else:\n+ return hashlib.sha256('UnsafeStaticSecret'.encode()).digest()\n+\n+def __get_mac_address(delay=1):\n+ \"\"\"\n+ Returns the users mac address\n+\n+ :param delay: retry delay in sec\n+ :type delay: int\n+ :returns: string -- Devices MAC address\n+ \"\"\"\n+ mac_addr = xbmc.getInfoLabel('Network.MacAddress')\n+ # hack response busy\n+ i = 0\n+ while ':' not in mac_addr and i < 3:\n+ i += 1\n+ time.sleep(delay)\n+ mac_addr = xbmc.getInfoLabel('Network.MacAddress')\n+ return mac_addr\n" }, { "change_type": "MODIFY", "old_path": "resources/settings.xml", "new_path": "resources/settings.xml", "diff": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n<settings>\n<category label=\"30014\">\n- <setting id=\"email\" type=\"text\" label=\"30005\" default=\"\"/>\n- <setting id=\"password\" type=\"text\" option=\"hidden\" label=\"30004\" default=\"\"/>\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=\"is_settings\" type=\"action\" label=\"30035\" action=\"RunPlugin(plugin://plugin.video.netflix/?mode=openSettings&url=is)\" option=\"close\"/>\n</category>\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
feat(settings): Encrypt credentials
105,979
10.10.2017 11:37:39
-7,200
929931efe5c1e2fe21d2749e209fb7f90e23e5e9
feat(dependencies): Adds inputstream.adaptive as plugin dependency
[ { "change_type": "MODIFY", "old_path": "addon.xml", "new_path": "addon.xml", "diff": "<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n<import addon=\"script.module.pycryptodome\" version=\"3.4.3\"/>\n+ <import addon=\"inputstream.adaptive\" version=\"2.0.0\"/>\n</requires>\n<extension point=\"xbmc.python.pluginsource\" library=\"addon.py\">\n<provides>video</provides>\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
feat(dependencies): Adds inputstream.adaptive as plugin dependency
105,979
10.10.2017 11:45:11
-7,200
afb7e467e1d4ae5c0922a30367ec52e04079cab9
fix(cache): Workaround to catch cache failures (which rarely happen), but could kill the plugin if it happens
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -387,14 +387,20 @@ class KodiHelper:\ndef setup_memcache (self):\n\"\"\"Sets up the memory cache if not existant\"\"\"\n+ try:\ncached_items = xbmcgui.Window(xbmcgui.getCurrentWindowId()).getProperty('memcache')\n# no cache setup yet, create one\nif len(cached_items) < 1:\nxbmcgui.Window(xbmcgui.getCurrentWindowId()).setProperty('memcache', pickle.dumps({}))\n+ except EOFError:\n+ pass\ndef invalidate_memcache (self):\n\"\"\"Invalidates the memory cache\"\"\"\n+ try:\nxbmcgui.Window(xbmcgui.getCurrentWindowId()).setProperty('memcache', pickle.dumps({}))\n+ except EOFError:\n+ pass\ndef get_cached_item (self, cache_id):\n\"\"\"Returns an item from the in memory cache\n@@ -409,9 +415,13 @@ class KodiHelper:\nmixed\nContents of the requested cache item or none\n\"\"\"\n+ ret = None\n+ try:\ncached_items = pickle.loads(xbmcgui.Window(xbmcgui.getCurrentWindowId()).getProperty('memcache'))\n-\n- return cached_items.get(cache_id)\n+ ret = cached_items.get(cache_id)\n+ except EOFError:\n+ ret = None\n+ return ret\ndef add_cached_item (self, cache_id, contents):\n\"\"\"Adds an item to the in memory cache\n@@ -424,9 +434,12 @@ class KodiHelper:\ncontents : mixed\nCache entry contents\n\"\"\"\n+ try:\ncached_items = pickle.loads(xbmcgui.Window(xbmcgui.getCurrentWindowId()).getProperty('memcache'))\ncached_items.update({cache_id: contents})\nxbmcgui.Window(xbmcgui.getCurrentWindowId()).setProperty('memcache', pickle.dumps(cached_items))\n+ except EOFError:\n+ pass\ndef set_custom_view(self, content):\n\"\"\"Set the view mode\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(cache): Workaround to catch cache failures (which rarely happen), but could kill the plugin if it happens
105,979
10.10.2017 12:35:58
-7,200
5cb4814b2c360977a28a951a000b8099e3c70b0b
feat(video): Adds abikity to enable & retrieve HEVC profiles
[ { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "@@ -252,3 +252,7 @@ msgstr \"\"\nmsgctxt \"#30058\"\nmsgid \"Auto Login enabled!\"\nmsgstr \"\"\n+\n+msgctxt \"#30060\"\n+msgid \"Enable HEVC profiles (f.e. 4k for Android)\"\n+msgstr \"\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -338,9 +338,24 @@ class KodiHelper:\ndef get_dolby_setting(self):\n\"\"\"\nReturns if the dolby sound is enabled\n- :return: True|False\n+ :return: bool - Dolby Sourrind profile setting is enabled\n\"\"\"\n- return self.get_addon().getSetting('enable_dolby_sound') == 'true'\n+ use_dolby = False\n+ setting = self.get_addon().getSetting('enable_dolby_sound')\n+ if setting == 'true' or setting == 'True':\n+ use_dolby = True\n+ return use_dolby\n+\n+ def use_hevc(self):\n+ \"\"\"\n+ Checks if HEVC profiles should be used\n+ :return: bool - HEVC profile setting is enabled\n+ \"\"\"\n+ use_hevc = False\n+ setting = self.get_addon().getSetting('enable_hevc_profiles')\n+ if setting == 'true' or setting == 'True':\n+ use_hevc = True\n+ return use_hevc\ndef get_custom_library_settings (self):\n\"\"\"Returns the settings in regards to the custom library folder(s)\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/MSL.py", "new_path": "resources/lib/MSL.py", "diff": "@@ -96,67 +96,11 @@ class MSL:\n'lookupType': 'PREPARE',\n'viewableIds': [viewable_id],\n'profiles': [\n+ # Video\n\"playready-h264bpl30-dash\",\n\"playready-h264mpl30-dash\",\n\"playready-h264mpl31-dash\",\n\"playready-h264mpl40-dash\",\n- # \"hevc-main-L30-dash-cenc\",\n- # \"hevc-main-L31-dash-cenc\",\n- # \"hevc-main-L40-dash-cenc\",\n- # \"hevc-main-L41-dash-cenc\",\n- # \"hevc-main-L50-dash-cenc\",\n- # \"hevc-main-L51-dash-cenc\",\n- # \"hevc-main10-L30-dash-cenc\",\n- # \"hevc-main10-L31-dash-cenc\",\n- # \"hevc-main10-L40-dash-cenc\",\n- # \"hevc-main10-L41-dash-cenc\",\n- # \"hevc-main10-L50-dash-cenc\",\n- # \"hevc-main10-L51-dash-cenc\",\n- # \"hevc-main10-L30-dash-cenc-prk\",\n- # \"hevc-main10-L31-dash-cenc-prk\",\n- # \"hevc-main10-L40-dash-cenc-prk\",\n- # \"hevc-main10-L41-dash-cenc-prk\",\n- # \"hevc-main-L30-L31-dash-cenc-tl\",\n- # \"hevc-main-L31-L40-dash-cenc-tl\",\n- # \"hevc-main-L40-L41-dash-cenc-tl\",\n- # \"hevc-main-L50-L51-dash-cenc-tl\",\n- # \"hevc-main10-L30-L31-dash-cenc-tl\",\n- # \"hevc-main10-L31-L40-dash-cenc-tl\",\n- # \"hevc-main10-L40-L41-dash-cenc-tl\",\n- # \"hevc-main10-L50-L51-dash-cenc-tl\",\n- # \"hevc-dv-main10-L30-dash-cenc\",\n- # \"hevc-dv-main10-L31-dash-cenc\",\n- # \"hevc-dv-main10-L40-dash-cenc\",\n- # \"hevc-dv-main10-L41-dash-cenc\",\n- # \"hevc-dv-main10-L50-dash-cenc\",\n- # \"hevc-dv-main10-L51-dash-cenc\",\n- # \"hevc-dv5-main10-L30-dash-cenc-prk\",\n- # \"hevc-dv5-main10-L31-dash-cenc-prk\",\n- # \"hevc-dv5-main10-L40-dash-cenc-prk\",\n- # \"hevc-dv5-main10-L41-dash-cenc-prk\",\n- # \"hevc-dv5-main10-L50-dash-cenc-prk\",\n- # \"hevc-dv5-main10-L51-dash-cenc-prk\",\n- # \"hevc-hdr-main10-L30-dash-cenc\",\n- # \"hevc-hdr-main10-L31-dash-cenc\",\n- # \"hevc-hdr-main10-L40-dash-cenc\",\n- # \"hevc-hdr-main10-L41-dash-cenc\",\n- # \"hevc-hdr-main10-L50-dash-cenc\",\n- # \"hevc-hdr-main10-L51-dash-cenc\",\n- # \"hevc-hdr-main10-L30-dash-cenc-prk\",\n- # \"hevc-hdr-main10-L31-dash-cenc-prk\",\n- # \"hevc-hdr-main10-L40-dash-cenc-prk\",\n- # \"hevc-hdr-main10-L41-dash-cenc-prk\",\n- # \"hevc-hdr-main10-L50-dash-cenc-prk\",\n- # \"hevc-hdr-main10-L51-dash-cenc-prk\"\n-\n- # 'playready-h264mpl30-dash',\n- #'playready-h264mpl31-dash',\n- #'playready-h264mpl40-dash',\n- #'hevc-main10-L41-dash-cenc',\n- #'hevc-main10-L50-dash-cenc',\n- #'hevc-main10-L51-dash-cenc',\n-\n-\n# Audio\n'heaac-2-dash',\n@@ -187,6 +131,60 @@ class MSL:\n'uiVersion': 'akira'\n}\n+ # add hevc profiles if setting is set\n+ if self.kodi_helper.use_hevc() is True:\n+ manifest_request_data['profiles'].append('hevc-main10-L41-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main10-L50-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main10-L51-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main-L30-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main-L31-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main-L40-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main-L41-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main-L50-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main-L51-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main10-L30-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main10-L31-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main10-L40-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main10-L41-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main10-L50-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main10-L51-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-main10-L30-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-main10-L31-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-main10-L40-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-main10-L41-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-main-L30-L31-dash-cenc-tl')\n+ manifest_request_data['profiles'].append('hevc-main-L31-L40-dash-cenc-tl')\n+ manifest_request_data['profiles'].append('hevc-main-L40-L41-dash-cenc-tl')\n+ manifest_request_data['profiles'].append('hevc-main-L50-L51-dash-cenc-tl')\n+ manifest_request_data['profiles'].append('hevc-main10-L30-L31-dash-cenc-tl')\n+ manifest_request_data['profiles'].append('hevc-main10-L31-L40-dash-cenc-tl')\n+ manifest_request_data['profiles'].append('hevc-main10-L40-L41-dash-cenc-tl')\n+ manifest_request_data['profiles'].append('hevc-main10-L50-L51-dash-cenc-tl')\n+ manifest_request_data['profiles'].append('hevc-dv-main10-L30-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-dv-main10-L31-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-dv-main10-L40-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-dv-main10-L41-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-dv-main10-L50-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-dv-main10-L51-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-dv5-main10-L30-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-dv5-main10-L31-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-dv5-main10-L40-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-dv5-main10-L41-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-dv5-main10-L50-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-dv5-main10-L51-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-hdr-main10-L30-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-hdr-main10-L31-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-hdr-main10-L40-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-hdr-main10-L41-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-hdr-main10-L50-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-hdr-main10-L51-dash-cenc')\n+ manifest_request_data['profiles'].append('hevc-hdr-main10-L30-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-hdr-main10-L31-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-hdr-main10-L40-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-hdr-main10-L41-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-hdr-main10-L50-dash-cenc-prk')\n+ manifest_request_data['profiles'].append('hevc-hdr-main10-L51-dash-cenc-prk')\n+s\n# Check if dolby sound is enabled and add to profles\nif self.kodi_helper.get_dolby_setting():\nmanifest_request_data['profiles'].append('ddplus-2.0-dash')\n@@ -442,7 +440,7 @@ class MSL:\n# Serialize the given Data\nserialized_data = json.dumps(data)\nserialized_data = serialized_data.replace('\"', '\\\\\"')\n- serialized_data = '[{},{\"headers\":{},\"path\":\"/cbp/cadmium-13\",\"payload\":{\"data\":\"' + serialized_data + '\"},\"query\":\"\"}]\\n'\n+ serialized_data = '[{},{\"headers\":{},\"path\":\"/cbp/cadmium-13'\"payload\":{\"data\":\"' + serialized_data + '\"},\"query\":\"\"}]\\n'\ncompressed_data = self.__compress_data(serialized_data)\n" }, { "change_type": "MODIFY", "old_path": "resources/settings.xml", "new_path": "resources/settings.xml", "diff": "</category>\n<category label=\"30023\">\n<setting id=\"enable_dolby_sound\" type=\"bool\" label=\"30033\" default=\"true\"/>\n+ <setting id=\"enable_hevc_profiles\" type=\"bool\" label=\"30060\" 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
feat(video): Adds abikity to enable & retrieve HEVC profiles
105,979
10.10.2017 12:45:46
-7,200
70825219176ab860b7db155bc6a450843d14aa3d
fix(msl): Remove left over char
[ { "change_type": "MODIFY", "old_path": "resources/lib/MSL.py", "new_path": "resources/lib/MSL.py", "diff": "@@ -184,7 +184,7 @@ class MSL:\nmanifest_request_data['profiles'].append('hevc-hdr-main10-L41-dash-cenc-prk')\nmanifest_request_data['profiles'].append('hevc-hdr-main10-L50-dash-cenc-prk')\nmanifest_request_data['profiles'].append('hevc-hdr-main10-L51-dash-cenc-prk')\n-s\n+\n# Check if dolby sound is enabled and add to profles\nif self.kodi_helper.get_dolby_setting():\nmanifest_request_data['profiles'].append('ddplus-2.0-dash')\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(msl): Remove left over char
105,979
10.10.2017 12:51:35
-7,200
eac45b55215eb51578ab3aa7e2fd705d9d220af0
fix(msl): Fixes code formatting issues
[ { "change_type": "MODIFY", "old_path": "resources/lib/MSL.py", "new_path": "resources/lib/MSL.py", "diff": "@@ -440,7 +440,7 @@ class MSL:\n# Serialize the given Data\nserialized_data = json.dumps(data)\nserialized_data = serialized_data.replace('\"', '\\\\\"')\n- serialized_data = '[{},{\"headers\":{},\"path\":\"/cbp/cadmium-13'\"payload\":{\"data\":\"' + serialized_data + '\"},\"query\":\"\"}]\\n'\n+ serialized_data = '[{},{\"headers\":{},\"path\":\"/cbp/cadmium-13\",\"payload\":{\"data\":\"' + serialized_data + '\"},\"query\":\"\"}]\\n'\ncompressed_data = self.__compress_data(serialized_data)\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(msl): Fixes code formatting issues
105,979
10.10.2017 13:32:11
-7,200
467351612dc079622cb63afe438d2d9529763ebc
feat(settings): Use cryptodomes own padding methods
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -11,6 +11,7 @@ import base64\nimport hashlib\nfrom Cryptodome import Random\nfrom Cryptodome.Cipher import AES\n+from Cryptodome.Util import Padding\nfrom MSL import MSL\nfrom os import remove\nfrom os.path import join, isfile\n@@ -342,7 +343,7 @@ class KodiHelper:\n:type data: str\n:returns: string -- Encoded data\n\"\"\"\n- raw = self._pad(raw)\n+ raw = Padding.pad(data_to_pad=raw, block_size=self.bs)\niv = Random.new().read(AES.block_size)\ncipher = AES.new(self.crypt_key, AES.MODE_CBC, iv)\nreturn base64.b64encode(iv + cipher.encrypt(raw))\n@@ -358,14 +359,7 @@ class KodiHelper:\nenc = base64.b64decode(enc)\niv = enc[:AES.block_size]\ncipher = AES.new(self.crypt_key, AES.MODE_CBC, iv)\n- return self._unpad(cipher.decrypt(enc[AES.block_size:])).decode('utf-8')\n-\n- def _pad(self, s):\n- return s + (self.bs - len(s) % self.bs) * chr(self.bs - len(s) % self.bs)\n-\n- @staticmethod\n- def _unpad(s):\n- return s[:-ord(s[len(s)-1:])]\n+ return Padding.unpad(padded_data=cipher.decrypt(enc[AES.block_size:]), block_size=self.bs).decode('utf-8')\ndef get_esn(self):\n\"\"\"\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
feat(settings): Use cryptodomes own padding methods
105,979
10.10.2017 15:00:36
-7,200
6575467f94f7e0f1d9a486bcc60bfa9a1e0a4949
chore(readme): Adds note about 4k videos & HEVC profiles to the readme
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -31,6 +31,7 @@ FAQ\n- [Does it work with Kodi 17](https://github.com/asciidisco/plugin.video.netflix/issues/25)\n- [Does it work on a RPI](https://github.com/asciidisco/plugin.video.netflix/issues/28)\n- [Which video resolutions are supported](https://github.com/asciidisco/plugin.video.netflix/issues/27)\n+- [Can it play 4k Videos](https://github.com/asciidisco/plugin.video.netflix/issues/86)\nFunctionality\n-------------\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(readme): Adds note about 4k videos & HEVC profiles to the readme
105,979
10.10.2017 15:19:44
-7,200
91d67f92b83e902865daaf592e15ff88b28777b9
fix(list-item): Do not override watchcount from Kodi if item hasn't been played on Netflix
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -1106,8 +1106,10 @@ class KodiHelper:\nif entry['mediatype'] == 'movie' or entry['mediatype'] == 'episode':\nli.setProperty('IsPlayable', 'true')\ninfos.update({'mediatype': entry['mediatype']})\n- if 'watched' in entry_keys:\n- infos.update({'playcount': (1, 0)[entry['watched']]})\n+ if 'watched' in entry_keys and entry.get('watched') is True:\n+ infos.update({'playcount': 1})\n+ else:\n+ del infos['playcount']\nif 'index' in entry_keys:\ninfos.update({'episode': entry['index']})\nif 'episode' in entry_keys:\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -785,7 +785,7 @@ class NetflixSession:\n'in_my_list': video['queue']['inQueue'],\n'year': video['releaseYear'],\n'runtime': self.parse_runtime_for_video(video=video),\n- 'watched': video['watched'],\n+ 'watched': video.get('watched', None),\n'tags': self.parse_tags_for_video(video=video),\n'genres': self.parse_genres_for_video(video=video, genres=genres),\n'quality': self.parse_quality_for_video(video=video),\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(list-item): Do not override watchcount from Kodi if item hasn't been played on Netflix
106,018
10.10.2017 16:46:50
-7,200
e9ea04ff5c8d87e8037cec703520f4184d4c4e64
Enable update for still exported media
[ { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "@@ -260,3 +260,7 @@ msgstr \"\"\nmsgctxt \"#30060\"\nmsgid \"Enable HEVC profiles (f.e. 4k for Android)\"\nmsgstr \"\"\n+\n+msgctxt \"#30061\"\n+msgid \"Update inside library\"\n+msgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -1221,6 +1221,7 @@ class KodiHelper:\nactions = [\n['export_to_library', self.get_local_string(30018), 'export'],\n['remove_from_library', self.get_local_string(30030), 'remove'],\n+ ['update_the_library', self.get_local_string(30061), 'update'],\n['rate_on_netflix', self.get_local_string(30019), 'rating'],\n['remove_from_my_list', self.get_local_string(30020), 'remove_from_list'],\n['add_to_my_list', self.get_local_string(30021), 'add_to_list']\n@@ -1246,11 +1247,17 @@ class KodiHelper:\nif entry['type'] == 'movie':\naction_type = 'remove_from_library' if self.library.movie_exists(title=entry['title'], year=entry['year']) else 'export_to_library'\nitems.append(action[action_type])\n- # add/remove show\n+ # Add update option\n+ if action_type == 'remove_from_library':\n+ action_type = 'update_the_library'\n+ items.append(action[action_type])\nif entry['type'] == 'show' and 'title' in entry_keys:\naction_type = 'remove_from_library' if self.library.show_exists(title=entry['title']) else 'export_to_library'\nitems.append(action[action_type])\n-\n+ # Add update option\n+ if action_type == 'remove_from_library':\n+ action_type = 'update_the_library'\n+ items.append(action[action_type])\n# add it to the item\nli.addContextMenuItems(items)\nreturn li\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -114,10 +114,18 @@ class Navigation:\nelif params['action'] == 'export':\n# adds a title to the users list on Netflix\nalt_title = self.kodi_helper.show_add_to_library_title_dialog(original_title=urllib.unquote(params['title']).decode('utf8'))\n- return self.export_to_library(video_id=params['id'], alt_title=alt_title)\n+ self.export_to_library(video_id=params['id'], alt_title=alt_title)\n+ return self.kodi_helper.refresh()\nelif params['action'] == 'remove':\n# adds a title to the users list on Netflix\n- return self.remove_from_library(video_id=params['id'])\n+ self.remove_from_library(video_id=params['id'])\n+ return self.kodi_helper.refresh()\n+ elif params['action'] == 'update':\n+ # adds a title to the users list on Netflix\n+ self.remove_from_library(video_id=params['id'])\n+ alt_title = self.kodi_helper.show_add_to_library_title_dialog(original_title=urllib.unquote(params['title']).decode('utf8'))\n+ self.export_to_library(video_id=params['id'], alt_title=alt_title)\n+ return self.kodi_helper.refresh()\nelif params['action'] == 'removeexported':\n# adds a title to the users list on Netflix\nterm = self.kodi_helper.show_finally_remove(title=params['title'], type=params['type'], year=params['year'])\n@@ -401,7 +409,7 @@ class Navigation:\nfor episode in season['episodes']:\nepisodes.append({'season': season['seq'], 'episode': episode['seq'], 'id': episode['id']})\nself.library.add_show(title=video['title'], alt_title=alt_title, episodes=episodes, build_url=self.build_url)\n- return self.kodi_helper.refresh()\n+ return True\nself.kodi_helper.show_no_metadata_notification()\nreturn False\n@@ -421,7 +429,7 @@ class Navigation:\nself.library.remove_movie(title=video['title'], year=video['year'])\nif video['type'] == 'show':\nself.library.remove_show(title=video['title'])\n- return self.kodi_helper.refresh()\n+ return True\nself.kodi_helper.show_no_metadata_notification()\nreturn False\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Enable update for still exported media
105,979
10.10.2017 19:50:27
-7,200
d2768f28d6d68efa7c2d1f5cfad0d1b1eed5628e
feat(video): Add ability to turn on the adult pin verification
[ { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "@@ -264,3 +264,7 @@ msgstr \"\"\nmsgctxt \"#30061\"\nmsgid \"Update inside library\"\nmsgstr \"\"\n+\n+msgctxt \"#30062\"\n+msgid \"Enable/disable adult pin. Active:\"\n+msgstr \"\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -68,6 +68,13 @@ class Navigation:\nif self.establish_session(account=account) != True:\nreturn self.kodi_helper.show_login_failed_notification()\n+ # switch user account\n+ if 'action' in params.keys() and params['action'] == 'toggle_adult_pin':\n+ adult_pin = self.kodi_helper.show_adult_pin_dialog()\n+ if self._check_response(self.call_netflix_service({'method': 'send_adult_pin', 'pin': adult_pin})) != True:\n+ return self.kodi_helper.show_wrong_adult_pin_notification()\n+ return self.kodi_helper.toggle_adult_pin()\n+\n# check if we need to execute any actions before the actual routing\n# gives back a dict of options routes might need\noptions = self.before_routing_action(params=params)\n@@ -145,6 +152,14 @@ class Navigation:\n# display the lists (recommendations, genres, etc.)\nreturn self.show_user_list(type=params['type'])\nelif params['action'] == 'play_video':\n+ # play a video, check for adult pin if needed\n+ adult_pin = None\n+ ask_for_adult_pin = self.kodi_helper.get_setting('adultpin_enable').lower() == 'true'\n+ if ask_for_adult_pin is True:\n+ if self.check_for_adult_pin(params=params):\n+ adult_pin = self.kodi_helper.show_adult_pin_dialog()\n+ if self._check_response(self.call_netflix_service({'method': 'send_adult_pin', 'pin': adult_pin})) != True:\n+ return self.kodi_helper.show_wrong_adult_pin_notification()\nself.play_video(video_id=params['video_id'], start_offset=params.get('start_offset', -1), infoLabels=params.get('infoLabels', {}))\nelif params['action'] == 'user-items' and params['type'] == 'search':\n# if the user requested a search, ask for the term\n@@ -472,6 +487,21 @@ class Navigation:\nreturn self.kodi_helper.show_login_failed_notification()\nreturn True\n+ def check_for_adult_pin (self, params):\n+ \"\"\"Checks if an adult pin is given in the query params\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Url query params\n+\n+ Returns\n+ -------\n+ bool\n+ Adult pin parameter exists or not\n+ \"\"\"\n+ return (True, False)[params.get('pin') == 'True']\n+\n@log\ndef before_routing_action(self, params):\n\"\"\"Executes actions before the actual routing takes place:\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "new_path": "resources/lib/NetflixHttpSubRessourceHandler.py", "diff": "@@ -281,6 +281,22 @@ class NetflixHttpSubRessourceHandler:\nvideo_id = params.get('video_id', [''])[0]\nreturn self.netflix_session.fetch_metadata(id=video_id)\n+ def send_adult_pin(self, params):\n+ \"\"\"Checks the adult pin\n+\n+ Parameters\n+ ----------\n+ params : :obj:`dict` of :obj:`str`\n+ Request params\n+\n+ Returns\n+ -------\n+ :obj:`Requests.Response`\n+ Response of the remote call\n+ \"\"\"\n+ pin = params.get('pin', [''])[0]\n+ return self.netflix_session.send_adult_pin(pin=pin)\n+\ndef switch_profile (self, params):\n\"\"\"Switch profile proxy function\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -309,16 +309,15 @@ class NetflixSession:\n\"\"\"\npayload = {\n'pin': pin,\n- 'authURL': self.user_data['authURL']\n+ 'authURL': self.user_data.get('authURL', '')\n}\n- response = self._session_get(component='adult_pin', params=payload)\n+ response = self._session_post(component='adult_pin', type='api', data=payload)\npin_response = self._process_response(response=response, component=self._get_api_url_for(component='adult_pin'))\n- keys = pin_response.keys()\n- if 'success' in keys:\n- return True\n- if 'error' in keys:\n- return pin_response\n+ if 'error' in pin_response.keys():\n+ self.log(msg='Pin error')\n+ self.log(msg=str(pin_response))\nreturn False\n+ return pin_response.get('success', False)\ndef add_to_list (self, video_id):\n\"\"\"Adds a video to \"my list\" on Netflix\n" }, { "change_type": "MODIFY", "old_path": "resources/settings.xml", "new_path": "resources/settings.xml", "diff": "<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 type=\"sep\"/>\n<setting id=\"is_settings\" type=\"action\" label=\"30035\" action=\"RunPlugin(plugin://plugin.video.netflix/?mode=openSettings&url=is)\" option=\"close\"/>\n</category>\n<category label=\"30025\">\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
feat(video): Add ability to turn on the adult pin verification
105,979
10.10.2017 20:15:44
-7,200
1f4909319889ce920a7d6274d37dbed0904c63e2
fix(search): Fixes error if movie in search result has no nested text member
[ { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -1040,10 +1040,11 @@ class NetflixSession:\nshow = {}\nraw_show = response_data['value']['videos'][id]\nshow.update({'synopsis': raw_show['regularSynopsis']})\n- if 'evidence' in raw_show:\n- show.update({'detail_text': raw_show['evidence']['value']['text']})\n+\n+ if 'evidence' in raw_show and raw_show.get('evidence') is not None and raw_show.get('evidence').get('value') is not None:\n+ show.update({'detail_text': raw_show.get('evidence', {}).get('value', {}).get('text', '')})\nif 'seasonList' in raw_show:\n- show.update({'season_id': raw_show['seasonList']['current'][1]})\n+ show.update({'season_id': raw_show.get('seasonList', {}).get('current', [])[1]})\nreturn show\ndef parse_seasons (self, id, response_data):\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(search): Fixes error if movie in search result has no nested text member
105,979
10.10.2017 20:30:36
-7,200
a540dafe0e87ba986af9a811144c2c566da58f6f
chore(readme): Adds contributing & code of conduct docs. Imporves readme
[ { "change_type": "ADD", "old_path": null, "new_path": "Code_of_Conduct.md", "diff": "+# Contributor Covenant Code of Conduct\n+\n+## Our Pledge\n+\n+In the interest of fostering an open and welcoming environment, we as\n+contributors and maintainers pledge to making participation in our project and\n+our community a harassment-free experience for everyone, regardless of age, body\n+size, disability, ethnicity, gender identity and expression, level of experience,\n+nationality, personal appearance, race, religion, or sexual identity and\n+orientation.\n+\n+## Our Standards\n+\n+Examples of behavior that contributes to creating a positive environment\n+include:\n+\n+* Using welcoming and inclusive language\n+* Being respectful of differing viewpoints and experiences\n+* Gracefully accepting constructive criticism\n+* Focusing on what is best for the community\n+* Showing empathy towards other community members\n+\n+Examples of unacceptable behavior by participants include:\n+\n+* The use of sexualized language or imagery and unwelcome sexual attention or\n+advances\n+* Trolling, insulting/derogatory comments, and personal or political attacks\n+* Public or private harassment\n+* Publishing others' private information, such as a physical or electronic\n+ address, without explicit permission\n+* Other conduct which could reasonably be considered inappropriate in a\n+ professional setting\n+\n+## Our Responsibilities\n+\n+Project maintainers are responsible for clarifying the standards of acceptable\n+behavior and are expected to take appropriate and fair corrective action in\n+response to any instances of unacceptable behavior.\n+\n+Project maintainers have the right and responsibility to remove, edit, or\n+reject comments, commits, code, wiki edits, issues, and other contributions\n+that are not aligned to this Code of Conduct, or to ban temporarily or\n+permanently any contributor for other behaviors that they deem inappropriate,\n+threatening, offensive, or harmful.\n+\n+## Scope\n+\n+This Code of Conduct applies both within project spaces and in public spaces\n+when an individual is representing the project or its community. Examples of\n+representing a project or community include using an official project e-mail\n+address, posting via an official social media account, or acting as an appointed\n+representative at an online or offline event. Representation of a project may be\n+further defined and clarified by project maintainers.\n+\n+## Enforcement\n+\n+Instances of abusive, harassing, or otherwise unacceptable behavior may be\n+reported by contacting the project team at undefined. All\n+complaints will be reviewed and investigated and will result in a response that\n+is deemed necessary and appropriate to the circumstances. The project team is\n+obligated to maintain confidentiality with regard to the reporter of an incident.\n+Further details of specific enforcement policies may be posted separately.\n+\n+Project maintainers who do not follow or enforce the Code of Conduct in good\n+faith may face temporary or permanent repercussions as determined by other\n+members of the project's leadership.\n+\n+## Attribution\n+\n+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,\n+available at [http://contributor-covenant.org/version/1/4][version]\n+\n+[homepage]: http://contributor-covenant.org\n+[version]: http://contributor-covenant.org/version/1/4/\n\\ No newline at end of file\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(readme): Adds contributing & code of conduct docs. Imporves readme
105,979
10.10.2017 20:50:33
-7,200
1485444ee38f9974f844f482f7c71ff2bdd3a50c
chore(version-bump): Version bump
[ { "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.11.25\" provider-name=\"libdev + jojo + asciidisco\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.12.0\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n<import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n<license>MIT</license>\n<forum>http://www.kodinerds.net/index.php/Thread/55607-Inputstream-Agile-Betatest-Netflix/</forum>\n<source>https://github.com/asciidisco/plugin.video.netflix</source>\n- <news>v0.11.25 (2017-09-28)\n-- Polish, Hebrew, German translation - update\n-- Export improments\n-- Better missing/disabled Inputstream addon detection\n-- Fixed no search result notification\n-- Metadata caching\n-- Background service improvements\n-- Netflic API fixes\n-\n+ <news>v0.12.0 (2017-10-10)\n+- Polish, English, German transaltion update\n+- Added setting to enable adult pin\n+- Adds ability to update exported library items\n+- Adds setting to enable HEVC profiles (4k on Android)\n+- Adds default encryption for account data\n+- Adds inputstream.adaptive as default dependency\n+- Adds metadata for exported items\n+- Adds setting to set default profile\n+- Fixes error when malformed search results appear\n+- Fixes problems with invalid cache items\n+- Fixes watchcount override\n+- Fixes issues with unicode chars in export folders\n</news>\n</extension>\n</addon>\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Dutch/strings.po", "new_path": "resources/language/Dutch/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/English/strings.po", "new_path": "resources/language/English/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/German/strings.po", "new_path": "resources/language/German/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Hebrew/strings.po", "new_path": "resources/language/Hebrew/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\n# Translated by: Itayshechter\nmsgid \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Italian/strings.po", "new_path": "resources/language/Italian/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Polish/strings.po", "new_path": "resources/language/Polish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Portugese/strings.po", "new_path": "resources/language/Portugese/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Slovak/strings.po", "new_path": "resources/language/Slovak/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Spanish/strings.po", "new_path": "resources/language/Spanish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Swedish/strings.po", "new_path": "resources/language/Swedish/strings.po", "diff": "# Kodi Media Center language file\n# Addon Name: Netflix\n# Addon id: plugin.video.netflix\n-# Addon version: 0.11.25\n# Addon Provider: libdev + jojo + asciidisco\nmsgid \"\"\nmsgstr \"\"\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(version-bump): Version bump
106,035
09.10.2017 11:09:36
18,000
fc92f032db06039fafcc4f3f1deb30d7aa6ad0f9
Avoid redundant log-in check
[ { "change_type": "MODIFY", "old_path": "resources/lib/Navigation.py", "new_path": "resources/lib/Navigation.py", "diff": "@@ -61,12 +61,9 @@ class Navigation:\nif 'action' in params.keys() and params['action'] == 'switch_account':\nreturn self.switch_account()\n- # check login & try to relogin if necessary\n- account = self.kodi_helper.get_credentials()\n- if account['email'] != '' and account['password'] != '':\n- if self._check_response(self.call_netflix_service({'method': 'is_logged_in'})) == False:\n- if self.establish_session(account=account) != True:\n- return self.kodi_helper.show_login_failed_notification()\n+ # check if we need to execute any actions before the actual routing\n+ # gives back a dict of options routes might need\n+ options = self.before_routing_action(params=params)\n# switch user account\nif 'action' in params.keys() and params['action'] == 'toggle_adult_pin':\n@@ -75,10 +72,6 @@ class Navigation:\nreturn self.kodi_helper.show_wrong_adult_pin_notification()\nreturn self.kodi_helper.toggle_adult_pin()\n- # check if we need to execute any actions before the actual routing\n- # gives back a dict of options routes might need\n- options = self.before_routing_action(params=params)\n-\n# check if one of the before routing options decided to killthe routing\nif 'exit' in options:\nself.kodi_helper.log(\"exit in options\")\n@@ -531,6 +524,10 @@ class Navigation:\npassword = self.kodi_helper.show_password_dialog()\nself.kodi_helper.set_setting(key='password', value=password)\ncredentials['password'] = password\n+ # check login & try to relogin if necessary\n+ if self._check_response(self.call_netflix_service({'method': 'is_logged_in'})) == False:\n+ if self.establish_session(account=credentials) != True:\n+ self.kodi_helper.show_login_failed_notification()\n# persist & load main menu selection\nif 'type' in params:\nself.kodi_helper.set_main_menu_selection(type=params['type'])\n@@ -545,9 +542,6 @@ class Navigation:\nprofile_id = user_data['guid']\nif profile_id:\nself.call_netflix_service({'method': 'switch_profile', 'profile_id': profile_id})\n- # check login, in case of main menu\n- if 'action' not in params:\n- self.establish_session(account=credentials)\nreturn options\ndef check_for_designated_profile_change(self, params):\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
Avoid redundant log-in check
105,979
11.10.2017 11:42:00
-7,200
c830999aea7583d4bb30cbe4a65bfac3833917cf
chore(refactor): Remove unused code paths
[ { "change_type": "MODIFY", "old_path": "resources/lib/NetflixSession.py", "new_path": "resources/lib/NetflixSession.py", "diff": "@@ -2136,26 +2136,6 @@ class NetflixSession:\ninline_data.update(avatars)\nreturn inline_data\n- def _parse_rec (self, node):\n- \"\"\"Iterates over a JavaScript AST and return values found\n-\n- Parameters\n- ----------\n- value : :obj:`dict`\n- JS AST Expression\n- Returns\n- -------\n- :obj:`dict` of :obj:`dict` or :obj:`str`\n- Parsed contents of the node\n- \"\"\"\n- if node['type'] == 'ObjectExpression':\n- _ret = {}\n- for prop in node['properties']:\n- _ret.update({prop['key']['value']: self._parse_rec(prop['value'])})\n- return _ret\n- if node['type'] == 'Literal':\n- return node['value']\n-\ndef _parse_user_data (self, netflix_page_data):\n\"\"\"Parse out the user data from the big chunk of dicts we got from\nparsing the JSON-ish data from the netflix homepage\n@@ -2189,14 +2169,6 @@ class NetflixSession:\nuser_data.update({important_field: netflix_page_data.get(important_field, '')})\nreturn user_data\n- # values are stored in lists (returned from JS parser)\n- for item in netflix_page_data:\n- if 'memberContext' in dict(item).keys():\n- for important_field in important_fields:\n- user_data.update({important_field: item['memberContext']['data']['userInfo'][important_field]})\n-\n- return user_data\n-\ndef _parse_profile_data (self, netflix_page_data):\n\"\"\"Parse out the profile data from the big chunk of dicts we got from\nparsing the JSON-ish data from the netflix homepage\n@@ -2222,7 +2194,7 @@ class NetflixSession:\n}\n}\n\"\"\"\n- profiles = {};\n+ profiles = {}\nimportant_fields = [\n'profileName',\n'isActive',\n@@ -2245,21 +2217,6 @@ class NetflixSession:\nprofiles.update({profile_id: profile})\nreturn profiles\n- # values are stored in lists (returned from JS parser)\n- # TODO: get rid of this christmas tree of doom\n- for item in netflix_page_data:\n- if 'hasViewedRatingWelcomeModal' in dict(item).keys():\n- for profile_id in item:\n- if self._is_size_key(key=profile_id) == False and type(item[profile_id]) == dict and item[profile_id].get('avatar', False) != False:\n- profile = {'id': profile_id}\n- for important_field in important_fields:\n- profile.update({important_field: item[profile_id]['summary'][important_field]})\n- avatar_base = item['nf'].get(item[profile_id]['summary']['avatarName'], False);\n- avatar = 'https://secure.netflix.com/ffe/profiles/avatars_v2/320x320/PICON_029.png' if avatar_base == False else avatar_base['images']['byWidth']['320']['value']\n- profile.update({'avatar': avatar})\n- profiles.update({profile_id: profile})\n- return profiles\n-\ndef _parse_api_base_data (self, netflix_page_data):\n\"\"\"Parse out the api url data from the big chunk of dicts we got from\nparsing the JSOn-ish data from the netflix homepage\n@@ -2338,14 +2295,7 @@ class NetflixSession:\n# values are accessible via dict (sloppy parsing successfull)\nif type(netflix_page_data) == dict:\nreturn netflix_page_data.get('esn', '')\n-\n- esn = ''\n-\n- # values are stored in lists (returned from JS parser)\n- for item in netflix_page_data:\n- if 'esnGeneratorModel' in dict(item).keys():\n- esn = item['esnGeneratorModel']['data']['esn']\n- return esn\n+ return ''\ndef _parse_page_contents (self, page_soup):\n\"\"\"Call all the parsers we need to extract all the session relevant data from the HTML page\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(refactor): Remove unused code paths
105,979
11.10.2017 15:25:53
-7,200
af2305059a6287fff9c5df5d830f37039d830e2a
chore(github): Adds PR and ISSUE templates
[ { "change_type": "ADD", "old_path": null, "new_path": "PULL_REQUEST_TEMPLATE.md", "diff": "+## Types of changes\n+\n+- [ ] Bug fix (non-breaking change which fixes an issue)\n+- [ ] New feature (non-breaking change which adds functionality)\n+- [ ] Breaking change (fix or feature that would cause existing functionality to change)\n+- [ ] I have read the [**CONTRIBUTING**](Contributing.md) document.\n+\n+### All Submissions:\n+\n+* [ ] Have you followed the guidelines in our Contributing document?\n+* [ ] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change?\n+\n+\n+### Changes to Core Features:\n+\n+* [ ] Have you added an explanation of what your changes do and why you'd like us to include them?\n+* [ ] Have you successfully ran tests with your changes locally?\n+\n+## Screenshots (if appropriate):\n+\n+[You can erase any parts of this template not applicable to your Pull Request.]\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(github): Adds PR and ISSUE templates
105,979
11.10.2017 15:26:53
-7,200
db3ad3b9286395905d5627bbd068c4812e393c60
style(i18n): Fixes linting issues
[ { "change_type": "MODIFY", "old_path": "resources/language/Italian/strings.po", "new_path": "resources/language/Italian/strings.po", "diff": "@@ -19,7 +19,7 @@ msgstr \"\"\nmsgctxt \"Addon Summary\"\nmsgid \"Netflix\"\n-msgstr \"Netflix\"\n+msgstr \"\"\nmsgctxt \"Addon Description\"\nmsgid \"Netflix VOD Services Addon\"\n@@ -43,11 +43,11 @@ msgstr \"Termine di ricerca\"\nmsgctxt \"#30004\"\nmsgid \"Password\"\n-msgstr \"Password\"\n+msgstr \"\"\nmsgctxt \"#30005\"\nmsgid \"E-mail\"\n-msgstr \"E-mail\"\n+msgstr \"\"\nmsgctxt \"#30006\"\nmsgid \"Adult verification failed\"\n@@ -83,11 +83,11 @@ msgstr \"Nessuna corrispondenza trovata\"\nmsgctxt \"#30014\"\nmsgid \"Account\"\n-msgstr \"Account\"\n+msgstr \"\"\nmsgctxt \"#30017\"\nmsgid \"Logout\"\n-msgstr \"Logout\"\n+msgstr \"\"\nmsgctxt \"#30018\"\nmsgid \"Export to library\"\n@@ -147,7 +147,7 @@ msgstr \"Modifica il titolo della libreria\"\nmsgctxt \"#30032\"\nmsgid \"Tracking\"\n-msgstr \"Tracking\"\n+msgstr \"\"\nmsgctxt \"#30033\"\nmsgid \"Use Dolby Sound\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Polish/strings.po", "new_path": "resources/language/Polish/strings.po", "diff": "@@ -19,7 +19,7 @@ msgstr \"\"\nmsgctxt \"Addon Summary\"\nmsgid \"Netflix\"\n-msgstr \"Netflix\"\n+msgstr \"\"\nmsgctxt \"Addon Description\"\nmsgid \"Netflix VOD Services Addon\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Portugese/strings.po", "new_path": "resources/language/Portugese/strings.po", "diff": "@@ -18,7 +18,7 @@ msgstr \"\"\nmsgctxt \"Addon Summary\"\nmsgid \"Netflix\"\n-msgstr \"Netflix\"\n+msgstr \"\"\nmsgctxt \"Addon Description\"\nmsgid \"Netflix VOD Services Addon\"\n@@ -46,7 +46,7 @@ msgstr \"Senha\"\nmsgctxt \"#30005\"\nmsgid \"E-mail\"\n-msgstr \"E-mail\"\n+msgstr \"\"\nmsgctxt \"#30006\"\nmsgid \"Adult verification failed\"\n@@ -110,7 +110,7 @@ msgstr \"(Entre 0 & 10)\"\nmsgctxt \"#30023\"\nmsgid \"Expert\"\n-msgstr \"Expert\"\n+msgstr \"\"\nmsgctxt \"#30024\"\nmsgid \"SSL verification\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Slovak/strings.po", "new_path": "resources/language/Slovak/strings.po", "diff": "@@ -18,7 +18,7 @@ msgstr \"\"\nmsgctxt \"Addon Summary\"\nmsgid \"Netflix\"\n-msgstr \"Netflix\"\n+msgstr \"\"\nmsgctxt \"Addon Description\"\nmsgid \"Netflix VOD Services Addon\"\n@@ -46,7 +46,7 @@ msgstr \"Heslo\"\nmsgctxt \"#30005\"\nmsgid \"E-mail\"\n-msgstr \"E-mail\"\n+msgstr \"\"\nmsgctxt \"#30006\"\nmsgid \"Adult verification failed\"\n@@ -110,7 +110,7 @@ msgstr \"(od 0 do 10)\"\nmsgctxt \"#30023\"\nmsgid \"Expert\"\n-msgstr \"Expert\"\n+msgstr \"\"\nmsgctxt \"#30024\"\nmsgid \"SSL verification\"\n" }, { "change_type": "MODIFY", "old_path": "resources/language/Swedish/strings.po", "new_path": "resources/language/Swedish/strings.po", "diff": "@@ -18,7 +18,7 @@ msgstr \"\"\nmsgctxt \"Addon Summary\"\nmsgid \"Netflix\"\n-msgstr \"Netflix\"\n+msgstr \"\"\nmsgctxt \"Addon Description\"\nmsgid \"Netflix VOD Services Addon\"\n@@ -110,7 +110,7 @@ msgstr \"(mellan 0 & 10)\"\nmsgctxt \"#30023\"\nmsgid \"Expert\"\n-msgstr \"Expert\"\n+msgstr \"\"\nmsgctxt \"#30024\"\nmsgid \"SSL verification\"\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
style(i18n): Fixes linting issues
105,979
11.10.2017 15:27:13
-7,200
a9f9cf512a0e6442512a75a34b7fb8df55069676
chore(git): Updates gitignore file
[ { "change_type": "MODIFY", "old_path": ".gitignore", "new_path": ".gitignore", "diff": "-.DS_Store\n-*.pyo\n-*.pyc\n-.idea\n+# Byte-compiled / optimized / DLL files\n+__pycache__/\n+*.py[cod]\n+*$py.class\n+\n+# C extensions\n+*.so\n+\n+# Distribution / packaging\n+.Python\n+env/\n+build/\n+develop-eggs/\n+dist/\n+downloads/\n+eggs/\n+.eggs/\n+parts/\n+sdist/\n+report/\n+var/\n+wheels/\n+*.egg-info/\n+.installed.cfg\n+*.egg\n+Changelog.md\n+Authors.md\n+node_modules/\n+package-lock.json\n+# PyInstaller\n+# Usually these files are written by a python script from a template\n+# before PyInstaller builds the exe, so as to inject date/other infos into it.\n+*.manifest\n+*.spec\n+\n+# Installer logs\n+pip-log.txt\n+pip-delete-this-directory.txt\n+\n+# Unit test / coverage reports\n+htmlcov/\n+.tox/\n+.coverage\n+coverage/\n+coverage.*\n+.cache\n+nosetests.xml\n+coverage.xml\n+*.cover\n+.hypothesis/\n+\n+# Translations\n+*.mo\n+*.pot\n+\n+# Django stuff:\n+*.log\n+local_settings.py\n+\n+# Flask stuff:\n+instance/\n+.webassets-cache\n+\n+# Scrapy stuff:\n+.scrapy\n+\n+# Sphinx documentation\n+_build/\n+\n+# PyBuilder\n+target/\n+\n+# Jupyter Notebook\n+.ipynb_checkpoints\n+\n+# pyenv\n+.python-version\n+\n+# celery beat schedule file\n+celerybeat-schedule\n+\n+# SageMath parsed files\n+*.sage.py\n+\n+# dotenv\n+.env\n+\n+# virtualenv\n+.venv\n+venv/\n+ENV/\n+\n+# Spyder project settings\n+.spyderproject\n+.spyproject\n+\n+# Rope project settings\n+.ropeproject\n+\n+# mkdocs documentation\n+/site\n+\n+# mypy\n+.mypy_cache/\n+\n+.vscode\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(git): Updates gitignore file
105,979
11.10.2017 15:27:51
-7,200
93b31ea0ba6d92cdaa2eed79bcab174350b762cf
style(addon): Fixes linting issues
[ { "change_type": "MODIFY", "old_path": "addon.py", "new_path": "addon.py", "diff": "-#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n+# Author: asciidisco\n# Module: default\n# Created on: 13.01.2017\n+# License: MIT https://goo.gl/5bMj3H\n+\n+\"\"\"Kodi plugin for Netflix (https://netflix.com)\"\"\"\n+\nimport sys\nfrom resources.lib.KodiHelper import KodiHelper\n@@ -9,29 +13,30 @@ from resources.lib.Navigation import Navigation\nfrom resources.lib.Library import Library\n# Setup plugin\n-plugin_handle = int(sys.argv[1])\n-base_url = sys.argv[0]\n+PLUGIN_HANDLE = int(sys.argv[1])\n+BASE_URL = sys.argv[0]\n+# We use string slicing to trim the leading ? from the plugin call paramstring\n+REQUEST_PARAMS = sys.argv[2][1:]\n# init plugin libs\n-kodi_helper = KodiHelper(\n- plugin_handle=plugin_handle,\n- base_url=base_url\n+KODI_HELPER = KodiHelper(\n+ plugin_handle=PLUGIN_HANDLE,\n+ base_url=BASE_URL\n)\n-library = Library(\n- root_folder=kodi_helper.base_data_path,\n- library_settings=kodi_helper.get_custom_library_settings(),\n- log_fn=kodi_helper.log\n+LIBRARY = Library(\n+ root_folder=KODI_HELPER.base_data_path,\n+ library_settings=KODI_HELPER.get_custom_library_settings(),\n+ log_fn=KODI_HELPER.log\n)\n-navigation = Navigation(\n- kodi_helper=kodi_helper,\n- library=library,\n- base_url=base_url,\n- log_fn=kodi_helper.log\n+NAVIGATION = Navigation(\n+ kodi_helper=KODI_HELPER,\n+ library=LIBRARY,\n+ base_url=BASE_URL,\n+ log_fn=KODI_HELPER.log\n)\n-kodi_helper.set_library(library=library)\n+KODI_HELPER.set_library(library=LIBRARY)\nif __name__ == '__main__':\n# Call the router function and pass the plugin call parameters to it.\n- # We use string slicing to trim the leading '?' from the plugin call paramstring\n- kodi_helper.log('Started (Version ' + kodi_helper.version + ')')\n- navigation.router(paramstring=sys.argv[2][1:])\n+ KODI_HELPER.log('Started (Version ' + KODI_HELPER.version + ')')\n+ NAVIGATION.router(paramstring=REQUEST_PARAMS)\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
style(addon): Fixes linting issues
105,979
11.10.2017 15:28:09
-7,200
60610b85698c4b285b8ea644ac441b9cfd51b679
style(utils): Fixes linting issues
[ { "change_type": "MODIFY", "old_path": "resources/lib/utils.py", "new_path": "resources/lib/utils.py", "diff": "-#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Module: utils\n# Created on: 13.01.2017\n+\"\"\"General utils\"\"\"\n+\nimport time\nimport hashlib\nimport platform\n+from functools import wraps\nimport xbmc\n-# Takes everything, does nothing, classic no operation function\ndef noop(**kwargs):\n- return True\n+ \"\"\"Takes everything, does nothing, classic no operation function\"\"\"\n+ return kwargs\n+\n+\n+def log(func):\n+ \"\"\"\n+ Log decarator that is used to annotate methods & output everything to\n+ the Kodi debug log\n+\n+ :param delay: retry delay in sec\n+ :type delay: int\n+ :returns: string -- Devices MAC address\n+ \"\"\"\n+ name = func.func_name\n-# log decorator\n-def log(f, name=None):\n- if name is None:\n- name = f.func_name\n+ @wraps(func)\ndef wrapped(*args, **kwargs):\n+ \"\"\"Wrapper function to maintain correct stack traces\"\"\"\nthat = args[0]\nclass_name = that.__class__.__name__\narguments = ''\n@@ -25,31 +37,44 @@ def log(f, name=None):\nif key != 'account' and key != 'credentials':\narguments += \":%s = %s:\" % (key, value)\nif arguments != '':\n- that.log('\"' + class_name + '::' + name + '\" called with arguments ' + arguments)\n+ that.log('\"' + class_name + '::' + name +\n+ '\" called with arguments ' + arguments)\nelse:\nthat.log('\"' + class_name + '::' + name + '\" called')\n- result = f(*args, **kwargs)\n+ result = func(*args, **kwargs)\nthat.log('\"' + class_name + '::' + name + '\" returned: ' + str(result))\nreturn result\n- wrapped.__doc__ = f.__doc__\n+\n+ wrapped.__doc__ = func.__doc__\nreturn wrapped\n-def get_user_agent_for_current_platform():\n- \"\"\"Determines the user agent string for the current platform (to retrieve a valid ESN)\n- Returns\n- -------\n- :obj:`str`\n- User Agent for platform\n+def get_user_agent():\n\"\"\"\n+ Determines the user agent string for the current platform.\n+ Needed to retrieve a valid ESN (except for Android, where the ESN can\n+ be generated locally)\n+\n+ :returns: str -- User agent string\n+ \"\"\"\n+ chrome_version = 'Chrome/59.0.3071.115'\n+ base = 'Mozilla/5.0 '\n+ base += '%PL% '\n+ base += 'AppleWebKit/537.36 (KHTML, like Gecko) '\n+ base += '%CH_VER% Safari/537.36'.replace('%CH_VER%', chrome_version)\nsystem = platform.system()\n+ # Mac OSX\nif system == 'Darwin':\n- return 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'\n+ return base.replace('%PL%', '(Macintosh; Intel Mac OS X 10_10_1)')\n+ # Windows\nif system == 'Windows':\n- return 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'\n+ return base.replace('%PL%', '(Windows NT 6.1; WOW64)')\n+ # ARM based Linux\nif platform.machine().startswith('arm'):\n- return 'Mozilla/5.0 (X11; CrOS armv7l 7647.78.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'\n- return 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'\n+ return base.replace('%PL%', '(X11; CrOS armv7l 7647.78.0)')\n+ # x86 Linux\n+ return base.replace('%PL%', '(X11; Linux x86_64)')\n+\ndef uniq_id(delay=1):\n\"\"\"\n@@ -65,6 +90,7 @@ def uniq_id(delay=1):\nelse:\nreturn hashlib.sha256('UnsafeStaticSecret'.encode()).digest()\n+\ndef __get_mac_address(delay=1):\n\"\"\"\nReturns the users mac address\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
style(utils): Fixes linting issues
105,979
11.10.2017 15:35:53
-7,200
bcc8f96f9929683e3d923c14fbd2803a0edc9507
ci(codeclimate): Add codeclimate excludes
[ { "change_type": "ADD", "old_path": null, "new_path": ".codeclimate.yml", "diff": "+---\n+engines:\n+ pep8:\n+ enabled: true\n+ radon:\n+ enabled: true\n+ config:\n+ python_version: 2\n+ markdownlint:\n+ enabled: true\n+ratings:\n+ paths:\n+ - \"**.py\"\n+ - \"**.md\"\n+exclude_paths:\n+ - \"docs\"\n+ - \"resources/test/\"\n+ - \"resources/lib/UniversalAnalytics/\"\n+ - \"resources/language/\"\n+ - \"resources/media/\"\n+ - \"resources/fanart.jpg\"\n+ - \"resources/icon.png\"\n+ - \"resources/screenshot-01.jpg\"\n+ - \"resources/screenshot-02.jpg\"\n+ - \"resources/screenshot-03.jpg\"\n+ - \"resources/settings.xml\"\n+ - \"resources/__init__.py\"\n+ - \"resources/lib/__init__.py\"\n+ - \"__init__.py\"\n+ - \"addon.xml\"\n+ - \"LICENSE.txt\"\n+ - \"makefile\"\n+ - \"requirements.txt\"\n+ - \"ISSUE_TEMPLATE.md\"\n+ - \"PULL_REQUEST_TEMPLATE.md\"\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
ci(codeclimate): Add codeclimate excludes
105,979
11.10.2017 15:36:12
-7,200
facd577597c549639d06e623bdc8641861711dbb
chore(editorconfig): Adds editorconfig
[ { "change_type": "ADD", "old_path": null, "new_path": ".editorconfig", "diff": "+# This is the project's root directory\n+root = true\n+\n+[*]\n+# Use spaces for indentation\n+indent_style = space\n+# Each indent should contain 2 spaces\n+indent_size = 2\n+# Use Unix line endings\n+end_of_line = lf\n+# The files are utf-8 encoded\n+charset = utf-8\n+# No whitespace at the end of line\n+trim_trailing_whitespace = true\n+# A file must end with an empty line - this is good for version control systems\n+insert_final_newline = true\n+# A line should not have more than this amount of chars (not supported by all plugins)\n+max_line_length = 100\n+\n+[*.{py,md,txt}]\n+indent_size = 4\n+\n+[makefile]\n+# Use tabs for indentation (Makefiles require tabs)\n+indent_style = tab\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(editorconfig): Adds editorconfig
105,979
11.10.2017 15:37:16
-7,200
1423355c6fd2d11192442c41c25956281f4b9197
docs(init): Adds initial docs
[ { "change_type": "ADD", "old_path": null, "new_path": "docs/conf.py", "diff": "+# -*- coding: utf-8 -*-\n+#\n+# plugin.video.telekom-sport documentation build configuration file, created by\n+# sphinx-quickstart on Wed Apr 26 16:27:25 2017.\n+\n+\n+import os\n+import re\n+import sys\n+from shutil import copyfile\n+import sphinx_rtd_theme\n+\n+BASE_PATH = os.path.dirname(os.path.abspath(__file__)) + os.path.sep\n+ROOT_PATH = os.path.dirname(os.path.dirname(BASE_PATH)) + os.path.sep\n+\n+sys.path.insert(0, BASE_PATH)\n+sys.path.insert(0, ROOT_PATH)\n+sys.path.insert(0, ROOT_PATH + 'resources' + os.path.sep)\n+sys.path.insert(0, ROOT_PATH + 'resources' + os.path.sep + 'lib' + os.path.sep)\n+\n+def get_addon_data():\n+ \"\"\"Loads the Kodi plugin data from addon.xml\"\"\"\n+ root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n+ pathname = os.path.join(root_dir, 'addon.xml')\n+ with open(pathname, 'rb') as addon_xml:\n+ addon_xml_contents = addon_xml.read()\n+ _id = re.search(\n+ r'(?<!xml )id=\"(.+?)\"',\n+ addon_xml_contents).group(1)\n+ author = re.search(\n+ r'(?<!xml )provider-name=\"(.+?)\"',\n+ addon_xml_contents).group(1)\n+ name = re.search(\n+ r'(?<!xml )name=\"(.+?)\"',\n+ addon_xml_contents).group(1)\n+ version = re.search(\n+ r'(?<!xml )version=\"(.+?)\"',\n+ addon_xml_contents).group(1)\n+ desc = re.search(\n+ r'(?<!xml )description lang=\"en\">(.+?)<',\n+ addon_xml_contents).group(1)\n+ email = re.search(\n+ r'(?<!xml )email>(.+?)<',\n+ addon_xml_contents).group(1)\n+ source = re.search(\n+ r'(?<!xml )source>(.+?)<',\n+ addon_xml_contents).group(1)\n+ return {\n+ 'id': _id,\n+ 'author': author,\n+ 'name': name,\n+ 'version': version,\n+ 'desc': desc,\n+ 'email': email,\n+ 'source': source,\n+ }\n+\n+ADDON_DATA = get_addon_data()\n+\n+# -- General configuration ------------------------------------------------\n+\n+# Add any Sphinx extension module names here, as strings. They can be\n+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n+# ones.\n+extensions = [\n+ 'sphinx.ext.autodoc',\n+ 'sphinx.ext.doctest',\n+ 'sphinx.ext.coverage',\n+ 'sphinx.ext.imgmath',\n+ 'sphinx.ext.viewcode',\n+ 'm2r']\n+\n+# The suffix(es) of source filenames.\n+source_suffix = ['.rst', '.md']\n+\n+# The master toctree document.\n+master_doc = 'index'\n+\n+# General information about the project.\n+project = ADDON_DATA.get('id', '')\n+copyright = u'2017, ' + ADDON_DATA.get('author', '')\n+author = ADDON_DATA.get('author', '')\n+\n+# The version info for the project you're documenting, acts as replacement for\n+# |version| and |release|, also used in various other places throughout the\n+# built documents.\n+#\n+# The short X.Y version.\n+version = ADDON_DATA.get('version', '')\n+# The full version, including alpha/beta/rc tags.\n+release = ADDON_DATA.get('version', '')\n+\n+# The language for content autogenerated by Sphinx. Refer to documentation\n+# for a list of supported languages.\n+#\n+# This is also used if you do content translation via gettext catalogs.\n+# Usually you set \"language\" from the command line for these cases.\n+language = None\n+\n+# List of patterns, relative to source directory, that match files and\n+# directories to ignore when looking for source files.\n+# This patterns also effect to html_static_path and html_extra_path\n+exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']\n+\n+# The name of the Pygments (syntax highlighting) style to use.\n+pygments_style = 'sphinx'\n+\n+# If true, `todo` and `todoList` produce output, else they produce nothing.\n+todo_include_todos = False\n+\n+# -- Options for HTML output ----------------------------------------------\n+\n+# The theme to use for HTML and HTML Help pages.\n+html_theme = 'sphinx_rtd_theme'\n+html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]\n+\n+# Add any paths that contain custom static files (such as style sheets) here,\n+# relative to this directory. They are copied after the builtin static files,\n+# so a file named \"default.css\" will overwrite the builtin \"default.css\".\n+html_static_path = ['../resources/icon.png']\n+html_logo = '_static/icon.png'\n" }, { "change_type": "ADD", "old_path": null, "new_path": "docs/index.rst", "diff": "+.. plugin.video.netflix documentation master file, created by\n+ sphinx-quickstart on Wed Apr 26 16:27:25 2017.\n+ You can adapt this file completely to your liking, but it should at least\n+ contain the root `toctree` directive.\n+\n+:github_url: https://github.com/asciidisco/plugin.video.netflix\n+\n+Code Docs\n+=========\n+\n+.. automodule:: resources.lib.utils\n+ :members:\n+ :private-members:\n+\n+Indices and tables\n+==================\n+\n+* :ref:`genindex`\n+* :ref:`modindex`\n+* :ref:`search`\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
docs(init): Adds initial docs
105,979
11.10.2017 15:38:07
-7,200
6061f65af0f41cfa27b41621e1f26a97dd369136
chore(dev): Adds requirements file for linting, testing, etc.
[ { "change_type": "ADD", "old_path": null, "new_path": "requirements.txt", "diff": "+codeclimate-test-reporter==0.2.1\n+nose==1.3.7\n+pylint==1.6.5\n+flake8==3.3.0\n+mccabe==0.6.1\n+pycodestyle==2.3.1\n+pyflakes==1.5.0\n+git+https://github.com/romanvm/Kodistubs.git#egg=Kodistubs\n+httpretty==0.8.14\n+mock==1.0.1\n+requests==2.12.4\n+beautifulsoup4==4.3.2\n+pydes==2.0.1\n+radon==2.1.1\n+Sphinx==1.5.5\n+sphinx_rtd_theme==0.2.4\n+m2r==0.1.12\n+git+https://github.com/asciidisco/kodi-release-helper.git#egg=kodi-release-helper\n+dennis==0.9\n+blessings==1.6\n+demjson==2.2.4\n+yamllint==1.8.1\n+restructuredtext_lint==1.1.1\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(dev): Adds requirements file for linting, testing, etc.
105,979
11.10.2017 15:38:31
-7,200
a62cba80a82b4032ac959b0c87354d9fc5a208aa
test(init): Initial testsuite
[ { "change_type": "ADD", "old_path": "resources/test/__init__.py", "new_path": "resources/test/__init__.py", "diff": "" }, { "change_type": "ADD", "old_path": null, "new_path": "resources/test/test_KodiHelper.py", "diff": "+# -*- coding: utf-8 -*-\n+# Module: KodiHelper\n+# Author: asciidisco\n+# Created on: 11.10.2017\n+# License: MIT https://goo.gl/5bMj3H\n+\n+\"\"\"Tests for the `KodiHelper` module\"\"\"\n+\n+import unittest\n+import mock\n+from resources.lib.KodiHelper import KodiHelper\n+\n+class KodiHelperTestCase(unittest.TestCase):\n+ pass\n" }, { "change_type": "ADD", "old_path": null, "new_path": "resources/test/test_Library.py", "diff": "+# -*- coding: utf-8 -*-\n+# Module: Library\n+# Author: asciidisco\n+# Created on: 11.10.2017\n+# License: MIT https://goo.gl/5bMj3H\n+\n+\"\"\"Tests for the `Library` module\"\"\"\n+\n+import unittest\n+import mock\n+from resources.lib.Library import Library\n+\n+class LibraryTestCase(unittest.TestCase):\n+ pass\n" }, { "change_type": "ADD", "old_path": null, "new_path": "resources/test/test_MSL.py", "diff": "+# -*- coding: utf-8 -*-\n+# Module: MSL\n+# Author: asciidisco\n+# Created on: 11.10.2017\n+# License: MIT https://goo.gl/5bMj3H\n+\n+\"\"\"Tests for the `MSL` module\"\"\"\n+\n+import unittest\n+import mock\n+from resources.lib.MSL import MSL\n+\n+class MSLTestCase(unittest.TestCase):\n+ pass\n" }, { "change_type": "ADD", "old_path": null, "new_path": "resources/test/test_Navigation.py", "diff": "+# -*- coding: utf-8 -*-\n+# Module: Navigation\n+# Author: asciidisco\n+# Created on: 11.10.2017\n+# License: MIT https://goo.gl/5bMj3H\n+\n+\"\"\"Tests for the `Navigation` module\"\"\"\n+\n+import unittest\n+import mock\n+from resources.lib.Navigation import Navigation\n+\n+class NavigationTestCase(unittest.TestCase):\n+ pass\n" }, { "change_type": "ADD", "old_path": null, "new_path": "resources/test/test_NetflixHttpRequestHandler.py", "diff": "+# -*- coding: utf-8 -*-\n+# Module: NetflixHttpRequestHandler\n+# Author: asciidisco\n+# Created on: 11.10.2017\n+# License: MIT https://goo.gl/5bMj3H\n+\n+\"\"\"Tests for the `NetflixHttpRequestHandler` module\"\"\"\n+\n+import unittest\n+import mock\n+from resources.lib.NetflixHttpRequestHandler import NetflixHttpRequestHandler\n+\n+class NetflixHttpRequestHandlerTestCase(unittest.TestCase):\n+ pass\n" }, { "change_type": "ADD", "old_path": null, "new_path": "resources/test/test_NetflixHttpSubRessourceHandler.py", "diff": "+# -*- coding: utf-8 -*-\n+# Module: NetflixHttpSubRessourceHandler\n+# Author: asciidisco\n+# Created on: 11.10.2017\n+# License: MIT https://goo.gl/5bMj3H\n+\n+\"\"\"Tests for the `NetflixHttpSubRessourceHandler` module\"\"\"\n+\n+import unittest\n+import mock\n+from resources.lib.NetflixHttpSubRessourceHandler import NetflixHttpSubRessourceHandler\n+\n+class NetflixHttpSubRessourceHandlerTestCase(unittest.TestCase):\n+ pass\n" }, { "change_type": "ADD", "old_path": null, "new_path": "resources/test/test_NetflixSession.py", "diff": "+# -*- coding: utf-8 -*-\n+# Module: NetflixSession\n+# Author: asciidisco\n+# Created on: 11.10.2017\n+# License: MIT https://goo.gl/5bMj3H\n+\n+\"\"\"Tests for the `NetflixSession` module\"\"\"\n+\n+import unittest\n+import mock\n+from resources.lib.NetflixSession import NetflixSession\n+\n+class NetflixSessionTestCase(unittest.TestCase):\n+ pass\n" }, { "change_type": "ADD", "old_path": null, "new_path": "resources/test/test_Utils.py", "diff": "+# -*- coding: utf-8 -*-\n+# Module: Utils\n+# Author: asciidisco\n+# Created on: 11.10.2017\n+# License: MIT https://goo.gl/5bMj3H\n+\n+\"\"\"Tests for the `Utils` module\"\"\"\n+\n+import unittest\n+import mock\n+from resources.lib.utils import get_user_agent\n+\n+class UtilsTestCase(unittest.TestCase):\n+ \"\"\"Tests for the `Utils` module\"\"\"\n+\n+ def test_get_user_agent(self):\n+ \"\"\"ADD ME\"\"\"\n+ self.assertIn(\n+ container=get_user_agent(),\n+ member='Chrome/59.0.3071.115')\n+\n+\n+ @mock.patch('platform.system')\n+ def test_get_user_agent_Linux(self, mock_system):\n+ \"\"\"ADD ME\"\"\"\n+ mock_system.return_value = 'Linux'\n+ self.assertIn(\n+ container=get_user_agent(),\n+ member='Linux')\n+\n+ @mock.patch('platform.system')\n+ def test_get_user_agent_Darwin(self, mock_system):\n+ \"\"\"ADD ME\"\"\"\n+ mock_system.return_value = 'Darwin'\n+ self.assertIn(\n+ container=get_user_agent(),\n+ member='Mac')\n+\n+ @mock.patch('platform.system')\n+ def test_get_user_agent_Windows(self, mock_system):\n+ \"\"\"ADD ME\"\"\"\n+ mock_system.return_value = 'Windows'\n+ self.assertIn(\n+ container=get_user_agent(),\n+ member='Win')\n+\n+ @mock.patch('platform.system')\n+ @mock.patch('platform.machine')\n+ def test_get_user_agent_Windows(self, mock_machine, mock_system):\n+ \"\"\"ADD ME\"\"\"\n+ mock_system.return_value = 'Linux'\n+ mock_machine.return_value = 'arm'\n+ self.assertIn(\n+ container=get_user_agent(),\n+ member='armv')\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
test(init): Initial testsuite
105,979
11.10.2017 15:39:06
-7,200
4baa62a1fc5efd97aa92fe8ca920c3392c613de2
chore(dev): Adds makefile to make devs happy
[ { "change_type": "ADD", "old_path": null, "new_path": "makefile", "diff": "+.PHONY: all test clean docs clean-pyc clean-report clean-docs clean-coverage\n+.DEFAULT_GOAL := all\n+\n+SPHINXBUILD = sphinx-build\n+SPHINXPROJ = pluginvideonetflix\n+BUILDDIR = ./_build\n+SOURCEDIR = ./resources/lib\n+TEST_DIR = ./resources/test\n+COVERAGE_FILE = ./.coverage\n+COVERAGE_DIR = ./coverage\n+REPORT_DIR = ./report\n+DOCS_DIR = ./docs\n+FLAKE_FILES = ./addon.py ./resources/lib/utils.py\n+RADON_FILES = resources/lib/*.py ./addon.py\n+LINT_REPORT_FILE = ./report/lint.html\n+TEST_OPTIONS = -s --cover-package=resources.lib.utils --cover-package=resources.lib.NetflixSession --cover-package=resources.lib.Navigation --cover-package=resources.lib.MSL --cover-package=resources.lib.KodiHelper --cover-package=resources.lib.Library --cover-package=resources.lib.KodiHelper --cover-package=resources.lib.Library --cover-package=resources.lib.NetflixHttpRequestHandler --cover-package=resources.lib.NetflixHttpSubRessourceHandler --cover-erase --with-coverage --cover-branches\n+I18N_FILES = resources/language/**/*.po\n+\n+all: clean lint test docs\n+\n+clean: clean-pyc clean-report clean-docs clean-coverage\n+\n+clean-docs:\n+ rm -rf $(BUILDDIR) || exit 0\n+\n+clean-pyc:\n+ find . -name '*.pyc' -exec rm {} +\n+ find . -name '*.pyo' -exec rm {} +\n+\n+clean-report:\n+ rm -rf $(REPORT_DIR) || exit 0\n+ mkdir $(REPORT_DIR)\n+\n+clean-coverage:\n+ rm $(COVERAGE_FILE) || exit 0\n+ rm -rf $(COVERAGE_DIR) || exit 0\n+ mkdir $(COVERAGE_DIR)\n+\n+lint:\n+ flake8 --filename=$(FLAKE_FILES)\n+ pylint addon resources --ignore=test,UniversalAnalytics || exit 0\n+ pylint addon resources --ignore=test,UniversalAnalytics --output-format=html > $(LINT_REPORT_FILE)\n+ radon cc $(RADON_FILES)\n+ dennis-cmd lint $(I18N_FILES)\n+ rst-lint docs/index.rst --level=severe\n+ yamllint .travis.yml .codeclimate.yml\n+\n+docs:\n+ @$(SPHINXBUILD) $(DOCS_DIR) $(BUILDDIR) -T -c ./docs\n+\n+test:\n+ nosetests $(TEST_DIR) $(TEST_OPTIONS) --cover-html --cover-html-dir=$(COVERAGE_DIR)\n+\n+\n+help:\n+ @echo \" clean-pyc\"\n+ @echo \" Remove python artifacts.\"\n+ @echo \" clean-report\"\n+ @echo \" Remove coverage/lint report artifacts.\"\n+ @echo \" clean-docs\"\n+ @echo \" Remove sphinx artifacts.\"\n+ @echo \" clean-coverage\"\n+ @echo \" Remove code coverage artifacts.\"\n+ @echo \" clean\"\n+ @echo \" Calls all clean tasks.\"\n+ @echo \" lint\"\n+ @echo \" Check style with flake8, pylint & radon\"\n+ @echo \" test\"\n+ @echo \" Run unit tests\"\n+ @echo \" docs\"\n+ @echo \" Generate sphinx docs\"\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(dev): Adds makefile to make devs happy
105,979
11.10.2017 15:42:27
-7,200
87b627b494b0200e1f99bc0eba088a45cc8446c3
ci(travis): Adds travis config file
[ { "change_type": "ADD", "old_path": null, "new_path": ".travis.yml", "diff": "+---\n+sudo: false\n+language: python\n+\n+python:\n+ - \"2.7\"\n+\n+script:\n+ - make all\n+ - touch ./_build/.nojekyll\n+ - codeclimate-test-reporter\n+\n+deploy:\n+ - provider: pages\n+ skip_cleanup: true\n+ github_token: $GITHUB_TOKEN\n+ local_dir: _build\n+ target_branch: gh-pages\n+ \"on\":\n+ branch: master\n+\n+notifications:\n+ email:\n+ on_success: change\n+ on_failure: always\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
ci(travis): Adds travis config file
105,979
11.10.2017 15:44:37
-7,200
70488f111438dd41096243ce4136bf994569ed30
chore(readme): Adds more badges
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "# Netflix Plugin for Kodi 18 (plugin.video.netflix)\n<span class=\"badge-bitcoin\"><a href=\"https://blockchain.info/address/1DHGftMkFXXsDY7UnqQuatWwxQzKVu88sF\" title=\"Donate to this project using Bitcoin\"><img src=\"https://img.shields.io/badge/bitcoin-donate-yellow.svg\" alt=\"Bitcoin donate button\" /></a></span>\n+[![Build Status](https://travis-ci.org/asciidisco/plugin.video.netflix.svg?branch=master)](https://travis-ci.org/asciidisco/plugin.video.netflix)\n+[![Test Coverage](https://codeclimate.com/github/asciidisco/plugin.video.netflix/badges/coverage.svg)](https://codeclimate.com/github/asciidisco/plugin.video.netflix/coverage)\n+[![Issue Count](https://codeclimate.com/github/asciidisco/plugin.video.netflix/badges/issue_count.svg)](https://codeclimate.com/github/asciidisco/plugin.video.netflix)\n[![Code Climate](https://codeclimate.com/github/asciidisco/plugin.video.netflix/badges/gpa.svg)](https://codeclimate.com/github/asciidisco/plugin.video.netflix)\n[![GitHub release](https://img.shields.io/github/release/asciidisco/plugin.video.netflix.svg)](https://github.com/asciidisco/plugin.video.netflix/releases)\n+[![Docs](https://media.readthedocs.org/static/projects/badges/passing.svg)](https://asciidisco.github.io/plugin.video.netflix/)\n+[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n## Disclaimer\n" }, { "change_type": "DELETE", "old_path": "__init__.py", "new_path": "__init__.py", "diff": "" } ]
Python
MIT License
castagnait/plugin.video.netflix
chore(readme): Adds more badges
105,979
12.10.2017 12:38:07
-7,200
18648fa1f89e01d0756111635496b3123159e979
fix(inputstream): Fix return value of inputstream check if its not avilable
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -1388,7 +1388,7 @@ class KodiHelper:\ndata = json.loads(response)\nif not 'error' in data.keys():\nreturn (type, data['result']['addon']['enabled'])\n- return None\n+ return (type, False)\ndef movietitle_to_id(self, title):\nquery = {\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(inputstream): Fix return value of inputstream check if its not avilable
105,979
12.10.2017 12:45:28
-7,200
8ec61eae75868e562ea4903404a17fa37315b747
fix(inputstream): Makes availability check more reliable
[ { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -1374,21 +1374,25 @@ class KodiHelper:\n:obj:`tuple` of obj:`str` and bool, or None\nInputstream addon and if it's enabled, or None\n\"\"\"\n- type = 'inputstream.adaptive'\n+ is_type = 'inputstream.adaptive'\n+ is_enabled = False\npayload = {\n'jsonrpc': '2.0',\n'id': 1,\n'method': 'Addons.GetAddonDetails',\n'params': {\n- 'addonid': type,\n+ 'addonid': is_type,\n'properties': ['enabled']\n}\n}\nresponse = xbmc.executeJSONRPC(json.dumps(payload))\ndata = json.loads(response)\nif not 'error' in data.keys():\n- return (type, data['result']['addon']['enabled'])\n- return (type, False)\n+ if isinstance(data.get('result'), dict):\n+ if isinstance(data.get('result').get('addon'), dict):\n+ is_enabled = data.get('result').get('addon').get('enabled')\n+ return (is_type, is_enabled)\n+ return (None, is_enabled)\ndef movietitle_to_id(self, title):\nquery = {\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
fix(inputstream): Makes availability check more reliable
105,979
12.10.2017 18:23:04
-7,200
0b9fe99b542be571c769d605be440d187fa40e10
refactor(NetflixSession): Removes dependency on BeautifulSoup
[ { "change_type": "MODIFY", "old_path": "addon.xml", "new_path": "addon.xml", "diff": "<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"0.12.0\" provider-name=\"libdev + jojo + asciidisco\">\n<requires>\n<import addon=\"xbmc.python\" version=\"2.24.0\"/>\n- <import addon=\"script.module.beautifulsoup4\" version=\"4.3.2\"/>\n<import addon=\"script.module.requests\" version=\"2.12.4\"/>\n<import addon=\"script.module.pycryptodome\" version=\"3.4.3\"/>\n<import addon=\"inputstream.adaptive\" version=\"2.0.0\"/>\n" }, { "change_type": "MODIFY", "old_path": "requirements.txt", "new_path": "requirements.txt", "diff": "@@ -11,7 +11,6 @@ git+https://github.com/romanvm/Kodistubs.git#egg=Kodistubs\nhttpretty==0.8.14\nmock==1.0.1\nrequests==2.12.4\n-beautifulsoup4==4.3.2\npydes==2.0.1\nradon==2.1.1\nSphinx==1.5.5\n" }, { "change_type": "MODIFY", "old_path": "resources/lib/KodiHelper.py", "new_path": "resources/lib/KodiHelper.py", "diff": "@@ -400,8 +400,6 @@ class KodiHelper:\n\"\"\"\nReturns the esn from settings\n\"\"\"\n- self.log(msg='Is FILE: ' + str(isfile(self.msl_data_path + 'msl_data.json')))\n- self.log(msg=self.get_addon().getSetting('esn'))\nreturn self.get_addon().getSetting('esn')\ndef set_esn(self, esn):\n@@ -599,8 +597,8 @@ class KodiHelper:\nList could be build\n\"\"\"\nfor profile in profiles:\n- url = build_url({'action': action, 'profile_id': profile['id']})\n- url_save_autologin = build_url({'action': 'save_autologin', 'autologin_id': profile['id'], 'autologin_user': profile['profileName']})\n+ url = build_url({'action': action, 'profile_id': profile['guid']})\n+ url_save_autologin = build_url({'action': 'save_autologin', 'autologin_id': profile['guid'], 'autologin_user': profile['profileName']})\nli = xbmcgui.ListItem(label=profile['profileName'], iconImage=profile['avatar'])\nli.setProperty('fanart_image', self.default_fanart)\nli.addContextMenuItems([(self.get_local_string(30053), 'RunPlugin('+url_save_autologin+')',)])\n" } ]
Python
MIT License
castagnait/plugin.video.netflix
refactor(NetflixSession): Removes dependency on BeautifulSoup