chore: fix anthem url

This commit is contained in:
2022-06-24 01:17:06 +01:00
parent f0b675d4ef
commit 4b305f757c
2 changed files with 49 additions and 3571 deletions

View File

@@ -102,12 +102,9 @@ class CountrydownloaderSpider(scrapy.Spider):
anthem_text = response.xpath("//div[@id='mw-content-text']/div/p").get() anthem_text = response.xpath("//div[@id='mw-content-text']/div/p").get()
_anthem_file_url = response.xpath("//tr[contains(@class, 'haudio')]//a/@href").getall() _anthem_file_url = response.xpath("//tr[contains(@class, 'haudio')]//a/@href").getall()
for file in _anthem_file_url: anthem_file_url = next(
if file.endswith(".ogg") or file.endswith(".oga"): (file for file in _anthem_file_url if file.endswith(".ogg") or file.endswith(".oga")), None
anthem_file_url = file )
break
else:
anthem_file_url = None
country_scrapy_item = WikipediaCountryScraperItem() country_scrapy_item = WikipediaCountryScraperItem()
country_scrapy_item["country_url"] = country_item["country_url"] country_scrapy_item["country_url"] = country_item["country_url"]

File diff suppressed because it is too large Load Diff