diff --git a/biliup/engine/download.py b/biliup/engine/download.py index c4c0487..f62b773 100644 --- a/biliup/engine/download.py +++ b/biliup/engine/download.py @@ -244,8 +244,8 @@ class DownloadBase: 'date': date, 'live_cover_path': self.live_cover_path, 'is_download': self.is_download, - 'start_time': date, - 'end_time': time.localtime(), + 'start_time': time.strftime("%Y-%m-%d %H:%M:%S", date), + 'end_time': time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), } def download_cover(self, fmtname): diff --git a/biliup/handler.py b/biliup/handler.py index 1790144..a2dff47 100644 --- a/biliup/handler.py +++ b/biliup/handler.py @@ -44,11 +44,10 @@ def process(name, url): 'name': name, 'url': url, } - - start_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) - if config['streamers'].get(name, {}).get('preprocessor'): - processor(config['streamers'].get(name, {}).get('preprocessor'), - f'{{"name": "{name}", "url": "{url}", "start_time": "{start_time}"}}') + preprocessor = config['streamers'].get(name, {}).get('preprocessor') + if preprocessor: + processor(preprocessor, + f'{{"name": "{name}", "url": "{url}", "start_time": "{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())}"}}') url_status = event_manager.context['url_status'] # 下载开始