[deviantart] use fallback for /intermediary/ URLs
instead of checking availability with HEAD requests
This commit is contained in:
@@ -105,7 +105,8 @@ class DeviantartExtractor(Extractor):
|
||||
intermediary, count = re.subn(
|
||||
r"(/f/[^/]+/[^/]+)/v\d+/.*",
|
||||
r"/intermediary\1", content["src"], 1)
|
||||
if count and self._check_url(intermediary):
|
||||
if count:
|
||||
deviation["_fallback"] = (content["src"],)
|
||||
content["src"] = intermediary
|
||||
if self.quality:
|
||||
content["src"] = re.sub(
|
||||
@@ -282,9 +283,6 @@ class DeviantartExtractor(Extractor):
|
||||
if mtype and mtype.startswith("image/"):
|
||||
content.update(data)
|
||||
|
||||
def _check_url(self, url):
|
||||
return self.request(url, method="HEAD", fatal=False).status_code < 400
|
||||
|
||||
def _limited_request(self, url, **kwargs):
|
||||
"""Limits HTTP requests to one every 2 seconds"""
|
||||
kwargs["fatal"] = None
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
|
||||
__version__ = "1.17.1"
|
||||
__version__ = "1.17.2-dev"
|
||||
|
||||
Reference in New Issue
Block a user