From 3955d18d097102771b5e2a20768eaac08b949d9d Mon Sep 17 00:00:00 2001 From: MarkusJoe Date: Sat, 3 Sep 2022 08:00:41 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=9B=B4=E6=96=B0=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/db/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/db/__init__.py b/src/db/__init__.py index bacf0aa..c605b06 100644 --- a/src/db/__init__.py +++ b/src/db/__init__.py @@ -8,7 +8,7 @@ import os import sqlite3 -from urllib.request import urlopen +from src.utils.t_download import download class SQLite: @@ -54,7 +54,5 @@ class SQLite: if __name__ != '__main__': if not os.path.exists('./src/db/data.sqlite'): print('database file not exists, start downloading...') - resp = urlopen('https://pac.rtst.tech/static_file_hosting/static/counter/data.sqlite').read() - with open('./src/db/data.sqlite', 'wb') as fp: - fp.write(resp) + download('https://pac.rtst.tech/static_file_hosting/static/counter/data.sqlite') print('Done.')