From 37b9e0175731cbef4ed5ac659f70bfa1c16fbec6 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 22 Jun 2023 07:26:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix=20=E8=BD=AC=E7=A7=BB=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E6=98=BE=E7=A4=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/modules/filetransfer/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/modules/filetransfer/__init__.py b/app/modules/filetransfer/__init__.py index da5d381f..962e90b0 100644 --- a/app/modules/filetransfer/__init__.py +++ b/app/modules/filetransfer/__init__.py @@ -54,7 +54,7 @@ class FileTransferModule(_ModuleBase): target_path=target_path, message=msg, file_count=file_count, - file_size=file_size, + total_size=file_size, fail_list=fail_list) @staticmethod @@ -389,7 +389,7 @@ class FileTransferModule(_ModuleBase): # 计算大小 total_filesize += in_path.stat().st_size # 返回转移后的路径 - return new_path, total_filesize, total_filesize, [], "" + return new_path, total_num, total_filesize, [], "" else: # 获取文件清单 transfer_files: List[Path] = SystemUtils.list_files_with_extensions(in_path, settings.RMT_MEDIAEXT) @@ -454,7 +454,7 @@ class FileTransferModule(_ModuleBase): # 计算文件数 total_num += 1 # 计算大小 - total_filesize += transfer_file.stat().st_size + total_filesize += new_file.stat().st_size except Exception as err: err_msgs.append(f"{transfer_file.name}:{err}") logger.error(f"{transfer_file}转移失败:{err}") From 9eaef01df57c5d7272408ded5eac26c8cc7cdec8 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 22 Jun 2023 07:52:46 +0800 Subject: [PATCH 2/3] fix bug --- app/modules/subtitle/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/modules/subtitle/__init__.py b/app/modules/subtitle/__init__.py index c7a2a02f..c934cd2c 100644 --- a/app/modules/subtitle/__init__.py +++ b/app/modules/subtitle/__init__.py @@ -62,7 +62,7 @@ class SubtitleModule(_ModuleBase): if download_dir.is_file(): download_dir = download_dir.parent # 读取网站代码 - request = RequestUtils(cookies=torrent.site_cookie, headers=torrent.site_ua) + request = RequestUtils(cookies=torrent.site_cookie, ua=torrent.site_ua) res = request.get_res(torrent.page_url) if res and res.status_code == 200: if not res.text: From a16b9b39d93e573cfd38fe3e0dcda512ab599f9b Mon Sep 17 00:00:00 2001 From: jxxghp Date: Fri, 23 Jun 2023 07:19:42 +0800 Subject: [PATCH 3/3] fix timeout --- app/modules/telegram/telegram.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/modules/telegram/telegram.py b/app/modules/telegram/telegram.py index fa24252c..438e5f10 100644 --- a/app/modules/telegram/telegram.py +++ b/app/modules/telegram/telegram.py @@ -52,7 +52,7 @@ class Telegram(metaclass=Singleton): 定义线程函数来运行 infinity_polling """ try: - _bot.infinity_polling(long_polling_timeout=5) + _bot.infinity_polling(long_polling_timeout=10) except Exception as err: logger.error(f"Telegram消息接收服务异常:{err}")