Old methods not workes for music.db. So we using oldest methods.

This commit is contained in:
Halhadus 2024-12-07 00:40:53 +03:00
parent 4b8f1a65fa
commit cc8670b6e0

View file

@ -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()