[philomena] support downloading SVG files (#5643)
This commit is contained in:
@@ -24,8 +24,13 @@ class PhilomenaExtractor(BooruExtractor):
|
||||
|
||||
def _init(self):
|
||||
self.api = PhilomenaAPI(self)
|
||||
if not self.config("svg", True):
|
||||
self._file_url = operator.itemgetter("view_url")
|
||||
|
||||
_file_url = operator.itemgetter("view_url")
|
||||
def _file_url(self, post):
|
||||
if post["format"] == "svg":
|
||||
return post["view_url"].rpartition(".")[0] + ".svg"
|
||||
return post["view_url"]
|
||||
|
||||
@staticmethod
|
||||
def _prepare(post):
|
||||
|
||||
@@ -28,8 +28,13 @@ class TwibooruExtractor(BooruExtractor):
|
||||
|
||||
def _init(self):
|
||||
self.api = TwibooruAPI(self)
|
||||
if not self.config("svg", True):
|
||||
self._file_url = operator.itemgetter("view_url")
|
||||
|
||||
_file_url = operator.itemgetter("view_url")
|
||||
def _file_url(self, post):
|
||||
if post["format"] == "svg":
|
||||
return post["view_url"].rpartition(".")[0] + ".svg"
|
||||
return post["view_url"]
|
||||
|
||||
@staticmethod
|
||||
def _prepare(post):
|
||||
|
||||
Reference in New Issue
Block a user