diff --git a/websitemodule.py b/websitemodule.py index 339e4db..40ff721 100644 --- a/websitemodule.py +++ b/websitemodule.py @@ -3,7 +3,11 @@ import sqlite3 import requests def read_music_database(url): - conn = sqlite3.connect(requests.get(url).content) + os.remove("assets/localwrapped/music.db") + get_music_database = requests.get(url) + with open("assets/localwrapped/music.db", "wb") as f: + f.write(get_music_database.content) + conn = sqlite3.connect("assets/localwrapped/music.db") c = conn.cursor() c.execute('SELECT * FROM music') music_list = c.fetchall()