Skip to content

Commit 1eea067

Browse files
committed
Fix for downloading the uncompressed json
1 parent 1bf274b commit 1eea067

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cache.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def _update_andruzzzhka_scrapes(self):
3939
print("Updating Local BeatSaver Cache. This helps avoiding spamming the API hundreds of times.")
4040
print("Downloading beatSaverScrappedData (helps to avoid spamming beatsaver API)...")
4141

42+
self.beatsaver_cachefile.unlink(missing_ok=True)
43+
4244
dl_filename = str(self.tmp_dir.joinpath("andruzzzhka_scrape.zip"))
4345
wget.download(beatsaver_scraped_data_url, dl_filename)
4446

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

5659
last_updated = time.time()
5760
print("\nCache ready.")

0 commit comments

Comments
 (0)