chore: dont set file url if anthem is missing

This commit is contained in:
2022-06-25 17:17:00 +01:00
parent c4f785286c
commit d51e803baf

View File

@@ -60,6 +60,7 @@ class AnthemsSpider(scrapy.Spider):
anthem_item["country_name"] = country_name anthem_item["country_name"] = country_name
anthem_item["native_anthem_title"] = native_anthem_title anthem_item["native_anthem_title"] = native_anthem_title
anthem_item["english_title"] = english_title anthem_item["english_title"] = english_title
anthem_item["file_urls"] = [f"https://en.wikipedia.org{anthem_url}" if anthem_url is not None else None] if anthem_url is not None:
anthem_item["file_urls"] = [f"https://en.wikipedia.org{anthem_url}"]
yield anthem_item yield anthem_item