From cc8670b6e037773ea88d14930151aab76413533f Mon Sep 17 00:00:00 2001 From: Halhadus Date: Sat, 7 Dec 2024 00:40:53 +0300 Subject: [PATCH] Old methods not workes for music.db. So we using oldest methods. --- websitemodule.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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()