From f70d6b4288139b5bc8a77598c9c2ccd93bdf46bf Mon Sep 17 00:00:00 2001 From: getzze Date: Sat, 22 Jun 2024 09:46:35 +0100 Subject: [PATCH 01/13] remove rebulk dep --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 554f0d1c..3b8ccfa0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,6 @@ dependencies = [ "platformdirs>=4.2", "pysubs2>=1.7", "rarfile>=2.7", - "rebulk>=3.0", "requests>=2.0", "srt>=3.5", "stevedore>=3.0", From ee92155a193e5f6ac362b8eba22c3dab587ac13c Mon Sep 17 00:00:00 2001 From: getzze Date: Sat, 22 Jun 2024 09:46:21 +0100 Subject: [PATCH 02/13] change cli option to config-file --- subliminal/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subliminal/cli.py b/subliminal/cli.py index 04c7042b..8014902c 100644 --- a/subliminal/cli.py +++ b/subliminal/cli.py @@ -181,7 +181,7 @@ def plural(quantity: int, name: str, *, bold: bool = True, **kwargs: Any) -> str ) @click.option( '-c', - '--config', + '--config-file', type=click.Path(dir_okay=False, path_type=pathlib.Path), default=default_config_path, callback=configure, From e22c18aee38a65ea0094a423b8353c4aaf649412 Mon Sep 17 00:00:00 2001 From: getzze Date: Sat, 22 Jun 2024 09:45:45 +0100 Subject: [PATCH 03/13] update documentation --- docs/user/how_it_works.rst | 3 ++- docs/user/usage.rst | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/user/how_it_works.rst b/docs/user/how_it_works.rst index 3aa792f9..c73bfa75 100644 --- a/docs/user/how_it_works.rst +++ b/docs/user/how_it_works.rst @@ -47,4 +47,5 @@ Various libraries are used by subliminal and are key to its success: * `dogpile.cache `_ to cache intermediate search results * `stevedore `_ to manage the provider entry point * `chardet `_ to detect subtitles' encoding -* `srt `_ to validate downloaded subtitles +* `srt `_ to validate downloaded SubRip subtitles +* `pysub2 `_ to validate and convert downloaded subtitles to other formats. diff --git a/docs/user/usage.rst b/docs/user/usage.rst index 7ba16380..7fb600ae 100644 --- a/docs/user/usage.rst +++ b/docs/user/usage.rst @@ -16,6 +16,14 @@ Download English subtitles:: only. Otherwise you will get banned from the providers for abuse due to too many requests. If subliminal didn't find subtitles for an old video, it's unlikely it will find subtitles for that video ever anyway. +You can use a configuration file in the `TOML `_ format with the ``-config-file/-c`` option. If no configuration file is +provided, it looks for a ``subliminal.toml`` file in the default configuration folder for the application. This folder is +`OS dependent `_: + +- Linux: ``/home//.config/subliminal/subliminal.toml`` +- MacOS: ``/Users//Library/Application Support/subliminal/subliminal.toml`` +- Windows: ``C:\\Users\\\\AppData\\Local\\Acme\\subliminal\\subliminal.toml`` + See :ref:`cli` for more details on the available commands and options. @@ -23,6 +31,9 @@ Nautilus/Nemo integration ------------------------- See the dedicated `project page `_ for more information. +Dolphin integration +------------------- +See `this Gist `_. High level API -------------- From 1b083df31f72fc7553a3cc282d306e2e6543b03e Mon Sep 17 00:00:00 2001 From: getzze Date: Sat, 22 Jun 2024 09:46:55 +0100 Subject: [PATCH 04/13] add changes --- HISTORY.rst | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 30f952b6..2b79bb7c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,16 +1,29 @@ Changelog --------- -2.1.1 +2.2.0 ^^^^^ **release date:** *not released* -* Change default encoding of downloaded subtitle to 'utf-8' (not the original encoding) -* Switch podnapisi provider to use JSON API -* Add support for episodes with season 0 in podnapisi provider -* Disabled addic7ed provider due to required captcha for authentication -* Disabled shooter provider since it doesn't filter by language +* Drop python2 support, the supported versions are `>=3.8,<=3.12`. +* Load CLI options from a configuration file with the ``--config-file/-c`` option (`#1084 `_). +* Change default encoding of downloaded subtitles to 'utf-8' (not the original encoding). Use the ``--original-encoding`` cli option to recover the previous default behavior (`#1125 `_). +* Add opensubtitlescom provider +* Add gestdown provider +* Add tmdb refiner (requires a personal API key) +* Fix tvsubtitles provider +* Fix opensubtitles provider +* Fix napiprojekt provider +* Fix podnapisi provider to use JSON API +* Fix addic7ed provider +* Remove thesubdb provider +* Remove argenteam provider +* Remove shooter provider * Remove legendastv provider +* Use `pyproject.toml` to specify the package configurations.* Add pre-commit hook (`#1115 `_). +* Use ruff to lint and format +* Use mypy to check types +* Add type annotations 2.1.0 From 3f0c2d23b13d86f4443abf653ff648dc413747d4 Mon Sep 17 00:00:00 2001 From: getzze Date: Sun, 23 Jun 2024 16:59:23 +0100 Subject: [PATCH 05/13] bump enzyme to version 0.5.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3b8ccfa0..80f3c82b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ dependencies = [ "click>=8.0", "click-option-group>=0.5.6", "dogpile.cache>=1.0", - "enzyme>=0.4.1", + "enzyme>=0.5.0", "guessit>=3.0.0", "platformdirs>=4.2", "pysubs2>=1.7", From c54247cdb68d84973c018fb572bfbedd4fefb665 Mon Sep 17 00:00:00 2001 From: getzze Date: Fri, 21 Jun 2024 19:33:09 +0100 Subject: [PATCH 06/13] bump to version 2.2.0 --- subliminal/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subliminal/__init__.py b/subliminal/__init__.py index 5ddc52e8..7d4d8bc2 100644 --- a/subliminal/__init__.py +++ b/subliminal/__init__.py @@ -3,7 +3,7 @@ from __future__ import annotations __title__: str = 'subliminal' -__version__: str = '2.1.1-dev' +__version__: str = '2.2.0' __short_version__: str = '.'.join(__version__.split('.')[:2]) __author__: str = 'Antoine Bertin' __license__: str = 'MIT' From 8806cd18a07e55010ad49460d0bf09b74a215130 Mon Sep 17 00:00:00 2001 From: getzze Date: Mon, 24 Jun 2024 12:02:46 +0100 Subject: [PATCH 07/13] add dependency changes to HISTORY --- HISTORY.rst | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 2b79bb7c..1a5a5baa 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -24,7 +24,20 @@ Changelog * Use ruff to lint and format * Use mypy to check types * Add type annotations - +* Drop dependencies: pysrt, appdirs, six, pytz +* Add dependencies: + - click-option-group>=0.5.6 + - platformdirs>=4.2 + - pysubs2>=1.7 + - srt>=3.5 + - tomli>=2 +* Bump dependency versions: + - babelfish>=0.6.1 + - chardet>=5.0 + - click>=8.0 + - dogpile.cache>=1.0 + - enzyme>=0.5.0 + - stevedore>=3.0 2.1.0 ^^^^^ From e77fd76fea053a3680e0395279a3f39e80362837 Mon Sep 17 00:00:00 2001 From: getzze Date: Mon, 24 Jun 2024 12:04:53 +0100 Subject: [PATCH 08/13] update Dockerfile to use py3.12 --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2927604c..47d065c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9.19-alpine3.20 +FROM python:3.12-alpine MAINTAINER Antoine Bertin @@ -8,8 +8,7 @@ ARG UNRAR_VERSION=6.2.6 RUN \ if [ "$BUILD_WITH_UNRAR" = true ]; then \ - apk add -U --update --no-cache --virtual=build-dependencies \ - build-base curl && \ + apk add -U --update --no-cache --virtual=build-dependencies build-base curl && \ echo "**** install unrar from source ****" && \ mkdir /tmp/unrar && \ curl -o /tmp/unrar.tar.gz -L "https://www.rarlab.com/rar/unrarsrc-${UNRAR_VERSION}.tar.gz" && \ @@ -19,7 +18,7 @@ if [ "$BUILD_WITH_UNRAR" = true ]; then \ install -v -m755 unrar /usr/local/bin && \ apk del build-dependencies curl && \ rm -rf /tmp/unrar /tmp/unrar.tar.gz; \ - fi +fi RUN mkdir -p /usr/src/app /usr/src/cache From ecc8c0ba0673e79f58a521a3daacb1d8df0d8a12 Mon Sep 17 00:00:00 2001 From: getzze Date: Mon, 24 Jun 2024 12:36:54 +0100 Subject: [PATCH 09/13] revert to using --config, not --config-file --- HISTORY.rst | 2 +- docs/user/usage.rst | 2 +- subliminal/cli.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 1a5a5baa..4c7fe47f 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -6,7 +6,7 @@ Changelog **release date:** *not released* * Drop python2 support, the supported versions are `>=3.8,<=3.12`. -* Load CLI options from a configuration file with the ``--config-file/-c`` option (`#1084 `_). +* Load CLI options from a configuration file with the ``--config/-c`` option (`#1084 `_). * Change default encoding of downloaded subtitles to 'utf-8' (not the original encoding). Use the ``--original-encoding`` cli option to recover the previous default behavior (`#1125 `_). * Add opensubtitlescom provider * Add gestdown provider diff --git a/docs/user/usage.rst b/docs/user/usage.rst index 7fb600ae..dae380f9 100644 --- a/docs/user/usage.rst +++ b/docs/user/usage.rst @@ -16,7 +16,7 @@ Download English subtitles:: only. Otherwise you will get banned from the providers for abuse due to too many requests. If subliminal didn't find subtitles for an old video, it's unlikely it will find subtitles for that video ever anyway. -You can use a configuration file in the `TOML `_ format with the ``-config-file/-c`` option. If no configuration file is +You can use a configuration file in the `TOML `_ format with the ``--config/-c`` option. If no configuration file is provided, it looks for a ``subliminal.toml`` file in the default configuration folder for the application. This folder is `OS dependent `_: diff --git a/subliminal/cli.py b/subliminal/cli.py index 8014902c..04c7042b 100644 --- a/subliminal/cli.py +++ b/subliminal/cli.py @@ -181,7 +181,7 @@ def plural(quantity: int, name: str, *, bold: bool = True, **kwargs: Any) -> str ) @click.option( '-c', - '--config-file', + '--config', type=click.Path(dir_okay=False, path_type=pathlib.Path), default=default_config_path, callback=configure, From 1798217d3e5807a2e455e2c71b576093fa149f7e Mon Sep 17 00:00:00 2001 From: getzze Date: Mon, 24 Jun 2024 22:04:01 +0100 Subject: [PATCH 10/13] add gha to publish to Pypi --- .github/workflows/publish.yaml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 00000000..e3343728 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,33 @@ +name: Publish + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/subliminal + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From c5eb03233f1c427054efb76ee51b820b215a6bf8 Mon Sep 17 00:00:00 2001 From: getzze Date: Mon, 24 Jun 2024 22:04:22 +0100 Subject: [PATCH 11/13] add release date --- HISTORY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 4c7fe47f..cf6a65d2 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,7 +3,7 @@ Changelog 2.2.0 ^^^^^ -**release date:** *not released* +**release date:** 2024-06-24 * Drop python2 support, the supported versions are `>=3.8,<=3.12`. * Load CLI options from a configuration file with the ``--config/-c`` option (`#1084 `_). From 2350e9b0968c9b88669ca450c46b38e39aa5f0ad Mon Sep 17 00:00:00 2001 From: getzze Date: Mon, 24 Jun 2024 22:18:00 +0100 Subject: [PATCH 12/13] add readthedocs config file --- .readthedocs.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..a0efadf9 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,19 @@ +# Read the Docs configuration file for Sphinx projects +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.12" + +python: + install: + - method: pip + path: . + extra_requirements: + - docs + +sphinx: + configuration: docs/conf.py From 30b45d67fdddc7cb1c14c8de47e5cd34e429bbb3 Mon Sep 17 00:00:00 2001 From: getzze Date: Mon, 24 Jun 2024 22:20:51 +0100 Subject: [PATCH 13/13] add readthedocs.yaml to MANIFEST --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index e45e1167..e38b1f56 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,6 +4,7 @@ include CONTRIBUTING.md include Dockerfile include .dockerignore include .pre-commit-config.yaml +include .readthedocs.yaml include tox.ini graft docs