bazarr/libs/subliminal_patch/exceptions.py

34 lines
703 B
Python
Raw Normal View History

2018-11-01 00:08:29 +08:00
# coding=utf-8
2019-09-17 10:04:27 +08:00
from __future__ import absolute_import
2018-11-01 00:08:29 +08:00
from subliminal import ProviderError
class TooManyRequests(ProviderError):
"""Exception raised by providers when too many requests are made."""
2018-11-01 00:08:29 +08:00
pass
2018-11-01 00:08:29 +08:00
class APIThrottled(ProviderError):
pass
class ParseResponseError(ProviderError):
"""Exception raised by providers when they are not able to parse the response."""
pass
class IPAddressBlocked(ProviderError):
"""Exception raised when providers block requests from IP Address."""
pass
class MustGetBlacklisted(ProviderError):
def __init__(self, id: str, media_type: str):
super().__init__()
self.id = id
self.media_type = media_type