update: 更新下载方式

This commit is contained in:
MarkusJoe
2022-09-03 08:00:41 +08:00
parent 840002b9d9
commit 3955d18d09
1 file changed
+2 -4
+2 -4
View File
@@ -8,7 +8,7 @@
import os import os
import sqlite3 import sqlite3
from urllib.request import urlopen from src.utils.t_download import download
class SQLite: class SQLite:
@@ -54,7 +54,5 @@ class SQLite:
if __name__ != '__main__': if __name__ != '__main__':
if not os.path.exists('./src/db/data.sqlite'): if not os.path.exists('./src/db/data.sqlite'):
print('database file not exists, start downloading...') print('database file not exists, start downloading...')
resp = urlopen('https://pac.rtst.tech/static_file_hosting/static/counter/data.sqlite').read() download('https://pac.rtst.tech/static_file_hosting/static/counter/data.sqlite')
with open('./src/db/data.sqlite', 'wb') as fp:
fp.write(resp)
print('Done.') print('Done.')