From 21930067a317db562d7c8d9314ac10e16f8bc04e Mon Sep 17 00:00:00 2001 From: newt-sc <47229722+newt-sc@users.noreply.github.com> Date: Thu, 24 Dec 2020 06:51:32 +0200 Subject: [PATCH] release: v1.8.0 --- .github/workflows/ci.yml | 2 - .github/workflows/cron-tests-subdb.yml | 31 --------- CHANGELOG.md | 4 ++ README.md | 3 +- a4kSubtitles/services/__init__.py | 1 - a4kSubtitles/services/subdb.py | 63 ------------------- addon.xml | 8 ++- main_service.py | 2 - packages/addons.xml | 8 ++- packages/addons.xml.crc | 2 +- .../resource.language.en_gb/strings.po | 4 -- resources/settings.xml | 1 - tests/test_suite.py | 48 -------------- 13 files changed, 18 insertions(+), 159 deletions(-) delete mode 100644 .github/workflows/cron-tests-subdb.yml delete mode 100644 a4kSubtitles/services/subdb.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0d53e8..1cc5258 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,6 @@ name: CI on: - push: - branches: [ master ] pull_request: branches: [ master ] workflow_dispatch: ~ diff --git a/.github/workflows/cron-tests-subdb.yml b/.github/workflows/cron-tests-subdb.yml deleted file mode 100644 index e5ff2e8..0000000 --- a/.github/workflows/cron-tests-subdb.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Subdb -on: - push: - branches: - - master - paths: - - '.github/workflows/cron-tests-subdb.yml' - schedule: - - cron: '0 7 * * *' - workflow_dispatch: ~ - -jobs: - tests: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: setup-python - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: install - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements.txt - - - name: test - run: | - pytest -v -k 'test_subdb' ./tests/test_suite.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a6ee8e..ef35d84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +* [v1.8.0](https://github.com/newt-sc/a4kSubtitles/releases/tag/service.subtitles.a4ksubtitles%2Fservice.subtitles.a4ksubtitles-1.8.0): + * Remove SubDb (Site is down) + * Make lib vfs optional since there are fallbacks and it is used as last case scenario. Thus making the addon installable on platforms which are not supported by lib vfs. + * [v1.7.2](https://github.com/newt-sc/a4kSubtitles/releases/tag/service.subtitles.a4ksubtitles%2Fservice.subtitles.a4ksubtitles-1.7.2): * Improve results sort based on title match diff --git a/README.md b/README.md index 0a01a22..de74713 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ### General Status ![general-service](https://github.com/a4k-openproject/a4kSubtitles/workflows/Service/badge.svg) ![general-api](https://github.com/a4k-openproject/a4kSubtitles/workflows/API/badge.svg) ![general-search](https://github.com/a4k-openproject/a4kSubtitles/workflows/Search/badge.svg) ![general-tvshow](https://github.com/a4k-openproject/a4kSubtitles/workflows/TVShow/badge.svg) ### Providers Status -![addic7ed](https://github.com/a4k-openproject/a4kSubtitles/workflows/Addic7ed/badge.svg) ![bsplayer](https://github.com/a4k-openproject/a4kSubtitles/workflows/BSPlayer/badge.svg) ![opensubtitles](https://github.com/a4k-openproject/a4kSubtitles/workflows/OpenSubtitles/badge.svg) ![podnadpisi](https://github.com/a4k-openproject/a4kSubtitles/workflows/Podnadpisi.NET/badge.svg) ![subdb](https://github.com/a4k-openproject/a4kSubtitles/workflows/Subdb/badge.svg) ![subscene](https://github.com/a4k-openproject/a4kSubtitles/workflows/Subscene/badge.svg) +![addic7ed](https://github.com/a4k-openproject/a4kSubtitles/workflows/Addic7ed/badge.svg) ![bsplayer](https://github.com/a4k-openproject/a4kSubtitles/workflows/BSPlayer/badge.svg) ![opensubtitles](https://github.com/a4k-openproject/a4kSubtitles/workflows/OpenSubtitles/badge.svg) ![podnadpisi](https://github.com/a4k-openproject/a4kSubtitles/workflows/Podnadpisi.NET/badge.svg) ![subscene](https://github.com/a4k-openproject/a4kSubtitles/workflows/Subscene/badge.svg) ## Description @@ -15,7 +15,6 @@ Subtitle addon for KODI with support for multiple subtitle services: * BSPlayer * OpenSubtitles * Podnadpisi.NET -* SubDB * Subscene ## Configuration diff --git a/a4kSubtitles/services/__init__.py b/a4kSubtitles/services/__init__.py index e50ada5..04c5618 100644 --- a/a4kSubtitles/services/__init__.py +++ b/a4kSubtitles/services/__init__.py @@ -9,7 +9,6 @@ 'bsplayer': 'BSPlayer', 'opensubtitles': 'OpenSubtitles', 'podnadpisi': 'Podnadpisi', - 'subdb': 'SubDB', 'subscene': 'Subscene', } diff --git a/a4kSubtitles/services/subdb.py b/a4kSubtitles/services/subdb.py deleted file mode 100644 index 062ee97..0000000 --- a/a4kSubtitles/services/subdb.py +++ /dev/null @@ -1,63 +0,0 @@ -# -*- coding: utf-8 -*- - -__url = 'http://api.thesubdb.com?action={action}&hash={hash}' -__user_agent = 'SubDB/1.0 (a4kSubtitles/{version}; https://github.com/a4k-openproject/a4kSubtitles)' - -def build_search_requests(core, service_name, meta): - if meta.subdb_hash == '': - return [] - - request = { - 'method': 'GET', - 'url': __url.format(action='search', hash=meta.subdb_hash), - 'headers': { - 'User-Agent': __user_agent.format(version=core.kodi.addon_version) - } - } - - return [request] - -def parse_search_response(core, service_name, meta, response): - service = core.services[service_name] - - lang_ids = core.utils.get_lang_ids(meta.languages, core.kodi.xbmc.ISO_639_1) - name = '%s.srt' % meta.filename_without_ext - results = [] - - lang_codes = response.text.split(',') - for lang_code in lang_codes: - if lang_code in lang_ids: - lang = meta.languages[lang_ids.index(lang_code)] - - results.append({ - 'service_name': service_name, - 'service': service.display_name, - 'lang': lang, - 'name': name, - 'rating': 0, - 'lang_code': lang_code, - 'sync': 'true', - 'impaired': 'false', - 'color': 'cyan', - 'action_args': { - 'url': '', - 'hash': meta.subdb_hash, - 'lang': lang, - 'filename': name, - 'raw': True - } - }) - - return results - -def build_download_request(core, service_name, args): - lang_code = core.kodi.xbmc.convertLanguage(args['lang'], core.kodi.xbmc.ISO_639_1) - request = { - 'method': 'GET', - 'url': __url.format(action='download', hash=args['hash']) + ('&language=%s' % lang_code), - 'headers': { - 'User-Agent': __user_agent.format(version=core.kodi.addon_version) - } - } - - return request diff --git a/addon.xml b/addon.xml index fecf5c6..d725dfb 100644 --- a/addon.xml +++ b/addon.xml @@ -1,11 +1,11 @@ - + @@ -27,6 +27,10 @@ Supports: OpenSubtitles, BSPlayer, Podnadpisi.NET, SubDB, Subscene, Addic7ed screenshot-03.png +[v1.8.0]: + * Remove SubDb (Site is down) + * Make lib vfs optional since there are fallbacks and it is used as last case scenario. Thus making the addon installable on platforms which are not supported by lib vfs. + [v1.7.2]: * Improve results sort based on title match diff --git a/main_service.py b/main_service.py index 7e4127c..e84a541 100644 --- a/main_service.py +++ b/main_service.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- -import os -import importlib from a4kSubtitles import api, service if __name__ == '__main__': diff --git a/packages/addons.xml b/packages/addons.xml index ca6fcd8..f0b504d 100644 --- a/packages/addons.xml +++ b/packages/addons.xml @@ -4,11 +4,11 @@ - + @@ -30,6 +30,10 @@ Supports: OpenSubtitles, BSPlayer, Podnadpisi.NET, SubDB, Subscene, Addic7ed screenshot-03.png +[v1.8.0]: + * Remove SubDb (Site is down) + * Make lib vfs optional since there are fallbacks and it is used as last case scenario. Thus making the addon installable on platforms which are not supported by lib vfs. + [v1.7.2]: * Improve results sort based on title match diff --git a/packages/addons.xml.crc b/packages/addons.xml.crc index ca356e5..bba8e47 100644 --- a/packages/addons.xml.crc +++ b/packages/addons.xml.crc @@ -1 +1 @@ -35e4b34b1943a8d1fd3c23db47d36a52ca064b7f \ No newline at end of file +bde01dcf6a9f3cc4714b9b86735740ce03d7ec73 \ No newline at end of file diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 1037315..e9651ee 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -49,10 +49,6 @@ msgctxt "#33203" msgid "Podnadpisi" msgstr "" -msgctxt "#33204" -msgid "SubDB" -msgstr "" - msgctxt "#33205" msgid "Subscene" msgstr "" diff --git a/resources/settings.xml b/resources/settings.xml index 5b45979..512835c 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -13,7 +13,6 @@ - diff --git a/tests/test_suite.py b/tests/test_suite.py index 0ff3925..6b35d82 100644 --- a/tests/test_suite.py +++ b/tests/test_suite.py @@ -110,7 +110,6 @@ def __search(a4ksubtitles_api, settings={}, video_meta={}): 'opensubtitles.password': '', 'bsplayer.enabled': 'false', 'podnadpisi.enabled': 'false', - 'subdb.enabled': 'false', 'subscene.enabled': 'false', 'addic7ed.enabled': 'false', } @@ -450,53 +449,6 @@ def test_podnadpisi_tvshow(): assert filepath != '' -# def test_subdb(): -# a4ksubtitles_api = api.A4kSubtitlesApi({'kodi': True}) -# __remove_all_cache(a4ksubtitles_api) - -# # search -# settings = { -# 'subdb.enabled': 'true', -# } -# search = __search_movie(a4ksubtitles_api, settings) - -# # download -# item = search.results[0] - -# params = { -# 'action': 'download', -# 'service_name': 'subdb', -# 'action_args': item['action_args'] -# } - -# filepath = a4ksubtitles_api.download(params, search.settings) - -# assert filepath != '' - -def test_subdb_tvshow(): - a4ksubtitles_api = api.A4kSubtitlesApi({'kodi': True}) - __remove_all_cache(a4ksubtitles_api) - - # search - settings = { - 'subdb.enabled': 'true', - } - - search = __search_tvshow(a4ksubtitles_api, settings) - - # download - item = search.results[0] - - params = { - 'action': 'download', - 'service_name': 'subdb', - 'action_args': item['action_args'] - } - - filepath = a4ksubtitles_api.download(params, search.settings) - - assert filepath != '' - def test_subscene(): a4ksubtitles_api = api.A4kSubtitlesApi({'kodi': True}) __remove_all_cache(a4ksubtitles_api)