From 6eb9ceb6508601fe463a08891415b7a00801b770 Mon Sep 17 00:00:00 2001 From: anxdpanic Date: Sun, 26 Feb 2023 13:08:44 -0500 Subject: [PATCH 1/2] linting --- .pylintrc | 15 --------------- resources/lib/src/httpd/daemon.py | 3 ++- resources/lib/src/httpd/handler.py | 4 +++- resources/lib/src/tubed_api/oauth/client.py | 2 +- .../lib/src/tubed_api/usher/lib/video_info.py | 3 ++- 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/.pylintrc b/.pylintrc index 1bd25c4..63ebe12 100644 --- a/.pylintrc +++ b/.pylintrc @@ -240,13 +240,6 @@ max-line-length=100 # Maximum number of lines in a module. max-module-lines=2000 -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma, - dict-separator - # Allow the body of a class to be on the same line as the declaration if body # contains single statement. single-line-class-stmt=no @@ -497,11 +490,3 @@ known-third-party=enchant # Couples of modules and preferred modules, separated by a comma. preferred-modules= - - -[EXCEPTIONS] - -# Exceptions that will emit a warning when being caught. Defaults to -# "BaseException, Exception". -overgeneral-exceptions=BaseException, - Exception diff --git a/resources/lib/src/httpd/daemon.py b/resources/lib/src/httpd/daemon.py index 3419279..295fac0 100644 --- a/resources/lib/src/httpd/daemon.py +++ b/resources/lib/src/httpd/daemon.py @@ -79,7 +79,8 @@ def shutdown(self): def ping(self): try: response = requests.get('http://{address}:{port}/ping' - .format(address=self.address, port=self.port)) + .format(address=self.address, port=self.port), + timeout=60) return response.status_code == 204 finally: diff --git a/resources/lib/src/httpd/handler.py b/resources/lib/src/httpd/handler.py index 799e149..0da3b8d 100644 --- a/resources/lib/src/httpd/handler.py +++ b/resources/lib/src/httpd/handler.py @@ -146,7 +146,9 @@ def do_POST(self): # pylint: disable=invalid-name 'Authorization': 'Bearer %s' % token } - response = requests.post(url=url, headers=headers, data=data, stream=True) + response = requests.post(url=url, headers=headers, + data=data, stream=True, + timeout=60) content = response.raw.read(int(response.headers.get('content-length'))) diff --git a/resources/lib/src/tubed_api/oauth/client.py b/resources/lib/src/tubed_api/oauth/client.py index f7810df..9689960 100644 --- a/resources/lib/src/tubed_api/oauth/client.py +++ b/resources/lib/src/tubed_api/oauth/client.py @@ -204,7 +204,7 @@ def revoke_token(self, token): @staticmethod def _post(url, data, headers): - response = requests.post(url, data=data, headers=headers) + response = requests.post(url, data=data, headers=headers, timeout=60) response.encoding = 'utf-8' diff --git a/resources/lib/src/tubed_api/usher/lib/video_info.py b/resources/lib/src/tubed_api/usher/lib/video_info.py index 45cc4b1..6a1972a 100644 --- a/resources/lib/src/tubed_api/usher/lib/video_info.py +++ b/resources/lib/src/tubed_api/usher/lib/video_info.py @@ -213,7 +213,8 @@ def get_video(self, video_id, quality=None): # pylint: disable=too-many-locals, try: response_payload = requests.post(video_info_url, params=params, json=payload, headers=headers, - cookies=None, allow_redirects=True) + cookies=None, allow_redirects=True, + timeout=60) response_payload.raise_for_status() player_response = response_payload.json() if player_response.get('playabilityStatus', {}).get('status', 'OK') == \ From 4e082496aa3fc27b678078088c92e70c342782dd Mon Sep 17 00:00:00 2001 From: anxdpanic Date: Sun, 26 Feb 2023 12:59:56 -0500 Subject: [PATCH 2/2] v2.0.0 --- .github/workflows/addon-validations.yml | 6 +++--- .github/workflows/make-release.yml | 15 ++++++++------- .github/workflows/submit-release.yml | 10 +++++----- addon.xml | 7 +++---- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/addon-validations.yml b/.github/workflows/addon-validations.yml index 745596b..57cf78e 100644 --- a/.github/workflows/addon-validations.yml +++ b/.github/workflows/addon-validations.yml @@ -17,12 +17,12 @@ jobs: steps: - name: Set up Python v3.9 - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: '3.9' - name: Checkout Add-on - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: ${{ github.event.repository.name }} @@ -44,7 +44,7 @@ jobs: - name: Kodi Add-on Checker id: kodi-addon-checker run: | - kodi-addon-checker ${{ github.event.repository.name }} --branch=matrix + kodi-addon-checker ${{ github.event.repository.name }} --branch=nexus - name: Pylint id: pylint diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml index 52649e5..8b9c611 100644 --- a/.github/workflows/make-release.yml +++ b/.github/workflows/make-release.yml @@ -26,12 +26,13 @@ jobs: fi - name: Checkout Add-on - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: ${{ github.event.repository.name }} - name: Install dependencies run: | + sudo apt-get update sudo apt-get install libxml2-utils xmlstarlet zip - name: Get Changelog @@ -51,8 +52,8 @@ jobs: rm *.md working-directory: ${{ github.event.repository.name }} - - name: Create Zip (Matrix) - id: zip-matrix + - name: Create Zip (Nexus) + id: zip-nexus run: | version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml) filename=${{ github.event.repository.name }}-${version}.zip @@ -73,13 +74,13 @@ jobs: draft: false prerelease: ${{ steps.release.outputs.pre-release }} - - name: Upload Zip (Matrix) - id: upload-matrix + - name: Upload Zip (Nexus) + id: upload-nexus uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_name: ${{ steps.zip-matrix.outputs.filename }} - asset_path: ${{ steps.zip-matrix.outputs.filename }} + asset_name: ${{ steps.zip-nexus.outputs.filename }} + asset_path: ${{ steps.zip-nexus.outputs.filename }} asset_content_type: application/zip diff --git a/.github/workflows/submit-release.yml b/.github/workflows/submit-release.yml index 98a6bba..38d21de 100644 --- a/.github/workflows/submit-release.yml +++ b/.github/workflows/submit-release.yml @@ -19,12 +19,12 @@ jobs: steps: - name: Checkout Add-on - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: ${{ github.event.repository.name }} - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} @@ -48,10 +48,10 @@ jobs: git commit -m "Remove unwanted files" working-directory: ${{ github.event.repository.name }} - - name: Submit to Official Repository (Matrix) - id: submit-matrix + - name: Submit to Official Repository (Nexus) + id: submit-nexus run: | - submit-addon -r repo-scripts -b matrix --pull-request ${{ github.event.repository.name }} + submit-addon -r repo-scripts -b nexus --pull-request ${{ github.event.repository.name }} working-directory: ${{ github.event.repository.name }} env: GH_USERNAME: anxdpanic diff --git a/addon.xml b/addon.xml index 679d1e5..0e886b4 100644 --- a/addon.xml +++ b/addon.xml @@ -1,15 +1,14 @@ - + - + -- fixup for age-gated material -- fixup issue with mpd generation +- removed support for Kodi Matrix v19 resources/media/icon.png