Skip to content

Commit

Permalink
Fix for downloading the uncompressed json
Browse files Browse the repository at this point in the history
  • Loading branch information
Luux committed Apr 10, 2021
1 parent 1bf274b commit 1eea067
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def _update_andruzzzhka_scrapes(self):
print("Updating Local BeatSaver Cache. This helps avoiding spamming the API hundreds of times.")
print("Downloading beatSaverScrappedData (helps to avoid spamming beatsaver API)...")

self.beatsaver_cachefile.unlink(missing_ok=True)

dl_filename = str(self.tmp_dir.joinpath("andruzzzhka_scrape.zip"))
wget.download(beatsaver_scraped_data_url, dl_filename)

Expand All @@ -51,7 +53,8 @@ def _update_andruzzzhka_scrapes(self):
except zipfile.BadZipFile as e:
# Workaround for https://github.com/andruzzzhka/BeatSaberScrappedData/issues/6
print(f"Error when extracting zipfile:\n{e}\nDownloading uncompressed json instead (will be slower!)...")
wget.download("https://raw.githubusercontent.com/andruzzzhka/BeatSaberScrappedData/master/beatSaverScrappedData.json")
wget.download("https://raw.githubusercontent.com/andruzzzhka/BeatSaberScrappedData/master/beatSaverScrappedData.json",
out=str(self.beatsaver_cachefile))

last_updated = time.time()
print("\nCache ready.")
Expand Down

0 comments on commit 1eea067

Please sign in to comment.