aboutsummaryrefslogtreecommitdiffhomepage
path: root/custom_libs/subliminal_patch/providers/subf2m.py
diff options
context:
space:
mode:
authorJayZed <[email protected]>2024-09-29 21:05:46 -0400
committerJayZed <[email protected]>2024-09-29 21:05:46 -0400
commitc2a1e4d62c1bbb372127a78e4419a96d3c00e81c (patch)
treeaf19b97bbb71b514ef39928e55769fa85064e23a /custom_libs/subliminal_patch/providers/subf2m.py
parent4cc6806193127f9d6d3f2dab26969471d9bbf159 (diff)
parent0200bb96d98127ee32b6b66f8d6b9e21d4571a4d (diff)
downloadbazarr-c2a1e4d62c1bbb372127a78e4419a96d3c00e81c.tar.gz
bazarr-c2a1e4d62c1bbb372127a78e4419a96d3c00e81c.zip
Merge branch 'development' of https://github.com/morpheus65535/bazarr into developmentv1.4.5-beta.7
Diffstat (limited to 'custom_libs/subliminal_patch/providers/subf2m.py')
-rw-r--r--custom_libs/subliminal_patch/providers/subf2m.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/custom_libs/subliminal_patch/providers/subf2m.py b/custom_libs/subliminal_patch/providers/subf2m.py
index 6b3a59129..1ac0b4048 100644
--- a/custom_libs/subliminal_patch/providers/subf2m.py
+++ b/custom_libs/subliminal_patch/providers/subf2m.py
@@ -132,9 +132,9 @@ _DEFAULT_HEADERS = {
class Subf2mProvider(Provider):
provider_name = "subf2m"
- _movie_title_regex = re.compile(r"^(.+?)( \((\d{4})\))?$")
+ _movie_title_regex = re.compile(r"^(.+?)(\s+\((\d{4})\))?$")
_tv_show_title_regex = re.compile(
- r"^(.+?) [-\(]\s?(.*?) (season|series)\)?( \((\d{4})\))?$"
+ r"^(.+?)\s+[-\(]\s?(.*?)\s+(season|series)\)?(\s+\((\d{4})\))?$"
)
_tv_show_title_alt_regex = re.compile(r"(.+)\s(\d{1,2})(?:\s|$)")
_supported_languages = {}
@@ -220,7 +220,7 @@ class Subf2mProvider(Provider):
results = []
for result in self._gen_results(title):
- text = result.text.lower()
+ text = result.text.strip().lower()
match = self._movie_title_regex.match(text)
if not match:
continue
@@ -254,7 +254,7 @@ class Subf2mProvider(Provider):
results = []
for result in self._gen_results(title):
- text = result.text.lower()
+ text = result.text.strip().lower()
match = self._tv_show_title_regex.match(text)
if not match: