summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSamuel Bartík <[email protected]>2022-10-09 15:17:16 +0200
committerGitHub <[email protected]>2022-10-09 09:17:16 -0400
commita82ab6769d9f508151c1cc438a6ab637d65bd7e8 (patch)
tree28aad22f3c94fa6990b31fd43ced4ca15ffa8b69
parent582c2d9b3c373b531047bda4fbf4267a7f2b2942 (diff)
downloadbazarr-a82ab6769d9f508151c1cc438a6ab637d65bd7e8.tar.gz
bazarr-a82ab6769d9f508151c1cc438a6ab637d65bd7e8.zip
Fix titulky's subtitle downloading logic
-rw-r--r--libs/subliminal_patch/providers/titulky.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/subliminal_patch/providers/titulky.py b/libs/subliminal_patch/providers/titulky.py
index aedbe7906..9fdc1661c 100644
--- a/libs/subliminal_patch/providers/titulky.py
+++ b/libs/subliminal_patch/providers/titulky.py
@@ -452,7 +452,11 @@ class TitulkyProvider(Provider, ProviderSubtitleArchiveMixin):
else:
subtitle_content = fix_line_ending(res.content)
- if not subtitle_content:
+ if archive and len(archive.infolist()) > 1 and not subtitle_content:
+ logger.info(f"Titulky.com: Couldn't find a proper subtitle file in the downloaded archive.")
+ elif archive and len(archive.infolist()) == 1 and not subtitle_content:
raise DownloadLimitExceeded("Subtitles download limit has been exceeded")
+ elif not subtitle_content:
+ raise ProviderError("No subtitles provided from titulky")
subtitle.content = subtitle_content