保存路径添加日期区分

main
RogerWork 1 year ago
parent 81e165e515
commit 50d27d4508
  1. 4
      main.py

@ -1,6 +1,7 @@
from db import DbAction
from req import ReqAction
from time import sleep
import datetime
import random
# config
@ -18,7 +19,8 @@ def format_link(link):
def req(_data, req_obj, db_obj):
base_temp_path = r'/Temp/'
save_path = [base_temp_path, _data['cate'] + r'/', str(_data['id'])]
date_str = datetime.datetime.strftime(datetime.datetime.now(), '%Y%m%d')
save_path = [base_temp_path, _data['cate'] + '_' + date_str + r'/', str(_data['id'])]
print('-' * 30 + str(_data['id']) + '-' * 30)
print(save_path)
link = format_link(_data['save_link'])

Loading…
Cancel
Save