chore: add flags spider
This commit is contained in:
@@ -33,5 +33,19 @@ class AnthemDownloadFilesPipeline(FilesPipeline):
|
||||
flag_filename = re.search(r"([^\/]*)$", request.url)
|
||||
|
||||
if isinstance(flag_filename, re.Match):
|
||||
if (filename := flag_filename[1]).endswith("ogg") or filename.endswith("oga"):
|
||||
if (
|
||||
(filename := flag_filename[1]).endswith("ogg")
|
||||
or filename.endswith("oga")
|
||||
or filename.endswith("mp3")
|
||||
or filename.endswith("wav")
|
||||
):
|
||||
return f"files/anthems/{filename}"
|
||||
|
||||
|
||||
class FlagDownloadFilesPipeline(FilesPipeline):
|
||||
def file_path(self, request, response=None, info=None, *, item=None):
|
||||
flag_filename = re.search(r"([^\/]*)$", request.url)
|
||||
|
||||
if isinstance(flag_filename, re.Match):
|
||||
if filename := flag_filename[1].endswith(".svg"):
|
||||
return f"files/flags/{filename}"
|
||||
|
||||
Reference in New Issue
Block a user