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
|
---|---|---|---|---|---|---|---|---|---|
106,046 | 30.12.2021 09:32:53 | -3,600 | 5cf5fa436eb9956576c0f62aa31a4c7d6c5b8a4a | Version bump (1.18.3) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.18.2+matrix.1\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.18.3+matrix.1\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n-v1.18.2 (2021-12-12)\n-- Fix \"This title is not available to watch instantly\" error due to website changes\n+v1.18.3 (2021-12-30)\n+- Add 1080P workaround for linux ARM devices\n+To enable it: On Expert settings, set \"MSL manifest version\" to \"Version 1\"\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.18.3 (2021-12-30)\n+- Add 1080P workaround for linux ARM devices\n+To enable it: On Expert settings, set \"MSL manifest version\" to \"Version 1\"\n+\nv1.18.2 (2021-12-12)\n- Fix \"This title is not available to watch instantly\" error due to website changes\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.18.3) (#1291) |
105,999 | 03.02.2022 14:15:32 | 18,000 | 7b877e6ae12a1688209591f93009971464f2b565 | Use single `viewableId` instead of list
This PR solves (or at least works around?) the issue described in and is inspired by the fixes posted there. I don't know whether this really fixes an underlying issue, but it at least gets playback working again for me. | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"new_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"diff": "@@ -164,7 +164,7 @@ class MSLHandler:\ndef _build_manifest_v1(self, **kwargs):\nparams = {\n'type': 'standard',\n- 'viewableId': [kwargs['viewable_id']],\n+ 'viewableId': kwargs['viewable_id'],\n'profiles': kwargs['profiles'],\n'flavor': 'PRE_FETCH',\n'drmType': 'widevine',\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Use single `viewableId` instead of list
This PR solves (or at least works around?) the issue described in #1300 and is inspired by the fixes posted there. I don't know whether this really fixes an underlying issue, but it at least gets playback working again for me. |
106,046 | 05.02.2022 10:51:02 | -3,600 | f329ccbcfd6ab3adb0c217b03010955f3f99dafc | Fixed tvshow.nfo not exported on library update | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/library_tasks.py",
"new_path": "resources/lib/kodi/library_tasks.py",
"diff": "@@ -153,22 +153,29 @@ class LibraryTasks(LibraryJobs):\ntasks = [self._create_export_episode_job(videoid, *metadata, nfo_settings=nfo_settings)]\nif nfo_settings and nfo_settings.export_full_tvshow:\n+ job = self._create_export_tvshow_nfo_job(videoid, metadata)\n+ if job:\n+ tasks.append(job)\n+ return tasks\n+\n+ def _create_export_tvshow_nfo_job(self, videoid, metadata):\n# Create tvshow.nfo file\n- # In episode metadata, the show data is at 3rd position,\n- # In show metadata, the show data is at 1st position.\n- # Best is to enumerate values to find the correct key position\n+ # 'get_metadata' return metadata as tuple that can have more items according to type requested, e.g.\n+ # for episode metadata: (episode_meta, season_meta, tvshow_meta)\n+ # for tvshow/season metadata: (tvshow_meta,)\n+ # We need to get the tvshow metadata for each case, then we try to find it on each tuple item\nkey_index = -1\nfor i, item in enumerate(metadata):\nif item and item.get('type', None) == 'show':\nkey_index = i\n- if key_index > -1:\n- tasks.append(self._build_export_job_data(False, True,\n+ if key_index == -1:\n+ return None\n+ return self._build_export_job_data(False, True,\nvideoid=videoid, title='tvshow.nfo',\nroot_folder_name=FOLDER_NAME_SHOWS,\nfolder_name=metadata[key_index]['title'],\nfilename='tvshow',\n- nfo_data=nfo.create_show_nfo(metadata[key_index])))\n- return tasks\n+ nfo_data=nfo.create_show_nfo(metadata[key_index]))\ndef _get_export_tvshow_jobs(self, videoid, show, nfo_settings):\n\"\"\"Get jobs data to export a tv show (join all jobs data of the seasons)\"\"\"\n@@ -219,6 +226,10 @@ class LibraryTasks(LibraryJobs):\nnfo_settings = nfo.NFOSettings(nfo_export)\n# Check and add missing seasons and episodes\nself._add_missing_items(tasks, season, videoid, metadata, nfo_settings)\n+ if nfo_settings and nfo_settings.export_full_tvshow:\n+ job = self._create_export_tvshow_nfo_job(videoid, metadata)\n+ if job:\n+ tasks.append(job)\nreturn tasks\ndef _add_missing_items(self, tasks, season, videoid, metadata, nfo_settings):\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed tvshow.nfo not exported on library update |
105,990 | 05.02.2022 18:21:01 | -3,600 | 22455d2a01f7c5714735d21b8a39ad2fbf259139 | Updated german translation for version 1.18.4 | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.de_de/strings.po",
"new_path": "resources/language/resource.language.de_de/strings.po",
"diff": "@@ -1088,7 +1088,7 @@ msgstr \"[B]Deaktivieren ist ein Sicherheitsrisiko![/B] Falls Ihr Betriebssystem\nmsgctxt \"#30612\"\nmsgid \"MSL manifest version\"\n-msgstr \"\"\n+msgstr \"MSL-Manifest-Version\"\n# Unused 30613 to 30619\nmsgctxt \"#30620\"\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Updated german translation for version 1.18.4 (#1311) |
106,046 | 05.02.2022 18:35:39 | -3,600 | 500b5a39ccd8bd44e42f1c6843f032b34a5bc946 | Version bump (1.18.4) | [
{
"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=\"1.18.3+matrix.1\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.18.4+matrix.1\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n-v1.18.3 (2021-12-30)\n-- Add 1080P workaround for linux ARM devices\n-To enable it: On Expert settings, set \"MSL manifest version\" to \"Version 1\"\n+v1.18.4 (2022-02-05)\n+- Fix error \"This title is not available to watch instantly\" when using MSL manifest v1\n+- Fixed tvshow.nfo not exported on library auto-update\n+- Update translations gl_es, jp, kr, de\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.18.4 (2022-02-05)\n+- Fix error \"This title is not available to watch instantly\" when using MSL manifest v1\n+- Fixed tvshow.nfo not exported on library auto-update\n+- Update translations gl_es, jp, kr, de\n+\nv1.18.3 (2021-12-30)\n- Add 1080P workaround for linux ARM devices\nTo enable it: On Expert settings, set \"MSL manifest version\" to \"Version 1\"\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.18.4) (#1308) |
106,046 | 06.03.2022 15:27:46 | -3,600 | 9c8938923eca97b4ade29908ec729da0c773c01d | Converted Issue bug report to YML | [
{
"change_type": "DELETE",
"old_path": ".github/ISSUE_TEMPLATE/bug_report.md",
"new_path": null,
"diff": "----\n-name: Bug report\n-about: To report errors or wrong behaviour - please use the Wiki pages, Kodi forum or Discussions tab to solve other questions\n----\n-## Bug report\n-\n-#### Your Environment\n-- Netflix add-on version: <!--- e.g. 14.1 -->\n-- Operating system version/name: <!--- e.g. Windows 10, LibreElec 9.0, etc... -->\n-- Device model: <!--- if appropriate -->\n-\n-Used Operating system:\n-* [ ] Android\n-* [ ] iOS\n-* [ ] Linux\n-* [ ] OSX\n-* [ ] Raspberry-Pi\n-* [ ] Windows\n-\n-### Describe the bug\n-<!--- A bug report that is not clear or not have a log will be closed -->\n-<!--- Put your text below this line -->\n-\n-#### Expected behavior\n-<!--- Tell us what should happen -->\n-<!--- Put your text below this line -->\n-\n-#### Actual behavior\n-<!--- Tell us what happens instead -->\n-<!--- Put your text below this line -->\n-\n-#### Steps to reproduce the behavior\n-<!--- Put your text below this line -->\n-1.\n-2.\n-3.\n-\n-#### Possible fix\n-<!--- Not obligatory, but suggest a fix or reason for the bug -->\n-<!--- Put your text below this line -->\n-\n-### Debug log\n-<!--- MANDATORY ATTACH/LINK A LOG:\n-1) Go to add-on settings, in Expert page and change \"Debug logging level\" to \"Verbose\"\n-2) Enable Kodi debug: go to Kodi Settings > System Settings > Logging, and enable \"Enable debug logging\"\n-3) How to get the log file? Read Kodi wiki: https://kodi.wiki/view/Log_file/Easy\n-4) You can attach the log file here or use http://paste.kodi.tv/\n--->\n-The debug log can be found here:\n-<!--- PLEASE RESPECT THE RULES! DO NOT PASTE THE CONTENT OF THE LOG HERE AND DO NOT CUT THE LOG INFO -->\n-\n-### Additional context or screenshots (if appropriate)\n-\n-#### Other information\n-<!--- E.g. related issues, suggestions, links for us to have context, etc... -->\n-<!--- Put your text below this line -->\n-\n-#### Screenshots\n-<!--- Add some screenshots if that helps understanding your problem -->\n-\n-\n-<!---\n-This addon respects the same rules used in the Kodi forum\n-https://kodi.wiki/view/Official:Forum_rules\n-therefore the single violation will eliminate your request\n--->\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": ".github/ISSUE_TEMPLATE/bug_report.yml",
"diff": "+name: Bug Report\n+description: To report errors or wrong behaviour\n+labels: [\"Bug\", \"Triage: Needed\"]\n+\n+body:\n+ - type: markdown\n+ attributes:\n+ value: |\n+ Thanks for filing an issue, this help us to determine what is causing your issue, please take your time to read and fill out everything with as much detail as you can.\n+ We would like to remind you that if your problem not concern bugs, instead open an bug report please use channels like Kodi forum, Github Discussions tab or Github Wiki pages.\"\n+\n+ - type: input\n+ id: addon-version\n+ validations:\n+ required: true\n+ attributes:\n+ label: Netflix add-on version\n+ description: Specify the add-on version where you have encountered the problem\n+\n+ - type: dropdown\n+ id: operative-systems\n+ validations:\n+ required: true\n+ attributes:\n+ label: Operative systems used\n+ multiple: true\n+ description: Select the operative systems where you have encountered the problem\n+ options:\n+ - Android\n+ - Linux (Ubuntu / Mint / ...)\n+ - Raspbian\n+ - CoreELEC\n+ - LibreELEC\n+ - OSMC\n+ - Mac OSX\n+ - Windows\n+ - Other (specify in description)\n+\n+ - type: dropdown\n+ id: kodi-versions\n+ validations:\n+ required: true\n+ attributes:\n+ label: Kodi version used\n+ options:\n+ - Kodi 18 (Leia)\n+ - Kodi 19 (Matrix)\n+ - Kodi 20 (Nexus)\n+ - Other (specify in description)\n+\n+ - type: textarea\n+ id: description\n+ validations:\n+ required: true\n+ attributes:\n+ label: Description of the bug\n+ description: Give a clear detailed description of the problem\n+\n+ - type: textarea\n+ id: steps\n+ attributes:\n+ label: Steps to reproduce the behavior\n+ placeholder: |\n+ Example:\n+ 1. Navigate to menu X\n+ 2. Select context menu Y\n+ 3. Play Z\n+\n+ - type: input\n+ id: log-file\n+ validations:\n+ required: true\n+ attributes:\n+ label: Debug log - mandatory\n+ description: |\n+ Refer to the Github Readme instructions on how to get the log,\n+ then save it to http://paste.kodi.tv/ and paste the link here.\n+ If the log size is too large drag-n-drop the file on description field.\n+\n+ - type: textarea\n+ id: possible-fix\n+ attributes:\n+ label: Possible fix\n+ description: If you know a possible fix to the problem describe it\n+\n+ - type: textarea\n+ id: additional-context\n+ attributes:\n+ label: Additional context\n+ description: Anything else related that might be useful (related issues, suggestions, links, ...)\n+\n+ - type: textarea\n+ id: screenshots\n+ attributes:\n+ label: Screenshots\n+ description: Add some screenshots if that helps understanding your problem\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Converted Issue bug report to YML |
106,046 | 06.03.2022 15:24:31 | -3,600 | 960ad7239289ad729ecd2cee06e710fd72e28c66 | Temporary removed rules checker
Need to be fixed for new YML format | [
{
"change_type": "DELETE",
"old_path": ".github/workflows/rules-checker.yml",
"new_path": null,
"diff": "-name: 'Rules checker'\n-on:\n- issues:\n- types:\n- - opened\n-jobs:\n- rules-checker:\n- runs-on: ubuntu-latest\n- steps:\n- - uses: actions/checkout@v2\n- name: \"Run Rules checker\"\n- - uses: CastagnaIT/[email protected]\n- with:\n- github-token: ${{ secrets.GITHUB_TOKEN }}\n- log-miss-label-text: \"Ignored rules\"\n- log-section-start-text: \"### Debug log\"\n- log-section-end-text: \"### Additional context or screenshots (if appropriate)\"\n- log-miss-comment-text: |\n- Thank you for your interest in this add-on development,\n- this is an automatically generated message by our Bot\n-\n- It seems that you have not full followed the template we provide and require for all bug reports.\n-\n- Attach the debug log is mandatory for a bug report, _the log rules are explained in the Issue creation page or in the ReadMe_.\n-\n- Please edit your Issue message to follow our [template](../raw/master/.github/ISSUE_TEMPLATE/bug_report.md). The issue will be closed after about one week has passed without satisfactory follow-up from your side.\n-\n- If you believe it was sent in error, please say so and a team member will remove the \"Ignored rules\" label.\n- generic-comment-text: |\n- Thank you for your interest in this add-on development,\n- this is an automatically generated message by our Bot\n-\n- It seems that you have not used any of the templates provided to correctly open an Issue thread.\n-\n- Using the templates provided is mandatory to provide all necessary information, this helps us to better manage all your requests, optimizing the time needed to deal with the requests of all users and the development.\n-\n- Please edit your Issue message to follow our [templates](../issues/new/choose) and make sure to fill in all fields appropriately, or close this Issue and create a new one by using the most suitable template.\n-\n- If you believe it was sent in error, please say so.\n- triage-needed-label: \"Triage: Needed\"\n- feature-label-text: \"Enhancement\"\n\\ No newline at end of file\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Temporary removed rules checker
Need to be fixed for new YML format |
106,046 | 13.03.2022 11:39:33 | -3,600 | fba9bb5ecd3bee6c877b950a4049d00fad671b1a | Add notice for Kodi 18 | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -33,6 +33,8 @@ The trademark \"Netflix\" is registered by \"Netflix, Inc.\"\n#### Quick download links\nInstall add-on via repository - provide automatic installation of updates:\n+\n+***NOTICE Kodi 18 (Leia) is EOL and the add-on version for Kodi 18 is deprecated (#975), we highly recommend upgrading to Kodi 19!***\n* [CastagnaIT Repository for KODI 18.x LEIA - repository.castagnait-1.0.1.zip](https://github.com/castagnait/repository.castagnait/raw/master/repository.castagnait-1.0.1.zip)\n* [CastagnaIT Repository for KODI 19.x MATRIX - repository.castagnait-1.0.0.zip](https://github.com/castagnait/repository.castagnait/raw/matrix/repository.castagnait-1.0.0.zip)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add notice for Kodi 18 |
106,046 | 28.04.2022 16:05:25 | -7,200 | 1144f56e77221a5b5ba575a0749b62b29b6e5ce3 | [pylint] fix redefining name | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/nfsession_ops.py",
"new_path": "resources/lib/services/nfsession/nfsession_ops.py",
"diff": "@@ -186,10 +186,10 @@ class NFSessionOperations(SessionPathRequests):\nLOG.debug('find_episode_metadata raised an error: {}, refreshing cache', exc)\ntry:\nmetadata_data = self._episode_metadata(videoid, parent_videoid, refresh_cache=True)\n- except KeyError as exc:\n+ except KeyError as exc_:\n# The new metadata does not contain the episode\n- LOG.error('Episode metadata not found, find_episode_metadata raised an error: {}', exc)\n- raise MetadataNotAvailable from exc\n+ LOG.error('Episode metadata not found, find_episode_metadata raised an error: {}', exc_)\n+ raise MetadataNotAvailable from exc_\nelse:\nmetadata_data = self._metadata(video_id=parent_videoid), None\nreturn metadata_data\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | [pylint] fix redefining name |
106,046 | 19.05.2022 19:59:35 | -7,200 | c904f26eee4ed5df9b7a7efa1a7d150ebba3da1f | Version bump (1.18.5) | [
{
"change_type": "DELETE",
"old_path": ".github/workflows/release-Leia.yml",
"new_path": null,
"diff": "-name: Release Leia\n-on:\n- push:\n- tags:\n- - 'v*'\n-jobs:\n- build:\n- if: github.event.base_ref == 'refs/heads/Leia'\n- name: Publish Leia release\n- runs-on: ubuntu-latest\n- steps:\n- - name: Checkout code\n- uses: actions/checkout@v2\n- - name: Build zip files\n- run: |\n- sudo apt-get install libxml2-utils\n- make build release=1\n- - name: Get zip filename\n- id: get-zip-filename\n- run: |\n- echo ::set-output name=zip-filename::$(cd ..;ls plugin.video.netflix*.zip | head -1)\n- - name: Get body\n- id: get-body\n- run: |\n- description=$(sed '/v[0-9\\.]*\\s([0-9-]*)/d;/^$/,$d' changelog.txt)\n- echo $description\n- description=\"${description//'%'/'%25'}\"\n- description=\"${description//$'\\n'/'%0A'}\"\n- description=\"${description//$'\\r'/'%0D'}\"\n- echo ::set-output name=body::$description\n- - name: Create GitHub Release\n- id: create_release\n- uses: actions/create-release@v1\n- env:\n- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n- with:\n- tag_name: ${{ github.ref }}\n- release_name: ${{ github.ref }}-Leia\n- body: ${{ steps.get-body.outputs.body }}\n- draft: false\n- prerelease: false\n- - name: Upload zip file\n- id: upload-zip\n- uses: actions/upload-release-asset@v1\n- env:\n- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n- with:\n- upload_url: ${{ steps.create_release.outputs.upload_url }}\n- asset_name: ${{ steps.get-zip-filename.outputs.zip-filename }}\n- asset_path: ../${{ steps.get-zip-filename.outputs.zip-filename }}\n- asset_content_type: application/zip\n"
},
{
"change_type": "MODIFY",
"old_path": ".github/workflows/release.yml",
"new_path": ".github/workflows/release.yml",
"diff": "@@ -13,6 +13,7 @@ jobs:\nuses: actions/checkout@v2\n- name: Build zip files\nrun: |\n+ sudo apt-get update\nsudo apt-get install libxml2-utils\nmake build release=1\n- name: Get zip filename\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=\"1.18.4+matrix.1\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.18.5+matrix.1\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n-v1.18.4 (2022-02-05)\n-- Fix error \"This title is not available to watch instantly\" when using MSL manifest v1\n-- Fixed tvshow.nfo not exported on library auto-update\n-- Update translations gl_es, jp, kr, de\n+v1.18.5 (2022-05-19)\n+- Updates to get/handle licensed manifest\n+- Update translations pt_br, pl\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.18.5 (2022-05-19)\n+- Updates to get/handle licensed manifest\n+- Update translations pt_br, pl\n+\nv1.18.4 (2022-02-05)\n- Fix error \"This title is not available to watch instantly\" when using MSL manifest v1\n- Fixed tvshow.nfo not exported on library auto-update\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.18.5) (#1341) |
106,046 | 21.05.2022 10:22:47 | -7,200 | 7fdc505786165e8de2b57db551d8c3d91feb8387 | Readd challenge param
oversight from last changes | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"new_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"diff": "@@ -270,6 +270,7 @@ class MSLHandler:\n'name': 'default',\n'profiles': kwargs['profiles']\n}],\n+ 'challenge': kwargs['challenge'],\n'challenges': {\n'default': [{\n'drmSessionId': kwargs['sid'] or 'session',\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Readd challenge param
oversight from last changes |
106,046 | 21.05.2022 10:30:02 | -7,200 | 04bf810accf3e88cb1d4224cf3a43c4a01ad8879 | Version bump (1.18.6) | [
{
"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=\"1.18.5+matrix.1\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.18.6+matrix.1\" provider-name=\"libdev + jojo + asciidisco + caphm + castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n-v1.18.5 (2022-05-19)\n-- Updates to get/handle licensed manifest\n-- Update translations pt_br, pl\n+v1.18.6 (2022-05-21)\n+- Fix regression to allow 1080p on ARM\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.18.6 (2022-05-21)\n+- Fix regression to allow 1080p on ARM\n+\nv1.18.5 (2022-05-19)\n- Updates to get/handle licensed manifest\n- Update translations pt_br, pl\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.18.6) (#1344) |
106,046 | 10.06.2022 16:35:58 | -7,200 | e200112b9a5f33e65669e7451e844872897780e2 | Fix pylint unnecessary-dunder-call | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/videoid.py",
"new_path": "resources/lib/common/videoid.py",
"diff": "@@ -201,10 +201,10 @@ class VideoId:\n\"\"\"Return a dict containing the relevant properties of this\ninstance\"\"\"\nresult = {'mediatype': self.mediatype}\n- result.update({prop: self.__getattribute__(prop) # pylint: disable=no-member\n+ result.update({prop: getattr(self, prop)\nfor prop in ['videoid', 'supplementalid', 'movieid',\n'tvshowid', 'seasonid', 'episodeid']\n- if self.__getattribute__(prop) is not None}) # pylint: disable=no-member\n+ if getattr(self, prop, None) is not None})\nreturn result\ndef derive_season(self, seasonid):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/run_addon.py",
"new_path": "resources/lib/run_addon.py",
"diff": "@@ -149,7 +149,7 @@ def _get_nav_handler(root_handler, pathitems):\ndef _execute(executor_type, pathitems, params, root_handler):\n\"\"\"Execute an action as specified by the path\"\"\"\ntry:\n- executor = executor_type(params).__getattribute__(pathitems[0] if pathitems else 'root')\n+ executor = getattr(executor_type(params), pathitems[0] if pathitems else 'root')\nexcept AttributeError as exc:\nraise InvalidPathError(f'Unknown action {\"/\".join(pathitems)}') from exc\nLOG.debug('Invoking action: {}', executor.__name__)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix pylint unnecessary-dunder-call |
106,046 | 11.06.2022 11:35:13 | -7,200 | 38dc1c46f9c85c5de4e759f5d51c4b3f4d560e4d | Fixed genres/subgenres menus | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/videoid.py",
"new_path": "resources/lib/common/videoid.py",
"diff": "@@ -41,7 +41,6 @@ class VideoId:\nself._id_values = _get_unicode_kwargs(kwargs)\n# debug('VideoId validation values: {}'.format(self._id_values))\nself._validate()\n- self._menu_parameters = MenuIdParameters(self._assigned_id_values()[0])\ndef _validate(self):\nvalidation_mask = 0\n@@ -100,11 +99,6 @@ class VideoId:\n\"\"\"The value of this VideoId\"\"\"\nreturn self._assigned_id_values()[0]\n- @property\n- def menu_parameters(self):\n- \"\"\"The menu parameters of the videoid value, if it exists\"\"\"\n- return self._menu_parameters\n-\n@property\ndef videoid(self):\n\"\"\"The videoid value, if it exists\"\"\"\n@@ -323,50 +317,3 @@ def _path_to_videoid(kwargs, pathitems_arg, path_offset,\nkwargs[pathitems_arg] = kwargs[pathitems_arg][:path_offset]\nelse:\ndel kwargs[pathitems_arg]\n-\n-\n-class MenuIdParameters:\n- \"\"\"Parse the information grouped in a id value of a menu\"\"\"\n- # Example:\n- # 8f0bcda8-a281-4ca3-9f56-f64ee1d76219_68180357X28X1430972X1551542684270\n- # [ request id ]X[ type id ]X[ context id ]X[ timestamp ]\n-\n- def __init__(self, id_values):\n- # Check if the idvalues is a menu id value\n- if id_values and id_values.count('-') == 4 and id_values.count('_') == 1 and id_values.count('X') == 3:\n- self._is_menu_id = True\n- self._splitted_id = id_values.split('X')\n- else:\n- self._is_menu_id = False\n-\n- @property\n- def is_menu_id(self):\n- \"\"\"Return True if is a Menu Id\"\"\"\n- return self._is_menu_id\n-\n- @property\n- def request_id(self):\n- \"\"\"Return the menu id\"\"\"\n- return self._splitted_id[0] if self._is_menu_id else None\n-\n- @property\n- def type_id(self):\n- \"\"\"Return the menu type\n- Menu types can be distinguished by numeric code, some example:\n- 6 - My list menu\n- 20 - Featured menu\n- 28 - Generic type of menu that returns tv series\n- 29 - Generic type of \"Other content similar to\"\n- 55 - Original netflix menu\n- \"\"\"\n- return self._splitted_id[1] if self._is_menu_id else None\n-\n- @property\n- def context_id(self):\n- \"\"\"Return the menu context id\"\"\"\n- return self._splitted_id[2] if self._is_menu_id else None\n-\n- @property\n- def timestamp(self):\n- \"\"\"Return the menu timestamp\"\"\"\n- return self._splitted_id[3] if self._is_menu_id else None\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -146,7 +146,7 @@ class GlobalVariables:\n'content_type': CONTENT_MOVIE,\n'has_sort_setting': True}),\n('tvshows', {'path': ['genres', 'tvshows', '83'],\n- 'loco_contexts': None,\n+ 'loco_contexts': ['genre'],\n'loco_known': False,\n'request_context_name': 'genres', # Used for sub-menus\n'label_id': 30095,\n@@ -154,7 +154,7 @@ class GlobalVariables:\n'icon': 'DefaultTVShows.png',\n'has_sort_setting': True}),\n('movies', {'path': ['genres', 'movies', '34399'],\n- 'loco_contexts': None,\n+ 'loco_contexts': ['genre'],\n'loco_known': False,\n'request_context_name': 'genres', # Used for sub-menus\n'label_id': 30096,\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_builder.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_builder.py",
"diff": "@@ -139,12 +139,10 @@ class DirectoryBuilder(DirectoryPathRequests):\nif genre_id:\n# Load the LoCo list of the specified genre\nloco_list = self.req_loco_list_genre(genre_id)\n- exclude_loco_known = True\nelse:\n# Load the LoCo root list filtered by 'loco_contexts' specified in the menu_data\nloco_list = self.req_loco_list_root()\n- exclude_loco_known = False\n- return build_loco_listing(loco_list, menu_data, force_use_videolist_id, exclude_loco_known)\n+ return build_loco_listing(loco_list, menu_data, force_use_videolist_id)\n@measure_exec_time_decorator(is_immediate=True)\ndef get_subgenres(self, menu_data, genre_id):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"diff": "@@ -184,7 +184,7 @@ def _create_episode_item(seasonid, episodeid_value, episode, episodes_list, comm\n@measure_exec_time_decorator(is_immediate=True)\n-def build_loco_listing(loco_list, menu_data, force_use_videolist_id=False, exclude_loco_known=False):\n+def build_loco_listing(loco_list, menu_data, force_use_videolist_id=False):\n\"\"\"Build a listing of video lists (LoCo)\"\"\"\n# If contexts are specified (loco_contexts in the menu_data), then the loco_list data will be filtered by\n# the specified contexts, otherwise all LoCo items will be added\n@@ -196,30 +196,17 @@ def build_loco_listing(loco_list, menu_data, force_use_videolist_id=False, exclu\ncontexts = menu_data.get('loco_contexts')\nitems_list = loco_list.lists_by_context(contexts) if contexts else loco_list.lists.items()\ndirectory_items = []\n- for video_list_id, video_list in items_list:\n- menu_parameters = common.MenuIdParameters(video_list_id)\n- if not menu_parameters.is_menu_id:\n- continue\n- list_id = (menu_parameters.context_id\n- if menu_parameters.context_id and not force_use_videolist_id\n- else video_list_id)\n- # Keep only some type of menus: 28=genre, 101=top 10\n- if exclude_loco_known:\n- if menu_parameters.type_id not in ['28', '101']:\n- continue\n- if menu_parameters.type_id == '101':\n- # Top 10 list can be obtained only with 'video_list' query\n- force_use_videolist_id = True\n+ for video_list_id, video_list in items_list: # pylint: disable=unused-variable\n# Create dynamic sub-menu info in MAIN_MENU_ITEMS\n+ list_id = str(video_list['genreId'])\nsub_menu_data = menu_data.copy()\nsub_menu_data['path'] = [menu_data['path'][0], list_id, list_id]\nsub_menu_data['loco_known'] = False\n- sub_menu_data['loco_contexts'] = None\nsub_menu_data['content_type'] = menu_data.get('content_type', G.CONTENT_SHOW)\nsub_menu_data['force_use_videolist_id'] = force_use_videolist_id\nsub_menu_data['title'] = video_list['displayName']\nsub_menu_data['initial_menu_id'] = menu_data.get('initial_menu_id', menu_data['path'][1])\n- sub_menu_data['no_use_cache'] = menu_parameters.type_id == '101'\n+ sub_menu_data['no_use_cache'] = False\nG.LOCAL_DB.set_value(list_id, sub_menu_data, TABLE_MENU_DATA)\ndirectory_items.append(_create_videolist_item(list_id, video_list, sub_menu_data, common_data))\n@@ -274,7 +261,6 @@ def build_video_listing(video_list, menu_data, sub_genre_id=None, pathitems=None\nsub_menu_data = menu_data.copy()\nsub_menu_data['path'] = [menu_data['path'][0], menu_id, sub_genre_id]\nsub_menu_data['loco_known'] = False\n- sub_menu_data['loco_contexts'] = None\nsub_menu_data['content_type'] = menu_data.get('content_type', G.CONTENT_SHOW)\nsub_menu_data.update({'title': common.get_local_string(30089)})\nsub_menu_data['initial_menu_id'] = menu_data.get('initial_menu_id', menu_data['path'][1])\n@@ -371,7 +357,6 @@ def build_lolomo_category_listing(lolomo_cat_list, menu_data):\nfor list_id, summary_data, video_list in lolomo_cat_list.lists():\nif summary_data['length'] == 0: # Do not show empty lists\ncontinue\n- menu_parameters = common.MenuIdParameters(list_id)\n# Create dynamic sub-menu info in MAIN_MENU_ITEMS\nsub_menu_data = menu_data.copy()\nsub_menu_data['path'] = [menu_data['path'][0], list_id, list_id]\n@@ -380,7 +365,7 @@ def build_lolomo_category_listing(lolomo_cat_list, menu_data):\nsub_menu_data['content_type'] = menu_data.get('content_type', G.CONTENT_SHOW)\nsub_menu_data['title'] = summary_data['displayName']\nsub_menu_data['initial_menu_id'] = menu_data.get('initial_menu_id', menu_data['path'][1])\n- sub_menu_data['no_use_cache'] = menu_parameters.type_id == '101'\n+ sub_menu_data['no_use_cache'] = False\nG.LOCAL_DB.set_value(list_id, sub_menu_data, TABLE_MENU_DATA)\ndirectory_item = _create_category_item(list_id, video_list, sub_menu_data, common_data, summary_data)\ndirectory_items.append(directory_item)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed genres/subgenres menus |
106,046 | 11.06.2022 12:01:49 | -7,200 | 7df7254cc596d50ab768036387b2e05da4534b9b | Removed update_videoid_bookmark | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/events_handler.py",
"new_path": "resources/lib/services/nfsession/msl/events_handler.py",
"diff": "@@ -96,8 +96,6 @@ class EventsHandler(threading.Thread):\nself.loco_data['list_index'])\nelse:\nLOG.debug('EventsHandler: LoCo list not updated no list context data provided')\n- # video_id = request_data['params']['sessionParams']['uiplaycontext']['video_id']\n- # self.nfsession.update_videoid_bookmark(video_id)\nself.loco_data = None\nexcept Exception as exc: # pylint: disable=broad-except\nLOG.error('EVENT [{}] - The request has failed: {}', event_type, exc)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/nfsession_ops.py",
"new_path": "resources/lib/services/nfsession/nfsession_ops.py",
"diff": "@@ -249,23 +249,6 @@ class NFSessionOperations(SessionPathRequests):\nmsg='An error prevented the update the loco context on Netflix',\ntime=10000)\n- def update_videoid_bookmark(self, video_id):\n- \"\"\"Update the videoid bookmark position\"\"\"\n- # You can check if this function works through the official android app\n- # by checking if the red status bar of watched time position appears and will be updated, or also\n- # if continueWatching list will be updated (e.g. try to play a new tvshow not contained in the \"my list\")\n- # 22/11/2021: This method seem not more used\n- call_paths = [['refreshVideoCurrentPositions']]\n- params = [f'[{video_id}]', '[]']\n- try:\n- response = self.callpath_request(call_paths, params)\n- LOG.debug('refreshVideoCurrentPositions response: {}', response)\n- except Exception as exc: # pylint: disable=broad-except\n- LOG.warn('refreshVideoCurrentPositions failed: {}', exc)\n- ui.show_notification(title=common.get_local_string(30105),\n- msg='An error prevented the update the status watched on Netflix',\n- time=10000)\n-\ndef get_videoid_info(self, videoid):\n\"\"\"Get infolabels and arts from cache (if exist) otherwise will be requested\"\"\"\nfrom resources.lib.kodi.infolabels import get_info, get_art\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Removed update_videoid_bookmark |
106,046 | 11.06.2022 14:42:40 | -7,200 | 8ba300db1d4f13279da5ea9cd95b99c5a3555762 | Add HDR type info to skin flags | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/kodi_wrappers.py",
"new_path": "resources/lib/common/kodi_wrappers.py",
"diff": "\"\"\"\nfrom typing import Dict, List, Tuple\n+import xbmc\nimport xbmcgui\n+from resources.lib.globals import G\n-# pylint: disable=redefined-builtin,invalid-name\n+\n+# pylint: disable=redefined-builtin,invalid-name,no-member\nclass ListItemW(xbmcgui.ListItem):\n\"\"\"\nWrapper for xbmcgui.ListItem\n@@ -35,11 +38,19 @@ class ListItemW(xbmcgui.ListItem):\ndef __setstate__(self, state): # Pickle method\n\"\"\"Restore the state of the object data\"\"\"\nself.setContentLookup(False)\n+ if G.IS_OLD_KODI_MODULES:\nsuper().setInfo('video', state['infolabels'])\n- super().setProperties(state['properties'])\n- super().setArt(state['art'])\nfor stream_type, quality_info in state['stream_info'].items():\nsuper().addStreamInfo(stream_type, quality_info)\n+ else:\n+ # TODO: setInfo is deprecated\n+ super().setInfo('video', state['infolabels'])\n+ video_info_tag = super().getVideoInfoTag()\n+ if state['stream_info']:\n+ video_info_tag.addVideoStream(xbmc.VideoStreamDetail(**state['stream_info']['video']))\n+ video_info_tag.addAudioStream(xbmc.AudioStreamDetail(**state['stream_info']['audio']))\n+ super().setProperties(state['properties'])\n+ super().setArt(state['art'])\nsuper().addContextMenuItems(state.get('context_menus', []))\nsuper().select(state.get('is_selected', False))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -247,6 +247,7 @@ class GlobalVariables:\nself.BASE_URL = f'plugin://{self.ADDON_ID}'\nfrom resources.lib.common.kodi_ops import KodiVersion\nself.KODI_VERSION = KodiVersion()\n+ self.IS_OLD_KODI_MODULES = self.KODI_VERSION < '20'\n# Initialize the log\nfrom resources.lib.utils.logging import LOG\nLOG.initialize(self.ADDON_ID, self.PLUGIN_HANDLE,\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -22,9 +22,9 @@ from resources.lib.utils.logging import LOG\n# it is not possible to provide specific info, then we set info according to the video properties of the video list data\n# h264 is the entry-level codec always available to all streams, the 4k only works with HEVC\nQUALITIES = [\n- {'codec': 'h264', 'width': '960', 'height': '540'},\n- {'codec': 'h264', 'width': '1920', 'height': '1080'},\n- {'codec': 'hevc', 'width': '3840', 'height': '2160'}\n+ {'codec': 'h264', 'width': 960, 'height': 540},\n+ {'codec': 'h264', 'width': 1920, 'height': 1080},\n+ {'codec': 'hevc', 'width': 3840, 'height': 2160}\n]\nCOLORS = [None, 'blue', 'red', 'green', 'white', 'yellow', 'black', 'gray']\n@@ -202,6 +202,10 @@ def get_quality_infos(item):\nquality_infos['audio']['codec'] = 'eac3'\nelse:\nquality_infos['audio']['codec'] = 'aac'\n+ if delivery.get('hasDolbyVision', False):\n+ quality_infos['video']['hdrType'] = 'dolbyvision'\n+ elif delivery.get('hasHDR', False):\n+ quality_infos['video']['hdrType'] = 'hdr10'\nreturn quality_infos\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add HDR type info to skin flags |
106,046 | 11.06.2022 16:49:14 | -7,200 | f3b76ac342f994ab5a9aa2d3e055787a568807cc | Fixed setSetting error at first startup | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/config_wizard.py",
"new_path": "resources/lib/config_wizard.py",
"diff": "@@ -12,8 +12,8 @@ from xbmc import getCondVisibility\nfrom xbmcaddon import Addon\nfrom xbmcgui import getScreenHeight, getScreenWidth\n-from resources.lib.common.exceptions import InputStreamHelperError\nfrom resources.lib.common import get_system_platform, is_device_4k_capable, get_local_string, json_rpc\n+from resources.lib.common.exceptions import InputStreamHelperError\nfrom resources.lib.globals import G\nfrom resources.lib.kodi.ui import show_ok_dialog\nfrom resources.lib.utils.logging import LOG\n@@ -56,12 +56,19 @@ def _set_isa_addon_settings(is_4k_capable, hdcp_override):\nraise InputStreamHelperError(str(exc)) from exc\nisa_addon = Addon('inputstream.adaptive')\n+ if G.KODI_VERSION < '20':\nisa_addon.setSettingBool('HDCPOVERRIDE', hdcp_override)\nif isa_addon.getSettingInt('STREAMSELECTION') == 1:\n# Stream selection must never be set to 'Manual' or cause problems with the streams\nisa_addon.setSettingInt('STREAMSELECTION', 0)\n# 'Ignore display' should only be set when Kodi display resolution is not 4K\n- isa_addon.setSettingBool('IGNOREDISPLAY', is_4k_capable and (getScreenWidth() != 3840 or getScreenHeight() != 2160))\n+ isa_addon.setSettingBool('IGNOREDISPLAY',\n+ is_4k_capable and (getScreenWidth() != 3840 or getScreenHeight() != 2160))\n+ else:\n+ isa_addon.setSettingBool('HDCPOVERRIDE', hdcp_override)\n+ # 'Ignore display' should only be set when Kodi display resolution is not 4K\n+ isa_addon.setSettingBool('adaptivestream.ignore.screen.res',\n+ is_4k_capable and (getScreenWidth() != 3840 or getScreenHeight() != 2160))\ndef _set_profiles(system, is_4k_capable):\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed setSetting error at first startup |
106,046 | 12.06.2022 09:22:35 | -7,200 | 3f62805569caf657256fbbd1401c04b70967a3a7 | Migration to new repository | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/upgrade_actions.py",
"new_path": "resources/lib/upgrade_actions.py",
"diff": "@@ -12,6 +12,7 @@ import os\nimport xbmc\nimport xbmcvfs\n+from resources.lib.common import CmpVersion\nfrom resources.lib.common.fileops import (list_dir, join_folders_paths, load_file, save_file, copy_file, delete_file)\nfrom resources.lib.globals import G\nfrom resources.lib.kodi import ui\n@@ -72,3 +73,44 @@ def _migrate_strm_files(folder_path):\ncontinue\nfile_content = file_content.strip('\\t\\n\\r').replace('/play/', '/play_strm/')\nsave_file(file_path, file_content.encode('utf-8'))\n+\n+\n+def migrate_repository():\n+ if not xbmc.getCondVisibility('System.hasAddon(repository.castagnait)'):\n+ return\n+ from xbmcaddon import Addon\n+ if CmpVersion(Addon('repository.castagnait').getAddonInfo('version')) >= '2.0.0':\n+ return\n+ LOG.info('Upgrading add-on repository \"repository.castagnait\" to version 2.0.0')\n+ repo_folder = G.ADDON_DATA_PATH.replace('plugin.video.netflix', 'repository.castagnait')\n+ data = (\n+ '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\\n'\n+ '<addon id=\"repository.castagnait\" name=\"CastagnaIT Repository\" version=\"2.0.0\" provider-name=\"castagnait\">\\n'\n+ '<extension point=\"xbmc.addon.repository\" name=\"CastagnaIT Repository\">\\n'\n+ '<dir minversion=\"18.0.0\">\\n'\n+ '<info compressed=\"false\">https://github.com/CastagnaIT/repository.castagnait/raw/kodi/kodi18/addons.xml</info>\\n'\n+ '<checksum>https://github.com/CastagnaIT/repository.castagnait/raw/kodi/kodi18/addons.xml.md5</checksum>\\n'\n+ '<datadir zip=\"true\">https://github.com/CastagnaIT/repository.castagnait/raw/kodi/kodi18</datadir>\\n'\n+ '<hashes>false</hashes>\\n'\n+ '</dir>\\n'\n+ '<dir minversion=\"19.0.0\">\\n'\n+ '<info compressed=\"false\">https://github.com/CastagnaIT/repository.castagnait/raw/kodi/kodi19/addons.xml</info>\\n'\n+ '<checksum>https://github.com/CastagnaIT/repository.castagnait/raw/kodi/kodi19/addons.xml.md5</checksum>\\n'\n+ '<datadir zip=\"true\">https://github.com/CastagnaIT/repository.castagnait/raw/kodi/kodi19</datadir>\\n'\n+ '<hashes>false</hashes>\\n'\n+ '</dir>\\n'\n+ '</extension>\\n'\n+ '<extension point=\"xbmc.addon.metadata\">\\n'\n+ '<summary>CastagnaIT Repository</summary>\\n'\n+ '<description>Castagna IT repository</description>\\n'\n+ '<platform>all</platform>\\n'\n+ '<assets>\\n'\n+ '<icon>icon.jpg</icon>\\n'\n+ '</assets>\\n'\n+ '</extension>\\n'\n+ '</addon>\\n')\n+ try:\n+ save_file(repo_folder + 'addon.xml', data.encode('utf-8'))\n+ xbmc.executebuiltin('UpdateLocalAddons')\n+ except Exception: # pylint: disable=broad-except\n+ LOG.error('Failed to upgrade add-on repository')\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/upgrade_controller.py",
"new_path": "resources/lib/upgrade_controller.py",
"diff": "@@ -123,6 +123,10 @@ def _perform_service_changes(previous_ver, current_ver):\nif CmpVersion(previous_ver) < '1.18.3':\n# In the version 1.18.3 content_profiles_int has been replaced by manifest_settings_status\nG.LOCAL_DB.delete_key('content_profiles_int')\n+ if CmpVersion(previous_ver) < '1.18.7':\n+ # Migrate to new repository\n+ from resources.lib.upgrade_actions import migrate_repository\n+ migrate_repository()\ndef _perform_local_db_changes(current_version, upgrade_to_version):\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Migration to new repository |
106,046 | 12.06.2022 10:45:22 | -7,200 | 940c767437ca18a80867cd2f53be7f206ba7ad8f | Update README.md
Update for new repository | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -32,15 +32,11 @@ The trademark \"Netflix\" is registered by \"Netflix, Inc.\"\n#### Quick download links\n-Install add-on via repository - provide automatic installation of updates:\n+Install add-on via repository - provide automatic installation of updates:<br/>\n+[CastagnaIT Repository for Kodi - repository.castagnait-2.0.0.zip](https://github.com/castagnait/repository.castagnait/raw/kodi/repository.castagnait-2.0.0.zip)<br/>\n+_NOTICE: Add-on version for Kodi 18 is deprecated [#975](https://github.com/CastagnaIT/plugin.video.netflix/issues/975), we highly recommend upgrading to Kodi 19 or above._\n-***NOTICE Kodi 18 (Leia) is EOL and the add-on version for Kodi 18 is deprecated (#975), we highly recommend upgrading to Kodi 19!***\n-* [CastagnaIT Repository for KODI 18.x LEIA - repository.castagnait-1.0.1.zip](https://github.com/castagnait/repository.castagnait/raw/master/repository.castagnait-1.0.1.zip)\n-* [CastagnaIT Repository for KODI 19.x MATRIX - repository.castagnait-1.0.0.zip](https://github.com/castagnait/repository.castagnait/raw/matrix/repository.castagnait-1.0.0.zip)\n-\n-Install add-on manually - updates should always be installed manually:\n-* Daily builds - To get latest fixes https://bit.ly/citnfdailybuilds (not always published see dates)\n-* As Kodi file source, only for Kodi 19:<br/>\n+Install add-on manually - updates should always be installed manually:<br/>\nhttps://castagnait.github.io/repository.castagnait/ (url to add in the Kodi file manager)\n## Login with Authentication key\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Update README.md
Update for new repository |
106,046 | 13.06.2022 11:25:41 | -7,200 | 215c3992590206df097c6e7d86bc4ae2523c3859 | Reintroduced no cache for Top 10 menus | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"diff": "@@ -206,7 +206,8 @@ def build_loco_listing(loco_list, menu_data, force_use_videolist_id=False):\nsub_menu_data['force_use_videolist_id'] = force_use_videolist_id\nsub_menu_data['title'] = video_list['displayName']\nsub_menu_data['initial_menu_id'] = menu_data.get('initial_menu_id', menu_data['path'][1])\n- sub_menu_data['no_use_cache'] = False\n+ # Do not use the cache with 'Top 10' menus, so that you always get up-to-date data.\n+ sub_menu_data['no_use_cache'] = video_list['context'] == 'mostWatched'\nG.LOCAL_DB.set_value(list_id, sub_menu_data, TABLE_MENU_DATA)\ndirectory_items.append(_create_videolist_item(list_id, video_list, sub_menu_data, common_data))\n@@ -365,7 +366,8 @@ def build_lolomo_category_listing(lolomo_cat_list, menu_data):\nsub_menu_data['content_type'] = menu_data.get('content_type', G.CONTENT_SHOW)\nsub_menu_data['title'] = summary_data['displayName']\nsub_menu_data['initial_menu_id'] = menu_data.get('initial_menu_id', menu_data['path'][1])\n- sub_menu_data['no_use_cache'] = False\n+ # Do not use the cache with 'Top 10' menus, so that you always get up-to-date data.\n+ sub_menu_data['no_use_cache'] = video_list['context'] == 'mostWatched'\nG.LOCAL_DB.set_value(list_id, sub_menu_data, TABLE_MENU_DATA)\ndirectory_item = _create_category_item(list_id, video_list, sub_menu_data, common_data, summary_data)\ndirectory_items.append(directory_item)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Reintroduced no cache for Top 10 menus |
106,046 | 14.06.2022 10:28:31 | -7,200 | 4181da903a39d562eae8dad2e0198b4c09f8866c | Version bump (1.18.7) | [
{
"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=\"1.18.6+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.18.7+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n-v1.18.6 (2022-05-21)\n-- Fix regression to allow 1080p on ARM\n+v1.18.7 (2022-06-14)\n+- REPOSITORY CHANGED: The repository has been changed, to receive future updates\n+the add-on will try update it automatically to new v2.0, if for some reason this not\n+happens you can update it manually by downloading: repository.castagnait-2.0.0.zip\n+from Github Readme: https://github.com/CastagnaIT/plugin.video.netflix\n+- Started tv shows are no longer marked as watched by default, this to prevent problems\n+with Skin filters, if you prefer it enable \"Marks started tv shows as watched\" from settings.\n+- Fix genres/subgenres menus due to website changes\n+- Add support to HDR/DolbyVision skin media flags (Kodi 20)\n+- Update translations pl, it, cs_cz, hu, de, zh_tw, fr, gl_es\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.18.7 (2022-06-14)\n+- REPOSITORY CHANGED: The repository has been changed, to receive future updates\n+the add-on will try update it automatically to new v2.0, if for some reason this not\n+happens you can update it manually by downloading: repository.castagnait-2.0.0.zip\n+from Github Readme: https://github.com/CastagnaIT/plugin.video.netflix\n+- Started tv shows are no longer marked as watched by default, this to prevent problems\n+with Skin filters, if you prefer it enable \"Marks started tv shows as watched\" from settings.\n+- Fix genres/subgenres menus due to website changes\n+- Add support to HDR/DolbyVision skin media flags (Kodi 20)\n+- Update translations pl, it, cs_cz, hu, de, zh_tw, fr, gl_es\n+\nv1.18.6 (2022-05-21)\n- Fix regression to allow 1080p on ARM\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.18.7) (#1357) |
106,046 | 18.06.2022 10:34:05 | -7,200 | 23dbde5e2cf41e09181a27ea7ae6290b5387fe8c | Fix to version suffix added from kodi | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -306,7 +306,7 @@ class GlobalVariables:\ndef remove_ver_suffix(version):\n\"\"\"Remove the codename suffix from version value\"\"\"\nimport re\n- pattern = re.compile(r'\\+\\w+\\.\\d$') # Example: +matrix.1\n+ pattern = re.compile(r'\\+.+$') # Example: +matrix +matrix.1 ...\nreturn re.sub(pattern, '', version)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/upgrade_actions.py",
"new_path": "resources/lib/upgrade_actions.py",
"diff": "@@ -14,7 +14,7 @@ import xbmcvfs\nfrom resources.lib.common import CmpVersion\nfrom resources.lib.common.fileops import (list_dir, join_folders_paths, load_file, save_file, copy_file, delete_file)\n-from resources.lib.globals import G\n+from resources.lib.globals import G, remove_ver_suffix\nfrom resources.lib.kodi import ui\nfrom resources.lib.kodi.library_utils import get_library_subfolders, FOLDER_NAME_MOVIES, FOLDER_NAME_SHOWS\nfrom resources.lib.utils.logging import LOG\n@@ -79,7 +79,8 @@ def migrate_repository():\nif not xbmc.getCondVisibility('System.hasAddon(repository.castagnait)'):\nreturn\nfrom xbmcaddon import Addon\n- if CmpVersion(Addon('repository.castagnait').getAddonInfo('version')) >= '2.0.0':\n+ # Sometime kodi append suffix \"+matrix\" to the version also when the addon version string not include it\n+ if CmpVersion(remove_ver_suffix(Addon('repository.castagnait').getAddonInfo('version'))) >= '2.0.0':\nreturn\nLOG.info('Upgrading add-on repository \"repository.castagnait\" to version 2.0.0')\nrepo_folder = G.ADDON_DATA_PATH.replace('plugin.video.netflix', 'repository.castagnait')\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix to version suffix added from kodi |
106,046 | 19.06.2022 11:45:53 | -7,200 | dfa358cd0a4912a4930342a13a654a79dde65dce | Version bump (1.18.8) | [
{
"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=\"1.18.7+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.18.8+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n-v1.18.7 (2022-06-14)\n+v1.18.8 (2022-06-19)\n- REPOSITORY CHANGED: The repository has been changed, to receive future updates\nthe add-on will try update it automatically to new v2.0, if for some reason this not\nhappens you can update it manually by downloading: repository.castagnait-2.0.0.zip\nfrom Github Readme: https://github.com/CastagnaIT/plugin.video.netflix\n-- Started tv shows are no longer marked as watched by default, this to prevent problems\n-with Skin filters, if you prefer it enable \"Marks started tv shows as watched\" from settings.\n-- Fix genres/subgenres menus due to website changes\n-- Add support to HDR/DolbyVision skin media flags (Kodi 20)\n-- Update translations pl, it, cs_cz, hu, de, zh_tw, fr, gl_es\n+- Fix broken addon startup due to update error\n+- Update translations zh_cn, ro, pt_br\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.18.8 (2022-06-19)\n+- REPOSITORY CHANGED: The repository has been changed, to receive future updates\n+the add-on will try update it automatically to new v2.0, if for some reason this not\n+happens you can update it manually by downloading: repository.castagnait-2.0.0.zip\n+from Github Readme: https://github.com/CastagnaIT/plugin.video.netflix\n+- Fix broken addon startup due to update error\n+- Update translations zh_cn, ro, pt_br\n+\nv1.18.7 (2022-06-14)\n- REPOSITORY CHANGED: The repository has been changed, to receive future updates\nthe add-on will try update it automatically to new v2.0, if for some reason this not\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.18.8) (#1376) |
106,046 | 24.06.2022 15:23:19 | -7,200 | 4341e43da360cb9ac1ef85a05e86e8e5ab685748 | Fixed recommendations menu | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"diff": "@@ -198,9 +198,14 @@ def build_loco_listing(loco_list, menu_data, force_use_videolist_id=False):\ndirectory_items = []\nfor video_list_id, video_list in items_list: # pylint: disable=unused-variable\n# Create dynamic sub-menu info in MAIN_MENU_ITEMS\n+ if video_list['context'] == 'genre':\n+ menu_func_name = menu_data['path'][0]\nlist_id = str(video_list['genreId'])\n+ else:\n+ menu_func_name = 'video_list'\n+ list_id = video_list['id']\nsub_menu_data = menu_data.copy()\n- sub_menu_data['path'] = [menu_data['path'][0], list_id, list_id]\n+ sub_menu_data['path'] = [menu_func_name, list_id, list_id]\nsub_menu_data['loco_known'] = False\nsub_menu_data['content_type'] = menu_data.get('content_type', G.CONTENT_SHOW)\nsub_menu_data['force_use_videolist_id'] = force_use_videolist_id\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed recommendations menu |
106,046 | 27.06.2022 21:02:20 | -7,200 | d4238a38f51800087d54779d29f446550dae0262 | Fix "double click" on skip button
Needed for Kodi 20 | [
{
"change_type": "MODIFY",
"old_path": "resources/skins/default/1080i/plugin-video-netflix-Skip.xml",
"new_path": "resources/skins/default/1080i/plugin-video-netflix-Skip.xml",
"diff": "<texturenofocus border=\"10\" colordiffuse=\"B3161618\">smallbutton.png</texturenofocus>\n<animation effect=\"fade\" start=\"0\" end=\"100\" time=\"200\">WindowOpen</animation>\n<animation effect=\"fade\" start=\"100\" end=\"0\" time=\"200\">WindowClose</animation>\n+ <!--\n+ allowhiddenfocus is necessary because the window is opened completely transparently (animation fade effect start from 0)\n+ Without it, the button cannot receive focus and a double \"click\" is required to trigger the action\n+ -->\n+ <visible allowhiddenfocus=\"true\">true</visible>\n</control>\n</control>\n</controls>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix "double click" on skip button
Needed for Kodi 20 |
106,046 | 03.07.2022 20:50:00 | -7,200 | 41f3cb27af525f39aebc8bbad1ba35cfe322caa7 | Make mediaflag video codec settings dependent | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -18,15 +18,6 @@ from resources.lib.globals import G\nfrom resources.lib.utils.logging import LOG\n-# For each videos Netflix provides multiple codecs and the resolutions depends on type of device/SO/DRM used\n-# it is not possible to provide specific info, then we set info according to the video properties of the video list data\n-# h264 is the entry-level codec always available to all streams, the 4k only works with HEVC\n-QUALITIES = [\n- {'codec': 'h264', 'width': 960, 'height': 540},\n- {'codec': 'h264', 'width': 1920, 'height': 1080},\n- {'codec': 'hevc', 'width': 3840, 'height': 2160}\n-]\n-\nCOLORS = [None, 'blue', 'red', 'green', 'white', 'yellow', 'black', 'gray']\n# Mapping of videoid type to ListItem.MediaType\n@@ -40,7 +31,21 @@ MEDIA_TYPE_MAPPINGS = {\n}\n-def get_info(videoid, item, raw_data, profile_language_code='', delayed_db_op=False):\n+def get_video_codec_hint():\n+ \"\"\"Suggests which codec the video may have\"\"\"\n+ # The video lists do not provide the type of codec, it depends on many factors (device/SO/DRM/manifest request)\n+ # but we can rely on which codec is enabled from the settings, if there are more codecs enabled usually\n+ # the most efficient codec has the priority, e.g. HEVC > VP9 > H264\n+ # This could be not always reliable, depends also on the availability of stream types\n+ codec = 'h264'\n+ if G.ADDON.getSettingBool('enable_hevc_profiles'):\n+ codec = 'hevc'\n+ elif G.ADDON.getSettingBool('enable_vp9_profiles'):\n+ codec = 'vp9'\n+ return codec\n+\n+\n+def get_info(videoid, item, raw_data, profile_language_code='', delayed_db_op=False, common_data=dict):\n\"\"\"Get the infolabels data\"\"\"\ncache_identifier = f'{videoid.value}_{profile_language_code}'\ntry:\n@@ -48,7 +53,7 @@ def get_info(videoid, item, raw_data, profile_language_code='', delayed_db_op=Fa\ninfos = cache_entry['infos']\nquality_infos = cache_entry['quality_infos']\nexcept CacheMiss:\n- infos, quality_infos = parse_info(videoid, item, raw_data)\n+ infos, quality_infos = parse_info(videoid, item, raw_data, common_data)\nG.CACHE.add(CACHE_INFOLABELS, cache_identifier, {'infos': infos, 'quality_infos': quality_infos},\ndelayed_db_op=delayed_db_op)\nreturn infos, quality_infos\n@@ -56,8 +61,7 @@ def get_info(videoid, item, raw_data, profile_language_code='', delayed_db_op=Fa\ndef add_info_list_item(list_item: ListItemW, videoid, item, raw_data, is_in_mylist, common_data, art_item=None):\n\"\"\"Add infolabels and art to a ListItem\"\"\"\n- infos, quality_infos = get_info(videoid, item, raw_data,\n- delayed_db_op=True)\n+ infos, quality_infos = get_info(videoid, item, raw_data, delayed_db_op=True, common_data=common_data)\nlist_item.addStreamInfoFromDict(quality_infos)\n# Use a deepcopy of dict to not reflect future changes to the dictionary also to the cache\ninfos_copy = copy.deepcopy(infos)\n@@ -124,7 +128,7 @@ def get_resume_info_from_library(videoid):\nreturn {}\n-def parse_info(videoid, item, raw_data):\n+def parse_info(videoid, item, raw_data, common_data):\n\"\"\"Parse info from a path request response into Kodi infolabels\"\"\"\nif (videoid.mediatype == common.VideoId.UNSPECIFIED and\nhasattr(item, 'contained_titles')):\n@@ -147,7 +151,7 @@ def parse_info(videoid, item, raw_data):\ninfos.update(_parse_referenced_infos(item, raw_data))\ninfos.update(_parse_tags(item))\n- return infos, get_quality_infos(item)\n+ return infos, get_quality_infos(item, common_data.get('video_codec_hint', get_video_codec_hint()))\ndef _parse_atomic_infos(item):\n@@ -186,14 +190,17 @@ def _parse_tags(item):\nif isinstance(tagdef.get('name', {}), str)]}\n-def get_quality_infos(item):\n+def get_quality_infos(item, video_codec_hint):\n\"\"\"Return audio and video quality infolabels\"\"\"\nquality_infos = {}\ndelivery = item.get('delivery')\nif delivery:\n- quality_infos['video'] = QUALITIES[\n- min((delivery.get('hasUltraHD', False) << 1 |\n- delivery.get('hasHD')), 2)]\n+ if delivery.get('hasUltraHD', False): # 4k only with HEVC codec\n+ quality_infos['video'] = {'codec': 'hevc', 'width': 3840, 'height': 2160}\n+ elif delivery.get('hasHD'):\n+ quality_infos['video'] = {'codec': video_codec_hint, 'width': 1920, 'height': 1080}\n+ else:\n+ quality_infos['video'] = {'codec': video_codec_hint, 'width': 960, 'height': 540}\nquality_infos['audio'] = {'channels': 2 + 4 * delivery.get('has51Audio', False)}\nif G.ADDON.getSettingBool('enable_dolby_sound'):\nif delivery.get('hasDolbyAtmos', False):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"diff": "@@ -15,7 +15,7 @@ from resources.lib.database.db_utils import (TABLE_MENU_DATA)\nfrom resources.lib.globals import G\nfrom resources.lib.kodi.context_menu import (generate_context_menu_items, generate_context_menu_profile,\ngenerate_context_menu_remind_me)\n-from resources.lib.kodi.infolabels import get_color_name, set_watched_status, add_info_list_item\n+from resources.lib.kodi.infolabels import get_color_name, set_watched_status, add_info_list_item, get_video_codec_hint\nfrom resources.lib.services.nfsession.directorybuilder.dir_builder_utils import (get_param_watched_status_by_profile,\nadd_items_previous_next_page,\nget_availability_message)\n@@ -30,15 +30,21 @@ from resources.lib.utils.logging import measure_exec_time_decorator\n# 'common_data' dict is used to avoid cpu overload for multiple accesses to other resources improve a lot the execution\n+def get_common_data():\n+ \"\"\"Temporarily stores common data for faster access\"\"\"\n+ return {\n+ 'supplemental_info_color': get_color_name(G.ADDON.getSettingInt('supplemental_info_color')),\n+ 'profile_language_code': G.LOCAL_DB.get_profile_config('language', ''),\n+ 'video_codec_hint': get_video_codec_hint()\n+ }\n+\n+\n@measure_exec_time_decorator(is_immediate=True)\ndef build_mainmenu_listing(loco_list):\n\"\"\"Builds the main menu listing (my list, continue watching, etc.)\"\"\"\nfrom resources.lib.kodi.context_menu import generate_context_menu_mainmenu\ndirectory_items = []\n- common_data = {\n- 'profile_language_code': G.LOCAL_DB.get_profile_config('language', ''),\n- 'supplemental_info_color': get_color_name(G.ADDON.getSettingInt('supplemental_info_color'))\n- }\n+ common_data = get_common_data()\nfor menu_id, data in G.MAIN_MENU_ITEMS.items():\nif data.get('has_show_setting', True) and not G.ADDON.getSettingBool('_'.join(('show_menu', menu_id))):\ncontinue\n@@ -122,10 +128,7 @@ def _create_profile_item(profile_guid, is_selected, is_autoselect, is_library_pl\n@measure_exec_time_decorator(is_immediate=True)\ndef build_season_listing(season_list, tvshowid, pathitems=None):\n\"\"\"Build a season listing\"\"\"\n- common_data = {\n- 'supplemental_info_color': get_color_name(G.ADDON.getSettingInt('supplemental_info_color')),\n- 'profile_language_code': G.LOCAL_DB.get_profile_config('language', '')\n- }\n+ common_data = get_common_data()\ndirectory_items = [_create_season_item(tvshowid, seasonid_value, season, season_list, common_data)\nfor seasonid_value, season in season_list.seasons.items()]\n# add_items_previous_next_page use the new value of perpetual_range_selector\n@@ -147,13 +150,11 @@ def _create_season_item(tvshowid, seasonid_value, season, season_list, common_da\n@measure_exec_time_decorator(is_immediate=True)\ndef build_episode_listing(episodes_list, seasonid, pathitems=None):\n\"\"\"Build a episodes listing of a season\"\"\"\n- common_data = {\n- 'params': get_param_watched_status_by_profile(),\n- 'set_watched_status': G.ADDON.getSettingBool('sync_watched_status'),\n- 'supplemental_info_color': get_color_name(G.ADDON.getSettingInt('supplemental_info_color')),\n- 'profile_language_code': G.LOCAL_DB.get_profile_config('language', ''),\n- 'active_profile_guid': G.LOCAL_DB.get_active_profile_guid()\n- }\n+ common_data = get_common_data()\n+ common_data['params'] = get_param_watched_status_by_profile()\n+ common_data['set_watched_status'] = G.ADDON.getSettingBool('sync_watched_status')\n+ common_data['active_profile_guid'] = G.LOCAL_DB.get_active_profile_guid()\n+\ndirectory_items = [_create_episode_item(seasonid, episodeid_value, episode, episodes_list, common_data)\nfor episodeid_value, episode\nin episodes_list.episodes.items()]\n@@ -188,11 +189,8 @@ def build_loco_listing(loco_list, menu_data, force_use_videolist_id=False):\n\"\"\"Build a listing of video lists (LoCo)\"\"\"\n# If contexts are specified (loco_contexts in the menu_data), then the loco_list data will be filtered by\n# the specified contexts, otherwise all LoCo items will be added\n- common_data = {\n- 'menu_data': menu_data,\n- 'supplemental_info_color': get_color_name(G.ADDON.getSettingInt('supplemental_info_color')),\n- 'profile_language_code': G.LOCAL_DB.get_profile_config('language', '')\n- }\n+ common_data = get_common_data()\n+ common_data['menu_data'] = menu_data\ncontexts = menu_data.get('loco_contexts')\nitems_list = loco_list.lists_by_context(contexts) if contexts else loco_list.lists.items()\ndirectory_items = []\n@@ -244,19 +242,18 @@ def _create_videolist_item(list_id, video_list, menu_data, common_data, static_l\ndef build_video_listing(video_list, menu_data, sub_genre_id=None, pathitems=None, perpetual_range_start=None,\nmylist_items=None, path_params=None):\n\"\"\"Build a video listing\"\"\"\n- common_data = {\n+ common_data = get_common_data()\n+ common_data.update({\n'params': get_param_watched_status_by_profile(),\n'mylist_items': mylist_items,\n'set_watched_status': G.ADDON.getSettingBool('sync_watched_status'),\n- 'supplemental_info_color': get_color_name(G.ADDON.getSettingInt('supplemental_info_color')),\n'mylist_titles_color': (get_color_name(G.ADDON.getSettingInt('mylist_titles_color'))\nif menu_data['path'][1] != 'myList'\nelse None),\n- 'profile_language_code': G.LOCAL_DB.get_profile_config('language', ''),\n'ctxmenu_remove_watched_status': menu_data['path'][1] == 'continueWatching',\n'active_profile_guid': G.LOCAL_DB.get_active_profile_guid(),\n'marks_tvshow_started': G.ADDON.getSettingBool('marks_tvshow_started'),\n- }\n+ })\ndirectory_items = [_create_video_item(videoid_value, video, video_list, perpetual_range_start, common_data)\nfor videoid_value, video\nin video_list.videos.items()]\n@@ -355,10 +352,7 @@ def _create_subgenre_item(video_list_id, subgenre_data, menu_data):\ndef build_lolomo_category_listing(lolomo_cat_list, menu_data):\n\"\"\"Build a folders listing of a LoLoMo category\"\"\"\n- common_data = {\n- 'profile_language_code': G.LOCAL_DB.get_profile_config('language', ''),\n- 'supplemental_info_color': get_color_name(G.ADDON.getSettingInt('supplemental_info_color'))\n- }\n+ common_data = get_common_data()\ndirectory_items = []\nfor list_id, summary_data, video_list in lolomo_cat_list.lists():\nif summary_data['length'] == 0: # Do not show empty lists\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Make mediaflag video codec settings dependent |
106,046 | 07.07.2022 08:32:57 | -7,200 | 1705ab40046a9aca8c09e7f46f84a6a9dbd306f4 | Fix wrong default value argument | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -45,8 +45,10 @@ def get_video_codec_hint():\nreturn codec\n-def get_info(videoid, item, raw_data, profile_language_code='', delayed_db_op=False, common_data=dict):\n+def get_info(videoid, item, raw_data, profile_language_code='', delayed_db_op=False, common_data=None):\n\"\"\"Get the infolabels data\"\"\"\n+ if common_data is None:\n+ common_data = {}\ncache_identifier = f'{videoid.value}_{profile_language_code}'\ntry:\ncache_entry = G.CACHE.get(CACHE_INFOLABELS, cache_identifier)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix wrong default value argument |
106,046 | 09.07.2022 08:38:02 | -7,200 | 11c5a758c51afb552beca624fb1be5c2a73462d9 | Fixed default value for isa_streamselection_override setting | [
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<group id=\"2\" label=\"30078\">\n<setting id=\"isa_streamselection_override\" type=\"string\" label=\"30703\" help=\"30704\">\n<level>0</level>\n- <default>fixed</default>\n+ <default>disabled</default>\n<constraints>\n<options>\n<option label=\"13106\">disabled</option>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed default value for isa_streamselection_override setting |
106,046 | 30.07.2022 10:52:45 | -7,200 | e3644d9aa99f105b32c4615c042861531706d931 | Updated callpath due to website changes | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/nfsession_ops.py",
"new_path": "resources/lib/services/nfsession/nfsession_ops.py",
"diff": "@@ -227,11 +227,11 @@ class NFSessionOperations(SessionPathRequests):\n# seem to have some kind of relationship with renoMessageId suspect with the logblob but i am not sure.\n# I noticed also that this request can also be made with the fourth parameter empty.\n# The fifth parameter unknown\n- params = [common.enclose_quotes(list_id),\n- list_index,\n- common.enclose_quotes(list_context_name),\n- '\"\"',\n- '\"\"']\n+ params = [list_id,\n+ int(list_index),\n+ list_context_name,\n+ '',\n+ '']\n# path_suffixs = [\n# [{'from': 0, 'to': 100}, 'itemSummary'],\n# [['componentSummary']]\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/session/path_requests.py",
"new_path": "resources/lib/services/nfsession/session/path_requests.py",
"diff": "@@ -126,13 +126,11 @@ class SessionPathRequests(SessionAccess):\n'materialize': 'true',\n}\n# Use separators with dumps because Netflix rejects spaces\n+ # The data must be formatted correctly (numbers, strings, spaces) otherwise will raise HTTP error 401\ndata = 'callPath=' + '&callPath='.join(\njson.dumps(callpath, separators=(',', ':')) for callpath in callpaths)\nif params:\n- # The data to pass on 'params' must not be formatted with json.dumps because it is not full compatible\n- # if the request have wrong data will raise error 401\n- # if the parameters are not formatted correctly will raise error 401\n- data += '¶m=' + '¶m='.join(params)\n+ data += '¶m=' + '¶m='.join(json.dumps(param, separators=(',', ':')) for param in params)\nif path:\ndata += '&path=' + json.dumps(path, separators=(',', ':'))\nif path_suffixs:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/api_requests.py",
"new_path": "resources/lib/utils/api_requests.py",
"diff": "@@ -102,9 +102,9 @@ def update_remindme(operation, videoid, trackid):\n\"\"\"Call API to update \"Remind Me\" feature with either add or remove action\"\"\"\ncmd = 'addToRemindMeList' if operation == 'add' else 'removeFromRemindMeList'\ncall_args = {\n- 'callpaths': [['videos', videoid.value, cmd]],\n+ 'callpaths': [['videos', int(videoid.value), cmd]],\n'params': [trackid],\n- 'path': ['videos', videoid.value, 'inRemindMeList']\n+ 'path': ['videos', int(videoid.value), 'inRemindMeList']\n}\nresponse = common.make_call('callpath_request', call_args)\nLOG.debug('update_remindme response: {}', response)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Updated callpath due to website changes |
106,046 | 25.08.2022 09:26:48 | -7,200 | a9b266e3e9fab68d805baf368be4959c203e13b7 | Fixed MSL error User entity association record... | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/base_crypto.py",
"new_path": "resources/lib/services/nfsession/msl/base_crypto.py",
"diff": "@@ -123,7 +123,14 @@ class MSLBaseCrypto:\n\"\"\"Check if user id token is expired\"\"\"\ntoken_data = json.loads(base64.standard_b64decode(user_id_token['tokendata']))\n# Subtract 5min as a safety measure\n- return (token_data['expiration'] - 300) < time.time()\n+ # return (token_data['expiration'] - 300) < time.time()\n+ #\n+ # 25/08/2022 The 'expiration' value on android seems not works correctly anymore, by returning MSL error:\n+ # \"User entity association record query returned different entity identities.\"\n+ # Internal code 205043\n+ # Is not clear the problem, if it is a bug in the netflix server or other changes, at first seems that we have\n+ # the validity window limited to the 'renewalwindow' instead of 'expiration' value\n+ return token_data['renewalwindow'] < time.time()\ndef is_current_mastertoken_expired(self):\n\"\"\"Check if the current MasterToken is expired\"\"\"\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed MSL error User entity association record... |
106,046 | 29.08.2022 18:47:18 | -7,200 | b0da06f19d831195fc70e92bc334eb34b410dcc9 | Add black bars setting (test) | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -1169,3 +1169,21 @@ msgstr \"\"\nmsgctxt \"#30720\"\nmsgid \"Please note that enabling this setting will force the removal of streams that are not within the set range and this may affect the operation of InputStream Adaptive. If possible try limiting the quality from the InputStream Adaptive settings first.\"\nmsgstr \"\"\n+\n+msgctxt \"#30721\"\n+msgid \"Limit maximum height of black bars (Experimental)\"\n+msgstr \"\"\n+\n+# Description of setting ID #30721\n+msgctxt \"#30722\"\n+msgid \"Cropped videos will be stretched up by setting Kodi \\\"View mode\\\" to \\\"Zoom\\\" to minimize the black bars at the maximum height set. For example 10% means that the black bars can cover a maximum of 10% of the screen. To disable it, set to 50%.\"\n+msgstr \"\"\n+\n+msgctxt \"#30723\"\n+msgid \"Force reset the \\\"View mode\\\" setting\"\n+msgstr \"\"\n+\n+# Description of setting ID #30723\n+msgctxt \"#30724\"\n+msgid \"Kodi saves the \\\"View mode\\\" \\\"Zoom\\\" setting permanently, enable this setting to restore the \\\"Normal\\\" View mode when playing a previously watched video.\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/converter.py",
"new_path": "resources/lib/services/nfsession/msl/converter.py",
"diff": "@@ -151,6 +151,12 @@ def _convert_video_track(video_track, period, protection, has_drm_streams, cdn_i\nif int(downloadable['res_h']) > limit_res:\ncontinue\n_convert_video_downloadable(downloadable, adaptation_set, cdn_index)\n+ # Calculate the crop factor, will be used on am_playback.py to set zoom viewmode\n+ try:\n+ factor = video_track['maxHeight'] / video_track['maxCroppedHeight']\n+ adaptation_set.set('name', f'(Crop {factor:0.2f})')\n+ except Exception as exc: # pylint: disable=broad-except\n+ LOG.error('Cannot calculate crop factor: {}', exc)\ndef _limit_video_resolution(video_tracks, has_drm_streams):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/playback/action_controller.py",
"new_path": "resources/lib/services/playback/action_controller.py",
"diff": "@@ -206,7 +206,8 @@ class ActionController(xbmc.Monitor):\n'currentsubtitle',\n'subtitleenabled',\n'percentage',\n- 'time']\n+ 'time',\n+ 'videostreams']\n})\nexcept IOError as exc:\nLOG.warn('_get_player_state: {}', exc)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/playback/am_playback.py",
"new_path": "resources/lib/services/playback/am_playback.py",
"diff": "SPDX-License-Identifier: MIT\nSee LICENSES/MIT.md for more information.\n\"\"\"\n+import re\nimport time\nimport xbmc\n@@ -47,6 +48,29 @@ class AMPlayback(ActionManager):\nself.watched_threshold = data['metadata'][0]['creditsOffset'] - lower_value\ndef on_playback_started(self, player_state):\n+ # The black bar minimizer zoom the video to show the same height of black bars for all cropped videos,\n+ # so this calculation takes into account the different black band heights between various videos.\n+ # NOTE: Kodi save viewmode permanently\n+ blackbar_perc = G.ADDON.getSettingInt('blackbars_minimizer')\n+ if blackbar_perc < 50:\n+ # Try find the crop info to the track name\n+ stream = player_state['videostreams'][0]\n+ result = re.match(r'\\(Crop (\\d+\\.\\d+)\\)', stream['name'])\n+ if result:\n+ crop_factor = float(result.group(1))\n+ video_height = stream['height']\n+ crop_height = stream['height'] / crop_factor\n+ blackbar_px = video_height - crop_height\n+ blackbar_px_max = video_height / 100 * blackbar_perc\n+ blackbar_px = min(blackbar_px, blackbar_px_max)\n+ zoom_factor = (video_height - blackbar_px) / crop_height\n+ # Check if the current view mode (previously stored) has already the right zoom value\n+ current_view_mode = common.json_rpc('Player.GetViewMode')\n+ current_zoom = current_view_mode.get('zoom', 1.0)\n+ if current_zoom != zoom_factor:\n+ common.json_rpc('Player.SetViewMode', {'viewmode': {'zoom': zoom_factor}})\n+ elif G.ADDON.getSettingBool('blackbars_minimizer_restore'):\n+ common.json_rpc('Player.SetViewMode', {'viewmode': 'normal'})\nif self.resume_position:\n# Due to a bug on Kodi the resume on STRM files not works correctly,\n# so we force the skip to the resume point\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<dependency type=\"visible\" setting=\"auto_skip_credits\">true</dependency>\n</dependencies>\n</setting>\n+ <setting id=\"blackbars_minimizer\" type=\"integer\" label=\"30721\" help=\"30722\">\n+ <level>0</level>\n+ <default>50</default>\n+ <constraints>\n+ <minimum>0</minimum>\n+ <step>1</step>\n+ <maximum>50</maximum>\n+ </constraints>\n+ <control type=\"slider\" format=\"percentage\"/>\n+ </setting>\n+ <setting id=\"blackbars_minimizer_restore\" type=\"boolean\" label=\"30723\" help=\"30724\" parent=\"blackbars_minimizer\">\n+ <level>0</level>\n+ <default>true</default>\n+ <control type=\"toggle\"/>\n+ <dependencies>\n+ <dependency type=\"enable\">\n+ <condition setting=\"blackbars_minimizer\">50</condition>\n+ </dependency>\n+ </dependencies>\n+ </setting>\n</group>\n<!--GROUP: Library-->\n<group id=\"2\" label=\"30049\">\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add black bars setting (test) |
106,046 | 30.08.2022 08:48:04 | -7,200 | 2b758120df27749b843a2af011046124d92fe1af | Fix remind me context menu | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/session/endpoints.py",
"new_path": "resources/lib/services/nfsession/session/endpoints.py",
"diff": "@@ -143,6 +143,13 @@ ENDPOINTS = {\n'add_auth_url': 'to_data',\n'content_type': 'application/json',\n'accept': 'application/json, text/javascript, */*'},\n+ 'shakti_playlistop':\n+ {'address': '/api/shakti/mre/playlistop',\n+ 'is_api_call': False,\n+ 'use_default_params': False,\n+ 'add_auth_url': 'to_data',\n+ 'content_type': 'application/json',\n+ 'accept': 'application/json, text/javascript, */*'},\n'viewing_activity':\n{'address': '/viewingactivity',\n'is_api_call': True,\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/api_requests.py",
"new_path": "resources/lib/utils/api_requests.py",
"diff": "@@ -100,13 +100,15 @@ def rate_thumb(videoid, rating, track_id_jaw):\ndef update_remindme(operation, videoid, trackid):\n\"\"\"Call API to update \"Remind Me\" feature with either add or remove action\"\"\"\n- cmd = 'addToRemindMeList' if operation == 'add' else 'removeFromRemindMeList'\n- call_args = {\n- 'callpaths': [['videos', int(videoid.value), cmd]],\n- 'params': [trackid],\n- 'path': ['videos', int(videoid.value), 'inRemindMeList']\n- }\n- response = common.make_call('callpath_request', call_args)\n+ response = common.make_call(\n+ 'post_safe',\n+ {'endpoint': 'shakti_playlistop',\n+ 'data': {\n+ 'lolomoId': '',\n+ 'operation': operation,\n+ 'videoId': int(videoid.value),\n+ 'trackId': int(trackid)\n+ }})\nLOG.debug('update_remindme response: {}', response)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix remind me context menu |
106,046 | 30.08.2022 15:55:35 | -7,200 | 207d2f2a692de7cfb42f557ba1bb689f4637053a | Version bump (1.18.9) | [
{
"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=\"1.18.8+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.18.9+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n-v1.18.8 (2022-06-19)\n-- REPOSITORY CHANGED: The repository has been changed, to receive future updates\n-the add-on will try update it automatically to new v2.0, if for some reason this not\n-happens you can update it manually by downloading: repository.castagnait-2.0.0.zip\n-from Github Readme: https://github.com/CastagnaIT/plugin.video.netflix\n-- Fix broken addon startup due to update error\n-- Update translations zh_cn, ro, pt_br\n+v1.18.9 (2022-08-30)\n+- Add new expert setting to override \"Stream selection type\" setting of InputStream Adaptive (Kodi 20)\n+- Add new experimental setting \"Limit maximum height of black bars\"\n+- Fixed recommendations menu\n+- Fixed \"Remind me\" context menu error\n+- Fixed MSL error \"User entity association record ...\"\n+- Fixed \"double click\" problem on Skip button (Kodi 20)\n+- Better match for video codec with skin mediaflag\n+- Update translations it, de, zh_tw, hu, ro, fr, jp, kr\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.18.9 (2022-08-30)\n+- Add new expert setting to override \"Stream selection type\" setting of InputStream Adaptive (Kodi 20)\n+- Add new experimental setting \"Limit maximum height of black bars\"\n+- Fixed recommendations menu\n+- Fixed \"Remind me\" context menu error\n+- Fixed MSL error \"User entity association record ...\"\n+- Fixed \"double click\" problem on Skip button (Kodi 20)\n+- Better match for video codec with skin mediaflag\n+- Update translations it, de, zh_tw, hu, ro, fr, jp, kr\n+\nv1.18.8 (2022-06-19)\n- REPOSITORY CHANGED: The repository has been changed, to receive future updates\nthe add-on will try update it automatically to new v2.0, if for some reason this not\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.18.9) (#1391) |
106,046 | 24.09.2022 17:23:07 | -7,200 | 3e38835ce1190da74246c7491cd484fb80398626 | Allow STRM workaround only for Kodi versions below 19.5 | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/player.py",
"new_path": "resources/lib/navigation/player.py",
"diff": "@@ -165,7 +165,9 @@ def _profile_switch():\ndef _strm_resume_workaroud(is_played_from_strm, videoid):\n- \"\"\"Workaround for resuming STRM files from library\"\"\"\n+ \"\"\"Workaround for resuming STRM files from library, for Kodi versions below 19.5\"\"\"\n+ if G.KODI_VERSION > '19.4':\n+ return None\nif not is_played_from_strm or not G.ADDON.getSettingBool('ResumeManager_enabled'):\nreturn None\n# The resume workaround will fail when:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "</group>\n<!--GROUP: Library-->\n<group id=\"2\" label=\"30049\">\n- <setting id=\"ResumeManager_enabled\" type=\"boolean\" label=\"30176\" help=\"\">\n+ <setting id=\"ResumeManager_enabled\" type=\"boolean\" label=\"30176\" help=\"\"><!-- Needed only to Kodi versions below 19.5 -->\n<level>0</level>\n<default>true</default>\n<control type=\"toggle\"/>\n+ <dependencies>\n+ <dependency type=\"visible\">\n+ <and>\n+ <condition on=\"property\" operator=\"!is\" name=\"InfoBool\">String.StartsWith(System.BuildVersionCode,19.5)</condition>\n+ <condition on=\"property\" operator=\"!is\" name=\"InfoBool\">String.StartsWith(System.BuildVersionCode,19.9)</condition> <!-- v20 pre-releases -->\n+ <condition on=\"property\" operator=\"!is\" name=\"InfoBool\">Integer.IsGreaterOrEqual(System.BuildVersionCode,20)</condition>\n+ </and>\n+ </dependency>\n+ </dependencies>\n</setting>\n<setting id=\"ResumeManager_dialog\" type=\"boolean\" label=\"30177\" help=\"\" parent=\"ResumeManager_enabled\">\n<level>0</level>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Allow STRM workaround only for Kodi versions below 19.5 |
106,046 | 24.09.2022 17:32:41 | -7,200 | 539da6b7aa370e47bbcc89d8002957520d37d343 | Improved comment/message on Kodi playlist bug | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/playback/am_stream_continuity.py",
"new_path": "resources/lib/services/playback/am_stream_continuity.py",
"diff": "@@ -78,13 +78,13 @@ class AMStreamContinuity(ActionManager):\nself.enabled = False\nif (player_state.get(STREAMS['subtitle']['current']) is None and\nplayer_state.get('currentvideostream') is None):\n- # Kodi 19 BUG JSON RPC: \"Player.GetProperties\" is broken: https://github.com/xbmc/xbmc/issues/17915\n- # The first call return wrong data the following calls return OSError, and then _notify_all will be blocked\n+ # KODI BUG! All Kodi v19 Matrix versions have the playlist bug, full fixed in version 20\n+ # These versions set a wrong playlist id and corrupt the response data in JSON-RPC calls.\nself.enabled = False\n- LOG.error('Due of Kodi 19 bug has been disabled: '\n- 'Ask to skip dialog, remember audio/subtitles preferences and other features')\n+ LOG.error('You are using a bugged Kodi version, please update to Kodi 20 or above: '\n+ 'All Netflix add-on features has been now disabled and cannot be used.')\nui.show_notification(title=common.get_local_string(30105),\n- msg='Due to Kodi bug has been disabled all Netflix features')\n+ msg='A Kodi bug prevent to use Netflix features, please update to Kodi 20 or above.')\nreturn\nxbmc.sleep(500) # Wait for slower systems\nself.player_state = player_state\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Improved comment/message on Kodi playlist bug |
106,046 | 25.09.2022 11:51:38 | -7,200 | a32783264e7b70d9333cc95b5ea4881a7a591787 | Force InputStreamAdaptive settings for Kodi v19 or below only | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/config_wizard.py",
"new_path": "resources/lib/config_wizard.py",
"diff": "@@ -55,8 +55,9 @@ def _set_isa_addon_settings(is_4k_capable, hdcp_override):\nLOG.error(traceback.format_exc())\nraise InputStreamHelperError(str(exc)) from exc\n- isa_addon = Addon('inputstream.adaptive')\nif G.KODI_VERSION < '20':\n+ # Only needed for Kodi <= v19, this has been fixed on Kodi 20\n+ isa_addon = Addon('inputstream.adaptive')\nisa_addon.setSettingBool('HDCPOVERRIDE', hdcp_override)\nif isa_addon.getSettingInt('STREAMSELECTION') == 1:\n# Stream selection must never be set to 'Manual' or cause problems with the streams\n@@ -64,11 +65,6 @@ def _set_isa_addon_settings(is_4k_capable, hdcp_override):\n# 'Ignore display' should only be set when Kodi display resolution is not 4K\nisa_addon.setSettingBool('IGNOREDISPLAY',\nis_4k_capable and (getScreenWidth() != 3840 or getScreenHeight() != 2160))\n- else:\n- isa_addon.setSettingBool('HDCPOVERRIDE', hdcp_override)\n- # 'Ignore display' should only be set when Kodi display resolution is not 4K\n- isa_addon.setSettingBool('adaptivestream.ignore.screen.res',\n- is_4k_capable and (getScreenWidth() != 3840 or getScreenHeight() != 2160))\ndef _set_profiles(system, is_4k_capable):\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Force InputStreamAdaptive settings for Kodi v19 or below only |
106,046 | 25.09.2022 11:18:46 | -7,200 | 8c030c5fa3b9c6f1b122d9ea0f9cfdae43b8bd9a | Fix MSL user authentication | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_request_builder.py",
"new_path": "resources/lib/services/nfsession/msl/msl_request_builder.py",
"diff": "@@ -11,16 +11,24 @@ import json\nimport base64\nimport random\nimport time\n+from typing import TYPE_CHECKING\n+from resources.lib.common.exceptions import MSLError\nfrom resources.lib.globals import G\nimport resources.lib.common as common\n+from resources.lib.services.nfsession.msl.msl_utils import (MSL_AUTH_USER_ID_TOKEN, MSL_AUTH_EMAIL_PASSWORD,\n+ MSL_AUTH_NETFLIXID)\nfrom resources.lib.utils.logging import measure_exec_time_decorator\n+if TYPE_CHECKING: # This variable/imports are used only by the editor, so not at runtime\n+ from resources.lib.services.nfsession.nfsession_ops import NFSessionOperations\n+\nclass MSLRequestBuilder:\n\"\"\"Provides mechanisms to create MSL requests\"\"\"\n- def __init__(self):\n+ def __init__(self, nfsession):\n+ self.nfsession: 'NFSessionOperations' = nfsession\nself.current_message_id = None\nself.rndm = random.SystemRandom()\n# Set the Crypto handler\n@@ -124,14 +132,16 @@ class MSLRequestBuilder:\ndef _add_auth_info(self, header_data, auth_data):\n\"\"\"User authentication identifies the application user associated with a message\"\"\"\n- # Warning: the user id token contains also contains the identity of the netflix profile\n- # therefore it is necessary to use the right user id token for the request\n- if auth_data.get('user_id_token'):\n+ if auth_data['auth_scheme'] == MSL_AUTH_USER_ID_TOKEN:\n+ # Authentication scheme with: User ID token\n+ # Make requests by using by default main netflix profile, since the user id token contains also the identity\n+ # of the netflix profile, to send data to the right profile (e.g. for continue watching) must be used\n+ # SWITCH_PROFILE scheme to switching MSL profile.\n+ # 25/09/2022: SWITCH_PROFILE auth scheme has been disabled on netflix website backend and not works anymore.\nif auth_data['use_switch_profile']:\n- # The SWITCH_PROFILE is a custom Netflix MSL user authentication scheme\n- # that is needed for switching profile on MSL side\n- # works only combined with user id token and can not be used with all endpoints\n- # after use it you will get user id token of the profile specified in the response\n+ # The SWITCH_PROFILE is a custom Netflix MSL user authentication scheme, that is needed for switching\n+ # profile on MSL side, works only combined with user id token and can not be used with all endpoints\n+ # after use it you will get the user id token of the requested profile in the response.\nheader_data['userauthdata'] = {\n'scheme': 'SWITCH_PROFILE',\n'authdata': {\n@@ -140,10 +150,10 @@ class MSLRequestBuilder:\n}\n}\nelse:\n- # Authentication with user ID token containing the user identity (netflix profile)\nheader_data['useridtoken'] = auth_data['user_id_token']\n- else:\n- # Authentication with the user credentials\n+ elif auth_data['auth_scheme'] == MSL_AUTH_EMAIL_PASSWORD:\n+ # Authentication scheme with: Email password\n+ # Make requests by using main netflix profile only (you cannot update continue watching to other profiles)\ncredentials = common.get_credentials()\nheader_data['userauthdata'] = {\n'scheme': 'EMAIL_PASSWORD',\n@@ -152,13 +162,15 @@ class MSLRequestBuilder:\n'password': credentials['password']\n}\n}\n- # Authentication with user Netflix ID cookies\n- # This not works on android,\n- # will raise: User authentication data does not match entity identity\n- # header_data['userauthdata'] = {\n- # 'scheme': 'NETFLIXID',\n- # 'authdata': {\n- # 'netflixid': cookies['NetflixId'],\n- # 'securenetflixid': cookies['SecureNetflixId']\n- # }\n- # }\n+ elif auth_data['auth_scheme'] == MSL_AUTH_NETFLIXID:\n+ # Authentication scheme with: Netflix ID cookies\n+ # Make requests by using the same netflix profile used/set on nfsession (website)\n+ header_data['userauthdata'] = {\n+ 'scheme': 'NETFLIXID',\n+ 'authdata': {\n+ 'netflixid': self.nfsession.session.cookies['NetflixId'],\n+ 'securenetflixid': self.nfsession.session.cookies['SecureNetflixId']\n+ }\n+ }\n+ else:\n+ raise MSLError(f'Authentication scheme \"{auth_data[\"auth_scheme\"]}\" is not supported.')\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"new_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"diff": "@@ -12,7 +12,6 @@ import base64\nimport json\nimport time\nimport zlib\n-from typing import TYPE_CHECKING\nimport httpx\n@@ -22,13 +21,11 @@ from resources.lib.globals import G\nfrom resources.lib.services.nfsession.msl.msl_request_builder import MSLRequestBuilder\nfrom resources.lib.services.nfsession.msl.msl_utils import (ENDPOINTS, create_req_params, generate_logblobs_params,\n- MSL_DATA_FILENAME)\n+ MSL_DATA_FILENAME, MSL_AUTH_NETFLIXID,\n+ MSL_AUTH_USER_ID_TOKEN)\nfrom resources.lib.utils.esn import get_esn\nfrom resources.lib.utils.logging import LOG, measure_exec_time_decorator\n-if TYPE_CHECKING: # This variable/imports are used only by the editor, so not at runtime\n- from resources.lib.services.nfsession.nfsession_ops import NFSessionOperations\n-\nclass MSLRequests(MSLRequestBuilder):\n\"\"\"Provides methods to make MSL requests\"\"\"\n@@ -40,9 +37,13 @@ class MSLRequests(MSLRequestBuilder):\n'Host': 'www.netflix.com'\n}\n+ # Define the user authentication scheme to be used on the MSL HTTP requests\n+ # https://github.com/Netflix/msl/wiki/User-Authentication-%28Configuration%29\n+ # Values can be: MSL_AUTH_NETFLIXID, MSL_AUTH_EMAIL_PASSWORD, MSL_AUTH_USER_ID_TOKEN\n+ MSL_AUTH_SCHEME = MSL_AUTH_NETFLIXID\n+\ndef __init__(self, msl_data, nfsession):\n- super().__init__()\n- self.nfsession: 'NFSessionOperations' = nfsession\n+ super().__init__(nfsession)\nself._load_msl_data(msl_data)\nself.msl_switch_requested = False\n@@ -123,6 +124,9 @@ class MSLRequests(MSLRequestBuilder):\n:param: force_auth_credential: force the use of authentication with credentials\n:return: auth data that will be used in MSLRequestBuilder _add_auth_info\n\"\"\"\n+ # TODO: This _check_user_id_token method need to be revisited,\n+ # since at today 25/09/2022 the SWITCH_PROFILE auth scheme do not works anymore\n+\n# Warning: the user id token contains also contains the identity of the netflix profile\n# therefore it is necessary to use the right user id token for the request\ncurrent_profile_guid = G.LOCAL_DB.get_active_profile_guid()\n@@ -159,12 +163,15 @@ class MSLRequests(MSLRequestBuilder):\ndef chunked_request(self, endpoint, request_data, esn, disable_msl_switch=True, force_auth_credential=False):\n\"\"\"Do a POST request and process the chunked response\"\"\"\nself._mastertoken_checks()\n- auth_data = self._check_user_id_token(disable_msl_switch, force_auth_credential)\n+\n+ auth_data = {'auth_scheme': self.MSL_AUTH_SCHEME}\n+ if self.MSL_AUTH_SCHEME == MSL_AUTH_USER_ID_TOKEN:\n+ auth_data.update(self._check_user_id_token(disable_msl_switch, force_auth_credential))\nLOG.debug('Chunked request will be executed with auth data: {}', auth_data)\nchunked_response = self._process_chunked_response(\nself._post(endpoint, self.msl_request(request_data, esn, auth_data)),\n- save_uid_token_to_owner=auth_data['user_id_token'] is None)\n+ save_uid_token_to_owner=auth_data.get('user_id_token') is None)\nreturn chunked_response['result']\ndef _post(self, endpoint, request_data):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_utils.py",
"new_path": "resources/lib/services/nfsession/msl/msl_utils.py",
"diff": "@@ -34,6 +34,10 @@ ENDPOINTS = {\n'logblobs': CHROME_PLAYAPI_URL + 'logblob/1'\n}\n+MSL_AUTH_NETFLIXID = 'NETFLIXID' # Netflix ID cookies user authentication\n+MSL_AUTH_EMAIL_PASSWORD = 'EMAIL_PASSWORD' # Email password user authentication\n+MSL_AUTH_USER_ID_TOKEN = 'USER_ID_TOKEN' # User ID token user authentication\n+\nMSL_DATA_FILENAME = 'msl_data.json'\nEVENT_START = 'start' # events/start : Video starts\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix MSL user authentication |
106,046 | 25.09.2022 15:53:29 | -7,200 | c5d63d5c087b17eff200ab428fb1b23599bca16c | Fix add/remove errors when my list is empty | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/http_server.py",
"new_path": "resources/lib/services/http_server.py",
"diff": "@@ -109,7 +109,7 @@ def handle_request(server, handler, func_name, data):\nimport traceback\nLOG.error(traceback.format_exc())\nret_data = exc\n- if ret_data:\n+ if ret_data is not None:\nserver.wfile.write(pickle.dumps(ret_data, protocol=pickle.HIGHEST_PROTOCOL))\n@@ -124,7 +124,7 @@ def handle_cache_request(server, func_name, data):\nimport traceback\nLOG.error(traceback.format_exc())\nret_data = exc\n- if ret_data:\n+ if ret_data is not None:\nserver.wfile.write(pickle.dumps(ret_data, protocol=pickle.HIGHEST_PROTOCOL))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/data_types.py",
"new_path": "resources/lib/utils/data_types.py",
"diff": "@@ -72,10 +72,10 @@ class VideoListLoCo:\nself.perpetual_range_selector = path_response.get('_perpetual_range_selector')\nself.data = path_response\nself.list_id = list_id\n- self.videoids = None\n+ self.videoids = []\n# Set a 'UNSPECIFIED' type videoid (special handling for menus see parse_info in infolabels.py)\nself.videoid = common.VideoId(videoid=list_id)\n- self.contained_titles = None\n+ self.contained_titles = []\nself.artitem = None\nif 'lists' not in path_response:\n# No data in path response\n@@ -91,7 +91,7 @@ class VideoListLoCo:\ntry:\nself.videoids = _get_videoids(self.videos)\nexcept KeyError:\n- self.videoids = None\n+ self.videoids = []\ndef __getitem__(self, key):\nreturn _check_sentinel(self.data['lists'][self.list_id]['componentSummary'][key])\n@@ -110,8 +110,8 @@ class VideoList:\nhas_data = bool(path_response.get('lists'))\nself.videos = OrderedDict()\nself.artitem = None\n- self.contained_titles = None\n- self.videoids = None\n+ self.contained_titles = []\n+ self.videoids = []\nif has_data:\n# Generate one videoid, or from the first id of the list or with specified one\nself.videoid = common.VideoId(\n@@ -126,7 +126,7 @@ class VideoList:\ntry:\nself.videoids = _get_videoids(self.videos)\nexcept KeyError:\n- self.videoids = None\n+ self.videoids = []\ndef __getitem__(self, key):\nreturn _check_sentinel(self.data['lists'][self.videoid.value][key])\n@@ -149,8 +149,8 @@ class VideoListSorted:\nself.data_lists = {}\nself.videos = OrderedDict()\nself.artitem = None\n- self.contained_titles = None\n- self.videoids = None\n+ self.contained_titles = []\n+ self.videoids = []\nif has_data:\nself.data_lists = path_response[context_name][context_id][req_sort_order_type] \\\nif context_id else path_response[context_name][req_sort_order_type]\n@@ -162,7 +162,7 @@ class VideoListSorted:\ntry:\nself.videoids = _get_videoids(self.videos)\nexcept KeyError:\n- self.videoids = None\n+ self.videoids = []\ndef __getitem__(self, key):\nreturn _check_sentinel(self.data_lists[key])\n@@ -179,9 +179,9 @@ class SearchVideoList:\nself.data = path_response\nhas_data = 'search' in path_response\nself.videos = OrderedDict()\n- self.videoids = None\n+ self.videoids = []\nself.artitem = None\n- self.contained_titles = None\n+ self.contained_titles = []\nif has_data:\nself.title = common.get_local_string(30100).format(list(self.data['search']['byTerm'])[0][1:])\nself.videos = OrderedDict(resolve_refs(list(self.data['search']['byReference'].values())[0], self.data))\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix add/remove errors when my list is empty |
106,046 | 26.09.2022 09:34:25 | -7,200 | bdf7c8c7141e2721db6b610e998d44a9c6ca6ee5 | Version bump (1.18.10) | [
{
"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=\"1.18.9+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.18.10+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n-v1.18.9 (2022-08-30)\n-- Add new expert setting to override \"Stream selection type\" setting of InputStream Adaptive (Kodi 20)\n-- Add new experimental setting \"Limit maximum height of black bars\"\n-- Fixed recommendations menu\n-- Fixed \"Remind me\" context menu error\n-- Fixed MSL error \"User entity association record ...\"\n-- Fixed \"double click\" problem on Skip button (Kodi 20)\n-- Better match for video codec with skin mediaflag\n-- Update translations it, de, zh_tw, hu, ro, fr, jp, kr\n+v1.18.10 (2022-09-26)\n+- Fixed MSL error when playing videos from non-owner Netflix profiles\n+- Fixed setting type error at first plugin startup on Kodi 20\n+- Fixed error when you add a tvshow/movie on an empty my list\n+- Removed STRM resume workaround for Kodi v19.5 and v20 (fixed on Kodi)\n+- Update translations zh_cn, cs_cz, gl_es\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.18.10 (2022-09-26)\n+- Fixed MSL error when playing videos from non-owner Netflix profiles\n+- Fixed setting type error at first plugin startup on Kodi 20\n+- Fixed error when you add a tvshow/movie on an empty my list\n+- Removed STRM resume workaround for Kodi v19.5 and v20 (fixed on Kodi)\n+- Update translations zh_cn, cs_cz, gl_es\n+\nv1.18.9 (2022-08-30)\n- Add new expert setting to override \"Stream selection type\" setting of InputStream Adaptive (Kodi 20)\n- Add new experimental setting \"Limit maximum height of black bars\"\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.18.10) (#1420) |
106,046 | 29.09.2022 10:05:20 | -7,200 | 9b774068e846c28b9fa01e5bce526b278c4879d4 | Fix loading screen not ending | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -201,6 +201,7 @@ class GlobalVariables:\n# Define here also any other variables necessary for the correct loading of the other project modules\nself.WND_KODI_HOME = Window(10000) # Kodi home window\nself.IS_ADDON_FIRSTRUN = None\n+ self.IS_SERVICE = False\nself.ADDON = None\nself.ADDON_DATA_PATH = None\nself.DATA_PATH = None\n@@ -224,6 +225,11 @@ class GlobalVariables:\nexcept IndexError:\nself.PARAM_STRING = ''\nself.REQUEST_PARAMS = dict(parse_qsl(self.PARAM_STRING))\n+ try:\n+ self.PLUGIN_HANDLE = int(argv[1])\n+ except IndexError:\n+ self.PLUGIN_HANDLE = 0\n+ self.IS_SERVICE = True\nif self.IS_ADDON_FIRSTRUN:\n# Global variables that do not need to be generated at every instance\nself.ADDON_ID = self.ADDON.getAddonInfo('id')\n@@ -237,14 +243,10 @@ class GlobalVariables:\nself.ADDON_PACKAGES_PATH = os.path.join(self.ADDON_DATA_PATH, 'packages')\nself.CACHE_PATH = os.path.join(self.DATA_PATH, 'cache')\nself.COOKIES_PATH = os.path.join(self.DATA_PATH, 'COOKIES')\n- try:\n- self.PLUGIN_HANDLE = int(argv[1])\n- self.IS_SERVICE = False\n- self.BASE_URL = f'{self.URL[0]}://{self.URL[1]}'\n- except IndexError:\n- self.PLUGIN_HANDLE = 0\n- self.IS_SERVICE = True\n+ if self.IS_SERVICE:\nself.BASE_URL = f'plugin://{self.ADDON_ID}'\n+ else:\n+ self.BASE_URL = f'{self.URL[0]}://{self.URL[1]}'\nfrom resources.lib.common.kodi_ops import KodiVersion\nself.KODI_VERSION = KodiVersion()\nself.IS_OLD_KODI_MODULES = self.KODI_VERSION < '20'\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix loading screen not ending |
106,046 | 02.10.2022 20:31:26 | -7,200 | 6c2ba1655137f9ad29119b46a2ac19a47904e75f | Force useridtoken/creds auth with Android L3 devices | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/device_utils.py",
"new_path": "resources/lib/common/device_utils.py",
"diff": "@@ -89,6 +89,16 @@ def is_device_4k_capable():\nreturn False\n+def is_device_l1_enabled():\n+ \"\"\"Check if L1 security level is enabled\"\"\"\n+ from resources.lib.database.db_utils import TABLE_SESSION\n+ wv_force_sec_lev = G.LOCAL_DB.get_value('widevine_force_seclev',\n+ WidevineForceSecLev.DISABLED,\n+ table=TABLE_SESSION)\n+ is_l3_forced = wv_force_sec_lev != WidevineForceSecLev.DISABLED\n+ return G.LOCAL_DB.get_value('drm_security_level', '', table=TABLE_SESSION) == 'L1' and not is_l3_forced\n+\n+\ndef get_hdcp_level():\n\"\"\"Get the HDCP level when exist else None\"\"\"\nfrom re import findall\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"new_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"diff": "@@ -16,13 +16,14 @@ import zlib\nimport httpx\nimport resources.lib.common as common\n+from resources.lib.common import get_system_platform, is_device_l1_enabled\nfrom resources.lib.common.exceptions import MSLError\nfrom resources.lib.globals import G\nfrom resources.lib.services.nfsession.msl.msl_request_builder import MSLRequestBuilder\nfrom resources.lib.services.nfsession.msl.msl_utils import (ENDPOINTS, create_req_params, generate_logblobs_params,\nMSL_DATA_FILENAME, MSL_AUTH_NETFLIXID,\n- MSL_AUTH_USER_ID_TOKEN)\n+ MSL_AUTH_USER_ID_TOKEN, MSL_AUTH_EMAIL_PASSWORD)\nfrom resources.lib.utils.esn import get_esn\nfrom resources.lib.utils.logging import LOG, measure_exec_time_decorator\n@@ -37,11 +38,6 @@ class MSLRequests(MSLRequestBuilder):\n'Host': 'www.netflix.com'\n}\n- # Define the user authentication scheme to be used on the MSL HTTP requests\n- # https://github.com/Netflix/msl/wiki/User-Authentication-%28Configuration%29\n- # Values can be: MSL_AUTH_NETFLIXID, MSL_AUTH_EMAIL_PASSWORD, MSL_AUTH_USER_ID_TOKEN\n- MSL_AUTH_SCHEME = MSL_AUTH_NETFLIXID\n-\ndef __init__(self, msl_data, nfsession):\nsuper().__init__(nfsession)\nself._load_msl_data(msl_data)\n@@ -134,6 +130,12 @@ class MSLRequests(MSLRequestBuilder):\nuse_switch_profile = False\nuser_id_token = None\n+ if current_profile_guid != owner_profile_guid:\n+ # TODO: due to removal of SWITCH_PROFILE, we cannot currently switch profile on MSL side,\n+ # CIT: i have no idea if there is another way to have a kind of profile switching with id tokens\n+ raise Exception('Due to changes to the Netflix website, on Android L3 devices '\n+ 'videos can only be played from the main/owner profile.')\n+\nif not force_auth_credential:\nif current_profile_guid == owner_profile_guid:\n# The request will be executed from the owner profile\n@@ -164,9 +166,25 @@ class MSLRequests(MSLRequestBuilder):\n\"\"\"Do a POST request and process the chunked response\"\"\"\nself._mastertoken_checks()\n- auth_data = {'auth_scheme': self.MSL_AUTH_SCHEME}\n- if self.MSL_AUTH_SCHEME == MSL_AUTH_USER_ID_TOKEN:\n+ # Define the user authentication scheme to be used on the MSL HTTP requests\n+ # https://github.com/Netflix/msl/wiki/User-Authentication-%28Configuration%29\n+ # Values can be: MSL_AUTH_NETFLIXID, MSL_AUTH_EMAIL_PASSWORD, MSL_AUTH_USER_ID_TOKEN\n+ auth_scheme = MSL_AUTH_NETFLIXID\n+ auth_data = {}\n+\n+ # TODO: MSL netflixid auth at today not works with L3 android devices by returning error:\n+ # \"User authentication data does not match entity identity.\"\n+ # so we fallback to idtoken auth, but this will not allow to play videos with other profiles than owner one,\n+ # then until another solution will be found the other profiles will be unusable...\n+ if get_system_platform() == 'android' and not is_device_l1_enabled():\n+ auth_scheme = MSL_AUTH_USER_ID_TOKEN\n+\n+ if auth_scheme == MSL_AUTH_USER_ID_TOKEN:\nauth_data.update(self._check_user_id_token(disable_msl_switch, force_auth_credential))\n+ if auth_data['user_id_token'] is None:\n+ auth_scheme = MSL_AUTH_EMAIL_PASSWORD\n+\n+ auth_data['auth_scheme'] = auth_scheme\nLOG.debug('Chunked request will be executed with auth data: {}', auth_data)\nchunked_response = self._process_chunked_response(\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Force useridtoken/creds auth with Android L3 devices |
106,046 | 04.10.2022 09:27:20 | -7,200 | 93d581bb8d31f9179debaafea94d8e0f8c1c8232 | Version bump (1.19.0) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.18.10+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.19.0+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n-v1.18.10 (2022-09-26)\n-- Fixed MSL error when playing videos from non-owner Netflix profiles\n-- Fixed setting type error at first plugin startup on Kodi 20\n-- Fixed error when you add a tvshow/movie on an empty my list\n-- Removed STRM resume workaround for Kodi v19.5 and v20 (fixed on Kodi)\n-- Update translations zh_cn, cs_cz, gl_es\n+v1.19.0 (2022-10-04)\n+- NOTE: DUE TO WEBSITE CHANGES ANDROID L3 DEVICES CAN PLAY VIDEOS FROM MAIN PROFILE ONLY\n+- Rework of the addon due to website API change\n+- Fix HTTP error 404 Not Found for url\n+- Fix error missing 2 required keyword-only arguments: 'request' and 'response'\n+- Fix MSL error user auth data does not match entity identity on android L3 devices\n+- Update translation sv_se\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.19.0 (2022-10-04)\n+- NOTE: DUE TO WEBSITE CHANGES ANDROID L3 DEVICES CAN PLAY VIDEOS FROM MAIN PROFILE ONLY\n+- Rework of the addon due to website API change\n+- Fix HTTP error 404 Not Found for url\n+- Fix error missing 2 required keyword-only arguments: 'request' and 'response'\n+- Fix MSL error user auth data does not match entity identity on android L3 devices\n+- Update translation sv_se\n+\nv1.18.10 (2022-09-26)\n- Fixed MSL error when playing videos from non-owner Netflix profiles\n- Fixed setting type error at first plugin startup on Kodi 20\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.19.0) (#1443) |
106,046 | 04.10.2022 17:58:48 | -7,200 | 0f3f56cd0ba7e4d0261a37a3bb42c603a20b7c42 | Changed license type to "standard" | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"new_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"diff": "@@ -269,7 +269,9 @@ class MSLHandler:\n# License type:\n# - 'limited' license data provided in the manifest response, may be needed a second license request\n# - 'standard' no license data provided in the manifest response\n- 'licenseType': 'limited'\n+ # TODO: Currently on linux only the license type set to \"limited\" cause this error on ISA:\n+ # License update not successful (no keys)\n+ 'licenseType': 'standard'\n}\nendpoint_url = ENDPOINTS['manifest'] + create_req_params('licensedManifest')\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Changed license type to "standard" |
106,046 | 05.10.2022 13:49:04 | -7,200 | eac71aaa35d3a9a46fe202878a440369ec7b1adc | Fix trackid for add/remove mylist/remindme | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"diff": "@@ -299,7 +299,7 @@ def _create_video_item(videoid_value, video, video_list, perpetual_range_start,\nadd_info_list_item(list_item, videoid, video, video_list.data, is_in_mylist, common_data)\nif not is_folder:\nset_watched_status(list_item, video, common_data)\n- trackid = video['trackIds']['value']['trackId_jaw']\n+ trackid = video_list.component_summary.get('trackIds', {}).get('trackId', '')\nif is_playable:\n# The movie or tvshow (episodes) is playable\nurl = common.build_url(videoid=videoid,\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_path_requests.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_path_requests.py",
"diff": "@@ -113,7 +113,8 @@ class DirectoryPathRequests:\nLOG.debug('Requesting the seasons list for show {}', videoid)\ncall_args = {\n'paths': (build_paths(['videos', videoid.tvshowid], SEASONS_PARTIAL_PATHS) +\n- build_paths(['videos', videoid.tvshowid], ART_PARTIAL_PATHS)),\n+ build_paths(['videos', videoid.tvshowid], ART_PARTIAL_PATHS) +\n+ [['videos', videoid.tvshowid, 'componentSummary']]),\n'length_params': ['stdlist_wid', ['videos', videoid.tvshowid, 'seasonList']],\n'perpetual_range_start': perpetual_range_start\n}\n@@ -128,6 +129,7 @@ class DirectoryPathRequests:\nraise InvalidVideoId(f'Cannot request episode list for {videoid}')\nLOG.debug('Requesting episode list for {}', videoid)\npaths = ([['seasons', videoid.seasonid, 'summary']] +\n+ [['seasons', videoid.seasonid, 'componentSummary']] +\nbuild_paths(['seasons', videoid.seasonid, 'episodes', RANGE_PLACEHOLDER], EPISODES_PARTIAL_PATHS) +\nbuild_paths(['videos', videoid.tvshowid], ART_PARTIAL_PATHS + [['title']]))\ncall_args = {\n@@ -145,7 +147,8 @@ class DirectoryPathRequests:\n# Some of this type of request have results fixed at ~40 from netflix\n# The 'length' tag never return to the actual total count of the elements\nLOG.debug('Requesting video list {}', list_id)\n- paths = build_paths(['lists', list_id, RANGE_PLACEHOLDER, 'reference'], VIDEO_LIST_PARTIAL_PATHS)\n+ paths = (build_paths(['lists', list_id, RANGE_PLACEHOLDER, 'reference'], VIDEO_LIST_PARTIAL_PATHS) +\n+ [['lists', list_id, 'componentSummary']])\ncall_args = {\n'paths': paths,\n'length_params': ['stdlist', ['lists', list_id]],\n@@ -218,7 +221,7 @@ class DirectoryPathRequests:\n\"\"\"Retrieve a video list by search term\"\"\"\nLOG.debug('Requesting video list by search term \"{}\"', search_term)\nbase_path = ['search', 'byTerm', f'|{search_term}', 'titles', PATH_REQUEST_SIZE_STD]\n- paths = ([base_path + [['id', 'name', 'requestId']]] +\n+ paths = ([base_path + [['id', 'name', 'requestId', 'trackIds']]] +\nbuild_paths(base_path + [RANGE_PLACEHOLDER, 'reference'], VIDEO_LIST_PARTIAL_PATHS))\ncall_args = {\n'paths': paths,\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/api_requests.py",
"new_path": "resources/lib/utils/api_requests.py",
"diff": "@@ -100,32 +100,36 @@ def rate_thumb(videoid, rating, track_id_jaw):\ndef update_remindme(operation, videoid, trackid):\n\"\"\"Call API to add / remove \"Remind Me\" to not available videos\"\"\"\n- # Method used with old api endpoint\n- # response = common.make_call(\n- # 'post_safe',\n- # {'endpoint': 'playlistop',\n- # 'data': {\n- # 'lolomoId': 'unknown',\n- # 'operation': operation,\n- # 'videoId': int(videoid.value),\n- # 'trackId': int(trackid)\n- # }})\n- # LOG.debug('update_remindme response: {}', response)\n- op = 'addToRemindMeList' if operation == 'add' else 'removeToRemindMeList'\n- call_args = {\n- 'callpaths': [['videos', int(videoid.value), op]],\n- 'params': [str(trackid)],\n- 'path': ['videos', int(videoid.value), 'inRemindMeList']\n- }\n- response = common.make_call('callpath_request', call_args)\n- if response['videos'][videoid.value]['inRemindMeList']['value'] != (operation == 'add'):\n+ if not trackid:\n+ raise Exception('Unable update remind me, trackid not found.')\n+ response = common.make_call(\n+ 'post_safe',\n+ {'endpoint': 'playlistop',\n+ 'data': {\n+ 'lolomoId': 'unknown',\n+ 'operation': operation,\n+ 'videoId': int(videoid.value),\n+ 'trackId': int(trackid)\n+ }})\nLOG.debug('update_remindme response: {}', response)\n- raise Exception('Unable update remind me, an error occurred in the request.')\n+ # 05/10/2022: The remove action by using this new callpath not works\n+ # op = 'addToRemindMeList' if operation == 'add' else 'removeToRemindMeList'\n+ # call_args = {\n+ # 'callpaths': [['videos', int(videoid.value), op]],\n+ # 'params': [str(trackid)],\n+ # 'path': ['videos', int(videoid.value), 'inRemindMeList']\n+ # }\n+ # response = common.make_call('callpath_request', call_args)\n+ # if response['videos'][videoid.value]['inRemindMeList']['value'] != (operation == 'add'):\n+ # LOG.debug('update_remindme response: {}', response)\n+ # raise Exception('Unable update remind me, an error occurred in the request.')\n@measure_exec_time_decorator()\ndef update_my_list(videoid, operation, params):\n\"\"\"Call API to add / remove videos to my list\"\"\"\n+ if not params['trackid']:\n+ raise Exception('Unable update my list, trackid not found.')\nLOG.debug('My List: {} {}', operation, videoid)\nresponse = common.make_call(\n'post_safe',\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/data_types.py",
"new_path": "resources/lib/utils/data_types.py",
"diff": "@@ -93,6 +93,7 @@ class VideoListLoCo:\nself.videoids = _get_videoids(self.videos)\nexcept KeyError:\nself.videoids = []\n+ self.component_summary = {}\ndef __getitem__(self, key):\nreturn _check_sentinel(self.data['lists'][self.list_id]['componentSummary'].get('value', {})[key])\n@@ -113,12 +114,15 @@ class VideoList:\nself.artitem = None\nself.contained_titles = []\nself.videoids = []\n+ self.component_summary = {}\nif has_data:\n+ first_list_id = next(iter(self.data['lists']))\n+ self.component_summary = self.data['lists'][first_list_id].get('componentSummary', {}).get('value', {})\n# Generate one videoid, or from the first id of the list or with specified one\nself.videoid = common.VideoId(\nvideoid=(list_id\nif list_id\n- else next(iter(self.data['lists']))))\n+ else first_list_id))\nself.videos = OrderedDict(resolve_refs(self.data['lists'][self.videoid.value], self.data))\nif self.videos:\n# self.artitem = next(self.videos.values())\n@@ -152,6 +156,7 @@ class VideoListSorted:\nself.artitem = None\nself.contained_titles = []\nself.videoids = []\n+ self.component_summary = {}\nif has_data:\nself.data_lists = path_response[context_name][context_id][req_sort_order_type] \\\nif context_id else path_response[context_name][req_sort_order_type]\n@@ -183,9 +188,13 @@ class SearchVideoList:\nself.videoids = []\nself.artitem = None\nself.contained_titles = []\n+ self.component_summary = {}\nif has_data:\n+ first_list_id = next(iter(self.data['search']['byReference']))\n+ self.component_summary = {\n+ 'trackIds': self.data['search']['byReference'][first_list_id]['trackIds'].get('value', {})}\nself.title = common.get_local_string(30100).format(list(self.data['search']['byTerm'])[0][1:])\n- self.videos = OrderedDict(resolve_refs(list(self.data['search']['byReference'].values())[0], self.data))\n+ self.videos = OrderedDict(resolve_refs(self.data['search']['byReference'][first_list_id], self.data))\nself.videoids = _get_videoids(self.videos)\n# self.artitem = next(self.videos.values(), None)\nself.artitem = list(self.videos.values())[0] if self.videos else None\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix trackid for add/remove mylist/remindme |
106,046 | 06.10.2022 19:57:30 | -7,200 | 15d1ae67547a28ab2dcd2de3a42f7ebe5d84d5ec | Add python versions to sonar CI | [
{
"change_type": "MODIFY",
"old_path": ".github/workflows/ci.yml",
"new_path": ".github/workflows/ci.yml",
"diff": "@@ -34,6 +34,7 @@ jobs:\nargs: >\n-Dsonar.organization=add-ons\n-Dsonar.projectKey=add-ons_plugin.video.netflix\n+ -Dsonar.python.version=3.7,3.8,3.9,3.10\nenv:\nGITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\nSONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add python versions to sonar CI |
106,037 | 17.09.2022 12:18:54 | -7,200 | 1fc1673047bc42dca424705b569641456710aecf | Keep databases open
Try to longer open and close database handles for each operation.
For sqlite a check if done if the library is threadsafe.
If it's not, then the old "connect-statement-close" method is used. | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/database/db_base_mysql.py",
"new_path": "resources/lib/database/db_base_mysql.py",
"diff": "@@ -29,18 +29,13 @@ def handle_connection(func):\nif not args[0].is_mysql_database:\n# If database is not mysql pass to next decorator\nreturn func(*args, **kwargs)\n- conn = None\ntry:\nif not args[0].conn or (args[0].conn and not args[0].conn.is_connected()):\nargs[0].conn = mysql.connector.connect(**args[0].config)\n- conn = args[0].conn\nreturn func(*args, **kwargs)\nexcept mysql.connector.Error as exc:\nLOG.error('MySQL error {}:', exc)\nraise DBMySQLConnectionError from exc\n- finally:\n- if conn and conn.is_connected():\n- conn.close()\nreturn wrapper\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/database/db_base_sqlite.py",
"new_path": "resources/lib/database/db_base_sqlite.py",
"diff": "@@ -16,6 +16,7 @@ import resources.lib.database.db_base as db_base\nimport resources.lib.database.db_create_sqlite as db_create_sqlite\nimport resources.lib.database.db_utils as db_utils\nfrom resources.lib.common.exceptions import DBSQLiteConnectionError, DBSQLiteError\n+from resources.lib.globals import G\nfrom resources.lib.utils.logging import LOG\n@@ -39,20 +40,22 @@ def handle_connection(func):\n# If database is mysql pass to next decorator\nreturn func(*args, **kwargs)\nconn = None\n+ is_not_thread_safe = not G.IS_SQLITE3_THREADSAFE\ntry:\nif not args[0].is_connected:\n+ if is_not_thread_safe:\nargs[0].mutex.acquire()\nargs[0].conn = sql.connect(args[0].db_file_path,\n- isolation_level=CONN_ISOLATION_LEVEL)\n+ isolation_level=CONN_ISOLATION_LEVEL,\n+ check_same_thread = is_not_thread_safe)\nargs[0].is_connected = True\nconn = args[0].conn\n-\nreturn func(*args, **kwargs)\nexcept sql.Error as exc:\nLOG.error('SQLite error {}:', exc.args[0])\nraise DBSQLiteConnectionError from exc\nfinally:\n- if conn:\n+ if conn and is_not_thread_safe:\nargs[0].is_connected = False\nconn.close()\nargs[0].mutex.release()\n@@ -78,12 +81,13 @@ class SQLiteDatabase(db_base.BaseDatabase):\ndef _initialize_connection(self):\ntry:\n- LOG.debug('Trying connection to the database {}', self.db_filename)\n+ LOG.debug('Trying connection to the SQLite database {}', self.db_filename)\nself.conn = sql.connect(self.db_file_path, check_same_thread=False)\ncur = self.conn.cursor()\ncur.execute(str('SELECT SQLITE_VERSION()'))\n- LOG.debug('Database connection {} was successful (SQLite ver. {})',\n- self.db_filename, cur.fetchone()[0])\n+ LOG.debug('Database connection {} was successful (SQLite ver. {} {})',\n+ self.db_filename, cur.fetchone()[0],\n+ 'thread safe' if G.IS_SQLITE3_THREADSAFE else 'not thread safe')\ncur.row_factory = lambda cursor, row: row[0]\ncur.execute(str('SELECT name FROM sqlite_master WHERE type=\\'table\\' '\n'AND name NOT LIKE \\'sqlite_%\\''))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/database/db_utils.py",
"new_path": "resources/lib/database/db_utils.py",
"diff": "@@ -12,6 +12,7 @@ import os\nimport xbmcvfs\nfrom resources.lib.globals import G\n+from resources.lib.utils.logging import LOG\nLOCAL_DB_FILENAME = 'nf_local.sqlite3'\n@@ -95,3 +96,19 @@ def mysql_insert_or_update(table, id_columns, columns):\non_duplicate_params = [f'{col} = @{col}' for col in columns]\nquery_duplicate = f'ON DUPLICATE KEY UPDATE {\", \".join(on_duplicate_params)};'\nreturn ' '.join([query_set, query_insert, query_duplicate])\n+\n+\n+def is_sqlite3_threadsafe():\n+ \"\"\"\n+ Check if SQLite3 module is threadsafe\n+ \"\"\"\n+ try:\n+ import sqlite3 as sql\n+ conn = sql.connect(':memory:')\n+ threadsafety = conn.execute('SELECT * FROM pragma_compile_options WHERE compile_options LIKE \\'THREADSAFE=%\\'').fetchone()[0]\n+ conn.close()\n+ if int(threadsafety.split(\"=\")[1]) == 1:\n+ return True\n+ except Exception as exc: # pylint: disable=broad-except\n+ LOG.error('Failed to check sqlite thread safe: {}', exc)\n+ return False\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/globals.py",
"new_path": "resources/lib/globals.py",
"diff": "@@ -273,6 +273,9 @@ class GlobalVariables:\nself.IPC_OVER_HTTP = self.ADDON.getSettingBool('enable_ipc_over_http')\ndef init_database(self):\n+ # Check if SQLite module is thread safe\n+ from resources.lib.database.db_utils import is_sqlite3_threadsafe\n+ self.IS_SQLITE3_THREADSAFE = is_sqlite3_threadsafe()\n# Initialize local database\nimport resources.lib.database.db_local as db_local\nself.LOCAL_DB = db_local.NFLocalDatabase()\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/cache_management.py",
"new_path": "resources/lib/services/cache_management.py",
"diff": "@@ -38,10 +38,14 @@ def handle_connection(func):\n@wraps(func)\ndef wrapper(*args, **kwargs):\nconn = None\n+ is_not_thread_safe = not G.IS_SQLITE3_THREADSAFE\ntry:\nif not args[0].is_connected:\n+ if is_not_thread_safe:\nargs[0].mutex.acquire()\n- args[0].conn = sql.connect(args[0].db_file_path, isolation_level=CONN_ISOLATION_LEVEL)\n+ args[0].conn = sql.connect(args[0].db_file_path,\n+ isolation_level=CONN_ISOLATION_LEVEL,\n+ check_same_thread = is_not_thread_safe)\nargs[0].is_connected = True\nconn = args[0].conn\nreturn func(*args, **kwargs)\n@@ -49,7 +53,7 @@ def handle_connection(func):\nLOG.error('SQLite error {}:', exc.args[0])\nraise DBSQLiteConnectionError from exc\nfinally:\n- if conn:\n+ if conn and is_not_thread_safe:\nargs[0].is_connected = False\nconn.close()\nargs[0].mutex.release()\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Keep databases open
Try to longer open and close database handles for each operation.
For sqlite a check if done if the library is threadsafe.
If it's not, then the old "connect-statement-close" method is used. |
106,046 | 06.10.2022 18:54:04 | -7,200 | 67fcbc6c37edf38f5d8f7ff014c80175a6c568ad | Updated android ESN generation | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/esn.py",
"new_path": "resources/lib/utils/esn.py",
"diff": "@@ -14,32 +14,6 @@ from resources.lib.globals import G\nfrom .logging import LOG\n-# 25/11/2020 - Follow Android ESN generator is changed (current method not yet known)\n-# First NF identifies the device in this way and in the following order:\n-# 1) if getPackageManager().hasSystemFeature(\"org.chromium.arc\") == true\n-# the device is : DEV_TYPE_CHROME_OS (Chrome OS)\n-# 2) if getSystemService(Context.DISPLAY_SERVICE)).getDisplay(0) == null\n-# the device is : DEV_TYPE_ANDROID_STB (Set-Top Box)\n-# 3) if getSystemService(Context.UI_MODE_SERVICE)).getCurrentModeType() == UI_MODE_TYPE_TELEVISION\n-# the device is : DEV_TYPE_ANDROID_TV\n-# 4) if 528 is <= of (calculated resolution display):\n-# DisplayMetrics dMetr = new DisplayMetrics();\n-# defaultDisplay.getRealMetrics(displayMetrics);\n-# float disDens = displayMetrics.density;\n-# if 528 <= Math.min((dMetr.widthPixels / disDens, (dMetr.heightPixels / disDens)\n-# the device is : DEV_TYPE_TABLET\n-# 5) if all other cases are not suitable, then the device is : DEV_TYPE_PHONE\n-# Then after identifying the device type, a specific letter will be added after the prefix \"PRV-\"\n-\n-# ESN Device categories (updated 25/11/2020)\n-# Unknown or Phone \"PRV-P\"\n-# Tablet? \"PRV-T\" (should be for tablet)\n-# Tablet \"PRV-C\" (should be for Chrome OS devices only)\n-# Google TV \"PRV-B\" (Set-Top Box)\n-# Smart Display \"PRV-E\"\n-# Android TV \"PRV-\" (without letter specified)\n-\n-\nclass WidevineForceSecLev: # pylint: disable=no-init, disable=too-few-public-methods\n\"\"\"The values accepted for 'widevine_force_seclev' TABLE_SESSION setting\"\"\"\nDISABLED = 'Disabled'\n@@ -81,26 +55,106 @@ def generate_android_esn(wv_force_sec_lev=None):\n\"\"\"Generate an ESN if on android or return the one from user_data\"\"\"\nfrom resources.lib.common.device_utils import get_system_platform\nif get_system_platform() == 'android':\n- import subprocess\n- try:\n- sdk_version = int(subprocess.check_output(['/system/bin/getprop', 'ro.build.version.sdk']))\n- manufacturer = subprocess.check_output(\n- ['/system/bin/getprop',\n- 'ro.product.manufacturer']).decode('utf-8').strip(' \\t\\n\\r').upper()\n- if manufacturer:\n- model = subprocess.check_output(\n- ['/system/bin/getprop',\n- 'ro.product.model']).decode('utf-8').strip(' \\t\\n\\r').upper()\n+ props = _get_android_system_props()\n+ is_android_tv = 'TV' in props.get('ro.build.characteristics', '').upper()\n+ if is_android_tv:\n+ return _generate_esn_android_tv(props, wv_force_sec_lev)\n+ return _generate_esn_android(props, wv_force_sec_lev)\n+ return None\n+\n+\n+def generate_esn(prefix=''):\n+ \"\"\"Generate a random ESN\"\"\"\n+ # For possibles prefixes see website, are based on browser user agent\n+ import random\n+ esn = prefix\n+ possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'\n+ for _ in range(0, 30):\n+ esn += random.choice(possible)\n+ LOG.debug('Generated random ESN: {}', esn)\n+ return esn\n+\n+\n+def _generate_esn_android(props, wv_force_sec_lev):\n+ \"\"\"Generate ESN for Android device\"\"\"\n+ manufacturer = props.get('ro.product.manufacturer', '').upper()\n+ if not manufacturer:\n+ LOG.error('Cannot generate ESN ro.product.manufacturer not found')\n+ return None\n+ model = props.get('ro.product.model', '').upper()\n+ if not model:\n+ LOG.error('Cannot generate ESN ro.product.model not found')\n+ return None\n+\n+ device_category = 'T-' # The default value must be \"P\",\n+ # but we force to \"T\" that should provide 1080p on tablets, this because to determinate if the device fall in\n+ # to the tablet category we need to know the screen size by DisplayMetrics android API that we do not have access\n+ # and then check/calculate with the following formula:\n+ # if 600 <= min(width_px / density, height_px / density):\n+ # device_category = 'T-'\n+\n+ # Device categories (updated 06/10/2022):\n+ # Unknown or Phone \"P\"\n+ # Tablet \"T\"\n+ # Chrome OS Tablet \"C\"\n+ # Setup Box \"B\"\n+ # Smart Display \"E\"\n+\n+ drm_security_level, system_id = _get_drm_info(wv_force_sec_lev)\n+\n+ sec_lev = '' if drm_security_level == 'L1' else 'L3-'\n+\n+ if len(manufacturer) < 5:\n+ manufacturer += ' '\n+ manufacturer = manufacturer[:5]\n+ model = model[:45].strip()\n+\n+ prod = manufacturer + model\n+ prod = sub(r'[^A-Za-z0-9=-]', '=', prod)\n+ return 'NFANDROID1-PRV-' + device_category + sec_lev + prod + '-' + system_id + '-'\n+\n+\n+def _generate_esn_android_tv(props, wv_force_sec_lev):\n+ \"\"\"Generate ESN for Android TV device\"\"\"\n+ sdk_version = int(props['ro.build.version.sdk'])\n+ manufacturer = props.get('ro.product.manufacturer', '').upper()\n+ if not manufacturer:\n+ LOG.error('Cannot generate ESN ro.product.manufacturer not found')\n+ return None\n+ model = props.get('ro.product.model', '').upper()\n+ if not model:\n+ LOG.error('Cannot generate ESN ro.product.model not found')\n+ return None\n# Netflix Ready Device Platform (NRDP)\n- nrdp_modelgroup = subprocess.check_output(\n- ['/system/bin/getprop',\n- 'ro.vendor.nrdp.modelgroup' if sdk_version >= 28 else 'ro.nrdp.modelgroup']\n- ).decode('utf-8').strip(' \\t\\n\\r').upper()\n+ if sdk_version >= 28:\n+ model_group = props.get('ro.vendor.nrdp.modelgroup', '').upper()\n+ else:\n+ model_group = props.get('ro.nrdp.modelgroup', '').upper()\n+\n+ if not model_group:\n+ model_group = '0'\n+ model_group = sub(r'[^A-Za-z0-9=-]', '=', model_group)\n+\n+ if len(manufacturer) < 5:\n+ manufacturer += ' '\n+ manufacturer = manufacturer[:5]\n+ model = model[:45].strip()\n+\n+ prod = manufacturer + model\n+ prod = sub(r'[^A-Za-z0-9=-]', '=', prod)\n+\n+ _, system_id = _get_drm_info(wv_force_sec_lev)\n+ return 'NFANDROID2-PRV-' + model_group + '-' + prod + '-' + system_id + '-'\n+\n+def _get_drm_info(wv_force_sec_lev):\ndrm_security_level = G.LOCAL_DB.get_value('drm_security_level', '', table=TABLE_SESSION)\nsystem_id = G.LOCAL_DB.get_value('drm_system_id', table=TABLE_SESSION)\n+ if not system_id:\n+ raise Exception('Cannot get DRM system id')\n+\n# Some device with false Widevine certification can be specified as Widevine L1\n# but we do not know how NF original app force the fallback to L3, so we add a manual setting\nif not wv_force_sec_lev:\n@@ -113,36 +167,28 @@ def generate_android_esn(wv_force_sec_lev=None):\n# For some devices the Netflix android app change the DRM System ID to 4445\ndrm_security_level = 'L3'\nsystem_id = '4445'\n-\n- if drm_security_level == 'L1':\n- esn = 'NFANDROID2-PRV-'\n- if nrdp_modelgroup:\n- esn += nrdp_modelgroup + '-'\n- else:\n- esn += model.replace(' ', '') + '-'\n- else:\n- esn = 'NFANDROID1-PRV-'\n- esn += 'T-L3-'\n-\n- esn += f'{manufacturer:=<5.5}'\n- esn += model[:45].replace(' ', '=')\n- esn = sub(r'[^A-Za-z0-9=-]', '=', esn)\n- if system_id:\n- esn += f'-{system_id}-'\n- LOG.debug('Generated Android ESN: {} (widevine force sec.lev. set as \"{}\")', esn, wv_force_sec_lev)\n- return esn\n- except OSError:\n- pass\n- return None\n+ return drm_security_level, system_id\n-def generate_esn(prefix=''):\n- \"\"\"Generate a random ESN\"\"\"\n- # For possibles prefixes see website, are based on browser user agent\n- import random\n- esn = prefix\n- possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'\n- for _ in range(0, 30):\n- esn += random.choice(possible)\n- LOG.debug('Generated random ESN: {}', esn)\n- return esn\n+def _get_android_system_props():\n+ \"\"\"Get Android system properties by parsing the raw output of getprop into a dictionary\"\"\"\n+ try:\n+ import subprocess\n+ info_dict = {}\n+ info = subprocess.check_output(['/system/bin/getprop']).decode('utf-8', errors='ignore').replace('\\r\\n', '\\n')\n+ for line in info.split(']\\n'):\n+ if not line:\n+ continue\n+ try:\n+ name, value = line.split(': ', 1)\n+ except ValueError:\n+ LOG.debug('Failed to parse getprop line: {}', line)\n+ continue\n+ name = name.strip()[1:-1] # Remove brackets [] and spaces\n+ if value and value[0] == '[':\n+ value = value[1:]\n+ info_dict[name] = value\n+ return info_dict\n+ except OSError:\n+ LOG.error('Cannot get \"getprop\" data due to system error.')\n+ return {}\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Updated android ESN generation |
106,046 | 07.10.2022 14:59:06 | -7,200 | b94611069a93f6f1a1551e5cde5842e85f00307e | Add new expert setting to force MSL idtoken auth | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -1187,3 +1187,12 @@ msgstr \"\"\nmsgctxt \"#30724\"\nmsgid \"Kodi saves the \\\"View mode\\\" \\\"Zoom\\\" setting permanently, enable this setting to restore the \\\"Normal\\\" View mode when playing a previously watched video.\"\nmsgstr \"\"\n+\n+msgctxt \"#30725\"\n+msgid \"Force MSL with idtoken authentication\"\n+msgstr \"\"\n+\n+#. Description of setting ID 30725 - do not translate the error message\n+msgctxt \"#30726\"\n+msgid \"On some Android devices the error \\\"User authentication data does not match entity identity\\\" may occur, enabling this setting may solve the problem, but it will only be possible to play videos from the main profile.\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"new_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"diff": "@@ -170,12 +170,13 @@ class MSLRequests(MSLRequestBuilder):\nauth_data = {}\n# TODO: MSL netflixid auth at today not works with L3 android devices by returning error:\n- # \"User authentication data does not match entity identity.\"\n- # so we fallback to idtoken auth, but this will not allow to play videos with other profiles than owner one,\n- # then until another solution will be found the other profiles will be unusable...\n- if get_system_platform() == 'android' and not is_device_l1_enabled():\n+ # \"User authentication data does not match entity identity.\" so we fallback to idtoken auth\n+ if get_system_platform() == 'android' and (not is_device_l1_enabled()\n+ or G.ADDON.getSettingBool('msl_auth_type')):\nauth_scheme = MSL_AUTH_USER_ID_TOKEN\n+ # TODO: Due to removal of SWITCH_PROFILE using idtoken authenticaton is possible play videos\n+ # from main/owner profile only\nif auth_scheme == MSL_AUTH_USER_ID_TOKEN:\nauth_data.update(self._check_user_id_token(disable_msl_switch, force_auth_credential))\nif auth_data['user_id_token'] is None:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<close>true</close>\n</control>\n</setting>\n+ <setting id=\"msl_auth_type\" type=\"boolean\" label=\"30725\" help=\"30726\">\n+ <dependencies>\n+ <dependency type=\"visible\">\n+ <condition on=\"property\" name=\"InfoBool\">system.platform.android</condition>\n+ </dependency>\n+ </dependencies>\n+ <level>0</level>\n+ <default>false</default>\n+ <control type=\"toggle\"/>\n+ </setting>\n<setting id=\"enable_debug\" type=\"boolean\" label=\"30066\" help=\"\">\n<level>0</level>\n<default>false</default>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add new expert setting to force MSL idtoken auth |
106,046 | 07.10.2022 15:10:06 | -7,200 | 178d773a7babc85d6ada336418c33f603f3a4a1e | Add AV1 codec support for dev test purpose only | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -1196,3 +1196,7 @@ msgstr \"\"\nmsgctxt \"#30726\"\nmsgid \"On some Android devices the error \\\"User authentication data does not match entity identity\\\" may occur, enabling this setting may solve the problem, but it will only be possible to play videos from the main profile.\"\nmsgstr \"\"\n+\n+msgctxt \"#30727\"\n+msgid \"Enable AV1 profiles - FOR DEVELOPMENT TEST ONLY\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/converter.py",
"new_path": "resources/lib/services/nfsession/msl/converter.py",
"diff": "@@ -97,7 +97,7 @@ def _get_protection_info(content):\nreturn {'pssh': pssh, 'keyid': keyid}\n-def _add_protection_info(adaptation_set, pssh, keyid):\n+def _add_protection_info(video_track, adaptation_set, pssh, keyid):\nif keyid:\n# Signaling presence of encrypted content\nfrom base64 import standard_b64decode\n@@ -107,7 +107,7 @@ def _add_protection_info(adaptation_set, pssh, keyid):\nattrib={\n'schemeIdUri': 'urn:mpeg:dash:mp4protection:2011',\n'cenc:default_KID': str(uuid.UUID(bytes=standard_b64decode(keyid))),\n- 'value': 'cenc'\n+ 'value': 'cbcs' if 'av1' in video_track['profile'] else 'cenc'\n})\n# Define the DRM system configuration\nprotection = ET.SubElement(\n@@ -140,7 +140,7 @@ def _convert_video_track(video_track, period, protection, has_drm_streams, cdn_i\nmimeType='video/mp4',\ncontentType='video')\nif protection:\n- _add_protection_info(adaptation_set, **protection)\n+ _add_protection_info(video_track, adaptation_set, **protection)\nlimit_res = _limit_video_resolution(video_track['streams'], has_drm_streams)\n@@ -209,6 +209,8 @@ def _determine_video_codec(content_profile):\nreturn 'hevc'\nif content_profile.startswith('vp9'):\nreturn f'vp9.{content_profile[11:12]}'\n+ if 'av1' in content_profile:\n+ return 'av1'\nreturn 'h264'\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/profiles.py",
"new_path": "resources/lib/services/nfsession/msl/profiles.py",
"diff": "@@ -15,15 +15,18 @@ CENC_PRK = 'dash-cenc-prk'\nCENC_PRK_DO = 'dash-cenc-prk-do'\nCENC = 'dash-cenc'\nCENC_TL = 'dash-cenc-tl'\n+CBCS_PRK = 'dash-cbcs-prk'\nHDR = 'hevc-hdr-main10-'\nDV5 = 'hevc-dv5-main10-'\nVP9_PROFILE0 = 'vp9-profile0-'\n# VP9 Profile 2 (HDR) test only, the website does not list it but some videos still have this profile available\n# VP9_PROFILE2 = 'vp9-profile2-'\n+AV1 = 'av1-main-'\nBASE_LEVELS = ['L30-', 'L31-', 'L40-', 'L41-', 'L50-', 'L51-']\nVP9_PROFILE0_LEVELS = ['L21-', 'L30-', 'L31-', 'L40-']\n# VP9_PROFILE2_LEVELS = ['L30-', 'L31-', 'L40-', 'L50-', 'L51-']\n+AV1_LEVELS = ['L20-', 'L21-', 'L30-', 'L31-', 'L40-', 'L41-', 'L50-', 'L51-']\ndef _profile_strings(base, tails):\n@@ -60,10 +63,13 @@ PROFILES = {\n(BASE_LEVELS, CENC_PRK_DO)]),\n'vp9profile0':\n_profile_strings(base=VP9_PROFILE0,\n- tails=[(VP9_PROFILE0_LEVELS, CENC)])\n+ tails=[(VP9_PROFILE0_LEVELS, CENC)]),\n# 'vp9profile2':\n# _profile_strings(base=VP9_PROFILE2,\n# tails=[(VP9_PROFILE2_LEVELS, CENC_PRK)])\n+ 'av1':\n+ _profile_strings(base=AV1,\n+ tails=[(AV1_LEVELS, CBCS_PRK)])\n}\n@@ -81,7 +87,8 @@ def enabled_profiles():\n'enable_hdr_profiles']) +\n_additional_profiles('dolbyvision',\n['enable_hevc_profiles',\n- 'enable_dolbyvision_profiles']))\n+ 'enable_dolbyvision_profiles']) +\n+ _additional_profiles('av1', 'enable_av1_profiles'))\ndef _subtitle_profiles():\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/settings_monitor.py",
"new_path": "resources/lib/services/settings_monitor.py",
"diff": "@@ -130,7 +130,7 @@ def _check_manifest_settings_status(clean_buckets):\n# therefore cached manifests must be deleted (see load_manifest on msl_handler.py)\nmenu_keys_bool = ['enable_dolby_sound', 'enable_vp9_profiles', 'enable_hevc_profiles',\n'enable_hdr_profiles', 'enable_dolbyvision_profiles', 'enable_force_hdcp',\n- 'disable_webvtt_subtitle']\n+ 'disable_webvtt_subtitle', 'enable_av1_profiles']\ncollected_data = ''\nfor menu_key in menu_keys_bool:\ncollected_data += str(int(G.ADDON.getSettingBool(menu_key)))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<dependency type=\"visible\" setting=\"enable_hevc_profiles\">true</dependency>\n</dependencies>\n</setting>\n+ <setting id=\"enable_av1_profiles\" type=\"boolean\" label=\"30727\">\n+ <level>0</level>\n+ <default>false</default>\n+ <control type=\"toggle\"/>\n+ <dependencies> <!-- Feature available on Kodi v20 or above -->\n+ <dependency type=\"visible\">\n+ <or>\n+ <condition on=\"property\" operator=\"is\" name=\"InfoBool\">String.StartsWith(System.BuildVersionCode,19.9)</condition> <!-- v20 pre-releases -->\n+ <condition on=\"property\" operator=\"is\" name=\"InfoBool\">Integer.IsGreaterOrEqual(System.BuildVersionCode,20)</condition>\n+ </or>\n+ </dependency>\n+ </dependencies>\n+ </setting>\n<setting id=\"disable_webvtt_subtitle\" type=\"boolean\" label=\"30144\" help=\"\">\n<level>0</level>\n<default>false</default>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add AV1 codec support for dev test purpose only |
106,046 | 08.10.2022 11:16:50 | -7,200 | 6a0d09e7706fcc3aec82a4ff0eb2e1bca5f4a4af | Updated codec profiles | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/profiles.py",
"new_path": "resources/lib/services/nfsession/msl/profiles.py",
"diff": "@@ -12,6 +12,7 @@ import resources.lib.common as common\nHEVC_M10 = 'hevc-main10-'\nCENC_PRK = 'dash-cenc-prk'\n+CENC_PRK_QC = 'dash-cenc-prk-qc'\nCENC_PRK_DO = 'dash-cenc-prk-do'\nCENC = 'dash-cenc'\nCENC_TL = 'dash-cenc-tl'\n@@ -23,10 +24,12 @@ VP9_PROFILE0 = 'vp9-profile0-'\n# VP9_PROFILE2 = 'vp9-profile2-'\nAV1 = 'av1-main-'\n-BASE_LEVELS = ['L30-', 'L31-', 'L40-', 'L41-', 'L50-', 'L51-']\n-VP9_PROFILE0_LEVELS = ['L21-', 'L30-', 'L31-', 'L40-']\n-# VP9_PROFILE2_LEVELS = ['L30-', 'L31-', 'L40-', 'L50-', 'L51-']\n-AV1_LEVELS = ['L20-', 'L21-', 'L30-', 'L31-', 'L40-', 'L41-', 'L50-', 'L51-']\n+# Video codec levels\n+LEVELS_2 = ['L20-', 'L21-']\n+LEVELS_3 = ['L30-', 'L31-']\n+LEVELS_4 = ['L40-', 'L41-']\n+LEVELS_5 = ['L50-', 'L51-']\n+ALL_LEVELS = LEVELS_2 + LEVELS_3 + LEVELS_4 + LEVELS_5\ndef _profile_strings(base, tails):\n@@ -47,36 +50,38 @@ PROFILES = {\n'playready-h264mpl40-dash',\n'playready-h264hpl22-dash', 'playready-h264hpl30-dash',\n'playready-h264hpl31-dash', 'playready-h264hpl40-dash'],\n+ 'h264_prk_qc': ['h264mpl30-dash-playready-prk-qc', 'h264mpl31-dash-playready-prk-qc',\n+ 'h264mpl40-dash-playready-prk-qc'],\n'hevc':\n_profile_strings(base=HEVC_M10,\n- tails=[(BASE_LEVELS, CENC),\n- (BASE_LEVELS[:4], CENC_PRK),\n- (BASE_LEVELS, CENC_PRK_DO)]),\n+ tails=[(LEVELS_3 + LEVELS_4 + LEVELS_5, CENC),\n+ (LEVELS_3 + LEVELS_4, CENC_PRK),\n+ (LEVELS_3 + LEVELS_4 + LEVELS_5, CENC_PRK_DO)]),\n'hdr':\n_profile_strings(base=HDR,\n- tails=[(BASE_LEVELS, CENC),\n- (BASE_LEVELS, CENC_PRK),\n- (BASE_LEVELS, CENC_PRK_DO)]),\n+ tails=[(LEVELS_3 + LEVELS_4 + LEVELS_5, CENC_PRK),\n+ (LEVELS_3 + LEVELS_4, CENC_PRK_DO)]),\n'dolbyvision':\n_profile_strings(base=DV5,\n- tails=[(BASE_LEVELS, CENC_PRK),\n- (BASE_LEVELS, CENC_PRK_DO)]),\n+ tails=[(LEVELS_3 + LEVELS_4 + LEVELS_5, CENC_PRK),\n+ (LEVELS_4 + LEVELS_5, CENC_PRK_QC),\n+ (LEVELS_3 + LEVELS_4 + LEVELS_5, CENC_PRK_DO)]),\n'vp9profile0':\n_profile_strings(base=VP9_PROFILE0,\n- tails=[(VP9_PROFILE0_LEVELS, CENC)]),\n+ tails=[(LEVELS_2[1:2] + LEVELS_3 + LEVELS_4[:1], CENC)]),\n# 'vp9profile2':\n# _profile_strings(base=VP9_PROFILE2,\n- # tails=[(VP9_PROFILE2_LEVELS, CENC_PRK)])\n+ # tails=[(LEVELS_3 + LEVELS_4[:1] + LEVELS_5, CENC_PRK)])\n'av1':\n_profile_strings(base=AV1,\n- tails=[(AV1_LEVELS, CBCS_PRK)])\n+ tails=[(ALL_LEVELS, CBCS_PRK)])\n}\ndef enabled_profiles():\n\"\"\"Return a list of all base and enabled additional profiles\"\"\"\nreturn (PROFILES['base'] +\n- PROFILES['h264'] +\n+ PROFILES['h264'] + PROFILES['h264_prk_qc'] +\n_subtitle_profiles() +\n_additional_profiles('vp9profile0', 'enable_vp9_profiles') +\n# _additional_profiles('vp9profile2', 'enable_vp9_profiles') +\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Updated codec profiles |
106,046 | 08.10.2022 21:47:20 | -7,200 | c031116b750cc95f461783167ae1d201848e1b1f | Fixed trackid keyerrors | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/context_menu.py",
"new_path": "resources/lib/kodi/context_menu.py",
"diff": "@@ -76,7 +76,7 @@ def generate_context_menu_items(videoid, is_in_mylist, perpetual_range_start=Non\nvideoid.mediatype in [common.VideoId.MOVIE, common.VideoId.SHOW]):\nitems.insert(0, _ctx_item('trailer', videoid))\n- if videoid.mediatype in [common.VideoId.MOVIE, common.VideoId.SHOW]:\n+ if videoid.mediatype in [common.VideoId.MOVIE, common.VideoId.SHOW] and trackid is not None:\nlist_action = 'remove_from_list' if is_in_mylist else 'add_to_list'\nitems.insert(0, _ctx_item(list_action, videoid, {'perpetual_range_start': perpetual_range_start,\n'trackid': trackid}))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"diff": "@@ -243,6 +243,9 @@ def _create_videolist_item(list_id, video_list, menu_data, common_data, static_l\ndef build_video_listing(video_list, menu_data, sub_genre_id=None, pathitems=None, perpetual_range_start=None,\nmylist_items=None, path_params=None):\n\"\"\"Build a video listing\"\"\"\n+ trackid = None\n+ if hasattr(video_list, 'component_summary'):\n+ trackid = video_list.component_summary.get('trackIds', {}).get('trackId', 'None')\ncommon_data = get_common_data()\ncommon_data.update({\n'params': get_param_watched_status_by_profile(),\n@@ -254,6 +257,7 @@ def build_video_listing(video_list, menu_data, sub_genre_id=None, pathitems=None\n'ctxmenu_remove_watched_status': menu_data['path'][1] == 'continueWatching',\n'active_profile_guid': G.LOCAL_DB.get_active_profile_guid(),\n'marks_tvshow_started': G.ADDON.getSettingBool('marks_tvshow_started'),\n+ 'trackid': trackid\n})\ndirectory_items = [_create_video_item(videoid_value, video, video_list, perpetual_range_start, common_data)\nfor videoid_value, video\n@@ -299,7 +303,6 @@ def _create_video_item(videoid_value, video, video_list, perpetual_range_start,\nadd_info_list_item(list_item, videoid, video, video_list.data, is_in_mylist, common_data)\nif not is_folder:\nset_watched_status(list_item, video, common_data)\n- trackid = video_list.component_summary.get('trackIds', {}).get('trackId', '')\nif is_playable:\n# The movie or tvshow (episodes) is playable\nurl = common.build_url(videoid=videoid,\n@@ -307,7 +310,7 @@ def _create_video_item(videoid_value, video, video_list, perpetual_range_start,\nparams=None if is_folder else common_data['params'])\nlist_item.addContextMenuItems(generate_context_menu_items(videoid, is_in_mylist, perpetual_range_start,\ncommon_data['ctxmenu_remove_watched_status'],\n- trackid))\n+ common_data['trackid']))\nelse:\n# The movie or tvshow (episodes) is not available\n# Try check if there is a availability date\n@@ -320,7 +323,7 @@ def _create_video_item(videoid_value, video, video_list, perpetual_range_start,\nexcept CacheMiss:\n# The website check the \"Remind Me\" value on key \"inRemindMeList\" and also \"queue\"/\"inQueue\"\nis_in_remind_me = video['inRemindMeList']['value'] or video['queue']['value']['inQueue']\n- list_item.addContextMenuItems(generate_context_menu_remind_me(videoid, is_in_remind_me, trackid))\n+ list_item.addContextMenuItems(generate_context_menu_remind_me(videoid, is_in_remind_me, common_data['trackid']))\nurl = common.build_url(['show_availability_message'], videoid=videoid, mode=G.MODE_ACTION)\nreturn url, list_item, is_folder and is_playable\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_path_requests.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_path_requests.py",
"diff": "@@ -181,7 +181,8 @@ class DirectoryPathRequests:\n_base_path.append(RANGE_PLACEHOLDER)\nif not menu_data.get('query_without_reference', False):\n_base_path.append('reference')\n- paths = build_paths(_base_path, VIDEO_LIST_PARTIAL_PATHS)\n+ paths = (build_paths(_base_path, VIDEO_LIST_PARTIAL_PATHS) +\n+ [base_path[:-1] + [['id', 'name', 'requestId', 'trackIds']]])\npath_response = self.nfsession.perpetual_path_request(paths, [response_type, base_path], perpetual_range_start)\nreturn VideoListSorted(path_response, context_name, context_id, req_sort_order_type)\n@@ -244,7 +245,8 @@ class DirectoryPathRequests:\ncontains only minimal video info\n\"\"\"\nLOG.debug('Requesting the full video list for {}', context_name)\n- paths = build_paths([context_name, 'az', RANGE_PLACEHOLDER], VIDEO_LIST_BASIC_PARTIAL_PATHS)\n+ paths = (build_paths([context_name, 'az', RANGE_PLACEHOLDER], VIDEO_LIST_BASIC_PARTIAL_PATHS) +\n+ [[context_name, ['id', 'name', 'requestId', 'trackIds']]])\ncall_args = {\n'paths': paths,\n'length_params': ['stdlist', [context_name, 'az']],\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/api_requests.py",
"new_path": "resources/lib/utils/api_requests.py",
"diff": "@@ -100,8 +100,8 @@ def rate_thumb(videoid, rating, track_id_jaw):\ndef update_remindme(operation, videoid, trackid):\n\"\"\"Call API to add / remove \"Remind Me\" to not available videos\"\"\"\n- if not trackid:\n- raise Exception('Unable update remind me, trackid not found.')\n+ if trackid == 'None':\n+ raise Exception('Unable update my list, trackid not found.')\nresponse = common.make_call(\n'post_safe',\n{'endpoint': 'playlistop',\n@@ -128,7 +128,7 @@ def update_remindme(operation, videoid, trackid):\n@measure_exec_time_decorator()\ndef update_my_list(videoid, operation, params):\n\"\"\"Call API to add / remove videos to my list\"\"\"\n- if not params['trackid']:\n+ if params['trackid'] == 'None':\nraise Exception('Unable update my list, trackid not found.')\nLOG.debug('My List: {} {}', operation, videoid)\nresponse = common.make_call(\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/data_types.py",
"new_path": "resources/lib/utils/data_types.py",
"diff": "@@ -158,8 +158,12 @@ class VideoListSorted:\nself.videoids = []\nself.component_summary = {}\nif has_data:\n- self.data_lists = path_response[context_name][context_id][req_sort_order_type] \\\n- if context_id else path_response[context_name][req_sort_order_type]\n+ if context_id:\n+ self.data_lists = path_response[context_name][context_id][req_sort_order_type]\n+ self.component_summary = {'trackIds': self.data[context_name][context_id]['trackIds'].get('value', {})}\n+ else:\n+ self.data_lists = path_response[context_name][req_sort_order_type]\n+ self.component_summary = {'trackIds': self.data[context_name]['trackIds'].get('value', {})}\nself.videos = OrderedDict(resolve_refs(self.data_lists, self.data))\nif self.videos:\n# self.artitem = next(self.videos.values())\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed trackid keyerrors |
106,046 | 09.10.2022 14:46:43 | -7,200 | 5dec6b595fdaf63c362d0d94e45f39a027302398 | Version bump (1.19.1) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.19.0+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.19.1+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n-v1.19.0 (2022-10-04)\n+v1.19.1 (2022-10-09)\n- NOTE: DUE TO WEBSITE CHANGES ANDROID L3 DEVICES CAN PLAY VIDEOS FROM MAIN PROFILE ONLY\n-- Rework of the addon due to website API change\n-- Fix HTTP error 404 Not Found for url\n-- Fix error missing 2 required keyword-only arguments: 'request' and 'response'\n-- Fix MSL error user auth data does not match entity identity on android L3 devices\n-- Update translation sv_se\n+- Fixed error \"License update not successful (no keys)\" on linux systems\n+- Fixed add/remove the remind me to the videos\n+- Fixed IPC timeout error when you share STRM library with MySQL\n+- Speeded up database access\n+- Updated Android ESN generation\n+- Add Expert setting \"Force MSL with idtoken authentication\"\n+can be used to try solve error: \"User authentication data does not match entity identity\"\n+- Add AV1 codec support, for development test purpose only (Kodi 20)\n+- Update translations el_gr, it\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.19.1 (2022-10-09)\n+- NOTE: DUE TO WEBSITE CHANGES ANDROID L3 DEVICES CAN PLAY VIDEOS FROM MAIN PROFILE ONLY\n+- Fixed error \"License update not successful (no keys)\" on linux systems\n+- Fixed add/remove the remind me to the videos\n+- Fixed IPC timeout error when you share STRM library with MySQL\n+- Speeded up database access\n+- Updated Android ESN generation\n+- Add Expert setting \"Force MSL with idtoken authentication\"\n+can be used to try solve error: \"User authentication data does not match entity identity\"\n+- Add AV1 codec support, for development test purpose only (Kodi 20)\n+- Update translations el_gr, it\n+\nv1.19.0 (2022-10-04)\n- NOTE: DUE TO WEBSITE CHANGES ANDROID L3 DEVICES CAN PLAY VIDEOS FROM MAIN PROFILE ONLY\n- Rework of the addon due to website API change\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.19.1) (#1454) |
106,046 | 10.10.2022 18:00:02 | -7,200 | f3baff3ed05da66cc47883ff6dd6745da6ac3b56 | Fix error description oversight | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/api_requests.py",
"new_path": "resources/lib/utils/api_requests.py",
"diff": "@@ -101,7 +101,7 @@ def rate_thumb(videoid, rating, track_id_jaw):\ndef update_remindme(operation, videoid, trackid):\n\"\"\"Call API to add / remove \"Remind Me\" to not available videos\"\"\"\nif trackid == 'None':\n- raise Exception('Unable update my list, trackid not found.')\n+ raise Exception('Unable update remind me, trackid not found.')\nresponse = common.make_call(\n'post_safe',\n{'endpoint': 'playlistop',\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix error description oversight |
106,046 | 11.10.2022 08:18:18 | -7,200 | af2b2e7e02f9a77c443ee108e0727f1c08ff4d96 | Removed videoids datatype attribute | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/data_types.py",
"new_path": "resources/lib/utils/data_types.py",
"diff": "@@ -73,7 +73,6 @@ class VideoListLoCo:\nself.perpetual_range_selector = path_response.get('_perpetual_range_selector')\nself.data = path_response\nself.list_id = list_id\n- self.videoids = []\n# Set a 'UNSPECIFIED' type videoid (special handling for menus see parse_info in infolabels.py)\nself.videoid = common.VideoId(videoid=list_id)\nself.contained_titles = []\n@@ -89,10 +88,6 @@ class VideoListLoCo:\nself.contained_titles = _get_titles(self.videos)\n# Set art data of first video (special handling for menus see parse_info in infolabels.py)\nself.artitem = list(self.videos.values())[0]\n- try:\n- self.videoids = _get_videoids(self.videos)\n- except KeyError:\n- self.videoids = []\nself.component_summary = {}\ndef __getitem__(self, key):\n@@ -113,7 +108,6 @@ class VideoList:\nself.videos = OrderedDict()\nself.artitem = None\nself.contained_titles = []\n- self.videoids = []\nself.component_summary = {}\nif has_data:\nfirst_list_id = next(iter(self.data['lists']))\n@@ -128,10 +122,6 @@ class VideoList:\n# self.artitem = next(self.videos.values())\nself.artitem = list(self.videos.values())[0]\nself.contained_titles = _get_titles(self.videos)\n- try:\n- self.videoids = _get_videoids(self.videos)\n- except KeyError:\n- self.videoids = []\ndef __getitem__(self, key):\nreturn _check_sentinel(self.data['lists'][self.videoid.value][key])\n@@ -155,7 +145,6 @@ class VideoListSorted:\nself.videos = OrderedDict()\nself.artitem = None\nself.contained_titles = []\n- self.videoids = []\nself.component_summary = {}\nif has_data:\nif context_id:\n@@ -169,10 +158,6 @@ class VideoListSorted:\n# self.artitem = next(self.videos.values())\nself.artitem = list(self.videos.values())[0]\nself.contained_titles = _get_titles(self.videos)\n- try:\n- self.videoids = _get_videoids(self.videos)\n- except KeyError:\n- self.videoids = []\ndef __getitem__(self, key):\nreturn _check_sentinel(self.data_lists[key])\n@@ -189,7 +174,6 @@ class SearchVideoList:\nself.data = path_response\nhas_data = 'search' in path_response\nself.videos = OrderedDict()\n- self.videoids = []\nself.artitem = None\nself.contained_titles = []\nself.component_summary = {}\n@@ -199,7 +183,6 @@ class SearchVideoList:\n'trackIds': self.data['search']['byReference'][first_list_id]['trackIds'].get('value', {})}\nself.title = common.get_local_string(30100).format(list(self.data['search']['byTerm'])[0][1:])\nself.videos = OrderedDict(resolve_refs(self.data['search']['byReference'][first_list_id], self.data))\n- self.videoids = _get_videoids(self.videos)\n# self.artitem = next(self.videos.values(), None)\nself.artitem = list(self.videos.values())[0] if self.videos else None\nself.contained_titles = _get_titles(self.videos)\n@@ -218,7 +201,6 @@ class CustomVideoList:\nself.perpetual_range_selector = path_response.get('_perpetual_range_selector')\nself.data = path_response\nself.videos = OrderedDict(self.data.get('videos', {}))\n- self.videoids = _get_videoids(self.videos)\n# self.artitem = next(self.videos.values())\nself.artitem = list(self.videos.values())[0] if self.videos else None\nself.contained_titles = _get_titles(self.videos)\n@@ -297,7 +279,6 @@ class LoLoMoCategory:\ndef merge_data_type(data, data_to_merge):\nfor video_id, video in data_to_merge.videos.items():\ndata.videos[video_id] = video\n- data.videoids.extend(data_to_merge.videoids)\ndata.contained_titles.extend(data_to_merge.contained_titles)\n@@ -322,12 +303,6 @@ def _get_titles(videos):\nif _get_title(video)]\n-def _get_videoids(videos):\n- \"\"\"Return a list of VideoId s for the videos\"\"\"\n- return [common.VideoId.from_videolist_item(video)\n- for video in videos.values()]\n-\n-\ndef _filterout_loco_contexts(root_id, data, contexts):\n\"\"\"Deletes from the data all records related to the specified contexts\"\"\"\ntotal_items = data['locos'][root_id]['componentSummary'].get('value', {}).get('length', 0)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Removed videoids datatype attribute |
106,046 | 11.10.2022 08:39:50 | -7,200 | 3498ac82f9f0cf5faebfecff003ee599b48f4fe1 | Fixed trailers menu and list | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"diff": "@@ -257,7 +257,8 @@ def build_video_listing(video_list, menu_data, sub_genre_id=None, pathitems=None\n'ctxmenu_remove_watched_status': menu_data['path'][1] == 'continueWatching',\n'active_profile_guid': G.LOCAL_DB.get_active_profile_guid(),\n'marks_tvshow_started': G.ADDON.getSettingBool('marks_tvshow_started'),\n- 'trackid': trackid\n+ 'trackid': trackid,\n+ 'is_supplemental_type': video_list.__class__.__name__ == 'VideoListSupplemental'\n})\ndirectory_items = [_create_video_item(videoid_value, video, video_list, perpetual_range_start, common_data)\nfor videoid_value, video\n@@ -288,6 +289,11 @@ def build_video_listing(video_list, menu_data, sub_genre_id=None, pathitems=None\ndef _create_video_item(videoid_value, video, video_list, perpetual_range_start, common_data): # pylint: disable=unused-argument\n+ if common_data['is_supplemental_type']:\n+ # 10/10/2022 Broken api? the video trailers are not more identified as supplemental type but as movie type\n+ # as workaround we check the data type\n+ videoid = common.VideoId(supplementalid=videoid_value)\n+ else:\nvideoid = common.VideoId.from_videolist_item(video)\nis_folder = videoid.mediatype == common.VideoId.SHOW\nis_playable = video['availability'].get('value', {}).get('isPlayable', False)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_path_requests.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_path_requests.py",
"diff": "@@ -11,7 +11,7 @@ from typing import TYPE_CHECKING\nfrom resources.lib import common\nfrom resources.lib.utils.data_types import (VideoListSorted, SubgenreList, SeasonList, EpisodeList, LoCo, VideoList,\n- SearchVideoList, CustomVideoList, LoLoMoCategory)\n+ SearchVideoList, CustomVideoList, LoLoMoCategory, VideoListSupplemental)\nfrom resources.lib.common.exceptions import InvalidVideoListTypeError, InvalidVideoId\nfrom resources.lib.utils.api_paths import (VIDEO_LIST_PARTIAL_PATHS, RANGE_PLACEHOLDER, VIDEO_LIST_BASIC_PARTIAL_PATHS,\nSEASONS_PARTIAL_PATHS, EPISODES_PARTIAL_PATHS, ART_PARTIAL_PATHS,\n@@ -198,7 +198,7 @@ class DirectoryPathRequests:\n['videos', videoid.value, supplemental_type, {\"from\": 0, \"to\": 35}], TRAILER_PARTIAL_PATHS\n)\npath_response = self.nfsession.path_request(path)\n- return VideoListSorted(path_response, 'videos', videoid.value, supplemental_type)\n+ return VideoListSupplemental(path_response, 'videos', videoid.value, supplemental_type)\n@cache_utils.cache_output(cache_utils.CACHE_COMMON, identify_from_kwarg_name='chunked_video_list',\nttl=900, ignore_self_class=True)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/data_types.py",
"new_path": "resources/lib/utils/data_types.py",
"diff": "@@ -149,10 +149,11 @@ class VideoListSorted:\nif has_data:\nif context_id:\nself.data_lists = path_response[context_name][context_id][req_sort_order_type]\n- self.component_summary = {'trackIds': self.data[context_name][context_id]['trackIds'].get('value', {})}\n+ self.component_summary = {\n+ 'trackIds': self.data[context_name][context_id].get('trackIds', {}).get('value', {})}\nelse:\nself.data_lists = path_response[context_name][req_sort_order_type]\n- self.component_summary = {'trackIds': self.data[context_name]['trackIds'].get('value', {})}\n+ self.component_summary = {'trackIds': self.data[context_name].get('trackIds', {}).get('value', {})}\nself.videos = OrderedDict(resolve_refs(self.data_lists, self.data))\nif self.videos:\n# self.artitem = next(self.videos.values())\n@@ -167,6 +168,13 @@ class VideoListSorted:\nreturn _check_sentinel(self.data_lists.get(key, default))\n+class VideoListSupplemental(VideoListSorted):\n+ \"\"\"A video list\"\"\"\n+ def __init__(self, path_response, context_name, context_id, supplemental_type):\n+ # LOG.debug('VideoListSupplemental data: {}', path_response)\n+ VideoListSorted.__init__(self, path_response, context_name, context_id, supplemental_type)\n+\n+\nclass SearchVideoList:\n\"\"\"A video list with search results\"\"\"\ndef __init__(self, path_response):\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixed trailers menu and list |
106,046 | 11.10.2022 14:07:20 | -7,200 | b199ac07f5d5bd1df98203ae8eaa26e08032c844 | Changed xid param position on manifest | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"new_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"diff": "@@ -263,15 +263,15 @@ class MSLHandler:\n'default': [{\n'drmSessionId': kwargs['sid'] or 'session',\n'clientTime': int(time.time()),\n- 'challengeBase64': kwargs['challenge'],\n- 'xid': kwargs['xid']\n+ 'challengeBase64': kwargs['challenge']\n}]},\n# License type:\n# - 'limited' license data provided in the manifest response, may be needed a second license request\n# - 'standard' no license data provided in the manifest response\n# TODO: Currently on linux only the license type set to \"limited\" cause this error on ISA:\n# License update not successful (no keys)\n- 'licenseType': 'standard'\n+ 'licenseType': 'standard',\n+ 'xid': kwargs['xid']\n}\nendpoint_url = ENDPOINTS['manifest'] + create_req_params('licensedManifest')\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Changed xid param position on manifest |
106,046 | 11.10.2022 13:18:37 | -7,200 | fa9c5da959c3b14e94f35ddbf0b1410ceeec78d9 | Add color setting for remember me | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -846,7 +846,11 @@ msgctxt \"#30215\"\nmsgid \"Color of the titles included in 'My list'\"\nmsgstr \"\"\n-# Unused 30216 to 30218\n+msgctxt \"#30216\"\n+msgid \"Color of the titles marked as \\\"Remember me\\\"\"\n+msgstr \"\"\n+\n+# Unused 30217 to 30218\nmsgctxt \"#30219\"\nmsgid \"Disable notification for synchronization completed\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -62,7 +62,8 @@ def get_info(videoid, item, raw_data, profile_language_code='', delayed_db_op=Fa\nreturn infos, quality_infos\n-def add_info_list_item(list_item: ListItemW, videoid, item, raw_data, is_in_mylist, common_data, art_item=None):\n+def add_info_list_item(list_item: ListItemW, videoid, item, raw_data, is_in_mylist, common_data, art_item=None,\n+ is_in_remind_me=False):\n\"\"\"Add infolabels and art to a ListItem\"\"\"\ninfos, quality_infos = get_info(videoid, item, raw_data, delayed_db_op=True, common_data=common_data)\nlist_item.addStreamInfoFromDict(quality_infos)\n@@ -73,8 +74,11 @@ def add_info_list_item(list_item: ListItemW, videoid, item, raw_data, is_in_myli\ninfos_copy['Plot'] = infos_copy['PlotOutline']\n_add_supplemental_plot_info(infos_copy, item, common_data)\nif is_in_mylist and common_data.get('mylist_titles_color'):\n- # Highlight ListItem title when the videoid is contained in my-list\n+ # Highlight ListItem title when the videoid is contained in \"My list\"\nlist_item.setLabel(_colorize_text(common_data['mylist_titles_color'], list_item.getLabel()))\n+ elif is_in_remind_me:\n+ # Highlight ListItem title when a video is marked as \"Remind me\"\n+ list_item.setLabel(_colorize_text(common_data['rememberme_titles_color'], list_item.getLabel()))\ninfos_copy['title'] = list_item.getLabel()\nif videoid.mediatype == common.VideoId.SHOW and not common_data['marks_tvshow_started']:\ninfos_copy.pop('PlayCount', None)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"diff": "@@ -254,6 +254,7 @@ def build_video_listing(video_list, menu_data, sub_genre_id=None, pathitems=None\n'mylist_titles_color': (get_color_name(G.ADDON.getSettingInt('mylist_titles_color'))\nif menu_data['path'][1] != 'myList'\nelse None),\n+ 'rememberme_titles_color': get_color_name(G.ADDON.getSettingInt('rememberme_titles_color')),\n'ctxmenu_remove_watched_status': menu_data['path'][1] == 'continueWatching',\n'active_profile_guid': G.LOCAL_DB.get_active_profile_guid(),\n'marks_tvshow_started': G.ADDON.getSettingBool('marks_tvshow_started'),\n@@ -299,6 +300,7 @@ def _create_video_item(videoid_value, video, video_list, perpetual_range_start,\nis_playable = video['availability'].get('value', {}).get('isPlayable', False)\nis_video_playable = not is_folder and is_playable\nis_in_mylist = videoid in common_data['mylist_items']\n+ is_in_remind_me = False\nlist_item = ListItemW(label=video['title']['value'])\nlist_item.setProperties({\n'isPlayable': str(is_video_playable).lower(),\n@@ -306,9 +308,6 @@ def _create_video_item(videoid_value, video, video_list, perpetual_range_start,\n'nf_is_in_mylist': str(is_in_mylist),\n'nf_perpetual_range_start': str(perpetual_range_start)\n})\n- add_info_list_item(list_item, videoid, video, video_list.data, is_in_mylist, common_data)\n- if not is_folder:\n- set_watched_status(list_item, video, common_data)\nif is_playable:\n# The movie or tvshow (episodes) is playable\nurl = common.build_url(videoid=videoid,\n@@ -331,6 +330,10 @@ def _create_video_item(videoid_value, video, video_list, perpetual_range_start,\nis_in_remind_me = video['inRemindMeList']['value'] or video['queue']['value']['inQueue']\nlist_item.addContextMenuItems(generate_context_menu_remind_me(videoid, is_in_remind_me, common_data['trackid']))\nurl = common.build_url(['show_availability_message'], videoid=videoid, mode=G.MODE_ACTION)\n+ add_info_list_item(list_item, videoid, video, video_list.data, is_in_mylist, common_data,\n+ is_in_remind_me=is_in_remind_me)\n+ if not is_folder:\n+ set_watched_status(list_item, video, common_data)\nreturn url, list_item, is_folder and is_playable\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "</constraints>\n<control type=\"spinner\" format=\"string\"/>\n</setting>\n+ <setting id=\"rememberme_titles_color\" type=\"integer\" label=\"30216\" help=\"\">\n+ <level>0</level>\n+ <default>1</default>\n+ <constraints>\n+ <options>\n+ <option label=\"13106\">0</option>\n+ <option label=\"762\">1</option>\n+ <option label=\"13343\">2</option>\n+ <option label=\"13341\">3</option>\n+ <option label=\"761\">4</option>\n+ <option label=\"760\">5</option>\n+ <option label=\"731\">6</option>\n+ <option label=\"767\">7</option>\n+ </options>\n+ </constraints>\n+ <control type=\"spinner\" format=\"string\"/>\n+ </setting>\n<setting id=\"supplemental_info_color\" type=\"integer\" label=\"30239\" help=\"\">\n<level>0</level>\n<default>3</default>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add color setting for remember me |
106,046 | 12.10.2022 08:06:47 | -7,200 | ad98d0dd0877b00739119b739f3bf9f96684bdda | Make profile error message generic | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"new_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"diff": "@@ -132,7 +132,7 @@ class MSLRequests(MSLRequestBuilder):\nif current_profile_guid != owner_profile_guid:\n# TODO: due to removal of SWITCH_PROFILE, we cannot currently switch profile on MSL side,\n# CIT: i have no idea if there is another way to have a kind of profile switching with id tokens\n- raise Exception('Due to changes to the Netflix website, on Android L3 devices '\n+ raise Exception('Due to changes to the Netflix website, '\n'videos can only be played from the main/owner profile.')\nif not force_auth_credential:\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Make profile error message generic |
106,046 | 11.10.2022 18:18:05 | -7,200 | 3401ff46cb739117b9ff995cbe247c843f3799ba | Disable language code workaround on Kodi 20 or above | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/kodi_ops.py",
"new_path": "resources/lib/common/kodi_ops.py",
"diff": "@@ -261,7 +261,10 @@ def fix_locale_languages(item):\n# Replace pt-BR with pb, is an unofficial ISO 639-1 Portuguese (Brazil) language code\n# has been added to Kodi 18.7 and Kodi 19.x PR: https://github.com/xbmc/xbmc/pull/17689\nitem['language'] = 'pb'\n- if len(item['language']) > 2:\n+ # From Kodi v20, this problem has been improved by https://github.com/xbmc/xbmc/pull/21776\n+ # it is not needed anymore manually rename country codes to avoid inconsistent descriptions on kodi GUI\n+ # and so we allow users to use advancedsettings.xml to specify custom descriptions\n+ if G.KODI_VERSION < '20' and len(item['language']) > 2:\n# Replace know locale with country\n# so Kodi will not recognize the modified country code and will show the string as it is\nif item['language'] in LOCALE_CONV_TABLE:\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Disable language code workaround on Kodi 20 or above |
106,046 | 17.10.2022 14:40:46 | -7,200 | 4dbe550ed76e801870ac93be0614f88ff5685187 | Add ErrorMessage exception | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/exceptions.py",
"new_path": "resources/lib/common/exceptions.py",
"diff": "@@ -136,6 +136,10 @@ class DBRecordNotExistError(Exception):\n# All other exceptions\n+class ErrorMessage(Exception):\n+ \"\"\"Raise an error message by displaying a GUI dialog box WITHOUT instructions for reporting a bug\"\"\"\n+\n+\nclass InvalidPathError(Exception):\n\"\"\"The requested path is invalid and could not be routed\"\"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/player.py",
"new_path": "resources/lib/navigation/player.py",
"diff": "@@ -14,7 +14,7 @@ import resources.lib.common as common\nimport resources.lib.kodi.infolabels as infolabels\nimport resources.lib.kodi.ui as ui\nfrom resources.lib.globals import G\n-from resources.lib.common.exceptions import InputStreamHelperError\n+from resources.lib.common.exceptions import InputStreamHelperError, ErrorMessage\nfrom resources.lib.utils.logging import LOG, measure_exec_time_decorator\nMANIFEST_PATH_FORMAT = common.IPC_ENDPOINT_MSL + '/get_manifest?videoid={}'\n@@ -108,7 +108,7 @@ def get_inputstream_listitem(videoid):\nLOG.error(traceback.format_exc())\nraise InputStreamHelperError(str(exc)) from exc\nif not inputstream_ready:\n- raise Exception(common.get_local_string(30046))\n+ raise ErrorMessage(common.get_local_string(30046))\nlist_item.setProperty(\nkey='inputstream',\nvalue='inputstream.adaptive')\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/run_addon.py",
"new_path": "resources/lib/run_addon.py",
"diff": "@@ -12,7 +12,7 @@ from xbmc import getCondVisibility, Monitor, getInfoLabel\nfrom resources.lib.common.exceptions import (HttpError401, InputStreamHelperError, MbrStatusNeverMemberError,\nMbrStatusFormerMemberError, MissingCredentialsError, LoginError,\n- NotLoggedInError, InvalidPathError, BackendNotReady)\n+ NotLoggedInError, InvalidPathError, BackendNotReady, ErrorMessage)\nfrom resources.lib.common import check_credentials, get_local_string, WndHomeProps\nfrom resources.lib.globals import G\nfrom resources.lib.upgrade_controller import check_addon_upgrade\n@@ -50,6 +50,9 @@ def catch_exceptions_decorator(func):\nexcept (MbrStatusNeverMemberError, MbrStatusFormerMemberError):\nfrom resources.lib.kodi.ui import show_error_info\nshow_error_info(get_local_string(30008), get_local_string(30180), False, True)\n+ except ErrorMessage as exc:\n+ from resources.lib.kodi.ui import show_ok_dialog\n+ show_ok_dialog(get_local_string(30105), str(exc))\nexcept Exception as exc:\nimport traceback\nfrom resources.lib.kodi.ui import show_addon_error_info\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"new_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"diff": "@@ -17,7 +17,7 @@ import httpx\nimport resources.lib.common as common\nfrom resources.lib.common import get_system_platform, is_device_l1_enabled\n-from resources.lib.common.exceptions import MSLError\n+from resources.lib.common.exceptions import MSLError, ErrorMessage\nfrom resources.lib.globals import G\nfrom resources.lib.services.nfsession.msl.msl_request_builder import MSLRequestBuilder\n@@ -132,8 +132,8 @@ class MSLRequests(MSLRequestBuilder):\nif current_profile_guid != owner_profile_guid:\n# TODO: due to removal of SWITCH_PROFILE, we cannot currently switch profile on MSL side,\n# CIT: i have no idea if there is another way to have a kind of profile switching with id tokens\n- raise Exception('Due to changes to the Netflix website, '\n- 'videos can only be played from the main/owner profile.')\n+ raise ErrorMessage('Due to changes to the Netflix website, '\n+ 'videos can only be played from the main/owner profile, at moment this cannot be fixed.')\nif not force_auth_credential:\nif current_profile_guid == owner_profile_guid:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/nfsession_ops.py",
"new_path": "resources/lib/services/nfsession/nfsession_ops.py",
"diff": "@@ -18,7 +18,7 @@ import resources.lib.utils.website as website\nfrom resources.lib.common import cache_utils\nfrom resources.lib.common.exceptions import (NotLoggedInError, MissingCredentialsError, WebsiteParsingError,\nMbrStatusAnonymousError, MetadataNotAvailable, LoginValidateError,\n- HttpError401, InvalidProfilesError)\n+ HttpError401, InvalidProfilesError, ErrorMessage)\nfrom resources.lib.globals import G\nfrom resources.lib.kodi import ui\nfrom resources.lib.services.nfsession.session.path_requests import SessionPathRequests\n@@ -102,7 +102,7 @@ class NFSessionOperations(SessionPathRequests):\nif xbmc.Player().isPlayingVideo():\n# Change the current profile while a video is playing can cause problems with outgoing HTTP requests\n# (MSL/NFSession) causing a failure in the HTTP request or sending data on the wrong profile\n- raise Warning('It is not possible select a profile while a video is playing.')\n+ raise ErrorMessage('It is not possible select a profile while a video is playing.')\ntimestamp = time.time()\nLOG.info('Activating profile {}', guid)\n# 20/05/2020 - The method 1 not more working for switching PIN locked profiles\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add ErrorMessage exception |
106,046 | 17.10.2022 14:41:31 | -7,200 | 957a545ab230e7ca747b022b3227c1dc81d17a2c | Raise APIError exception | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/api_requests.py",
"new_path": "resources/lib/utils/api_requests.py",
"diff": "@@ -143,7 +143,7 @@ def update_my_list(videoid, operation, params):\n}})\nif response.get('status') != 'success':\nLOG.debug('update_my_list response: {}', response)\n- raise Exception('Unable update my list, an error occurred in the request.')\n+ raise APIError('Unable update my list, an error occurred in the request.')\n_update_mylist_cache(videoid, operation, params)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Raise APIError exception |
106,046 | 20.10.2022 16:37:15 | -7,200 | 44f67de7d2dfd3b1297878f2634802245b557a9d | Cleanup library settings | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -210,7 +210,9 @@ msgctxt \"#30049\"\nmsgid \"Library\"\nmsgstr \"\"\n-# Unused 30050\n+msgctxt \"#30050\"\n+msgid \"Enable Kodi library management\"\n+msgstr \"\"\nmsgctxt \"#30051\"\nmsgid \"Profile set for playback from the library\"\n@@ -263,7 +265,7 @@ msgid \"Perform auto-update\"\nmsgstr \"\"\nmsgctxt \"#30065\"\n-msgid \"Auto-update for TV shows seasons and episodes\"\n+msgid \"Video library update\"\nmsgstr \"\"\nmsgctxt \"#30066\"\n@@ -458,11 +460,7 @@ msgctxt \"#30113\"\nmsgid \"Logout successful\"\nmsgstr \"\"\n-msgctxt \"#30114\"\n-msgid \"Keep 'My list' and Kodi Library in sync\"\n-msgstr \"\"\n-\n-# Unused 30115\n+# Unused 30114, 30115\nmsgctxt \"#30116\"\nmsgid \"Advanced Add-on Configuration\"\n@@ -755,7 +753,7 @@ msgid \"[CR]These files are used by the provider information scrapers to integrat\nmsgstr \"\"\nmsgctxt \"#30193\"\n-msgid \"Include all information in NFO files (use only with 'Local Information' scraper)\"\n+msgid \"Include tv show NFO details\"\nmsgstr \"\"\nmsgctxt \"#30194\"\n@@ -890,7 +888,9 @@ msgctxt \"#30228\"\nmsgid \"Set a profile for synchronization\"\nmsgstr \"\"\n-# Unused 30229\n+msgctxt \"#30229\"\n+msgid \"When Kodi starts\"\n+msgstr \"\"\nmsgctxt \"#30230\"\nmsgid \"Check for updates now\"\n@@ -1204,3 +1204,31 @@ msgstr \"\"\nmsgctxt \"#30727\"\nmsgid \"Enable AV1 profiles - FOR DEVELOPMENT TEST ONLY\"\nmsgstr \"\"\n+\n+msgctxt \"#30728\"\n+msgid \"Add Netflix folders to Kodi library sources\"\n+msgstr \"\"\n+\n+msgctxt \"#30729\"\n+msgid \"The folders \\\"Netflix-Movies\\\" and \\\"Netflix-Shows\\\" have been added to Kodi sources, restart Kodi to view them in the Kodi [TV Shows] / [Movies] menus. Then edit the folders to set the appropriate content type and information provider scraper.\"\n+msgstr \"\"\n+\n+#. Description of setting ID 30224\n+msgctxt \"#30730\"\n+msgid \"[Manual] updates must be done manually by using \\\"Export new episodes\\\" context menu on each tv show, [Scheduled] you can establish automatic updates at scheduled times, [When Kodi starts] automatic updates start at Kodi start-up and will only be done once a day.\"\n+msgstr \"\"\n+\n+#. Description of setting ID 30227\n+msgctxt \"#30731\"\n+msgid \"Synchronises the library with My list, if my list has been modified externally e.g. mobile app or website, the update will be postponed to the scheduled time.\"\n+msgstr \"\"\n+\n+#. Description of setting ID 30185\n+msgctxt \"#30732\"\n+msgid \"If enabled, adds information to episodes or movies that are useful when Kodi information provider scraper does not provide data. This will also add the duration of the videos.\"\n+msgstr \"\"\n+\n+#. Description of setting ID 30193\n+msgctxt \"#30733\"\n+msgid \"Only enable if \\\"Local Information\\\" information provider scraper is used, or if certain titles are not displayed in Kodi library despite having been added.\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/fileops.py",
"new_path": "resources/lib/common/fileops.py",
"diff": "@@ -187,3 +187,12 @@ def join_folders_paths(*args):\n\"\"\"Join multiple folder paths in a safe way\"\"\"\n# Avoid the use of os.path.join, in some cases with special chars like % break the path\nreturn xbmcvfs.makeLegalFilename('/'.join(args))\n+\n+\n+def get_xml_nodes_text(nodelist):\n+ \"\"\"Get the text value of text node list\"\"\"\n+ rc = []\n+ for node in nodelist:\n+ if node.nodeType == node.TEXT_NODE:\n+ rc.append(node.data)\n+ return ''.join(rc)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/context_menu.py",
"new_path": "resources/lib/kodi/context_menu.py",
"diff": "@@ -58,9 +58,8 @@ def generate_context_menu_items(videoid, is_in_mylist, perpetual_range_start=Non\nif videoid.mediatype not in [common.VideoId.SUPPLEMENTAL, common.VideoId.EPISODE]:\n# Library operations for supplemental (trailers etc) and single episodes are not allowed\n- lib_auto_upd_mode = G.ADDON.getSettingInt('lib_auto_upd_mode')\n- if lib_auto_upd_mode != 0:\n- items = _generate_library_ctx_items(videoid, lib_auto_upd_mode)\n+ if G.ADDON.getSettingBool('lib_enabled'):\n+ items = _generate_library_ctx_items(videoid)\n# Old rating system\n# if videoid.mediatype != common.VideoId.SEASON and \\\n@@ -89,11 +88,11 @@ def generate_context_menu_items(videoid, is_in_mylist, perpetual_range_start=Non\nreturn items\n-def _generate_library_ctx_items(videoid, lib_auto_upd_mode):\n+def _generate_library_ctx_items(videoid):\nlibrary_actions = []\nallow_lib_operations = True\nlib_is_sync_with_mylist = (G.ADDON.getSettingBool('lib_sync_mylist') and\n- lib_auto_upd_mode == 2)\n+ G.ADDON.getSettingInt('lib_auto_upd_mode') in [0, 2])\nif lib_is_sync_with_mylist:\n# If the synchronization of Netflix \"My List\" with the Kodi library is enabled\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/actions.py",
"new_path": "resources/lib/navigation/actions.py",
"diff": "@@ -229,7 +229,10 @@ class AddonActionExecutor:\ndef sync_library(videoid, operation):\n- if operation and G.ADDON.getSettingBool('lib_sync_mylist') and G.ADDON.getSettingInt('lib_auto_upd_mode') == 2:\n+ if (operation\n+ and G.ADDON.getSettingBool('lib_enabled')\n+ and G.ADDON.getSettingBool('lib_sync_mylist')\n+ and G.ADDON.getSettingInt('lib_auto_upd_mode') in [0, 2]):\nsync_mylist_profile_guid = G.SHARED_DB.get_value('sync_mylist_profile_guid',\nG.LOCAL_DB.get_guid_owner_profile())\n# Allow to sync library with My List only by chosen profile\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/keymaps.py",
"new_path": "resources/lib/navigation/keymaps.py",
"diff": "@@ -101,11 +101,10 @@ def _get_selected_videoid():\ndef _is_library_ops_allowed():\n\"\"\"Check if library operations are allowed\"\"\"\nallow_lib_operations = True\n- lib_auto_upd_mode = G.ADDON.getSettingInt('lib_auto_upd_mode')\n- if lib_auto_upd_mode == 0:\n+ if not G.ADDON.getSettingBool('lib_enabled'):\nreturn False\nis_lib_sync_with_mylist = (G.ADDON.getSettingBool('lib_sync_mylist') and\n- lib_auto_upd_mode == 2)\n+ G.ADDON.getSettingInt('lib_auto_upd_mode') in [0, 2])\nif is_lib_sync_with_mylist:\n# If the synchronization of Netflix \"My List\" with the Kodi library is enabled\n# only in the chosen profile allow to do operations in the Kodi library otherwise\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/library.py",
"new_path": "resources/lib/navigation/library.py",
"diff": "import resources.lib.common as common\nimport resources.lib.kodi.ui as ui\nimport resources.lib.kodi.library_utils as lib_utils\n+from resources.lib.common.exceptions import ErrorMessage\nfrom resources.lib.globals import G\nfrom resources.lib.kodi.library import get_library_cls\nfrom resources.lib.utils.logging import LOG\n@@ -136,6 +137,75 @@ class LibraryActionExecutor:\nmsg = common.get_local_string(30210 if client_uuid == uuid else 30211)\nui.show_notification(msg, time=8000)\n+ def add_folders_to_library(self, pathitems): # pylint: disable=unused-argument\n+ from xml.dom import minidom\n+ from xbmcvfs import translatePath\n+ sources_xml_path = translatePath('special://userdata/sources.xml')\n+ if common.file_exists(sources_xml_path):\n+ try:\n+ xml_doc = minidom.parse(sources_xml_path)\n+ except Exception as exc: # pylint: disable=broad-except\n+ raise ErrorMessage('Cannot open \"sources.xml\" the file could be corrupted. '\n+ 'Please check manually on your Kodi userdata folder or reinstall Kodi.') from exc\n+ else:\n+ xml_doc = minidom.Document()\n+ source_node = xml_doc.createElement(\"sources\")\n+ for content_type in ['programs', 'video', 'music', 'pictures', 'files']:\n+ node_type = xml_doc.createElement(content_type)\n+ element_default = xml_doc.createElement('default')\n+ element_default.setAttribute('pathversion', '1')\n+ node_type.appendChild(element_default)\n+ source_node.appendChild(node_type)\n+ xml_doc.appendChild(source_node)\n+\n+ lib_path_movies = common.check_folder_path(common.join_folders_paths(lib_utils.get_library_path(),\n+ lib_utils.FOLDER_NAME_MOVIES))\n+ lib_path_shows = common.check_folder_path(common.join_folders_paths(lib_utils.get_library_path(),\n+ lib_utils.FOLDER_NAME_SHOWS))\n+\n+ # Check if the paths already exists in source tags of video content type\n+ is_movies_source_exist = False\n+ is_shows_source_exist = False\n+ video_node = xml_doc.childNodes[0].getElementsByTagName('video')[0]\n+ source_nodes = video_node.getElementsByTagName('source')\n+ for source_node in source_nodes:\n+ path_nodes = source_node.getElementsByTagName('path')\n+ if not path_nodes:\n+ continue\n+ source_path = common.get_xml_nodes_text(path_nodes[0].childNodes)\n+ if source_path == lib_path_movies:\n+ is_movies_source_exist = True\n+ elif source_path == lib_path_shows:\n+ is_shows_source_exist = True\n+\n+ # Add to the parent <video> tag, the folders as <source> child tags\n+ if not is_movies_source_exist:\n+ video_node.appendChild(_create_xml_source_tag(xml_doc, 'Netflix-Movies', lib_path_movies))\n+ if not is_shows_source_exist:\n+ video_node.appendChild(_create_xml_source_tag(xml_doc, 'Netflix-Shows', lib_path_shows))\n+\n+ common.save_file(sources_xml_path,\n+ '\\n'.join([x for x in xml_doc.toprettyxml().splitlines() if x.strip()]).encode('utf-8'))\n+ ui.show_ok_dialog(common.get_local_string(30728), common.get_local_string(30729))\n+\n+\n+def _create_xml_source_tag(xml_doc, source_name, source_path):\n+ source_node = xml_doc.createElement('source')\n+ # Create <name> tag\n+ name_node = xml_doc.createElement('name')\n+ name_node.appendChild(xml_doc.createTextNode(source_name))\n+ source_node.appendChild(name_node)\n+ # Create <path> tag\n+ path_node = xml_doc.createElement('path')\n+ path_node.setAttribute('pathversion', '1')\n+ path_node.appendChild(xml_doc.createTextNode(source_path))\n+ source_node.appendChild(path_node)\n+ # Create <allowsharing> tag\n+ allowsharing_node = xml_doc.createElement('allowsharing')\n+ allowsharing_node.appendChild(xml_doc.createTextNode('true'))\n+ source_node.appendChild(allowsharing_node)\n+ return source_node\n+\ndef _check_auto_update_running():\nreturn lib_utils.is_auto_update_library_running(True)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/library_updater.py",
"new_path": "resources/lib/services/library_updater.py",
"diff": "@@ -25,7 +25,8 @@ class LibraryUpdateService(xbmc.Monitor):\ndef __init__(self):\nsuper().__init__()\ntry:\n- self.enabled = G.ADDON.getSettingInt('lib_auto_upd_mode') == 2\n+ self.enabled = (G.ADDON.getSettingBool('lib_enabled')\n+ and G.ADDON.getSettingInt('lib_auto_upd_mode') in [0, 2])\nexcept Exception: # pylint: disable=broad-except\n# If settings.xml was not created yet, as at first service run\n# G.ADDON.getSettingInt('lib_auto_upd_mode') will thrown a TypeError\n@@ -82,7 +83,8 @@ class LibraryUpdateService(xbmc.Monitor):\n# Wait for slow system (like Raspberry Pi) to write the settings\nxbmc.sleep(500)\n# Check if the status is changed\n- self.enabled = G.ADDON.getSettingInt('lib_auto_upd_mode') == 2\n+ self.enabled = (G.ADDON.getSettingBool('lib_enabled')\n+ and G.ADDON.getSettingInt('lib_auto_upd_mode') in [0, 2])\n# Then compute the next schedule\nif self.enabled:\nself.next_schedule = _compute_next_schedule()\n@@ -158,9 +160,13 @@ def _compute_next_schedule(date_last_start=None):\n'has been set as the main update manager')\nreturn None\n- time = G.ADDON.getSetting('lib_auto_upd_start') or '00:00'\nlast_run = date_last_start or G.SHARED_DB.get_value('library_auto_update_last_start',\ndatetime.utcfromtimestamp(0))\n+ if G.ADDON.getSettingInt('lib_auto_upd_mode') == 0: # Update at Kodi startup\n+ time = '00:00'\n+ update_frequency = 0\n+ else:\n+ time = G.ADDON.getSetting('lib_auto_upd_start') or '00:00'\nupdate_frequency = G.ADDON.getSettingInt('lib_auto_upd_freq')\nlast_run = last_run.replace(hour=int(time[0:2]), minute=int(time[3:5]))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/upgrade_controller.py",
"new_path": "resources/lib/upgrade_controller.py",
"diff": "@@ -127,6 +127,13 @@ def _perform_service_changes(previous_ver, current_ver):\n# Migrate to new repository\nfrom resources.lib.upgrade_actions import migrate_repository\nmigrate_repository()\n+ if CmpVersion(previous_ver) < '1.19.2':\n+ # Migrate library setting\n+ if G.ADDON.getSettingInt('lib_auto_upd_mode') == 0:\n+ # Previously this value meant \"disabled\" (where now is \"when Kodi starts\")\n+ # this case has been moved in to a separate setting \"lib_enabled\"\n+ G.ADDON.setSettingBool('lib_enabled', False)\n+ G.ADDON.setSettingInt('lib_auto_upd_mode', 1) # Set to \"Manual\" default\ndef _perform_local_db_changes(current_version, upgrade_to_version):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "</category>\n<!--CATEGORY: Library-->\n<category id=\"library\" label=\"30025\" help=\"\">\n- <!--GROUP: Auto-Update-->\n- <group id=\"1\" label=\"30065\">\n- <setting id=\"lib_auto_upd_mode\" type=\"integer\" label=\"30224\" help=\"\">\n+ <!--GROUP: Library-->\n+ <group id=\"1\" label=\"30049\">\n+ <setting id=\"lib_enabled\" type=\"boolean\" label=\"30050\" help=\"\">\n+ <level>0</level>\n+ <default>true</default>\n+ <control type=\"toggle\"/>\n+ </setting>\n+ <setting id=\"lib_add_sources\" type=\"action\" label=\"30728\">\n+ <level>0</level>\n+ <data>RunPlugin(plugin://$ID/library/add_folders_to_library/)</data>\n+ <control type=\"button\" format=\"action\">\n+ <close>false</close>\n+ </control>\n+ <dependencies>\n+ <dependency type=\"enable\" setting=\"lib_enabled\">true</dependency>\n+ </dependencies>\n+ </setting>\n+ </group>\n+ <!--GROUP: Video library update-->\n+ <group id=\"2\" label=\"30065\">\n+ <setting id=\"lib_auto_upd_mode\" type=\"integer\" label=\"30224\" help=\"30730\">\n<level>0</level>\n<default>1</default>\n<constraints>\n<options>\n- <option label=\"13106\">0</option>\n+ <option label=\"30229\">0</option>\n<option label=\"30225\">1</option>\n<option label=\"30226\">2</option>\n</options>\n</constraints>\n<control type=\"spinner\" format=\"string\"/>\n+ <dependencies>\n+ <dependency type=\"enable\" setting=\"lib_enabled\">true</dependency>\n+ </dependencies>\n</setting>\n<setting id=\"lib_auto_upd_check_now\" type=\"action\" label=\"30230\" parent=\"lib_auto_upd_mode\">\n<level>0</level>\n<default>false</default>\n<control type=\"toggle\"/>\n<dependencies>\n- <dependency type=\"visible\" operator=\"gt\" setting=\"lib_auto_upd_mode\">1</dependency>\n+ <dependency type=\"visible\">\n+ <or>\n+ <condition setting=\"lib_auto_upd_mode\">0</condition>\n+ <condition setting=\"lib_auto_upd_mode\">2</condition>\n+ </or>\n+ </dependency>\n</dependencies>\n</setting>\n<setting id=\"lib_auto_upd_disable_notification\" type=\"boolean\" label=\"30219\" help=\"\" parent=\"lib_auto_upd_mode\">\n<default>false</default>\n<control type=\"toggle\"/>\n<dependencies>\n- <dependency type=\"visible\" operator=\"gt\" setting=\"lib_auto_upd_mode\">1</dependency>\n+ <dependency type=\"visible\">\n+ <or>\n+ <condition setting=\"lib_auto_upd_mode\">0</condition>\n+ <condition setting=\"lib_auto_upd_mode\">2</condition>\n+ </or>\n+ </dependency>\n</dependencies>\n</setting>\n- </group>\n- <!--GROUP: Synchronize Kodi library with My List-->\n- <group id=\"2\" label=\"30227\">\n- <setting id=\"lib_sync_mylist\" type=\"boolean\" label=\"30114\" help=\"\">\n+ <setting id=\"lib_sync_mylist\" type=\"boolean\" label=\"30227\" help=\"30731\">\n<level>0</level>\n<default>false</default>\n<control type=\"toggle\"/>\n<dependencies>\n- <dependency type=\"enable\" operator=\"gt\" setting=\"lib_auto_upd_mode\">1</dependency>\n+ <dependency type=\"enable\" setting=\"lib_enabled\">true</dependency>\n+ <dependency type=\"visible\">\n+ <or>\n+ <condition setting=\"lib_auto_upd_mode\">0</condition>\n+ <condition setting=\"lib_auto_upd_mode\">2</condition>\n+ </or>\n+ </dependency>\n</dependencies>\n</setting>\n<setting id=\"lib_sync_mylist_sel_profile\" type=\"action\" label=\"30228\" parent=\"lib_sync_mylist\">\n<close>false</close>\n</control>\n<dependencies>\n- <dependency type=\"enable\" setting=\"lib_sync_mylist\">true</dependency>\n<dependency type=\"visible\" setting=\"lib_sync_mylist\">true</dependency>\n+ <dependency type=\"visible\">\n+ <or>\n+ <condition setting=\"lib_auto_upd_mode\">0</condition>\n+ <condition setting=\"lib_auto_upd_mode\">2</condition>\n+ </or>\n+ </dependency>\n</dependencies>\n</setting>\n<setting id=\"lib_sync_mylist_now\" type=\"action\" label=\"30121\" parent=\"lib_sync_mylist\">\n<close>false</close>\n</control>\n<dependencies>\n- <dependency type=\"enable\" setting=\"lib_sync_mylist\">true</dependency>\n<dependency type=\"visible\" setting=\"lib_sync_mylist\">true</dependency>\n+ <dependency type=\"visible\">\n+ <or>\n+ <condition setting=\"lib_auto_upd_mode\">0</condition>\n+ <condition setting=\"lib_auto_upd_mode\">2</condition>\n+ </or>\n+ </dependency>\n</dependencies>\n</setting>\n</group>\n<!--GROUP: NFO Files-->\n<group id=\"3\" label=\"30184\">\n- <setting id=\"enable_nfo_export\" type=\"boolean\" label=\"30185\" help=\"\">\n+ <setting id=\"enable_nfo_export\" type=\"boolean\" label=\"30185\" help=\"30732\">\n<level>0</level>\n<default>false</default>\n<control type=\"toggle\"/>\n<dependency type=\"visible\" setting=\"enable_nfo_export\">true</dependency>\n</dependencies>\n</setting>\n- <setting id=\"export_full_tvshow_nfo\" type=\"boolean\" label=\"30193\" help=\"\">\n+ <setting id=\"export_full_tvshow_nfo\" type=\"boolean\" label=\"30193\" help=\"30733\">\n<level>0</level>\n<default>false</default>\n<control type=\"toggle\"/>\n</setting>\n</group>\n<!--GROUP: Other options-->\n- <group id=\"4\" label=\"30184\">\n+ <group id=\"4\" label=\"30015\">\n<setting id=\"enablelibraryfolder\" type=\"boolean\" label=\"30026\" help=\"\">\n<level>0</level>\n<default>false</default>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Cleanup library settings |
106,046 | 23.10.2022 10:03:12 | -7,200 | 960f2b985b36ce1f38c1c874d79672801bdb35ab | Restored MSL profile switching | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -1192,14 +1192,7 @@ msgctxt \"#30724\"\nmsgid \"Kodi saves the \\\"View mode\\\" \\\"Zoom\\\" setting permanently, enable this setting to restore the \\\"Normal\\\" View mode when playing a previously watched video.\"\nmsgstr \"\"\n-msgctxt \"#30725\"\n-msgid \"Force MSL with idtoken authentication\"\n-msgstr \"\"\n-\n-#. Description of setting ID 30725 - do not translate the error message\n-msgctxt \"#30726\"\n-msgid \"On some Android devices the error \\\"User authentication data does not match entity identity\\\" may occur, enabling this setting may solve the problem, but it will only be possible to play videos from the main profile.\"\n-msgstr \"\"\n+# Unused 30725, 30726\nmsgctxt \"#30727\"\nmsgid \"Enable AV1 profiles - FOR DEVELOPMENT TEST ONLY\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/events_handler.py",
"new_path": "resources/lib/services/nfsession/msl/events_handler.py",
"diff": "@@ -82,8 +82,7 @@ class EventsHandler(threading.Thread):\nLOG.info('EVENT [{}] - Executing request', event_type)\nendpoint_url = ENDPOINTS['events'] + create_req_params(f'events/{event_type}')\ntry:\n- response = self.chunked_request(endpoint_url, request_data, get_esn(),\n- disable_msl_switch=False)\n+ response = self.chunked_request(endpoint_url, request_data, get_esn())\n# Malformed/wrong content in requests are ignored without returning any error in the response or exception\nLOG.debug('EVENT [{}] - Request response: {}', event_type, response)\nif event_type == EVENT_STOP:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"new_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"diff": "@@ -147,7 +147,7 @@ class MSLHandler:\nhdcp_override=hdcp_override,\nprofiles=profiles,\nchallenge=challenge, sid=sid, xid=xid)\n- manifest = self.msl_requests.chunked_request(endpoint_url, request_data, esn, disable_msl_switch=False)\n+ manifest = self.msl_requests.chunked_request(endpoint_url, request_data, esn)\n# The xid must be used also for each future MSL requests, until playback stops\nG.LOCAL_DB.set_value('xid', xid, TABLE_SESSION)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"new_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"diff": "@@ -16,8 +16,8 @@ import zlib\nimport httpx\nimport resources.lib.common as common\n-from resources.lib.common import get_system_platform, is_device_l1_enabled\n-from resources.lib.common.exceptions import MSLError, ErrorMessage\n+from resources.lib.common import get_system_platform\n+from resources.lib.common.exceptions import MSLError\nfrom resources.lib.globals import G\nfrom resources.lib.services.nfsession.msl.msl_request_builder import MSLRequestBuilder\n@@ -85,7 +85,7 @@ class MSLRequests(MSLRequestBuilder):\nresponse = self.chunked_request(endpoint_url,\nself.build_request_data('/logblob', generate_logblobs_params()),\nget_esn(),\n- force_auth_credential=True)\n+ msl_auth_scheme=MSL_AUTH_EMAIL_PASSWORD)\nLOG.debug('Response of logblob request: {}', response)\ndef _mastertoken_checks(self):\n@@ -110,79 +110,73 @@ class MSLRequests(MSLRequestBuilder):\nself.crypto.load_msl_data(msl_data)\nself.crypto.load_crypto_session(msl_data)\n- def _check_user_id_token(self, disable_msl_switch, force_auth_credential=False):\n+ def _get_user_auth_data(self):\n\"\"\"\n- Performs user id token checks and return the auth data\n- checks: uid token validity, get if needed the owner uid token, set when use the switch\n+ Get the user id token for the current profile GUID and return the auth data.\n- :param: disable_msl_switch: to be used in requests that cannot make the switch\n- :param: force_auth_credential: force the use of authentication with credentials\n- :return: auth data that will be used in MSLRequestBuilder _add_auth_info\n+ :returns: The auth data, may override the current auth scheme.\n\"\"\"\n- # TODO: This _check_user_id_token method need to be revisited,\n- # since at today 25/09/2022 the SWITCH_PROFILE auth scheme do not works anymore\n-\n# Warning: the user id token contains also contains the identity of the netflix profile\n# therefore it is necessary to use the right user id token for the request\ncurrent_profile_guid = G.LOCAL_DB.get_active_profile_guid()\nowner_profile_guid = G.LOCAL_DB.get_guid_owner_profile()\nuse_switch_profile = False\n- user_id_token = None\n- if current_profile_guid != owner_profile_guid:\n- # TODO: due to removal of SWITCH_PROFILE, we cannot currently switch profile on MSL side,\n- # CIT: i have no idea if there is another way to have a kind of profile switching with id tokens\n- raise ErrorMessage('Due to changes to the Netflix website, '\n- 'videos can only be played from the main/owner profile, at moment this cannot be fixed.')\n+ # Get the UID token if it exists and is not expired, so we get 'None' in all other cases\n+ user_id_token = self.crypto.get_user_id_token(current_profile_guid)\n- if not force_auth_credential:\n+ if not user_id_token:\nif current_profile_guid == owner_profile_guid:\n- # The request will be executed from the owner profile\n- # By default MSL is associated to the owner profile, then is not necessary get the owner token id\n- # and it is not necessary use the MSL profile switch\n- user_id_token = self.crypto.get_user_id_token(current_profile_guid)\n- # The user_id_token can return None when the add-on is installed from scratch,\n- # in this case will be used the authentication with the user credentials\n- else:\n- # The request will be executed from a non-owner profile\n- # Get the non-owner profile token id, by checking that exists and it is valid\n- user_id_token = self.crypto.get_user_id_token(current_profile_guid)\n- if not user_id_token and not disable_msl_switch:\n- # The token does not exist/valid, you must set the MSL profile switch\n+ # The request need to be executed from the owner (main) profile,\n+ # but the current token does not exist, or it is expired\n+ # to avoid perform an additional request (_get_owner_user_id_token) we use MSL_AUTH_EMAIL_PASSWORD auth\n+ # that will provide us the owner token id in the response\n+ return {'auth_scheme': MSL_AUTH_EMAIL_PASSWORD}\n+ # The request need to be executed from a non-owner (main) profile,\n+ # but the current token does not exist, or it is expired\n+ # then we need to enable MSL profile switching\nuse_switch_profile = True\n- # First check if the owner profile token exist and it is valid\n+ # Try to get the UID of owner (main) profile\nuser_id_token = self.crypto.get_user_id_token(owner_profile_guid)\nif not user_id_token:\n- # The owner profile token id does not exist/valid, then get it\n+ # The token id does not exist, or it is expired, then we request it\nself._get_owner_user_id_token()\nuser_id_token = self.crypto.get_user_id_token(owner_profile_guid)\n+ if user_id_token is None:\n+ raise MSLError('Cannot get user token id of owner / main profile.')\nreturn {'use_switch_profile': use_switch_profile, 'user_id_token': user_id_token}\n@measure_exec_time_decorator(is_immediate=True)\n- def chunked_request(self, endpoint, request_data, esn, disable_msl_switch=True, force_auth_credential=False):\n- \"\"\"Do a POST request and process the chunked response\"\"\"\n+ def chunked_request(self, endpoint, request_data, esn, msl_auth_scheme=None):\n+ \"\"\"\n+ Do a POST request and process the chunked response\n+\n+ :param endpoint: The endpoint composed by a key of ENDPOINTS dict and create_req_params method (msl_utils.py)\n+ :param request_data: The request data (need to be wrapped by using build_request_data method)\n+ :param esn: The current ESN\n+ :param msl_auth_scheme: Optionals; Force use a type of MSL auth scheme\n+ :returns: The response data\n+ \"\"\"\nself._mastertoken_checks()\n- # Define the user authentication scheme to be used on the MSL HTTP requests\n- # https://github.com/Netflix/msl/wiki/User-Authentication-%28Configuration%29\n- # Values can be: MSL_AUTH_NETFLIXID, MSL_AUTH_EMAIL_PASSWORD, MSL_AUTH_USER_ID_TOKEN\n+ # Define the default auth scheme\n+ if msl_auth_scheme:\n+ auth_scheme = msl_auth_scheme\n+ elif get_system_platform() == 'android':\n+ # On android, we have a different ESN from the login then use NETFLIXID auth may cause MSL errors,\n+ # (usually on L3 devices) because the identity do not match, so we need to use User id token auth\n+ # to switch MSL profile with current ESN when needed\n+ auth_scheme = MSL_AUTH_USER_ID_TOKEN\n+ else:\nauth_scheme = MSL_AUTH_NETFLIXID\n- auth_data = {}\n- # TODO: MSL netflixid auth at today not works with L3 android devices by returning error:\n- # \"User authentication data does not match entity identity.\" so we fallback to idtoken auth\n- if get_system_platform() == 'android' and (not is_device_l1_enabled()\n- or G.ADDON.getSettingBool('msl_auth_type')):\n- auth_scheme = MSL_AUTH_USER_ID_TOKEN\n+ # Define the user authentication scheme to be used on the MSL HTTP requests\n+ # https://github.com/Netflix/msl/wiki/User-Authentication-%28Configuration%29\n+ auth_data = {'auth_scheme': auth_scheme}\n- # TODO: Due to removal of SWITCH_PROFILE using idtoken authenticaton is possible play videos\n- # from main/owner profile only\nif auth_scheme == MSL_AUTH_USER_ID_TOKEN:\n- auth_data.update(self._check_user_id_token(disable_msl_switch, force_auth_credential))\n- if auth_data['user_id_token'] is None:\n- auth_scheme = MSL_AUTH_EMAIL_PASSWORD\n+ auth_data.update(self._get_user_auth_data())\n- auth_data['auth_scheme'] = auth_scheme\nLOG.debug('Chunked request will be executed with auth data: {}', auth_data)\nchunked_response = self._process_chunked_response(\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<close>true</close>\n</control>\n</setting>\n- <setting id=\"msl_auth_type\" type=\"boolean\" label=\"30725\" help=\"30726\">\n- <dependencies>\n- <dependency type=\"visible\">\n- <condition on=\"property\" name=\"InfoBool\">system.platform.android</condition>\n- </dependency>\n- </dependencies>\n- <level>0</level>\n- <default>false</default>\n- <control type=\"toggle\"/>\n- </setting>\n<setting id=\"enable_debug\" type=\"boolean\" label=\"30066\" help=\"\">\n<level>0</level>\n<default>false</default>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Restored MSL profile switching |
106,046 | 23.10.2022 19:49:10 | -7,200 | 37c045f39b5e4e441908e4f8ae64ed9b4091a4b5 | Changed addon version for service upgrade operations | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/upgrade_controller.py",
"new_path": "resources/lib/upgrade_controller.py",
"diff": "@@ -127,7 +127,7 @@ def _perform_service_changes(previous_ver, current_ver):\n# Migrate to new repository\nfrom resources.lib.upgrade_actions import migrate_repository\nmigrate_repository()\n- if CmpVersion(previous_ver) < '1.19.2':\n+ if CmpVersion(previous_ver) < '1.20.0':\n# Migrate library setting\nif G.ADDON.getSettingInt('lib_auto_upd_mode') == 0:\n# Previously this value meant \"disabled\" (where now is \"when Kodi starts\")\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Changed addon version for service upgrade operations |
106,046 | 24.10.2022 09:49:25 | -7,200 | 82313bbd3667325eb9fcc1e23ec3106692e41a1a | Ask PIN to enable remember PIN | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/actions.py",
"new_path": "resources/lib/navigation/actions.py",
"diff": "@@ -63,8 +63,14 @@ class AddonActionExecutor:\ndef set_profile_remember_pin(self, pathitems): # pylint: disable=unused-argument\n\"\"\"Set whether to remember the profile PIN\"\"\"\n- is_remember_pin = G.LOCAL_DB.get_profile_config('addon_remember_pin', False, guid=self.params['profile_guid'])\n- G.LOCAL_DB.set_profile_config('addon_remember_pin', not is_remember_pin, guid=self.params['profile_guid'])\n+ is_remember_pin = not G.LOCAL_DB.get_profile_config('addon_remember_pin', False,\n+ guid=self.params['profile_guid'])\n+ if is_remember_pin:\n+ from resources.lib.navigation.directory_utils import verify_profile_pin\n+ if not verify_profile_pin(self.params['profile_guid'], is_remember_pin):\n+ ui.show_notification(common.get_local_string(30106), time=8000)\n+ return\n+ G.LOCAL_DB.set_profile_config('addon_remember_pin', is_remember_pin, guid=self.params['profile_guid'])\nif not is_remember_pin:\nG.LOCAL_DB.set_profile_config('addon_pin', '', guid=self.params['profile_guid'])\ncommon.container_refresh()\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/directory_utils.py",
"new_path": "resources/lib/navigation/directory_utils.py",
"diff": "@@ -83,7 +83,7 @@ def get_title(menu_data, extra_data):\ndef activate_profile(guid):\n\"\"\"Activate a profile and ask the PIN if required\"\"\"\n- pin_result = verify_profile_pin(guid)\n+ pin_result = verify_profile_pin(guid, G.LOCAL_DB.get_profile_config('addon_remember_pin', False, guid=guid))\nif not pin_result:\nif pin_result is not None:\nG.LOCAL_DB.set_profile_config('addon_pin', '', guid=guid)\n@@ -93,11 +93,10 @@ def activate_profile(guid):\nreturn True\n-def verify_profile_pin(guid):\n+def verify_profile_pin(guid, is_remember_pin):\n\"\"\"Verify if the profile is locked by a PIN and ask the PIN\"\"\"\nif not G.LOCAL_DB.get_profile_config('isPinLocked', False, guid=guid):\nreturn True\n- is_remember_pin = G.LOCAL_DB.get_profile_config('addon_remember_pin', False, guid=guid)\nstored_pin = ''\nif is_remember_pin:\ntry:\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Ask PIN to enable remember PIN |
106,046 | 25.10.2022 08:46:42 | -7,200 | 1cdbedd97e5e3b81f15cdaeebcd3076d9000ee46 | Removed use of deprecated setInfo (from Kodi v20) | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/kodi_wrappers.py",
"new_path": "resources/lib/common/kodi_wrappers.py",
"diff": "@@ -14,6 +14,28 @@ import xbmcgui\nfrom resources.lib.globals import G\n+# Convert the deprecated ListItem.setInfo keys to use method names of the new xbmc.InfoTagVideo object\n+INFO_CONVERT_KEY = {\n+ 'Title': 'setTitle',\n+ 'Year': 'setYear',\n+ 'Plot': 'setPlot',\n+ 'PlotOutline': 'setPlotOutline',\n+ 'Season': 'setSeason',\n+ 'Episode': 'setEpisode',\n+ 'Rating': 'setRating',\n+ 'UserRating': 'setUserRating',\n+ 'Mpaa': 'setMpaa',\n+ 'Duration': 'setDuration',\n+ 'Trailer': 'setTrailer',\n+ 'DateAdded': 'setDateAdded',\n+ 'Director': 'setDirectors',\n+ 'Writer': 'setWriters',\n+ 'Genre': 'setGenres',\n+ 'MediaType': 'setMediaType',\n+ 'TVShowTitle': 'setTvShowTitle',\n+ 'PlayCount': 'setPlaycount'\n+}\n+\n# pylint: disable=redefined-builtin,invalid-name,no-member\nclass ListItemW(xbmcgui.ListItem):\n@@ -43,12 +65,18 @@ class ListItemW(xbmcgui.ListItem):\nfor stream_type, quality_info in state['stream_info'].items():\nsuper().addStreamInfo(stream_type, quality_info)\nelse:\n- # TODO: setInfo is deprecated\n- super().setInfo('video', state['infolabels'])\n- video_info_tag = super().getVideoInfoTag()\n+ video_info = super().getVideoInfoTag()\n+ # \"Cast\" and \"Tag\" keys need to be converted\n+ cast_names = state['infolabels'].pop('Cast', [])\n+ video_info.setCast([xbmc.Actor(name) for name in cast_names])\n+ tag_names = state['infolabels'].pop('Tag', [])\n+ video_info.setTagLine(' / '.join(tag_names))\n+ # From Kodi v20 ListItem.setInfo is deprecated, we need to use the methods of InfoTagVideo object\n+ for key, value in state['infolabels'].items():\n+ getattr(video_info, INFO_CONVERT_KEY[key])(value)\nif state['stream_info']:\n- video_info_tag.addVideoStream(xbmc.VideoStreamDetail(**state['stream_info']['video']))\n- video_info_tag.addAudioStream(xbmc.AudioStreamDetail(**state['stream_info']['audio']))\n+ video_info.addVideoStream(xbmc.VideoStreamDetail(**state['stream_info']['video']))\n+ video_info.addAudioStream(xbmc.AudioStreamDetail(**state['stream_info']['audio']))\nsuper().setProperties(state['properties'])\nsuper().setArt(state['art'])\nsuper().addContextMenuItems(state.get('context_menus', []))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -79,7 +79,7 @@ def add_info_list_item(list_item: ListItemW, videoid, item, raw_data, is_in_myli\nelif is_in_remind_me:\n# Highlight ListItem title when a video is marked as \"Remind me\"\nlist_item.setLabel(_colorize_text(common_data['rememberme_titles_color'], list_item.getLabel()))\n- infos_copy['title'] = list_item.getLabel()\n+ infos_copy['Title'] = list_item.getLabel()\nif videoid.mediatype == common.VideoId.SHOW and not common_data['marks_tvshow_started']:\ninfos_copy.pop('PlayCount', None)\nlist_item.setInfo('video', infos_copy)\n@@ -199,7 +199,7 @@ def _parse_referenced_infos(item, raw_data):\ndef _parse_tags(item):\n\"\"\"Parse the tags\"\"\"\n- return {'tag': [tagdef['name']['value']\n+ return {'Tag': [tagdef['name']['value']\nfor tagdef\nin item.get('tags', {}).values()\nif isinstance(tagdef.get('name', {}), str)]}\n@@ -326,11 +326,11 @@ def set_watched_status(list_item: ListItemW, video_data, common_data):\nexcept CacheMiss:\n# NOTE shakti 'bookmarkPosition' tag when it is not set have -1 value\nbookmark_position = video_data['bookmarkPosition'].get('value', 0)\n- playcount = '1' if bookmark_position >= watched_threshold else '0'\n- if playcount == '0' and bookmark_position > 0:\n+ playcount = 1 if bookmark_position >= watched_threshold else 0\n+ if playcount == 0 and bookmark_position > 0:\nresume_time = bookmark_position\nelse:\n- playcount = '1' if is_watched_user_overrided else '0'\n+ playcount = 1 if is_watched_user_overrided else 0\n# We have to set playcount with setInfo(), because the setProperty('PlayCount', ) have a bug\n# when a item is already watched and you force to set again watched, the override do not work\nlist_item.updateInfo({'PlayCount': playcount})\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/directory_search.py",
"new_path": "resources/lib/navigation/directory_search.py",
"diff": "@@ -265,6 +265,6 @@ def _create_diritem_from_row(row):\nrow_id = str(row['ID'])\nsearch_desc = common.get_local_string(30401) + ': ' + SEARCH_TYPES_DESC.get(row['Type'], 'Unknown')\nlist_item = xbmcgui.ListItem(label=row['Value'], offscreen=True)\n- list_item.setInfo('video', {'plot': search_desc})\n+ list_item.setInfo('video', {'Plot': search_desc})\nlist_item.addContextMenuItems(generate_context_menu_searchitem(row_id, row['Type']))\nreturn common.build_url(['search', 'search', row_id], mode=G.MODE_DIRECTORY), list_item, True\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"diff": "@@ -63,7 +63,7 @@ def build_mainmenu_listing(loco_list):\nelse '')\nlist_item = ListItemW(label=menu_title)\nlist_item.setArt({'icon': data['icon']})\n- list_item.setInfo('video', {'plot': menu_description})\n+ list_item.setInfo('video', {'Plot': menu_description})\nlist_item.addContextMenuItems(generate_context_menu_mainmenu(menu_id))\ndirectory_items.append((common.build_url(data['path'], mode=G.MODE_DIRECTORY), list_item, True))\n# Save the menu titles, to reuse it when will be open the content of menus\n@@ -119,7 +119,7 @@ def _create_profile_item(profile_guid, is_selected, is_autoselect, is_autoselect\n'nf_description': description.replace('[CR]', ' - ')\n})\nlist_item.setArt({'icon': G.LOCAL_DB.get_profile_config('avatar', '', guid=profile_guid)})\n- list_item.setInfo('video', {'plot': description})\n+ list_item.setInfo('video', {'Plot': description})\nlist_item.select(is_selected)\nlist_item.addContextMenuItems(menu_items)\nreturn (common.build_url(pathitems=['home'], params={'switch_profile_guid': profile_guid}, mode=G.MODE_DIRECTORY),\n@@ -280,7 +280,7 @@ def build_video_listing(video_list, menu_data, sub_genre_id=None, pathitems=None\n# Create the folder for the access to sub-genre\nfolder_list_item = ListItemW(label=common.get_local_string(30089))\nfolder_list_item.setArt({'icon': 'DefaultVideoPlaylists.png'})\n- folder_list_item.setInfo('video', {'plot': common.get_local_string(30088)}) # The description\n+ folder_list_item.setInfo('video', {'Plot': common.get_local_string(30088)}) # The description\ndirectory_items.insert(0, (common.build_url(['genres', menu_id, sub_genre_id], mode=G.MODE_DIRECTORY),\nfolder_list_item,\nTrue))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/api_paths.py",
"new_path": "resources/lib/utils/api_paths.py",
"diff": "@@ -121,7 +121,6 @@ INFO_MAPPINGS = [\n# pylint: disable=unnecessary-lambda\nINFO_TRANSFORMATIONS = {\n'Season': lambda s_value: _convert_season(s_value),\n- 'Episode': lambda ep: str(ep),\n'Rating': lambda r: r / 10,\n'PlayCount': lambda w: int(w),\n'Trailer': lambda video_id: common.build_url(pathitems=[common.VideoId.SUPPLEMENTAL, str(video_id)],\n@@ -130,18 +129,18 @@ INFO_TRANSFORMATIONS = {\n}\nREFERENCE_MAPPINGS = {\n- 'cast': 'cast',\n- 'director': 'directors',\n- 'writer': 'creators',\n- 'genre': 'genres'\n+ 'Cast': 'cast',\n+ 'Director': 'directors',\n+ 'Writer': 'creators',\n+ 'Genre': 'genres'\n}\ndef _convert_season(value):\nif isinstance(value, int):\n- return str(value)\n+ return value\n# isdigit is needed to filter out non numeric characters from 'shortName' key\n- return ''.join([n for n in value if n.isdigit()])\n+ return int(''.join([n for n in value if n.isdigit()] or '0'))\ndef build_paths(base_path, partial_paths):\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Removed use of deprecated setInfo (from Kodi v20) |
106,046 | 25.10.2022 09:01:52 | -7,200 | 22979ff58265641b82096a0c824b2a8a3664e3ff | Dont show Remember PIN contextmenu if profile dont use it | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_builder_items.py",
"diff": "@@ -94,7 +94,8 @@ def build_profiles_listing(preselect_guid=None, detailed_info=True):\ndef _create_profile_item(profile_guid, is_selected, is_autoselect, is_autoselect_library, detailed_info):\nprofile_name = G.LOCAL_DB.get_profile_config('profileName', '???', guid=profile_guid)\nprofile_attributes = []\n- if G.LOCAL_DB.get_profile_config('isPinLocked', False, guid=profile_guid):\n+ is_pin_locked = G.LOCAL_DB.get_profile_config('isPinLocked', False, guid=profile_guid)\n+ if is_pin_locked:\nprofile_attributes.append(f'[COLOR red]{common.get_local_string(20068)}[/COLOR]')\nif G.LOCAL_DB.get_profile_config('isAccountOwner', False, guid=profile_guid):\nprofile_attributes.append(common.get_local_string(30221))\n@@ -110,7 +111,7 @@ def _create_profile_item(profile_guid, is_selected, is_autoselect, is_autoselect\ndescription = f'{attributes_desc}[{G.LOCAL_DB.get_profile_config(\"language_desc\", \"\", guid=profile_guid)}]'\nif detailed_info:\n- menu_items = generate_context_menu_profile(profile_guid, is_autoselect, is_autoselect_library)\n+ menu_items = generate_context_menu_profile(profile_guid, is_autoselect, is_autoselect_library, is_pin_locked)\nelse:\nmenu_items = []\nlist_item = ListItemW(label=profile_name)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Dont show Remember PIN contextmenu if profile dont use it |
106,046 | 26.10.2022 14:00:10 | -7,200 | 0ff77633793b64c936a836b0bcaa85f8d92e786a | Cleanup to delete a outdated comment | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_request_builder.py",
"new_path": "resources/lib/services/nfsession/msl/msl_request_builder.py",
"diff": "@@ -137,7 +137,6 @@ class MSLRequestBuilder:\n# Make requests by using by default main netflix profile, since the user id token contains also the identity\n# of the netflix profile, to send data to the right profile (e.g. for continue watching) must be used\n# SWITCH_PROFILE scheme to switching MSL profile.\n- # 25/09/2022: SWITCH_PROFILE auth scheme has been disabled on netflix website backend and not works anymore.\nif auth_data['use_switch_profile']:\n# The SWITCH_PROFILE is a custom Netflix MSL user authentication scheme, that is needed for switching\n# profile on MSL side, works only combined with user id token and can not be used with all endpoints\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Cleanup to delete a outdated comment |
106,046 | 27.10.2022 08:58:57 | -7,200 | 34be10bf3bc75fdf7ddb91f1c93669431fc55d5e | Version bump (1.20.0) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.19.1+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.20.0+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n-v1.19.1 (2022-10-09)\n-- NOTE: DUE TO WEBSITE CHANGES ANDROID L3 DEVICES CAN PLAY VIDEOS FROM MAIN PROFILE ONLY\n-- Fixed error \"License update not successful (no keys)\" on linux systems\n-- Fixed add/remove the remind me to the videos\n-- Fixed IPC timeout error when you share STRM library with MySQL\n-- Speeded up database access\n-- Updated Android ESN generation\n-- Add Expert setting \"Force MSL with idtoken authentication\"\n-can be used to try solve error: \"User authentication data does not match entity identity\"\n-- Add AV1 codec support, for development test purpose only (Kodi 20)\n-- Update translations el_gr, it\n+v1.20.0 (2022-10-27)\n+- Fixed limitation on Android devices to playback from main profile only\n+- Fixed trailers context menu and list\n+- Add color setting for videos set as \"Remind me\"\n+- Add \"Remember PIN\" feature, can be set by opening profile context menu\n+- Updated \"Remove watched status\" context menu (continue watching menu)\n+- Cleanup add-on library settings\n+- Cleanup profiles context menus\n+- Removed Expert setting \"Force MSL with idtoken authentication\" not more needed\n+- Removed language code descriptions workaround to Kodi 20 only, for details see Wiki FAQ:\n+\"Audio/Subtitles language codes have a wrong/incomplete descriptions\"\n+- Update translations it, de, fr, zh_cn\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.20.0 (2022-10-27)\n+- Fixed limitation on Android devices to playback from main profile only\n+- Fixed trailers context menu and list\n+- Add color setting for videos set as \"Remind me\"\n+- Add \"Remember PIN\" feature, can be set by opening profile context menu\n+- Updated \"Remove watched status\" context menu (continue watching menu)\n+- Cleanup add-on library settings\n+- Cleanup profiles context menus\n+- Removed Expert setting \"Force MSL with idtoken authentication\" not more needed\n+- Removed language code descriptions workaround to Kodi 20 only, for details see Wiki FAQ:\n+\"Audio/Subtitles language codes have a wrong/incomplete descriptions\"\n+- Update translations it, de, fr, zh_cn\n+\nv1.19.1 (2022-10-09)\n- NOTE: DUE TO WEBSITE CHANGES ANDROID L3 DEVICES CAN PLAY VIDEOS FROM MAIN PROFILE ONLY\n- Fixed error \"License update not successful (no keys)\" on linux systems\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.20.0) (#1474) |
106,046 | 30.10.2022 11:47:17 | -3,600 | 1b2b70ee81e5a2a89d9269a73e1b4d19f656c6d5 | Fix MSL manifest xid for linux devices | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"new_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"diff": "@@ -270,9 +270,14 @@ class MSLHandler:\n# - 'standard' no license data provided in the manifest response\n# TODO: Currently on linux only the license type set to \"limited\" cause this error on ISA:\n# License update not successful (no keys)\n- 'licenseType': 'standard',\n- 'xid': kwargs['xid']\n+ 'licenseType': 'standard'\n}\n+ # 30/10/2022 on linux xid must be specified on the challenge dict\n+ # otherwise ISA raise error: License update not successful (no keys)\n+ if common.get_system_platform() == 'linux':\n+ params['challenges']['default'][0]['xid'] = kwargs['xid']\n+ else:\n+ params['xid'] = kwargs['xid']\nendpoint_url = ENDPOINTS['manifest'] + create_req_params('licensedManifest')\nrequest_data = self.msl_requests.build_request_data('licensedManifest', params)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix MSL manifest xid for linux devices |
106,046 | 30.10.2022 18:46:19 | -3,600 | 0d92aac92c5a5063261537efc917fe7015a42b18 | Allow execute settings without check login | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/run_addon.py",
"new_path": "resources/lib/run_addon.py",
"diff": "@@ -85,7 +85,7 @@ def lazy_login(func):\n\"\"\"\n@wraps(func)\ndef lazy_login_wrapper(*args, **kwargs):\n- if _check_valid_credentials():\n+ if G.REQUEST_PARAMS.get('ignore_login') or _check_valid_credentials():\ntry:\nreturn func(*args, **kwargs)\nexcept NotLoggedInError:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<group id=\"1\" label=\"30734\">\n<setting id=\"purge_complete_cache\" type=\"action\" label=\"30735\">\n<level>0</level>\n- <data>RunPlugin(plugin://$ID/action/show_support_info/)</data>\n+ <data>RunPlugin(plugin://$ID/action/show_support_info/?ignore_login=True)</data>\n<control type=\"button\" format=\"action\">\n<close>false</close>\n</control>\n</setting>\n<setting id=\"profile_options_info\" type=\"action\" label=\"30012\">\n<level>0</level>\n- <data>RunPlugin(plugin://$ID/action/profile_options/)</data>\n+ <data>RunPlugin(plugin://$ID/action/profile_options/?ignore_login=True)</data>\n<control type=\"button\" format=\"action\">\n<close>false</close>\n</control>\n</setting>\n<setting id=\"lib_add_sources\" type=\"action\" label=\"30728\">\n<level>0</level>\n- <data>RunPlugin(plugin://$ID/library/add_folders_to_library/)</data>\n+ <data>RunPlugin(plugin://$ID/library/add_folders_to_library/?ignore_login=True)</data>\n<control type=\"button\" format=\"action\">\n<close>false</close>\n</control>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Allow execute settings without check login |
106,046 | 30.10.2022 19:38:31 | -3,600 | 57a350e90214fb97f3cf35502d59c0c341e7a835 | Version bump (1.20.1) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.20.0+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.20.1+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n-v1.20.0 (2022-10-27)\n-- Fixed limitation on Android devices to playback from main profile only\n-- Fixed trailers context menu and list\n-- Add color setting for videos set as \"Remind me\"\n-- Add \"Remember PIN\" feature, can be set by opening profile context menu\n-- Updated \"Remove watched status\" context menu (continue watching menu)\n-- Cleanup add-on library settings\n-- Cleanup profiles context menus\n-- Removed Expert setting \"Force MSL with idtoken authentication\" not more needed\n-- Removed language code descriptions workaround to Kodi 20 only, for details see Wiki FAQ:\n-\"Audio/Subtitles language codes have a wrong/incomplete descriptions\"\n-- Update translations it, de, fr, zh_cn\n+v1.20.1 (2022-10-30)\n+- Fixed playback on linux devices\n+- Protected Logout setting with a confirmation dialog\n+- Wait for service startup without notification\n+- Add support info on add-on settings\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.20.1 (2022-10-30)\n+- Fixed playback on linux devices\n+- Protected Logout setting with a confirmation dialog\n+- Wait for service startup without notification\n+- Add support info on add-on settings\n+\nv1.20.0 (2022-10-27)\n- Fixed limitation on Android devices to playback from main profile only\n- Fixed trailers context menu and list\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.20.1) (#1491) |
106,046 | 08.11.2022 08:24:15 | -3,600 | 09ba7dfa698301e37825662b5afcf5513e96bf77 | Fix to httpcore ReadError [Errno 11] Try again
At least to me happens with Wifi connection only
and randomly, no idea if there is an appropriate solution | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/session/http_requests.py",
"new_path": "resources/lib/services/nfsession/session/http_requests.py",
"diff": "@@ -89,6 +89,12 @@ class SessionHTTPRequests(SessionBase):\nraise\nretry += 1\nLOG.warn('Another attempt will be performed ({})', retry)\n+ except httpx.ReadError as exc:\n+ if retry == 3 or 'Try again' not in str(exc):\n+ raise\n+ LOG.error('HTTP request error: {}', exc)\n+ retry += 1\n+ LOG.warn('Another attempt will be performed ({})', retry)\n# for redirect in response.history:\n# LOG.warn('Redirected to: [{}] {}', redirect.status_code, redirect.url)\nif not session_refreshed:\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix to httpcore ReadError [Errno 11] Try again
At least to me happens with Wifi connection only
and randomly, no idea if there is an appropriate solution |
106,046 | 08.11.2022 08:26:56 | -3,600 | 0c52cd74db9738a0c3847f7731d799bce72b23a9 | Fix missing 4k HDR for some videos | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/profiles.py",
"new_path": "resources/lib/services/nfsession/msl/profiles.py",
"diff": "@@ -60,7 +60,7 @@ PROFILES = {\n'hdr':\n_profile_strings(base=HDR,\ntails=[(LEVELS_3 + LEVELS_4 + LEVELS_5, CENC_PRK),\n- (LEVELS_3 + LEVELS_4, CENC_PRK_DO)]),\n+ (LEVELS_3 + LEVELS_4 + LEVELS_5, CENC_PRK_DO)]),\n'dolbyvision':\n_profile_strings(base=DV5,\ntails=[(LEVELS_3 + LEVELS_4 + LEVELS_5, CENC_PRK),\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix missing 4k HDR for some videos |
106,046 | 09.11.2022 09:43:34 | -3,600 | 6f78940533f6036f212ba3dd9fd120a22c8b56b8 | Fix setting id name | [
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<category id=\"general\" label=\"30031\" help=\"\">\n<!--GROUP: Support-->\n<group id=\"1\" label=\"30734\">\n- <setting id=\"purge_complete_cache\" type=\"action\" label=\"30735\">\n+ <setting id=\"show_support_info\" type=\"action\" label=\"30735\">\n<level>0</level>\n<data>RunPlugin(plugin://$ID/action/show_support_info/?ignore_login=True)</data>\n<control type=\"button\" format=\"action\">\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix setting id name |
106,046 | 09.11.2022 09:44:10 | -3,600 | 00abee802f2015c9caa87bee68c6457c5a920657 | Fix plot on listitem setInfo | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/api_paths.py",
"new_path": "resources/lib/utils/api_paths.py",
"diff": "@@ -72,7 +72,7 @@ SEASONS_PARTIAL_PATHS = [\n] + ART_PARTIAL_PATHS\nEPISODES_PARTIAL_PATHS = [\n- [['requestId', 'summary', 'synopsis', 'title', 'runtime', 'releaseYear', 'queue',\n+ [['requestId', 'summary', 'synopsis', 'regularSynopsis', 'title', 'runtime', 'releaseYear', 'queue',\n'info', 'maturity', 'userRating', 'bookmarkPosition', 'creditsOffset',\n'watched', 'delivery', 'trackIds', 'availability']],\n[['genres', 'tags', 'creators', 'directors', 'cast'],\n@@ -80,7 +80,7 @@ EPISODES_PARTIAL_PATHS = [\n] + ART_PARTIAL_PATHS\nTRAILER_PARTIAL_PATHS = [\n- [['availability', 'summary', 'synopsis', 'title', 'trackIds', 'delivery', 'runtime',\n+ [['availability', 'summary', 'synopsis', 'regularSynopsis', 'title', 'trackIds', 'delivery', 'runtime',\n'bookmarkPosition', 'creditsOffset']]\n] + ART_PARTIAL_PATHS\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix plot on listitem setInfo |
106,046 | 09.11.2022 09:45:32 | -3,600 | 8c9a483c2435c8be9d822d33cbb8a55e02fa8940 | Disabled pylint too-many-branches to _request | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/session/http_requests.py",
"new_path": "resources/lib/services/nfsession/session/http_requests.py",
"diff": "@@ -47,6 +47,7 @@ class SessionHTTPRequests(SessionBase):\ndef _request_call(self, method, endpoint, **kwargs):\nreturn self._request(method, endpoint, None, **kwargs)\n+ # pylint: disable=too-many-branches\ndef _request(self, method, endpoint, session_refreshed, **kwargs):\nendpoint_conf = ENDPOINTS[endpoint]\nurl = (_api_url(endpoint_conf['address'])\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Disabled pylint too-many-branches to _request |
106,046 | 12.11.2022 11:45:03 | -3,600 | d8c6133d5cee031c4aab4f8b112cbd6202f4cdfe | Add premiered date to tvshow nfo | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/nfo.py",
"new_path": "resources/lib/kodi/nfo.py",
"diff": "@@ -119,6 +119,11 @@ def create_show_nfo(show):\n'id': show['id'],\n'mpaa': show.get('rating')\n}\n+ # Try get the year from the first season\n+ year = show.get('seasons', [{}])[0].get('year')\n+ if year:\n+ # Since we have the year only, so we hardcode the month/day\n+ tags['premiered'] = f'{year}-01-01'\nroot = _build_root_node('tvshow', tags)\n_add_poster(root, show)\n_add_fanart(root, show)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add premiered date to tvshow nfo |
106,046 | 12.11.2022 11:55:02 | -3,600 | 52a282c0035858dbcbd5f9ca4623d136dbe816e5 | Replaced deprecated NFO movie year with premiered | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/nfo.py",
"new_path": "resources/lib/kodi/nfo.py",
"diff": "@@ -136,9 +136,12 @@ def create_movie_nfo(movie):\n'plot': movie.get('synopsis'),\n'id': movie.get('id'),\n'mpaa': movie.get('rating'),\n- 'year': movie.get('year'),\n'runtime': movie.get('runtime', 0) / 60,\n}\n+ year = movie.get('year')\n+ if year:\n+ # Since we have the year only, so we hardcode the month/day\n+ tags['premiered'] = f'{year}-01-01'\nroot = _build_root_node('movie', tags)\n_add_poster(root, movie)\n_add_fanart(root, movie)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Replaced deprecated NFO movie year with premiered |
106,046 | 12.11.2022 11:56:27 | -3,600 | 92afdbaa1fe6177840bf593eab9707d024d9ee4f | Replaced deprecated NFO episode year with premiered | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/nfo.py",
"new_path": "resources/lib/kodi/nfo.py",
"diff": "@@ -101,10 +101,12 @@ def create_episode_nfo(episode, season, show):\n'episode': episode.get('seq'),\n'plot': episode.get('synopsis'),\n'runtime': episode.get('runtime', 0) / 60,\n- 'year': season.get('year'),\n'id': episode.get('id')\n}\n-\n+ year = episode.get('year')\n+ if year:\n+ # Since we have the year only, so we hardcode the month/day\n+ tags['premiered'] = f'{year}-01-01'\nroot = _build_root_node('episodedetails', tags)\n_add_episode_thumb(root, episode)\nreturn root\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Replaced deprecated NFO episode year with premiered |
106,046 | 12.11.2022 13:35:18 | -3,600 | 084d91097d7a21417836385d6fb594f1a7d73cc1 | Version bump (1.20.2) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.20.1+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.20.2+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n<news>\n-v1.20.1 (2022-10-30)\n-- Fixed playback on linux devices\n-- Protected Logout setting with a confirmation dialog\n-- Wait for service startup without notification\n-- Add support info on add-on settings\n+v1.20.2 (2022-11-12)\n+- Fixed 4k HDR\n+- Fixed missing plot\n+- Fix/workaround for error \"ReadError [Errno 11] Try again\"\n+- Fixed broken Clean cache menu\n+- Fix year/premiered date on NFO files.\n+Only the year is available, required optional full resync for existing files, on new files will be add by default.\n+- Update translations pl, it, de, hu, zh_tw\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.20.2 (2022-11-12)\n+- Fixed 4k HDR\n+- Fixed missing plot\n+- Fix/workaround for error \"ReadError [Errno 11] Try again\"\n+- Fixed broken Clean cache menu\n+- Fix year/premiered date on NFO files.\n+Only the year is available, required optional full resync for existing files, on new files will be add by default.\n+- Update translations pl, it, de, hu, zh_tw\n+\nv1.20.1 (2022-10-30)\n- Fixed playback on linux devices\n- Protected Logout setting with a confirmation dialog\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.20.2) (#1495) |
106,046 | 13.11.2022 14:01:18 | -3,600 | 24742d8216eae5a0e11ea96e34ad5e821b77451b | Make consistent supplemental plot info for all cases | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -59,7 +59,13 @@ def get_info(videoid, item, raw_data, profile_language_code='', delayed_db_op=Fa\ninfos, quality_infos = parse_info(videoid, item, raw_data, common_data)\nG.CACHE.add(CACHE_INFOLABELS, cache_identifier, {'infos': infos, 'quality_infos': quality_infos},\ndelayed_db_op=delayed_db_op)\n- return infos, quality_infos\n+ # Use a deepcopy of dict to not reflect changes of the dictionary also to the cache\n+ infos_copy = copy.deepcopy(infos)\n+ # Not all skins support PlotOutline, so copy over Plot if it does not exist\n+ if 'Plot' not in infos_copy and 'PlotOutline' in infos_copy:\n+ infos_copy['Plot'] = infos_copy['PlotOutline']\n+ _add_supplemental_plot_info(infos_copy, item, common_data)\n+ return infos_copy, quality_infos\ndef add_info_list_item(list_item: ListItemW, videoid, item, raw_data, is_in_mylist, common_data, art_item=None,\n@@ -67,27 +73,21 @@ def add_info_list_item(list_item: ListItemW, videoid, item, raw_data, is_in_myli\n\"\"\"Add infolabels and art to a ListItem\"\"\"\ninfos, quality_infos = get_info(videoid, item, raw_data, delayed_db_op=True, common_data=common_data)\nlist_item.addStreamInfoFromDict(quality_infos)\n- # Use a deepcopy of dict to not reflect future changes to the dictionary also to the cache\n- infos_copy = copy.deepcopy(infos)\n- if 'Plot' not in infos_copy and 'PlotOutline' in infos_copy:\n- # Not all skins support read value from PlotOutline\n- infos_copy['Plot'] = infos_copy['PlotOutline']\n- _add_supplemental_plot_info(infos_copy, item, common_data)\nif is_in_mylist and common_data.get('mylist_titles_color'):\n# Highlight ListItem title when the videoid is contained in \"My list\"\nlist_item.setLabel(_colorize_text(common_data['mylist_titles_color'], list_item.getLabel()))\nelif is_in_remind_me:\n# Highlight ListItem title when a video is marked as \"Remind me\"\nlist_item.setLabel(_colorize_text(common_data['rememberme_titles_color'], list_item.getLabel()))\n- infos_copy['Title'] = list_item.getLabel()\n+ infos['Title'] = list_item.getLabel()\nif videoid.mediatype == common.VideoId.SHOW and not common_data['marks_tvshow_started']:\n- infos_copy.pop('PlayCount', None)\n- list_item.setInfo('video', infos_copy)\n+ infos.pop('PlayCount', None)\n+ list_item.setInfo('video', infos)\nlist_item.setArt(get_art(videoid, art_item or item or {}, common_data['profile_language_code'],\ndelayed_db_op=True))\n-def _add_supplemental_plot_info(infos_copy, item, common_data):\n+def _add_supplemental_plot_info(infos, item, common_data):\n\"\"\"Add supplemental info to plot description\"\"\"\nsuppl_info = []\nsuppl_msg = item.get('dpSupplementalMessage', {}).get('value')\n@@ -110,16 +110,18 @@ def _add_supplemental_plot_info(infos_copy, item, common_data):\n# Short info about the actors career/awards and similarities/connections with others films or tv shows\nsuppl_info.append(hook_value['text'])\nsuppl_text = '[CR][CR]'.join(suppl_info)\n- plot = infos_copy.get('Plot', '')\n- plotoutline = infos_copy.get('PlotOutline', '')\nif suppl_text:\n- suppl_text = _colorize_text(common_data['supplemental_info_color'], suppl_text)\n+ suppl_text = _colorize_text(common_data.get('supplemental_info_color',\n+ get_color_name(G.ADDON.getSettingInt('supplemental_info_color'))),\n+ suppl_text)\n+ plot = infos.get('Plot', '')\nif plot:\nplot += '[CR][CR]'\n+ plotoutline = infos.get('PlotOutline', '')\nif plotoutline:\nplotoutline += '[CR][CR]'\n- infos_copy.update({'Plot': plot + suppl_text})\n- infos_copy.update({'PlotOutline': plotoutline + suppl_text})\n+ infos.update({'Plot': plot + suppl_text})\n+ infos.update({'PlotOutline': plotoutline + suppl_text})\ndef get_art(videoid, item, profile_language_code='', delayed_db_op=False):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/nfsession_ops.py",
"new_path": "resources/lib/services/nfsession/nfsession_ops.py",
"diff": "@@ -23,7 +23,8 @@ from resources.lib.globals import G\nfrom resources.lib.kodi import ui\nfrom resources.lib.services.nfsession.session.path_requests import SessionPathRequests\nfrom resources.lib.utils import cookies\n-from resources.lib.utils.api_paths import EPISODES_PARTIAL_PATHS, ART_PARTIAL_PATHS, build_paths\n+from resources.lib.utils.api_paths import (EPISODES_PARTIAL_PATHS, ART_PARTIAL_PATHS, build_paths,\n+ VIDEO_LIST_PARTIAL_PATHS)\nfrom resources.lib.utils.logging import LOG, measure_exec_time_decorator\n@@ -259,9 +260,11 @@ class NFSessionOperations(SessionPathRequests):\ninfos = get_info(videoid, None, None, profile_language_code)[0]\nart = get_art(videoid, None, profile_language_code)\nexcept (AttributeError, TypeError):\n- paths = build_paths(['videos', int(videoid.value)], EPISODES_PARTIAL_PATHS)\nif videoid.mediatype == common.VideoId.EPISODE:\n- paths.extend(build_paths(['videos', int(videoid.tvshowid)], ART_PARTIAL_PATHS + [['title']]))\n+ paths = (build_paths(['videos', int(videoid.value)], EPISODES_PARTIAL_PATHS) +\n+ build_paths(['videos', int(videoid.tvshowid)], ART_PARTIAL_PATHS + [['title']]))\n+ else:\n+ paths = build_paths(['videos', int(videoid.value)], VIDEO_LIST_PARTIAL_PATHS)\nraw_data = self.path_request(paths)\ninfos = get_info(videoid, raw_data['videos'][videoid.value], raw_data, profile_language_code)[0]\nart = get_art(videoid, raw_data['videos'][videoid.value], profile_language_code)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Make consistent supplemental plot info for all cases |
106,046 | 27.11.2022 17:09:29 | -3,600 | 19b904376780328aee36131fbb5fb40e56f962d7 | Avoid escape unicode property | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/website.py",
"new_path": "resources/lib/utils/website.py",
"diff": "@@ -281,6 +281,7 @@ def extract_json(content, name):\njson_str_replace = json_str_replace.replace(r'\\r', r'\\\\r') # Escape return\njson_str_replace = json_str_replace.replace(r'\\n', r'\\\\n') # Escape line feed\njson_str_replace = json_str_replace.replace(r'\\t', r'\\\\t') # Escape tab\n+ json_str_replace = json_str_replace.replace(r'\\p', r'/p') # Unicode property not supported, we change slash to avoid unescape it\njson_str_replace = json_str_replace.encode().decode('unicode_escape') # Decode the string as unicode\njson_str_replace = sub(r'\\\\(?![\"])', r'\\\\\\\\', json_str_replace) # Escape backslash (only when is not followed by double quotation marks \\\")\nreturn json.loads(json_str_replace)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Avoid escape unicode property |
106,046 | 07.12.2022 19:53:17 | -3,600 | 3d313570eb6bbde392fc6245f7bf2a5ace0d1829 | Use lowercase hdrType
due to | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -227,9 +227,9 @@ def get_quality_infos(item, video_codec_hint):\nelse:\nquality_infos['audio']['codec'] = 'aac'\nif delivery.get('hasDolbyVision', False):\n- quality_infos['video']['hdrType'] = 'dolbyvision'\n+ quality_infos['video']['hdrtype'] = 'dolbyvision'\nelif delivery.get('hasHDR', False):\n- quality_infos['video']['hdrType'] = 'hdr10'\n+ quality_infos['video']['hdrtype'] = 'hdr10'\nreturn quality_infos\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Use lowercase hdrType
due to https://github.com/xbmc/xbmc/pull/22192 |
106,046 | 08.12.2022 12:46:14 | -3,600 | b8f73d3eb656fb2648cdcb61e260e4dd2c55d3b7 | CmpVersion improvements | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/misc_utils.py",
"new_path": "resources/lib/common/misc_utils.py",
"diff": "@@ -194,46 +194,64 @@ def run_threaded(non_blocking, target_func, *args, **kwargs):\nclass CmpVersion:\n\"\"\"Comparator for version numbers\"\"\"\ndef __init__(self, version):\n- self.version = version\n+ self.__version = str(version or '')\n+ self.__ver_list = (self.__version or '0').split('.')\ndef __str__(self):\n- return self.version\n+ return self.__version\ndef __repr__(self):\n- return self.version\n+ return self.__version\n+\n+ def __bool__(self):\n+ \"\"\"\n+ Allow \"if\" operator to check if there is a version set.\n+ Will return False only when \"version\" set is an empty string or None.\n+ \"\"\"\n+ return bool(self.__version)\n+\n+ def __iter__(self):\n+ \"\"\"Allow to get the version list by using \"list\" command builtin\"\"\"\n+ return iter(self.__ver_list)\ndef __lt__(self, other):\n\"\"\"Operator <\"\"\"\nreturn operator.lt(*zip(*map(lambda x, y: (x or 0, y or 0),\n- map(int, self.version.split('.')),\n- map(int, other.split('.')))))\n+ map(int, self.__ver_list),\n+ map(int, self.__conv_to_list(other)))))\ndef __le__(self, other):\n\"\"\"Operator <=\"\"\"\nreturn operator.le(*zip(*map(lambda x, y: (x or 0, y or 0),\n- map(int, self.version.split('.')),\n- map(int, other.split('.')))))\n+ map(int, self.__ver_list),\n+ map(int, self.__conv_to_list(other)))))\ndef __gt__(self, other):\n\"\"\"Operator >\"\"\"\nreturn operator.gt(*zip(*map(lambda x, y: (x or 0, y or 0),\n- map(int, self.version.split('.')),\n- map(int, other.split('.')))))\n+ map(int, self.__ver_list),\n+ map(int, self.__conv_to_list(other)))))\ndef __ge__(self, other):\n\"\"\"Operator >=\"\"\"\nreturn operator.ge(*zip(*map(lambda x, y: (x or 0, y or 0),\n- map(int, self.version.split('.')),\n- map(int, other.split('.')))))\n+ map(int, self.__ver_list),\n+ map(int, self.__conv_to_list(other)))))\ndef __eq__(self, other):\n\"\"\"Operator ==\"\"\"\nreturn operator.eq(*zip(*map(lambda x, y: (x or 0, y or 0),\n- map(int, self.version.split('.')),\n- map(int, other.split('.')))))\n+ map(int, self.__ver_list),\n+ map(int, self.__conv_to_list(other)))))\ndef __ne__(self, other):\n\"\"\"Operator !=\"\"\"\nreturn operator.ne(*zip(*map(lambda x, y: (x or 0, y or 0),\n- map(int, self.version.split('.')),\n- map(int, other.split('.')))))\n+ map(int, self.__ver_list),\n+ map(int, self.__conv_to_list(other)))))\n+\n+ def __conv_to_list(self, value):\n+ \"\"\"Convert a string or number or CmpVersion object to a list of strings\"\"\"\n+ if isinstance(value, CmpVersion):\n+ return list(value)\n+ return str(value or '0').split('.')\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | CmpVersion improvements |
106,046 | 08.12.2022 13:26:41 | -3,600 | 797fc1e061a76083b71af1de61107ffb28cd5d8b | Cleanup version comparers | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/database/db_update.py",
"new_path": "resources/lib/database/db_update.py",
"diff": "@@ -11,10 +11,11 @@ from resources.lib.common import CmpVersion\nfrom resources.lib.globals import G\n-def run_local_db_updates(current_version, upgrade_to_version): # pylint: disable=unused-argument\n+# pylint: disable=unused-argument\n+def run_local_db_updates(current_version: CmpVersion, upgrade_to_version: CmpVersion):\n\"\"\"Perform database actions for a db version change\"\"\"\n# The changes must be left in sequence to allow cascade operations on non-updated databases\n- if CmpVersion(current_version) < '0.2':\n+ if current_version < '0.2':\n# Changes: added table 'search'\nimport sqlite3 as sql\nfrom resources.lib.database.db_base_sqlite import CONN_ISOLATION_LEVEL\n@@ -34,15 +35,16 @@ def run_local_db_updates(current_version, upgrade_to_version): # pylint: disabl\ncur.execute(table)\nshared_db_conn.close()\n- if CmpVersion(current_version) < '0.3':\n+ if current_version < '0.3':\npass\n-def run_shared_db_updates(current_version, upgrade_to_version): # pylint: disable=unused-argument\n+# pylint: disable=unused-argument\n+def run_shared_db_updates(current_version: CmpVersion, upgrade_to_version: CmpVersion):\n\"\"\"Perform database actions for a db version change\"\"\"\n# The changes must be left in sequence to allow cascade operations on non-updated databases\n- if CmpVersion(current_version) < '0.2':\n+ if current_version < '0.2':\n# Changes: added table 'watched_status_override'\n# SQLite\n@@ -91,5 +93,5 @@ def run_shared_db_updates(current_version, upgrade_to_version): # pylint: disab\ncur.execute(alter_tbl)\nshared_db_conn.conn.close()\n- if CmpVersion(current_version) < '0.3':\n+ if current_version < '0.3':\npass\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/upgrade_controller.py",
"new_path": "resources/lib/upgrade_controller.py",
"diff": "@@ -21,45 +21,45 @@ def check_addon_upgrade():\n:return True if this is the first run of the add-on after an installation from scratch\n\"\"\"\n# Upgrades that require user interaction or to be performed outside of the service\n- addon_previous_ver = G.LOCAL_DB.get_value('addon_previous_version', None)\n- addon_current_ver = G.VERSION\n- if addon_previous_ver is None or CmpVersion(addon_current_ver) > addon_previous_ver:\n+ addon_previous_ver = CmpVersion(G.LOCAL_DB.get_value('addon_previous_version'))\n+ addon_current_ver = CmpVersion(G.VERSION)\n+ if not addon_previous_ver or addon_current_ver > addon_previous_ver:\n_perform_addon_changes(addon_previous_ver, addon_current_ver)\n- G.LOCAL_DB.set_value('addon_previous_version', addon_current_ver)\n- return addon_previous_ver is None\n+ G.LOCAL_DB.set_value('addon_previous_version', str(addon_current_ver))\n+ return not addon_previous_ver\ndef check_service_upgrade():\n\"\"\"Check service upgrade and perform necessary update operations\"\"\"\n# Upgrades to be performed before starting the service\n# Upgrade the local database\n- current_local_db_version = G.LOCAL_DB.get_value('local_db_version', None)\n- upgrade_to_local_db_version = '0.2'\n- if current_local_db_version != upgrade_to_local_db_version:\n- _perform_local_db_changes(current_local_db_version, upgrade_to_local_db_version)\n- G.LOCAL_DB.set_value('local_db_version', upgrade_to_local_db_version)\n+ local_db_curr_ver = CmpVersion(G.LOCAL_DB.get_value('local_db_version'))\n+ local_db_upgrade_ver = CmpVersion('0.2')\n+ if local_db_curr_ver != local_db_upgrade_ver:\n+ _perform_local_db_changes(local_db_curr_ver, local_db_upgrade_ver)\n+ G.LOCAL_DB.set_value('local_db_version', str(local_db_upgrade_ver))\n# Upgrade the shared databases\n- current_shared_db_version = G.LOCAL_DB.get_value('shared_db_version', None)\n- upgrade_to_shared_db_version = '0.2'\n- if current_shared_db_version != upgrade_to_shared_db_version:\n- _perform_shared_db_changes(current_shared_db_version, upgrade_to_shared_db_version)\n- G.LOCAL_DB.set_value('shared_db_version', upgrade_to_shared_db_version)\n+ shared_db_curr_ver = CmpVersion(G.LOCAL_DB.get_value('shared_db_version'))\n+ shared_db_upgrade_ver = CmpVersion('0.2')\n+ if shared_db_curr_ver != shared_db_upgrade_ver:\n+ _perform_shared_db_changes(shared_db_curr_ver, shared_db_upgrade_ver)\n+ G.LOCAL_DB.set_value('shared_db_version', str(shared_db_upgrade_ver))\n# Perform service changes\n- service_previous_ver = G.LOCAL_DB.get_value('service_previous_version', None)\n- service_current_ver = G.VERSION\n- if service_previous_ver is None or CmpVersion(service_current_ver) > service_previous_ver:\n+ service_previous_ver = CmpVersion(G.LOCAL_DB.get_value('service_previous_version'))\n+ service_current_ver = CmpVersion(G.VERSION)\n+ if not service_previous_ver or service_current_ver > service_previous_ver:\n_perform_service_changes(service_previous_ver, service_current_ver)\n- G.LOCAL_DB.set_value('service_previous_version', service_current_ver)\n+ G.LOCAL_DB.set_value('service_previous_version', str(service_current_ver))\n-def _perform_addon_changes(previous_ver, current_ver):\n- \"\"\"Perform actions for an version bump\"\"\"\n- LOG.debug('Initialize add-on upgrade operations, from version {} to {}', previous_ver, current_ver)\n+def _perform_addon_changes(previous_ver: CmpVersion, current_ver: CmpVersion):\n+ \"\"\"Perform actions for a version bump\"\"\"\nif not previous_ver:\nreturn\n- if CmpVersion(previous_ver) < '1.16.2':\n+ LOG.debug('Initialize add-on upgrade operations, from version {} to {}', previous_ver, current_ver)\n+ if previous_ver < '1.16.2':\nfrom xbmcaddon import Addon\nisa_version = remove_ver_suffix(Addon('inputstream.adaptive').getAddonInfo('version'))\nif CmpVersion(isa_version) < '2.6.18':\n@@ -69,15 +69,15 @@ def _perform_addon_changes(previous_ver, current_ver):\n'[CR]To get HD video contents, please update it to the last version.')\n-def _perform_service_changes(previous_ver, current_ver):\n+def _perform_service_changes(previous_ver: CmpVersion, current_ver: CmpVersion):\n\"\"\"Perform actions for an version bump\"\"\"\n- LOG.debug('Initialize add-on service upgrade operations, from version {} to {}', previous_ver, current_ver)\n- # Clear cache (prevents problems when netflix change data structures)\n+ # Clear cache in any case (prevents problems when netflix change data structures)\nG.CACHE.clear()\nif not previous_ver:\nreturn\n+ LOG.debug('Initialize add-on service upgrade operations, from version {} to {}', previous_ver, current_ver)\n# Delete all stream continuity data - if user has upgraded from Kodi 18 to Kodi 19\n- if CmpVersion(previous_ver) < '1.13':\n+ if previous_ver < '1.13':\n# There is no way to determine if the user has migrated from Kodi 18 to Kodi 19,\n# then we assume that add-on versions prior to 1.13 was on Kodi 18\n# The am_stream_continuity.py on Kodi 18 works differently and the existing data can not be used on Kodi 19\n@@ -86,11 +86,11 @@ def _perform_service_changes(previous_ver, current_ver):\nwith G.SETTINGS_MONITOR.ignore_events(1):\nis_4k_capable = is_device_4k_capable()\nG.ADDON.setSettingBool('enable_hevc_profiles', is_4k_capable)\n- if CmpVersion(previous_ver) < '1.9.0':\n+ if previous_ver < '1.9.0':\n# In the version 1.9.0 has been changed the COOKIE_ filename with a static filename\nfrom resources.lib.upgrade_actions import rename_cookie_file\nrename_cookie_file()\n- if CmpVersion(previous_ver) < '1.12.0':\n+ if previous_ver < '1.12.0':\n# In the version 1.13.0:\n# - 'force_widevine' on setting.xml has been moved\n# as 'widevine_force_seclev' in TABLE_SESSION with different values:\n@@ -114,20 +114,20 @@ def _perform_service_changes(previous_ver, current_ver):\nui.show_ok_dialog('Netflix add-on upgrade',\n'This add-on upgrade has reset your ESN code, if you had set an ESN code manually '\n'you must re-enter it again in the Expert settings, otherwise simply ignore this message.')\n- if CmpVersion(previous_ver) < '1.16.0':\n+ if previous_ver < '1.16.0':\n# In the version 1.16.0 the watched status sync setting has been enabled by default,\n# therefore to be able to keep the user's setting even when it has never been changed,\n# we have done a new setting (ProgressManager_enabled >> to >> sync_watched_status)\nwith G.SETTINGS_MONITOR.ignore_events(1):\nG.ADDON.setSettingBool('sync_watched_status', G.ADDON.getSettingBool('ProgressManager_enabled'))\n- if CmpVersion(previous_ver) < '1.18.3':\n+ if previous_ver < '1.18.3':\n# In the version 1.18.3 content_profiles_int has been replaced by manifest_settings_status\nG.LOCAL_DB.delete_key('content_profiles_int')\n- if CmpVersion(previous_ver) < '1.18.7':\n+ if previous_ver < '1.18.7':\n# Migrate to new repository\nfrom resources.lib.upgrade_actions import migrate_repository\nmigrate_repository()\n- if CmpVersion(previous_ver) < '1.20.0':\n+ if previous_ver < '1.20.0':\n# Migrate library setting\nif G.ADDON.getSettingInt('lib_auto_upd_mode') == 0:\n# Previously this value meant \"disabled\" (where now is \"when Kodi starts\")\n@@ -136,17 +136,19 @@ def _perform_service_changes(previous_ver, current_ver):\nG.ADDON.setSettingInt('lib_auto_upd_mode', 1) # Set to \"Manual\" default\n-def _perform_local_db_changes(current_version, upgrade_to_version):\n+def _perform_local_db_changes(current_version: CmpVersion, upgrade_to_version: CmpVersion):\n\"\"\"Perform database actions for a db version change\"\"\"\n- if current_version is not None:\n+ if not current_version:\n+ return\nLOG.debug('Initialize local database updates, from version {} to {}',\ncurrent_version, upgrade_to_version)\nrun_local_db_updates(current_version, upgrade_to_version)\n-def _perform_shared_db_changes(current_version, upgrade_to_version):\n+def _perform_shared_db_changes(current_version: CmpVersion, upgrade_to_version: CmpVersion):\n\"\"\"Perform database actions for a db version change\"\"\"\n- if current_version is not None:\n+ if not current_version:\n+ return\nLOG.debug('Initialize shared databases updates, from version {} to {}',\ncurrent_version, upgrade_to_version)\nrun_shared_db_updates(current_version, upgrade_to_version)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Cleanup version comparers |
106,046 | 16.12.2022 20:00:05 | -3,600 | 8e2bbcf373b285ad6c7f85f32e4021a582f07959 | Auto generate ESN's | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -1225,3 +1225,11 @@ msgstr \"\"\nmsgctxt \"#30735\"\nmsgid \"About Netflix add-on\"\nmsgstr \"\"\n+\n+msgctxt \"#30736\"\n+msgid \"Automatically generates new ESNs (workaround for 540p limit)\"\n+msgstr \"\"\n+\n+msgctxt \"#30737\"\n+msgid \"WARNING: Do not use the original device ESN of the official app.\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/ui/xmldialog_esnwidevine.py",
"new_path": "resources/lib/kodi/ui/xmldialog_esnwidevine.py",
"diff": "SPDX-License-Identifier: MIT\nSee LICENSES/MIT.md for more information.\n\"\"\"\n+import time\n+\nimport xbmc\nimport xbmcgui\nimport xbmcvfs\n@@ -55,6 +57,8 @@ class ESNWidevine(xbmcgui.WindowXMLDialog):\nself.getControl(40002).setLabel(common.get_local_string(30605).format(WidevineForceSecLev.L3_4445))\n# Set the current ESN to Label\nself.getControl(30000).setLabel(self.esn)\n+ # Set [Auto generate ESN] radio button value\n+ self.getControl(40100).setSelected(G.LOCAL_DB.get_value('esn_auto_generate', True))\n# Set the current Widevine security level to the radio buttons\nself.getControl(self.WV_SECLEV_MAP_BTN[self.wv_force_sec_lev]).setSelected(True)\n# Hide force L3 on non-android systems (L1 is currently supported only to android)\n@@ -88,6 +92,11 @@ class ESNWidevine(xbmcgui.WindowXMLDialog):\nG.LOCAL_DB.set_value('widevine_force_seclev',\nself.wv_sec_lev_new or self.wv_force_sec_lev,\nTABLE_SESSION)\n+ # Reset ESN timestamp to prevent to replace the stored ESN immediately\n+ G.LOCAL_DB.set_value('esn_timestamp', int(time.time()))\n+ # Update value for auto generate ESN\n+ is_checked = self.getControl(40100).isSelected()\n+ G.LOCAL_DB.set_value('esn_auto_generate', is_checked)\n# Delete manifests cache, to prevent possible problems in relation to previous ESN used\nfrom resources.lib.common.cache_utils import CACHE_MANIFESTS\nG.CACHE.clear([CACHE_MANIFESTS])\n@@ -105,14 +114,13 @@ class ESNWidevine(xbmcgui.WindowXMLDialog):\nself._revert_changes()\nself.close()\n- def _esn_checks(self):\n- \"\"\"Sanity checks for custom ESN\"\"\"\n- esn = self.esn_new or self.esn\n+ def _esn_checks(self, esn):\n+ \"\"\"Sanity checks for ESN\"\"\"\nif self.is_android:\n- if not esn.startswith(('NFANDROID1-PRV-', 'NFANDROID2-PRV-')) or len(esn.split('-')) < 5:\n+ if not esn.startswith(('NFANDROID1-PRV-', 'NFANDROID2-PRV-')) or esn.count('-') < 5:\nreturn False\nelse:\n- if len(esn.split('-')) != 3 or len(esn) != 40:\n+ if esn.count('-') != 3 or len(esn) != 40:\nreturn False\nreturn True\n@@ -138,7 +146,7 @@ class ESNWidevine(xbmcgui.WindowXMLDialog):\ndef _change_esn(self):\nesn_custom = ui.ask_for_input(common.get_local_string(30602), self.esn_new or self.esn)\nif esn_custom:\n- if not self._esn_checks():\n+ if not self._esn_checks(esn_custom):\n# Wrong custom ESN format type\nui.show_ok_dialog(common.get_local_string(30600), common.get_local_string(30608))\nelse:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"new_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"diff": "@@ -19,7 +19,7 @@ from resources.lib.common.cache_utils import CACHE_MANIFESTS\nfrom resources.lib.common.exceptions import MSLError\nfrom resources.lib.database.db_utils import TABLE_SESSION\nfrom resources.lib.globals import G\n-from resources.lib.utils.esn import get_esn, set_esn\n+from resources.lib.utils.esn import get_esn, set_esn, regen_esn\nfrom resources.lib.utils.logging import LOG, measure_exec_time_decorator\nfrom .converter import convert_to_dash\nfrom .events_handler import EventsHandler\n@@ -94,6 +94,8 @@ class MSLHandler:\n# When the add-on is installed from scratch or you logout the account the ESN will be empty\nif not esn:\nesn = set_esn()\n+ else:\n+ esn = regen_esn(esn)\nmanifest = self._get_manifest(viewable_id, esn, challenge, sid)\nexcept MSLError as exc:\nif 'Email or password is incorrect' in str(exc):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/esn.py",
"new_path": "resources/lib/utils/esn.py",
"diff": "SPDX-License-Identifier: MIT\nSee LICENSES/MIT.md for more information.\n\"\"\"\n-from re import sub\n+import time\n+import re\nfrom resources.lib.database.db_utils import TABLE_SESSION\nfrom resources.lib.globals import G\n@@ -51,6 +52,41 @@ def set_website_esn(esn):\nG.LOCAL_DB.set_value('website_esn', esn, TABLE_SESSION)\n+def regen_esn(esn):\n+ \"\"\"\n+ Regenerate the ESN on the basis of the existing one,\n+ to preserve possible user customizations,\n+ this method will only be executed every 20 hours.\n+ \"\"\"\n+ # From the beginning of December 2022 if you are using an ESN for more than about 20 hours\n+ # Netflix limits the resolution to 540p. The reasons behind this are unknown, there are no changes on website\n+ # or Android apps. Moreover, if you set the full-length ESN of android app on the add-on, also the original app\n+ # will be downgraded to 540p without any kind of message.\n+ if not G.LOCAL_DB.get_value('esn_auto_generate', True):\n+ return esn\n+ from resources.lib.common.device_utils import get_system_platform\n+ ts_now = int(time.time())\n+ ts_esn = G.LOCAL_DB.get_value('esn_timestamp', default_value=0)\n+ # When an ESN has been used for more than 20 hours ago, generate a new ESN\n+ if ts_esn == 0 or ts_now - ts_esn > 72000:\n+ if get_system_platform() == 'android':\n+ if esn[-1] == '-':\n+ # We have a partial ESN without last 64 chars, so generate and add the 64 chars\n+ esn += _create_id64chars()\n+ elif re.search(r'-[0-9]+-[A-Z0-9]{64}', esn):\n+ # Replace last 64 chars with the new generated one\n+ esn = esn[:-64] + _create_id64chars()\n+ else:\n+ LOG.warn('ESN format not recognized, will be reset with a new ESN')\n+ esn = generate_android_esn()\n+ else:\n+ esn = generate_esn(esn[:-30])\n+ set_esn(esn)\n+ G.LOCAL_DB.set_value('esn_timestamp', ts_now)\n+ LOG.debug('The ESN has been regenerated (540p workaround).')\n+ return esn\n+\n+\ndef generate_android_esn(wv_force_sec_lev=None):\n\"\"\"Generate an ESN if on android or return the one from user_data\"\"\"\nfrom resources.lib.common.device_utils import get_system_platform\n@@ -63,15 +99,25 @@ def generate_android_esn(wv_force_sec_lev=None):\nreturn None\n-def generate_esn(prefix=''):\n- \"\"\"Generate a random ESN\"\"\"\n- # For possibles prefixes see website, are based on browser user agent\n- import random\n- esn = prefix\n+def generate_esn(init_part=None):\n+ \"\"\"\n+ Generate a random ESN\n+ :param init_part: Specify the initial part to be used e.g. \"NFCDCH-02-\",\n+ if not set will be obtained from the last retrieved from the website\n+ :return: The generated ESN\n+ \"\"\"\n+ # The initial part of the ESN e.g. \"NFCDCH-02-\" depends on the web browser used and then the user agent,\n+ # refer to website to know all types available.\n+ if not init_part:\n+ esn_w_split = get_website_esn().split('-', 2)\n+ if len(esn_w_split) != 3:\n+ raise Exception('Cannot generate ESN due to unexpected website ESN')\n+ init_part = '-'.join(esn_w_split[:2]) + '-'\n+ esn = init_part\npossible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'\n+ from secrets import choice\nfor _ in range(0, 30):\n- esn += random.choice(possible)\n- LOG.debug('Generated random ESN: {}', esn)\n+ esn += choice(possible)\nreturn esn\n@@ -110,8 +156,9 @@ def _generate_esn_android(props, wv_force_sec_lev):\nmodel = model[:45].strip()\nprod = manufacturer + model\n- prod = sub(r'[^A-Za-z0-9=-]', '=', prod)\n- return 'NFANDROID1-PRV-' + device_category + sec_lev + prod + '-' + system_id + '-'\n+ prod = re.sub(r'[^A-Za-z0-9=-]', '=', prod)\n+\n+ return 'NFANDROID1-PRV-' + device_category + sec_lev + prod + '-' + system_id + '-' + _create_id64chars()\ndef _generate_esn_android_tv(props, wv_force_sec_lev):\n@@ -134,7 +181,7 @@ def _generate_esn_android_tv(props, wv_force_sec_lev):\nif not model_group:\nmodel_group = '0'\n- model_group = sub(r'[^A-Za-z0-9=-]', '=', model_group)\n+ model_group = re.sub(r'[^A-Za-z0-9=-]', '=', model_group)\nif len(manufacturer) < 5:\nmanufacturer += ' '\n@@ -142,10 +189,11 @@ def _generate_esn_android_tv(props, wv_force_sec_lev):\nmodel = model[:45].strip()\nprod = manufacturer + model\n- prod = sub(r'[^A-Za-z0-9=-]', '=', prod)\n+ prod = re.sub(r'[^A-Za-z0-9=-]', '=', prod)\n_, system_id = _get_drm_info(wv_force_sec_lev)\n- return 'NFANDROID2-PRV-' + model_group + '-' + prod + '-' + system_id + '-'\n+\n+ return 'NFANDROID2-PRV-' + model_group + '-' + prod + '-' + system_id + '-' + _create_id64chars()\ndef _get_drm_info(wv_force_sec_lev):\n@@ -192,3 +240,11 @@ def _get_android_system_props():\nexcept OSError:\nLOG.error('Cannot get \"getprop\" data due to system error.')\nreturn {}\n+\n+def _create_id64chars():\n+ # The Android full length ESN include to the end a hashed ID of 64 chars,\n+ # this value is created from the android app by using the Widevine \"deviceUniqueId\" property value\n+ # hashed in various ways, not knowing the correct formula, we create a random value.\n+ # Starting from 12/2022 this value is mandatory to obtain HD resolutions\n+ from secrets import token_hex\n+ return re.sub(r'[^A-Za-z0-9=-]', '=', token_hex(32).upper())\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/skins/default/1080i/plugin-video-netflix-ESN-Widevine.xml",
"new_path": "resources/skins/default/1080i/plugin-video-netflix-ESN-Widevine.xml",
"diff": "<control type=\"group\">\n<width>1520</width>\n- <height>490</height>\n+ <height>600</height>\n<!-- Window Background -->\n<control type=\"image\">\n<left>0</left>\n<left>10</left>\n<top>80</top>\n<width>1200</width>\n- <height>400</height>\n+ <height>510</height>\n<texture border=\"40\">buttons/dialogbutton-nofo.png</texture>\n<aspectratio>stretch</aspectratio>\n</control>\n<left>0</left>\n<top>0</top>\n<width>1200</width>\n- <height>400</height>\n+ <height>550</height>\n<defaultcontrol>30010</defaultcontrol>\n<visible>true</visible>\n<onright>10090</onright>\n<scroll>true</scroll>\n<label>-</label>\n<textcolor>FFFFFFFF</textcolor>\n+ <align>left</align>\n<aligny>top</aligny>\n<haspath>false</haspath>\n<font>font14</font>\n<wrapmultiline>false</wrapmultiline>\n</control>\n- <control type=\"button\" id=\"30010\">\n- <description>CHANGE ESN button</description>\n+ <control type=\"label\" id=\"10004\">\n+ <description>Warning to avoid use the original device ESN</description>\n<posy>200</posy>\n<posx>65</posx>\n<top>200</top>\n<left>65</left>\n+ <width>1000</width>\n+ <height>90</height>\n+ <visible>true</visible>\n+ <scroll>false</scroll>\n+ <label>$ADDON[plugin.video.netflix 30737]</label>\n+ <textcolor>red</textcolor>\n+ <align>left</align>\n+ <aligny>top</aligny>\n+ <haspath>false</haspath>\n+ <font>font10</font>\n+ <wrapmultiline>false</wrapmultiline>\n+ </control>\n+\n+ <control type=\"button\" id=\"30010\">\n+ <description>CHANGE ESN button</description>\n+ <posy>240</posy>\n+ <posx>65</posx>\n+ <top>240</top>\n+ <left>65</left>\n<width>300</width>\n<height>100</height>\n<label>$ADDON[plugin.video.netflix 30602]</label>\n<align>center</align>\n<aligny>center</aligny>\n<pulseonselect>no</pulseonselect>\n- <ondown>40000</ondown>\n+ <ondown>40100</ondown>\n<onright>30011</onright>\n</control>\n<control type=\"button\" id=\"30011\">\n<description>Reset button</description>\n- <posy>200</posy>\n+ <posy>240</posy>\n<posx>365</posx>\n- <top>200</top>\n+ <top>240</top>\n<left>365</left>\n<width>300</width>\n<height>100</height>\n<align>center</align>\n<aligny>center</aligny>\n<pulseonselect>no</pulseonselect>\n- <ondown>40000</ondown>\n+ <ondown>40100</ondown>\n<onleft>30010</onleft>\n<onright>30012</onright>\n</control>\n<control type=\"button\" id=\"30012\">\n<description>Save system info button</description>\n- <posy>200</posy>\n+ <posy>240</posy>\n<posx>665</posx>\n- <top>200</top>\n+ <top>240</top>\n<left>665</left>\n<width>300</width>\n<height>100</height>\n<align>center</align>\n<aligny>center</aligny>\n<pulseonselect>no</pulseonselect>\n- <ondown>40000</ondown>\n+ <ondown>40100</ondown>\n<onleft>30011</onleft>\n<onright>40020</onright>\n</control>\n+ <control type=\"radiobutton\" id=\"40100\">\n+ <description>Radiobutton to auto generate ESN's</description>\n+ <type>radiobutton</type>\n+ <left>65</left>\n+ <top>310</top>\n+ <width>920</width>\n+ <height>110</height>\n+ <visible>true</visible>\n+ <texturefocus>myfocustexture.png</texturefocus>\n+ <texturenofocus>mynormaltexture.png</texturenofocus>\n+ <textureradioonfocus colordiffuse=\"red\">buttons/radio-button-on.png</textureradioonfocus>\n+ <textureradioonnofocus>buttons/radio-button-on.png</textureradioonnofocus>\n+ <textureradioofffocus colordiffuse=\"red\">buttons/radio-button-off.png</textureradioofffocus>\n+ <textureradiooffnofocus>buttons/radio-button-off.png</textureradiooffnofocus>\n+ <label>$ADDON[plugin.video.netflix 30736]</label>\n+ <font>font12</font>\n+ <textcolor>FFFFFFFF</textcolor>\n+ <focusedcolor>red</focusedcolor>\n+ <disabledcolor>80FFFFFF</disabledcolor>\n+ <align>left</align>\n+ <aligny>center</aligny>\n+ <textoffsetx>4</textoffsetx>\n+ <textoffsety>5</textoffsety>\n+ <pulseonselect>false</pulseonselect>\n+ <onup>30010</onup>\n+ <ondown>40000</ondown>\n+ <onright>40020</onright>\n+ </control>\n+\n<control type=\"label\" id=\"10004\">\n<description>Widevine security level</description>\n- <posy>310</posy>\n+ <posy>430</posy>\n<posx>65</posx>\n- <top>310</top>\n+ <top>430</top>\n<left>65</left>\n<width>1000</width>\n<height>110</height>\n<description>Widevine force sec.lev. DISABLED</description>\n<type>radiobutton</type>\n<left>65</left>\n- <top>350</top>\n+ <top>470</top>\n<width>300</width>\n<height>110</height>\n<visible>true</visible>\n- <colordiffuse>red</colordiffuse>\n<texturefocus>myfocustexture.png</texturefocus>\n<texturenofocus>mynormaltexture.png</texturenofocus>\n<textureradioonfocus colordiffuse=\"red\">buttons/radio-button-on-sm.png</textureradioonfocus>\n- <textureradioonnofocus colordiffuse=\"red\">buttons/radio-button-on-sm.png</textureradioonnofocus>\n+ <textureradioonnofocus>buttons/radio-button-on-sm.png</textureradioonnofocus>\n<textureradioofffocus colordiffuse=\"red\">buttons/radio-button-off-sm.png</textureradioofffocus>\n- <textureradiooffnofocus colordiffuse=\"red\">buttons/radio-button-off-sm.png</textureradiooffnofocus>\n+ <textureradiooffnofocus>buttons/radio-button-off-sm.png</textureradiooffnofocus>\n<label>$LOCALIZE[13106]</label>\n<font>font12</font>\n<textcolor>FFFFFFFF</textcolor>\n<textoffsetx>4</textoffsetx>\n<textoffsety>5</textoffsety>\n<pulseonselect>false</pulseonselect>\n- <onup>30010</onup>\n+ <onup>40100</onup>\n<onright>40001</onright>\n</control>\n<control type=\"radiobutton\" id=\"40001\">\n<description>Widevine force sec.lev. L3</description>\n<type>radiobutton</type>\n<left>375</left>\n- <top>350</top>\n+ <top>470</top>\n<width>300</width>\n<height>110</height>\n<visible>true</visible>\n- <colordiffuse>red</colordiffuse>\n<texturefocus>myfocustexture.png</texturefocus>\n<texturenofocus>mynormaltexture.png</texturenofocus>\n<textureradioonfocus colordiffuse=\"red\">buttons/radio-button-on-sm.png</textureradioonfocus>\n- <textureradioonnofocus colordiffuse=\"red\">buttons/radio-button-on-sm.png</textureradioonnofocus>\n+ <textureradioonnofocus>buttons/radio-button-on-sm.png</textureradioonnofocus>\n<textureradioofffocus colordiffuse=\"red\">buttons/radio-button-off-sm.png</textureradioofffocus>\n- <textureradiooffnofocus colordiffuse=\"red\">buttons/radio-button-off-sm.png</textureradiooffnofocus>\n+ <textureradiooffnofocus>buttons/radio-button-off-sm.png</textureradiooffnofocus>\n<label/>\n<font>font12</font>\n<textcolor>FFFFFFFF</textcolor>\n<textoffsetx>4</textoffsetx>\n<textoffsety>5</textoffsety>\n<pulseonselect>false</pulseonselect>\n- <onup>30010</onup>\n+ <onup>40100</onup>\n<onleft>40000</onleft>\n<onright>40002</onright>\n</control>\n<description>Widevine force sec.lev. L3 (ID 4445)</description>\n<type>radiobutton</type>\n<left>685</left>\n- <top>350</top>\n+ <top>470</top>\n<width>300</width>\n<height>110</height>\n<visible>true</visible>\n- <colordiffuse>red</colordiffuse>\n<texturefocus>myfocustexture.png</texturefocus>\n<texturenofocus>mynormaltexture.png</texturenofocus>\n<textureradioonfocus colordiffuse=\"red\">buttons/radio-button-on-sm.png</textureradioonfocus>\n- <textureradioonnofocus colordiffuse=\"red\">buttons/radio-button-on-sm.png</textureradioonnofocus>\n+ <textureradioonnofocus>buttons/radio-button-on-sm.png</textureradioonnofocus>\n<textureradioofffocus colordiffuse=\"red\">buttons/radio-button-off-sm.png</textureradioofffocus>\n- <textureradiooffnofocus colordiffuse=\"red\">buttons/radio-button-off-sm.png</textureradiooffnofocus>\n+ <textureradiooffnofocus>buttons/radio-button-off-sm.png</textureradiooffnofocus>\n<label/>\n<font>font12</font>\n<textcolor>FFFFFFFF</textcolor>\n<textoffsetx>4</textoffsetx>\n<textoffsety>5</textoffsety>\n<pulseonselect>false</pulseonselect>\n- <onup>30010</onup>\n+ <onup>40100</onup>\n<onleft>40001</onleft>\n<onright>40020</onright>\n</control>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Auto generate ESN's |
106,046 | 16.12.2022 20:19:03 | -3,600 | 3dd52add98168d2b3c28ff65c3562a5a68674dcf | [cookies] fixed and commented flwssn cookie removal
the code did not work the cookie was not removed. The code has been fixed but removing this cookie as of today seems to produce any change | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/cookies.py",
"new_path": "resources/lib/utils/cookies.py",
"diff": "@@ -76,8 +76,10 @@ def load():\ntry:\ncookie_jar = pickle.loads(cookie_file.readBytes())\n# Clear flwssn cookie if present, as it is trouble with early expiration\n- if 'flwssn' in cookie_jar:\n- cookie_jar.clear(domain='.netflix.com', path='/', name='flwssn')\n+ # Commented: this seem not produce any change\n+ # for cookie in cookie_jar:\n+ # if cookie.name == 'flwssn':\n+ # cookie_jar.clear(cookie.domain, cookie.path, cookie.name)\nlog_cookie(cookie_jar)\nreturn cookie_jar\nexcept Exception as exc: # pylint: disable=broad-except\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | [cookies] fixed and commented flwssn cookie removal
the code did not work the cookie was not removed. The code has been fixed but removing this cookie as of today seems to produce any change |
106,046 | 16.12.2022 20:25:01 | -3,600 | da93cd7b3ad0c49fc1f30f9d3660d2d14dd1a27b | [cookies] Cleanup | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/session/cookie.py",
"new_path": "resources/lib/services/nfsession/session/cookie.py",
"diff": "@@ -34,7 +34,6 @@ class SessionCookie(SessionBase):\nLOG.error('Failed to load stored cookies: {}', type(exc).__name__)\nLOG.error(traceback.format_exc())\nreturn False\n- LOG.info('Successfully loaded stored cookies')\nreturn True\ndef _verify_session_cookies(self):\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/cookies.py",
"new_path": "resources/lib/utils/cookies.py",
"diff": "@@ -71,15 +71,15 @@ def load():\nif not xbmcvfs.exists(file_path):\nLOG.debug('Cookies file does not exist')\nraise MissingCookiesError\n- LOG.debug('Loading cookies from {}', file_path)\ncookie_file = xbmcvfs.File(file_path, 'rb')\ntry:\n- cookie_jar = pickle.loads(cookie_file.readBytes())\n+ cookie_jar: PickleableCookieJar = pickle.loads(cookie_file.readBytes())\n# Clear flwssn cookie if present, as it is trouble with early expiration\n# Commented: this seem not produce any change\n# for cookie in cookie_jar:\n# if cookie.name == 'flwssn':\n# cookie_jar.clear(cookie.domain, cookie.path, cookie.name)\n+ LOG.debug('Cookies loaded from file')\nlog_cookie(cookie_jar)\nreturn cookie_jar\nexcept Exception as exc: # pylint: disable=broad-except\n@@ -95,7 +95,7 @@ def log_cookie(cookie_jar):\n\"\"\"Print cookie info to the log\"\"\"\nif not LOG.is_enabled:\nreturn\n- debug_output = 'Cookies currently loaded:\\n'\n+ debug_output = 'Current cookies:\\n'\nfor cookie in cookie_jar:\nremaining_ttl = int((cookie.expires or 0) - time()) if cookie.expires else None\ndebug_output += f'{cookie.name} (expires ts {cookie.expires} - remaining TTL {remaining_ttl} sec)\\n'\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | [cookies] Cleanup |
106,046 | 16.12.2022 21:16:48 | -3,600 | d8073c1731bef8f0145830553849d1c645184b07 | New manifest changes | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/device_utils.py",
"new_path": "resources/lib/common/device_utils.py",
"diff": "@@ -125,7 +125,7 @@ def get_user_agent(enable_android_mediaflag_fix=False):\n# the Windows UA is not limited, so we can use it to get the right video media flags.\nsystem = 'windows'\n- chrome_version = 'Chrome/96.0.4664.77'\n+ chrome_version = 'Chrome/108.0.0.0'\nbase = 'Mozilla/5.0 '\nbase += '%PL% '\nbase += 'AppleWebKit/537.36 (KHTML, like Gecko) '\n@@ -139,10 +139,10 @@ def get_user_agent(enable_android_mediaflag_fix=False):\nmachine_arch = get_machine()\nif machine_arch.startswith('arm'):\n# Last number is the platform version of Chrome OS\n- return base.replace('%PL%', '(X11; CrOS armv7l 14324.33.0)')\n+ return base.replace('%PL%', '(X11; CrOS armv7l 15183.69.0)')\nif machine_arch.startswith('aarch'):\n# Last number is the platform version of Chrome OS\n- return base.replace('%PL%', '(X11; CrOS aarch64 14324.33.0)')\n+ return base.replace('%PL%', '(X11; CrOS aarch64 15183.69.0)')\n# x86 Linux\nreturn base.replace('%PL%', '(X11; Linux x86_64)')\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/converter.py",
"new_path": "resources/lib/services/nfsession/msl/converter.py",
"diff": "@@ -291,6 +291,10 @@ def _convert_text_track(text_track, period, default, cdn_index):\n'Representation', # Tag\nid=str(list(text_track['downloadableIds'].values())[0]),\nnflxProfile=content_profile)\n+ if 'urls' in downloadable[content_profile]:\n+ # The path change when \"useBetterTextUrls\" param is enabled on manifest\n+ _add_base_url(representation, downloadable[content_profile]['urls'][cdn_index]['url'])\n+ else:\n_add_base_url(representation, list(downloadable[content_profile]['downloadUrls'].values())[cdn_index])\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"new_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"diff": "@@ -233,6 +233,9 @@ class MSLHandler:\n'uiVersion': G.LOCAL_DB.get_value('ui_version', '', table=TABLE_SESSION),\n'uiPlatform': 'SHAKTI',\n'clientVersion': G.LOCAL_DB.get_value('client_version', '', table=TABLE_SESSION),\n+ 'platform': G.LOCAL_DB.get_value('browser_info_version', '', table=TABLE_SESSION),\n+ 'osVersion': G.LOCAL_DB.get_value('browser_info_os_version', '', table=TABLE_SESSION),\n+ 'osName': G.LOCAL_DB.get_value('browser_info_os_name', '', table=TABLE_SESSION),\n'supportsPreReleasePin': True,\n'supportsWatermark': True,\n'showAllSubDubTracks': False,\n@@ -256,6 +259,7 @@ class MSLHandler:\n'supportsPartialHydration': False,\n'contentPlaygraph': ['start'],\n'liveMetadataFormat': 'INDEXED_SEGMENT_TEMPLATE',\n+ 'useBetterTextUrls': True,\n'profileGroups': [{\n'name': 'default',\n'profiles': kwargs['profiles']\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/website.py",
"new_path": "resources/lib/utils/website.py",
"diff": "@@ -48,9 +48,9 @@ PAGE_ITEMS_API_URL = {\n'request_id': 'models/serverDefs/data/requestId',\n'asset_core': 'models/playerModel/data/config/core/assets/core',\n'ui_version': 'models/playerModel/data/config/ui/initParams/uiVersion',\n- 'browser_info_version': 'models/browserInfo/data/version',\n- 'browser_info_os_name': 'models/browserInfo/data/os/name',\n- 'browser_info_os_version': 'models/browserInfo/data/os/version',\n+ 'browser_info_version': 'models/playerModel/data/config/core/initParams/browserInfo/version',\n+ 'browser_info_os_name': 'models/playerModel/data/config/core/initParams/browserInfo/os/name',\n+ 'browser_info_os_version': 'models/playerModel/data/config/core/initParams/browserInfo/os/version',\n}\nPAGE_ITEM_ERROR_CODE = 'models/flow/data/fields/errorCode/value'\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | New manifest changes |
106,046 | 17.12.2022 14:04:31 | -3,600 | c77d90e0e2407817bf60796eb8b8d726c4ea36bf | Update timestamp when the ESN is set for first time | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/esn.py",
"new_path": "resources/lib/utils/esn.py",
"diff": "@@ -30,7 +30,7 @@ def get_esn():\ndef set_esn(esn=None):\n\"\"\"\nSet the ESN to be used\n- :param esn: if None the ESN will be generated or retrieved\n+ :param esn: if None the ESN will be generated or retrieved, and updated the ESN timestamp\n:return: The ESN set\n\"\"\"\nif not esn:\n@@ -38,6 +38,7 @@ def set_esn(esn=None):\nesn = generate_android_esn() or get_website_esn()\nif not esn:\nraise Exception('It was not possible to obtain an ESN')\n+ G.LOCAL_DB.set_value('esn_timestamp', int(time.time()))\nG.LOCAL_DB.set_value('esn', esn, TABLE_SESSION)\nreturn esn\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Update timestamp when the ESN is set for first time |
106,046 | 18.12.2022 10:00:51 | -3,600 | 972a9138edcefa70622f7722ad01925238b17cd7 | Version bump (1.20.3) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.20.2+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.20.3+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<email></email>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n- <news>\n-v1.20.2 (2022-11-12)\n-- Fixed 4k HDR\n-- Fixed missing plot\n-- Fix/workaround for error \"ReadError [Errno 11] Try again\"\n-- Fixed broken Clean cache menu\n-- Fix year/premiered date on NFO files.\n-Only the year is available, required optional full resync for existing files, on new files will be add by default.\n-- Update translations pl, it, de, hu, zh_tw\n+ <news>v1.20.3 (2022-12-17)\n+- IMPORTANT NOTICE: New changes to website is causing video quality to drop to 540p after about 20h,\n+this add-on update implements a workaround to fix this problem by changing ESNs every 20h.\n+If necessary, you can open \"Widevine / ESN settings\" on the Expert settings, to manually generate new ESN's\n+by selecting the \"Reset\" button, or you can also disable the 540p workaround.\n+- IMPORTANT NOTICE FOR ANDROID: Do NOT USE the ESN of the original app with the add-on, or will cause video quality drop\n+to 540p also on the original android app for an unknown period of time. This problem cannot be solved by the add-on,\n+there are no know solutions yet, so you can only report the 540p problem to customer service.\n+- FOR ANDROID, KNOWN SIDE EFFECTS: You will receive a notification that a new device has logged in every time ESN changes.\n+- Add new 540p workaround setting to \"Widevine / ESN settings\" on the Expert settings\n+- Supplemental plot info are now consistent in all use cases\n+- Fix a possible website JSON parsing problem on login/refresh session\n+- Fix \"hdrType\" TypeError (Kodi 20)\n+- Update translations hu, zh_cn, ro, it\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.20.3 (2022-12-17)\n+- IMPORTANT NOTICE: New changes to website is causing video quality to drop to 540p after about 20h,\n+this add-on update implements a workaround to fix this problem by changing ESNs every 20h.\n+If necessary, you can open \"Widevine / ESN settings\" on the Expert settings, to manually generate new ESN's\n+by selecting the \"Reset\" button, or you can also disable the 540p workaround.\n+- IMPORTANT NOTICE FOR ANDROID: Do NOT USE the ESN of the original app with the add-on, or will cause video quality drop\n+to 540p also on the original android app for an unknown period of time. This problem cannot be solved by the add-on,\n+there are no know solutions yet, so you can only report the 540p problem to customer service.\n+- FOR ANDROID, KNOWN SIDE EFFECTS: You will receive a notification that a new device has logged in every time ESN changes.\n+- Add new 540p workaround setting to \"Widevine / ESN settings\" on the Expert settings\n+- Supplemental plot info are now consistent in all use cases\n+- Fix a possible website JSON parsing problem on login/refresh session\n+- Fix \"hdrType\" TypeError (Kodi 20)\n+- Update translations hu, zh_cn, ro, it, de\n+\nv1.20.2 (2022-11-12)\n- Fixed 4k HDR\n- Fixed missing plot\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.20.3) (#1516) |
106,046 | 24.12.2022 10:51:53 | -3,600 | fdc5e9d66499b95168db06737eb79fb50c81c0ab | Do not reload msl data from file
This seems to be the cause of the Kodi crash on android
for some reason the wv crypto session become closed after RestoreKeys
and when crypto_session.Encrypt is called for the manifest req kodi crashes | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"new_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"diff": "@@ -22,8 +22,8 @@ from resources.lib.globals import G\nfrom resources.lib.services.nfsession.msl.msl_request_builder import MSLRequestBuilder\nfrom resources.lib.services.nfsession.msl.msl_utils import (ENDPOINTS, create_req_params, generate_logblobs_params,\n- MSL_DATA_FILENAME, MSL_AUTH_NETFLIXID,\n- MSL_AUTH_USER_ID_TOKEN, MSL_AUTH_EMAIL_PASSWORD)\n+ MSL_AUTH_NETFLIXID, MSL_AUTH_USER_ID_TOKEN,\n+ MSL_AUTH_EMAIL_PASSWORD)\nfrom resources.lib.utils.esn import get_esn\nfrom resources.lib.utils.logging import LOG, measure_exec_time_decorator\n@@ -105,10 +105,7 @@ class MSLRequests(MSLRequestBuilder):\nLOG.debug('MSL MasterToken is not available, a new key handshake will be performed')\nis_handshake_required = True\nif is_handshake_required:\n- if self.perform_key_handshake():\n- msl_data = json.loads(common.load_file_def(MSL_DATA_FILENAME))\n- self.crypto.load_msl_data(msl_data)\n- self.crypto.load_crypto_session(msl_data)\n+ self.perform_key_handshake()\ndef _get_user_auth_data(self):\n\"\"\"\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Do not reload msl data from file
This seems to be the cause of the Kodi crash on android
for some reason the wv crypto session become closed after RestoreKeys
and when crypto_session.Encrypt is called for the manifest req kodi crashes |
106,046 | 24.12.2022 10:46:13 | -3,600 | 24a80ceab20bc362254e2673f1702cf319ab6934 | Fix method return description | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_request_builder.py",
"new_path": "resources/lib/services/nfsession/msl/msl_request_builder.py",
"diff": "@@ -85,7 +85,7 @@ class MSLRequestBuilder:\ndef _headerdata(self, auth_data, esn=None, compression=None, is_handshake=False):\n\"\"\"\nFunction that generates a MSL header dict\n- :return: The base64 encoded JSON String of the header\n+ :return: The header JSON data as string\n\"\"\"\nself.current_message_id = self.rndm.randint(0, pow(2, 52))\nheader_data = {\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix method return description |
106,046 | 24.12.2022 10:46:45 | -3,600 | f513fc015feddce8c098b725d463aaf13917cea3 | Use secrets to generate init vector | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/android_crypto.py",
"new_path": "resources/lib/services/nfsession/msl/android_crypto.py",
"diff": "@@ -115,11 +115,13 @@ class AndroidMSLCrypto(MSLBaseCrypto):\n:param plaintext:\n:return: Serialized JSON String of the encryption Envelope\n\"\"\"\n- from os import urandom\n- init_vector = bytes(urandom(16))\n+ from secrets import token_bytes\n+ init_vector = token_bytes(16)\n+\n# Add PKCS5Padding\npad = 16 - len(plaintext) % 16\npadded_data = plaintext + ''.join([chr(pad)] * pad)\n+\nencrypted_data = self.crypto_session.Encrypt(self.key_id,\npadded_data.encode('utf-8'),\ninit_vector)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/default_crypto.py",
"new_path": "resources/lib/services/nfsession/msl/default_crypto.py",
"diff": "@@ -13,14 +13,12 @@ import json\ntry: # The crypto package depends on the library installed (see Wiki)\n- from Cryptodome.Random import get_random_bytes\nfrom Cryptodome.Hash import HMAC, SHA256\nfrom Cryptodome.Cipher import PKCS1_OAEP\nfrom Cryptodome.PublicKey import RSA\nfrom Cryptodome.Util import Padding\nfrom Cryptodome.Cipher import AES\nexcept ImportError:\n- from Crypto.Random import get_random_bytes\nfrom Crypto.Hash import HMAC, SHA256\nfrom Crypto.Cipher import PKCS1_OAEP\nfrom Crypto.PublicKey import RSA\n@@ -74,10 +72,13 @@ class DefaultMSLCrypto(MSLBaseCrypto):\n:param plaintext:\n:return: Serialized JSON String of the encryption Envelope\n\"\"\"\n- init_vector = get_random_bytes(16)\n+ from secrets import token_bytes\n+ init_vector = token_bytes(16)\n+\ncipher = AES.new(self.encryption_key, AES.MODE_CBC, init_vector)\nciphertext = base64.standard_b64encode(\ncipher.encrypt(Padding.pad(plaintext.encode('utf-8'), 16))).decode('utf-8')\n+\nencryption_envelope = {\n'ciphertext': ciphertext,\n'keyid': '_'.join((esn, str(self.sequence_number))),\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Use secrets to generate init vector |
106,046 | 28.12.2022 18:28:08 | -3,600 | 3b854d356996f27e34f1c2a7efac613e3162bb36 | Fixes to menu settings conditions
On kodi v19.5 has not been added the resume fix
so we kept the workaround enabled for all v19 | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/player.py",
"new_path": "resources/lib/navigation/player.py",
"diff": "@@ -165,8 +165,8 @@ def _profile_switch():\ndef _strm_resume_workaroud(is_played_from_strm, videoid):\n- \"\"\"Workaround for resuming STRM files from library, for Kodi versions below 19.5\"\"\"\n- if G.KODI_VERSION > '19.4':\n+ \"\"\"Workaround for resuming STRM files from library, for Kodi v19\"\"\"\n+ if G.KODI_VERSION >= '20':\nreturn None\nif not is_played_from_strm or not G.ADDON.getSettingBool('ResumeManager_enabled'):\nreturn None\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "</group>\n<!--GROUP: Library-->\n<group id=\"2\" label=\"30049\">\n- <setting id=\"ResumeManager_enabled\" type=\"boolean\" label=\"30176\" help=\"\"><!-- Needed only to Kodi versions below 19.5 -->\n+ <setting id=\"ResumeManager_enabled\" type=\"boolean\" label=\"30176\" help=\"\"><!-- Needed only to Kodi v19 -->\n<level>0</level>\n<default>true</default>\n<control type=\"toggle\"/>\n<dependencies>\n<dependency type=\"visible\">\n<and>\n- <condition on=\"property\" operator=\"!is\" name=\"InfoBool\">String.StartsWith(System.BuildVersionCode,19.5)</condition>\n<condition on=\"property\" operator=\"!is\" name=\"InfoBool\">String.StartsWith(System.BuildVersionCode,19.9)</condition> <!-- v20 pre-releases -->\n<condition on=\"property\" operator=\"!is\" name=\"InfoBool\">Integer.IsGreaterOrEqual(System.BuildVersionCode,20)</condition>\n</and>\n<default>false</default>\n<control type=\"toggle\"/>\n<dependencies>\n- <dependency type=\"visible\" setting=\"ResumeManager_enabled\">true</dependency>\n+ <dependency type=\"visible\">\n+ <and>\n+ <condition on=\"property\" operator=\"!is\" name=\"InfoBool\">String.StartsWith(System.BuildVersionCode,19.9)</condition> <!-- v20 pre-releases -->\n+ <condition on=\"property\" operator=\"!is\" name=\"InfoBool\">Integer.IsGreaterOrEqual(System.BuildVersionCode,20)</condition>\n+ </and>\n+ </dependency>\n+ <dependency type=\"enable\" setting=\"ResumeManager_enabled\">true</dependency>\n</dependencies>\n</setting>\n</group>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fixes to menu settings conditions
On kodi v19.5 has not been added the resume fix
so we kept the workaround enabled for all v19 |
106,046 | 29.12.2022 11:32:07 | -3,600 | fca21c1b57ea22913059dca201ce6f312f6a83d0 | Fix for skin mediaflags wrong info on episodes | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/infolabels.py",
"new_path": "resources/lib/kodi/infolabels.py",
"diff": "@@ -168,7 +168,13 @@ def parse_info(videoid, item, raw_data, common_data):\ninfos.update(_parse_referenced_infos(item, raw_data))\ninfos.update(_parse_tags(item))\n- return infos, get_quality_infos(item, common_data.get('video_codec_hint', get_video_codec_hint()))\n+ if videoid.mediatype == common.VideoId.EPISODE:\n+ # 01/12/2022: The 'delivery' info in the episode data are wrong (e.g. wrong resolution)\n+ # as workaround we get the 'delivery' info from tvshow data\n+ delivery_info = raw_data['videos'][videoid.tvshowid]['delivery'].get('value', '')\n+ else:\n+ delivery_info = item.get('delivery', {}).get('value')\n+ return infos, get_quality_infos(delivery_info, common_data.get('video_codec_hint', get_video_codec_hint()))\ndef _parse_atomic_infos(item):\n@@ -207,10 +213,9 @@ def _parse_tags(item):\nif isinstance(tagdef.get('name', {}), str)]}\n-def get_quality_infos(item, video_codec_hint):\n+def get_quality_infos(delivery, video_codec_hint):\n\"\"\"Return audio and video quality infolabels\"\"\"\nquality_infos = {}\n- delivery = item.get('delivery', {}).get('value')\nif delivery:\nif delivery.get('hasUltraHD', False): # 4k only with HEVC codec\nquality_infos['video'] = {'codec': 'hevc', 'width': 3840, 'height': 2160}\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/directorybuilder/dir_path_requests.py",
"new_path": "resources/lib/services/nfsession/directorybuilder/dir_path_requests.py",
"diff": "@@ -131,7 +131,7 @@ class DirectoryPathRequests:\npaths = ([['seasons', videoid.seasonid, 'summary']] +\n[['seasons', videoid.seasonid, 'componentSummary']] +\nbuild_paths(['seasons', videoid.seasonid, 'episodes', RANGE_PLACEHOLDER], EPISODES_PARTIAL_PATHS) +\n- build_paths(['videos', videoid.tvshowid], ART_PARTIAL_PATHS + [['title']]))\n+ build_paths(['videos', videoid.tvshowid], ART_PARTIAL_PATHS + [[['title', 'delivery']]]))\ncall_args = {\n'paths': paths,\n'length_params': ['stdlist_wid', ['seasons', videoid.seasonid, 'episodes']],\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix for skin mediaflags wrong info on episodes |
106,046 | 28.12.2022 20:15:57 | -3,600 | 090bf5b2d89b3d1779c2629b201df8f572074fb4 | Add audio offset setting (Kodi 21) | [
{
"change_type": "MODIFY",
"old_path": "resources/language/resource.language.en_gb/strings.po",
"new_path": "resources/language/resource.language.en_gb/strings.po",
"diff": "@@ -1233,3 +1233,15 @@ msgstr \"\"\nmsgctxt \"#30737\"\nmsgid \"WARNING: Do not use the original device ESN of the official app.\"\nmsgstr \"\"\n+\n+msgctxt \"#30738\"\n+msgid \"Enable audio offset\"\n+msgstr \"\"\n+\n+msgctxt \"#30739\"\n+msgid \"Audio offset\"\n+msgstr \"\"\n+\n+msgctxt \"#30740\"\n+msgid \"Sets the audio offset by overriding the Kodi setting\"\n+msgstr \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/playback/action_controller.py",
"new_path": "resources/lib/services/playback/action_controller.py",
"diff": "@@ -213,6 +213,7 @@ class ActionController(xbmc.Monitor):\nLOG.warn('_get_player_state: {}', exc)\nreturn {}\n+ player_state['playerid'] = self.active_player_id if player_id is None else player_id\n# convert time dict to elapsed seconds\nplayer_state['elapsed_seconds'] = (player_state['time']['hours'] * 3600 +\nplayer_state['time']['minutes'] * 60 +\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/playback/am_playback.py",
"new_path": "resources/lib/services/playback/am_playback.py",
"diff": "@@ -48,6 +48,11 @@ class AMPlayback(ActionManager):\nself.watched_threshold = data['metadata'][0]['creditsOffset'] - lower_value\ndef on_playback_started(self, player_state):\n+ self._set_black_bar_minimizer(player_state)\n+ self._set_audio_offset(player_state)\n+ self._set_strm_resume_workaround()\n+\n+ def _set_black_bar_minimizer(self, player_state):\n# The black bar minimizer zoom the video to show the same height of black bars for all cropped videos,\n# so this calculation takes into account the different black band heights between various videos.\n# NOTE: Kodi save viewmode permanently\n@@ -71,9 +76,22 @@ class AMPlayback(ActionManager):\ncommon.json_rpc('Player.SetViewMode', {'viewmode': {'zoom': zoom_factor}})\nelif G.ADDON.getSettingBool('blackbars_minimizer_restore'):\ncommon.json_rpc('Player.SetViewMode', {'viewmode': 'normal'})\n- if self.resume_position:\n- # Due to a bug on Kodi the resume on STRM files not works correctly,\n+\n+ def _set_audio_offset(self, player_state):\n+ if not G.ADDON.getSettingBool('audio_offset_enabled') or G.KODI_VERSION < 21:\n+ return\n+ current_offset = common.json_rpc('Player.GetAudioDelay')['offset']\n+ target_offset = G.ADDON.getSettingNumber('audio_offset')\n+ if current_offset != target_offset:\n+ ret = common.json_rpc('Player.SetAudioDelay', {'playerid': player_state['playerid'],\n+ 'offset': target_offset})\n+ LOG.debug('Audio offset has been set to {}s (player value {}s)', target_offset, ret['offset'])\n+\n+ def _set_strm_resume_workaround(self):\n+ # Due to a bug on Kodi (until to v19) the resume on STRM files not works correctly,\n# so we force the skip to the resume point\n+ if not self.resume_position:\n+ return\nLOG.info('AMPlayback has forced resume point to {}', self.resume_position)\nxbmc.Player().seekTime(int(self.resume_position))\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "</dependency>\n</dependencies>\n</setting>\n+ <setting id=\"audio_offset_enabled\" type=\"boolean\" label=\"30738\" help=\"\">\n+ <level>0</level>\n+ <default>false</default>\n+ <control type=\"toggle\"/>\n+ <dependencies>\n+ <dependency type=\"visible\">\n+ <or>\n+ <condition on=\"property\" operator=\"is\" name=\"InfoBool\">String.StartsWith(System.BuildVersionCode,20.9)</condition> <!-- v21 pre-releases -->\n+ <condition on=\"property\" operator=\"is\" name=\"InfoBool\">Integer.IsGreaterOrEqual(System.BuildVersionCode,21)</condition>\n+ </or>\n+ </dependency>\n+ </dependencies>\n+ </setting>\n+ <setting id=\"audio_offset\" type=\"number\" label=\"30739\" help=\"30740\" parent=\"audio_offset_enabled\">\n+ <level>0</level>\n+ <default>0</default>\n+ <constraints>\n+ <minimum>-10</minimum>\n+ <step>0.025</step>\n+ <maximum>10</maximum>\n+ </constraints>\n+ <control type=\"slider\" format=\"percentage\">\n+ <format>{:.3f}s</format>\n+ </control>\n+ <dependencies>\n+ <dependency type=\"visible\">\n+ <or>\n+ <condition on=\"property\" operator=\"is\" name=\"InfoBool\">String.StartsWith(System.BuildVersionCode,20.9)</condition> <!-- v21 pre-releases -->\n+ <condition on=\"property\" operator=\"is\" name=\"InfoBool\">Integer.IsGreaterOrEqual(System.BuildVersionCode,21)</condition>\n+ </or>\n+ </dependency>\n+ <dependency type=\"visible\" setting=\"audio_offset_enabled\">true</dependency>\n+ </dependencies>\n+ </setting>\n</group>\n<!--GROUP: Library-->\n<group id=\"2\" label=\"30049\">\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add audio offset setting (Kodi 21) |
106,046 | 12.01.2023 15:43:42 | -3,600 | 2ac70df96aea1119743937a1ed07afb6de9f4698 | Try improving sqlite set_value with a single query | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/database/db_base_sqlite.py",
"new_path": "resources/lib/database/db_base_sqlite.py",
"diff": "@@ -215,12 +215,15 @@ class SQLiteDatabase(db_base.BaseDatabase):\ntable_name = table[0]\ntable_columns = table[1]\n# Update or insert approach, if there is no updated row then insert new one (no id changes)\n- update_query = f'UPDATE {table_name} SET {table_columns[1]} = ? WHERE {table_columns[0]} = ?'\n+ if common.CmpVersion(sql.sqlite_version) < '3.24.0':\n+ query = f'INSERT OR REPLACE INTO {table_name} ({table_columns[0]}, {table_columns[1]}) VALUES (?, ?)'\n+ else:\n+ # sqlite UPSERT clause exists only on sqlite >= 3.24.0\n+ query = (f'INSERT INTO {table_name} ({table_columns[0]}, {table_columns[1]}) VALUES (?, ?) '\n+ f'ON CONFLICT({table_columns[0]}) DO UPDATE SET {table_columns[1]} = ? '\n+ f'WHERE {table_columns[0]} = ?')\nvalue = common.convert_to_string(value)\n- cur = self._execute_query(update_query, (value, key))\n- if cur.rowcount == 0:\n- insert_query = f'INSERT INTO {table_name} ({table_columns[0]}, {table_columns[1]}) VALUES (?, ?)'\n- self._execute_non_query(insert_query, (key, value))\n+ self._execute_non_query(query, (key, value, value, key))\n@handle_connection\ndef set_values(self, dict_values, table=db_utils.TABLE_APP_CONF):\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Try improving sqlite set_value with a single query |
106,046 | 12.01.2023 15:45:10 | -3,600 | f6766506ae5523e18c2d92b529922b5309f2c203 | Allow logout also when not logged | [
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<group id=\"2\" label=\"30014\">\n<setting id=\"logout\" type=\"action\" label=\"30017\">\n<level>0</level>\n- <data>RunPlugin(plugin://$ID/action/logout/)</data>\n+ <data>RunPlugin(plugin://$ID/action/logout/?ignore_login=True)</data>\n<control type=\"button\" format=\"action\">\n- <close>false</close>\n+ <close>true</close>\n</control>\n</setting>\n<setting id=\"profile_options_info\" type=\"action\" label=\"30012\">\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Allow logout also when not logged |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.