Fix parameter of util.py
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import requests,json,datetime
|
import requests,json,datetime
|
||||||
from .. import config
|
from .. import config
|
||||||
|
|
||||||
def download(cls,url):
|
def download(url):
|
||||||
_session = requests.Session()
|
_session = requests.Session()
|
||||||
html = _session.get(url, headers=config.headers)
|
html = _session.get(url, headers=config.headers)
|
||||||
with open(str(datetime.datetime.now().strftime('%Y-%m-%d %H-%M-%S')
|
with open(str(datetime.datetime.now().strftime('%Y-%m-%d %H-%M-%S')
|
||||||
@@ -9,7 +9,7 @@ def download(cls,url):
|
|||||||
json.dump(html.json(),f,ensure_ascii=False)
|
json.dump(html.json(),f,ensure_ascii=False)
|
||||||
|
|
||||||
|
|
||||||
def save(cls,data,filename):
|
def save(data,filename):
|
||||||
with open(str(datetime.datetime.now().strftime('%Y-%m-%d %H-%M-%S')
|
with open(str(datetime.datetime.now().strftime('%Y-%m-%d %H-%M-%S')
|
||||||
)+filename,mode ='w',encoding='utf-8') as f:
|
)+filename,mode ='w',encoding='utf-8') as f:
|
||||||
f.writelines(data)
|
f.writelines(data)
|
||||||
|
|||||||
Reference in New Issue
Block a user