Old methods not workes for music.db. So we using oldest methods.
This commit is contained in:
parent
4b8f1a65fa
commit
cc8670b6e0
1 changed files with 5 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue