chore: add anthems spider
This commit is contained in:
@@ -26,3 +26,12 @@ class WikipediaCountryScraperFilesPipeline(FilesPipeline):
|
||||
return f"files/flags/{filename}"
|
||||
elif filename.endswith(".ogg") or filename.endswith("oga"):
|
||||
return f"files/anthems/{filename}"
|
||||
|
||||
|
||||
class AnthemDownloadFilesPipeline(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("ogg") or filename.endswith("oga"):
|
||||
return f"files/anthems/{filename}"
|
||||
|
||||
Reference in New Issue
Block a user