From f8497e27d503232d4a57cb00960991560973bb9a Mon Sep 17 00:00:00 2001 From: Steve Adams Date: Wed, 4 Nov 2020 10:43:36 +1100 Subject: [PATCH 1/3] I am getting 401's on yifysubtitles.com. I am now consistant 401's on yifysubtitles.com. I believe the site has moved to.org. --- libs/subliminal_patch/providers/yifysubtitles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/subliminal_patch/providers/yifysubtitles.py b/libs/subliminal_patch/providers/yifysubtitles.py index 3ec6a9e7b..bd1a1102a 100644 --- a/libs/subliminal_patch/providers/yifysubtitles.py +++ b/libs/subliminal_patch/providers/yifysubtitles.py @@ -96,7 +96,7 @@ class YifySubtitlesProvider(Provider): languages = {Language(l, c) for (_, l, c) in YifyLanguages} languages.update(set(Language.rebuild(l, hi=True) for l in languages)) - server_urls = ['https://yifysubtitles.org', 'https://www.yifysubtitles.com'] + server_urls = ['https://yifysubtitles.org'] video_types = (Movie,) def initialize(self): From 37ba592b1723445a42088bd26e5087f1d6ec7fe2 Mon Sep 17 00:00:00 2001 From: Steve Adams Date: Wed, 4 Nov 2020 14:14:16 +1100 Subject: [PATCH 2/3] yifysubtitles handle 404 when imdb_id not found yifysubtitles handle 404 when imdb_id not found --- libs/subliminal_patch/providers/yifysubtitles.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/subliminal_patch/providers/yifysubtitles.py b/libs/subliminal_patch/providers/yifysubtitles.py index bd1a1102a..21cc3eac9 100644 --- a/libs/subliminal_patch/providers/yifysubtitles.py +++ b/libs/subliminal_patch/providers/yifysubtitles.py @@ -147,7 +147,9 @@ class YifySubtitlesProvider(Provider): if response.status_code == 200: break - response.raise_for_status() + # 404 is returned if the imdb_id was not found + if response.status_code != 404: + response.raise_for_status() if response.status_code != 200: logger.debug('No subtitles found') From c2a311689e4e47e0d0f252ddbcc515b44ad908b9 Mon Sep 17 00:00:00 2001 From: Steve Adams Date: Wed, 4 Nov 2020 14:34:23 +1100 Subject: [PATCH 3/3] Handle when title cannot be parsed For example https://www.feliratok.info/index.php?term=American%20Chopper&nyelv=0&action=autoname returns a result which causes https://github.com/morpheus65535/bazarr/issues/1179#issuecomment-721068203 --- libs/subliminal_patch/providers/supersubtitles.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/subliminal_patch/providers/supersubtitles.py b/libs/subliminal_patch/providers/supersubtitles.py index 9c9653a18..7add15277 100644 --- a/libs/subliminal_patch/providers/supersubtitles.py +++ b/libs/subliminal_patch/providers/supersubtitles.py @@ -229,6 +229,8 @@ class SuperSubtitlesProvider(Provider, ProviderSubtitleArchiveMixin): continue result_title = result_title.strip().replace("�", "").replace(" ", ".") + if not result_title: + continue guessable = result_title.strip() + ".s01e01." + result_year guess = guessit(guessable, {'type': "episode"})