diff --git a/files/0001-Change-from-pysrt-to-srt.patch b/files/0001-Change-from-pysrt-to-srt.patch new file mode 100644 --- /dev/null +++ b/files/0001-Change-from-pysrt-to-srt.patch @@ -0,0 +1,64 @@ +From 144d519e8570abd3d4289fb9c16e13b29d5a040c Mon Sep 17 00:00:00 2001 +From: Marcus Mellor +Date: Wed, 9 Nov 2022 21:09:25 -0600 +Subject: [PATCH] Change from pysrt to srt + +--- + docs/user/how_it_works.rst | 2 +- + setup.py | 2 +- + subliminal/subtitle.py | 9 ++++----- + 3 files changed, 6 insertions(+), 7 deletions(-) + +diff --git a/docs/user/how_it_works.rst b/docs/user/how_it_works.rst +index fd845cf..e321c48 100644 +--- a/docs/user/how_it_works.rst ++++ b/docs/user/how_it_works.rst +@@ -48,4 +48,4 @@ 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 +-* `pysrt `_ to validate downloaded subtitles ++* `srt `_ to validate downloaded subtitles +diff --git a/setup.py b/setup.py +index ccc1cda..e25bc2b 100644 +--- a/setup.py ++++ b/setup.py +@@ -29,7 +29,7 @@ setup_requirements = ['pytest-runner'] if {'pytest', 'test', 'ptr'}.intersection + + install_requirements = ['guessit>=3.0.0', 'babelfish>=0.5.2', 'enzyme>=0.4.1', 'beautifulsoup4>=4.4.0', + 'requests>=2.0', 'click>=4.0', 'dogpile.cache>=0.6.0', 'stevedore>=1.20.0', +- 'chardet>=2.3.0', 'pysrt>=1.0.1', 'six>=1.9.0', 'appdirs>=1.3', 'rarfile>=2.7', ++ 'chardet>=2.3.0', 'srt>=3.5.0', 'six>=1.9.0', 'appdirs>=1.3', 'rarfile>=2.7', + 'pytz>=2012c'] + if sys.version_info < (3, 2): + install_requirements.append('futures>=3.0') +diff --git a/subliminal/subtitle.py b/subliminal/subtitle.py +index 54f76f6..05ef24e 100644 +--- a/subliminal/subtitle.py ++++ b/subliminal/subtitle.py +@@ -4,7 +4,7 @@ import logging + import os + + import chardet +-import pysrt ++import srt + + from six import text_type + +@@ -95,10 +95,9 @@ class Subtitle(object): + return False + + try: +- pysrt.from_string(self.text, error_handling=pysrt.ERROR_RAISE) +- except pysrt.Error as e: +- if e.args[0] < 80: +- return False ++ srt.parse(self.text) ++ except srt.SRTParseError: ++ return False + + return True + +-- +2.35.5 + diff --git a/package.yml b/package.yml --- a/package.yml +++ b/package.yml @@ -1,6 +1,6 @@ name : subliminal version : 2.1.0 -release : 6 +release : 7 source : - https://github.com/Diaoul/subliminal/archive/2.1.0.tar.gz : c7aca034332c254ab0e52b3d67d903a7f97cd614f115803269b7ba2e540f1db9 homepage : https://github.com/Diaoul/subliminal/ @@ -16,12 +16,13 @@ - python-dogpile-cache - python-enzyme - python-guessit - - python-pysrt - python-pytz - python-rarfile - python-requests + - python-srt - python-stevedore build : | + %patch -p1 < $pkgfiles/0001-Change-from-pysrt-to-srt.patch %python3_setup install : | %python3_install diff --git a/pspec_x86_64.xml b/pspec_x86_64.xml --- a/pspec_x86_64.xml +++ b/pspec_x86_64.xml @@ -3,8 +3,8 @@ subliminal https://github.com/Diaoul/subliminal/ - Joey Riches - josephriches@gmail.com + Marcus Mellor + infinitymdm@gmail.com MIT programming @@ -94,12 +94,12 @@ - - 2022-04-12 + + 2022-11-11 2.1.0 Packaging update - Joey Riches - josephriches@gmail.com + Marcus Mellor + infinitymdm@gmail.com \ No newline at end of file