diff --git a/app/downloader/client/qbittorrent.py b/app/downloader/client/qbittorrent.py index d0a2d8e1..7d4380cb 100644 --- a/app/downloader/client/qbittorrent.py +++ b/app/downloader/client/qbittorrent.py @@ -738,11 +738,11 @@ def torrent_properties(self, torrent): torrent_obj.id = torrent.get("hash") torrent_obj.name = torrent.get("name") # 下载时间 - torrent_obj.download_time = date_now - \ - torrent.get("added_on") if torrent.get("added_on") else 0 + torrent_obj.download_time = (date_now - \ + torrent.get("added_on")) if torrent.get("added_on") else 0 # 做种时间 - torrent_obj.seeding_time = date_now - \ - torrent.get("completion_on") if torrent.get( + torrent_obj.seeding_time = (date_now - \ + torrent.get("completion_on")) if torrent.get( "completion_on") else 0 # 分享率 torrent_obj.ratio = torrent.get("ratio") or 0 diff --git a/gunicorn.conf.py b/gunicorn.conf.py index 23f89661..8de5f4e0 100644 --- a/gunicorn.conf.py +++ b/gunicorn.conf.py @@ -20,10 +20,13 @@ ssl_cert = '' ssl_key = '' with open(config, 'r') as f: - yaml = ruamel.yaml.YAML() - cf = yaml.load(f) - ssl_cert = cf.get('app').get('ssl_cert') - ssl_key = cf.get('app').get('ssl_key') + try: + yaml = ruamel.yaml.YAML() + cf = yaml.load(f) + ssl_cert = cf.get('app').get('ssl_cert') + ssl_key = cf.get('app').get('ssl_key') + except Exception as e: + print("【Config】config.yaml 异常请删除重新配置...") ROOT_PATH = os.path.dirname(os.path.abspath(config)) LOG_PATH = os.path.join(ROOT_PATH, 'logs')