mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-04-24 06:37:16 -04:00
Added TooManyRequests throttling to podnapisi provider.
This commit is contained in:
parent
d7259d3b5a
commit
6a791b2be0
1 changed files with 4 additions and 0 deletions
|
@ -17,6 +17,8 @@ from requests.adapters import HTTPAdapter
|
|||
from subliminal.utils import sanitize
|
||||
from subliminal_patch.subtitle import guess_matches
|
||||
from subliminal_patch.providers.mixins import ProviderSubtitleArchiveMixin
|
||||
from subliminal_patch.exceptions import TooManyRequests
|
||||
|
||||
|
||||
try:
|
||||
from lxml import etree
|
||||
|
@ -205,6 +207,8 @@ class PodnapisiProvider(_PodnapisiProvider, ProviderSubtitleArchiveMixin):
|
|||
content = self.session.get(self.server_url + 'search/old', params=params, timeout=30).content
|
||||
xml = etree.fromstring(content)
|
||||
except etree.ParseError:
|
||||
if '429 Too Many Requests' in content:
|
||||
raise TooManyRequests
|
||||
logger.error("Wrong data returned: %r", content)
|
||||
break
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue