From 8da77a72eb0e22ab187a5df4dee4ac3681a1637c Mon Sep 17 00:00:00 2001 From: Bazarr Date: Thu, 7 May 2020 12:53:26 +0100 Subject: [PATCH] simplig --- libs/subliminal_patch/providers/legendasdivx.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libs/subliminal_patch/providers/legendasdivx.py b/libs/subliminal_patch/providers/legendasdivx.py index 4fff72552..77e1cd22a 100644 --- a/libs/subliminal_patch/providers/legendasdivx.py +++ b/libs/subliminal_patch/providers/legendasdivx.py @@ -8,6 +8,7 @@ import rarfile import zipfile from requests import Session +from requests.exceptions import HTTPError from guessit import guessit from subliminal.exceptions import ConfigurationError, AuthenticationError, ServiceUnavailable, DownloadLimitExceeded from subliminal_patch.providers import Provider @@ -303,11 +304,7 @@ class LegendasdivxProvider(Provider): res = self.session.get(subtitle.page_link) res.raise_for_status() if res: - if res.status_code in ['500', '503']: - raise ServiceUnavailable("Legendasdivx.pt :: 503 - Service Unavailable") - elif res.status_code == '403': - raise ParseResponseError("Legendasdivx.pt :: 403 - Forbidden") - elif 'limite' in res.text.lower(): # daily downloads limit reached + if 'limite' in res.text.lower(): # daily downloads limit reached raise DownloadLimitReached("Legendasdivx.pt :: Download limit reached") elif 'bloqueado' in res.text.lower(): # blocked IP address raise ParseResponseError("Legendasdivx.pt :: %r" % res.text)