[dl:http] fail downloads with HTML content (#7697)
add 'validate-html' option
This commit is contained in:
@@ -56,7 +56,6 @@ class FantiaExtractor(Extractor):
|
||||
"%s#post-content-id-%s", content["visible_status"],
|
||||
post["post_url"], content["id"])
|
||||
|
||||
post["_http_validate"] = self._validate_response
|
||||
for file in files:
|
||||
post.update(file)
|
||||
post["num"] += 1
|
||||
@@ -91,10 +90,6 @@ class FantiaExtractor(Extractor):
|
||||
self.headers["X-CSRF-Token"] = text.extr(
|
||||
page, 'name="csrf-token" content="', '"')
|
||||
|
||||
def _validate_response(self, response):
|
||||
return not response.history or not response.headers.get(
|
||||
"content-type", "").startswith("text/html")
|
||||
|
||||
def _get_post_data(self, post_id):
|
||||
"""Fetch and process post data"""
|
||||
url = self.root+"/api/v1/posts/"+post_id
|
||||
|
||||
Reference in New Issue
Block a user