Skip to content

Commit

Permalink
Merge pull request #79 from anxdpanic/nexus
Browse files Browse the repository at this point in the history
v2.0.0
  • Loading branch information
anxdpanic authored Feb 26, 2023
2 parents 5a98b31 + 4e08249 commit 40622aa
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 38 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/addon-validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
10 changes: 5 additions & 5 deletions .github/workflows/submit-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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
Expand Down
15 changes: 0 additions & 15 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
7 changes: 3 additions & 4 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.module.tubed.api" name="Tubed API" version="1.0.12" provider-name="anxdpanic">
<addon id="script.module.tubed.api" name="Tubed API" version="2.0.0" provider-name="anxdpanic">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="script.module.requests" version="2.12.4"/>
</requires>
<extension point="xbmc.python.module" library="resources/lib/src/"/>
<extension point="xbmc.service" library="resources/lib/service.py"/>
<extension point="xbmc.addon.metadata">
<news>
- fixup for age-gated material
- fixup issue with mpd generation
- removed support for Kodi Matrix v19
</news>
<assets>
<icon>resources/media/icon.png</icon>
Expand Down
3 changes: 2 additions & 1 deletion resources/lib/src/httpd/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion resources/lib/src/httpd/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')))

Expand Down
2 changes: 1 addition & 1 deletion resources/lib/src/tubed_api/oauth/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
3 changes: 2 additions & 1 deletion resources/lib/src/tubed_api/usher/lib/video_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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') == \
Expand Down

0 comments on commit 40622aa

Please sign in to comment.