2018-10-31 16:08:29 +00:00
|
|
|
# coding=utf-8
|
2019-09-17 02:04:27 +00:00
|
|
|
from __future__ import absolute_import
|
2018-10-31 16:08:29 +00:00
|
|
|
from subliminal import ProviderError
|
|
|
|
|
|
|
|
|
|
|
|
class TooManyRequests(ProviderError):
|
|
|
|
"""Exception raised by providers when too many requests are made."""
|
2022-01-01 23:18:40 +00:00
|
|
|
|
2018-10-31 16:08:29 +00:00
|
|
|
pass
|
|
|
|
|
2022-01-01 23:18:40 +00:00
|
|
|
|
2018-10-31 16:08:29 +00:00
|
|
|
class APIThrottled(ProviderError):
|
|
|
|
pass
|
2019-09-22 15:24:02 +00:00
|
|
|
|
2022-01-01 23:18:40 +00:00
|
|
|
|
2019-09-22 15:24:02 +00:00
|
|
|
class ParseResponseError(ProviderError):
|
|
|
|
"""Exception raised by providers when they are not able to parse the response."""
|
2022-01-01 23:18:40 +00:00
|
|
|
|
2019-09-22 15:24:02 +00:00
|
|
|
pass
|
2020-05-08 09:32:12 +00:00
|
|
|
|
2022-01-01 23:18:40 +00:00
|
|
|
|
2020-05-08 09:32:12 +00:00
|
|
|
class IPAddressBlocked(ProviderError):
|
2022-01-01 23:18:40 +00:00
|
|
|
"""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
|