From f89e762350a63728b65af97b72face2d7855ab68 Mon Sep 17 00:00:00 2001 From: thsrite Date: Thu, 20 Jul 2023 15:54:52 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix=20=E7=BF=BB=E9=A1=B5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/chain/message.py b/app/chain/message.py index e83dc3b5..8b130622 100644 --- a/app/chain/message.py +++ b/app/chain/message.py @@ -250,8 +250,8 @@ class MessageChain(ChainBase): cache_list: list = cache_data.get('items') total = len(cache_list) # 加一页 - self._current_page += 1 - cache_list = cache_list[self._current_page * self._page_size:(self._current_page + 1) * self._page_size] + cache_list = cache_list[ + (self._current_page + 1) * self._page_size:(self._current_page + 2) * self._page_size] if not cache_list: # 没有数据 self.post_message(Notification( From 0ca9ad64af1d4cbf734159945761395fe9ce2661 Mon Sep 17 00:00:00 2001 From: thsrite Date: Thu, 20 Jul 2023 16:13:26 +0800 Subject: [PATCH 2/3] =?UTF-8?q?WeChat=E4=BB=A3=E7=90=86=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 ++++--- app/core/config.py | 2 +- app/modules/wechat/wechat.py | 7 +++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5b68b281..bca96c86 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ docker pull jxxghp/moviepilot:latest - **USER_AGENT:** CookieCloud对应的浏览器UA,可选,同步站点后可以在管理界面中修改 -- **MESSAGER:** 消息通知渠道,支持 `telegram`/`wechat`/`slack`,开启多个渠道时使用`,`分隔。同时还需要配置对应渠道的环境变量,非对应渠道的变量可删除,推荐使用`telegram` +**MESSAGER:** 消息通知渠道,支持 `telegram`/`wechat`/`slack`,开启多个渠道时使用`,`分隔。同时还需要配置对应渠道的环境变量,非对应渠道的变量可删除,推荐使用`telegram` `wechat`设置项: @@ -70,6 +70,7 @@ docker pull jxxghp/moviepilot:latest - **WECHAT_TOKEN:** WeChat消息回调的Token - **WECHAT_ENCODING_AESKEY:** WeChat消息回调的EncodingAESKey - **WECHAT_ADMINS:** WeChat管理员列表,多个管理员用英文逗号分隔(可选) +- **WECHAT_PROXY:** WeChat代理服务器(后面不要加/) `telegram`设置项: @@ -85,7 +86,7 @@ docker pull jxxghp/moviepilot:latest - **SLACK_CHANNEL:** Slack 频道名称,默认`全体` -- **DOWNLOADER:** 下载器,支持`qbittorrent`/`transmission`,QB版本号要求>= 4.3.9,TR版本号要求>= 3.0,同时还需要配置对应渠道的环境变量,非对应渠道的变量可删除,推荐使用`qbittorrent` +**DOWNLOADER:** 下载器,支持`qbittorrent`/`transmission`,QB版本号要求>= 4.3.9,TR版本号要求>= 3.0,同时还需要配置对应渠道的环境变量,非对应渠道的变量可删除,推荐使用`qbittorrent` `qbittorrent`设置项: @@ -99,7 +100,7 @@ docker pull jxxghp/moviepilot:latest - **TR_USER:** transmission用户名 - **TR_PASSWORD:** transmission密码 -- **MEDIASERVER:** 媒体服务器,支持`emby`/`jellyfin`/`plex`,同时还需要配置对应媒体服务器的环境变量,非对应媒体服务器的变量可删除,推荐使用`emby` +**MEDIASERVER:** 媒体服务器,支持`emby`/`jellyfin`/`plex`,同时还需要配置对应媒体服务器的环境变量,非对应媒体服务器的变量可删除,推荐使用`emby` `emby`设置项: diff --git a/app/core/config.py b/app/core/config.py index 32349e88..3b53fea5 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -70,7 +70,7 @@ class Settings(BaseSettings): # WeChat应用ID WECHAT_APP_ID: str = None # WeChat代理服务器 - WECHAT_PROXY: str = None + WECHAT_PROXY: str = "https://qyapi.weixin.qq.com" # WeChat Token WECHAT_TOKEN: str = None # WeChat EncodingAESKey diff --git a/app/modules/wechat/wechat.py b/app/modules/wechat/wechat.py index d892f1cc..d2965f8d 100644 --- a/app/modules/wechat/wechat.py +++ b/app/modules/wechat/wechat.py @@ -16,7 +16,6 @@ lock = threading.Lock() class WeChat(metaclass=Singleton): - # 企业微信Token _access_token = None # 企业微信Token过期时间 @@ -29,11 +28,11 @@ class WeChat(metaclass=Singleton): _appsecret = None # 企业微信AppID _appid = None - + # 企业微信发送消息URL - _send_msg_url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=%s" + _send_msg_url = f"{settings.WECHAT_PROXY}/cgi-bin/message/send?access_token=%s" # 企业微信获取TokenURL - _token_url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=%s&corpsecret=%s" + _token_url = f"{settings.WECHAT_PROXY}/cgi-bin/gettoken?corpid=%s&corpsecret=%s" def __init__(self): """ From 3d5b572319b4e8cf3ad4f4aca287ed9d09b74d4c Mon Sep 17 00:00:00 2001 From: thsrite Date: Thu, 20 Jul 2023 16:19:07 +0800 Subject: [PATCH 3/3] fix --- app/chain/message.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/chain/message.py b/app/chain/message.py index 8b130622..25309fb9 100644 --- a/app/chain/message.py +++ b/app/chain/message.py @@ -258,6 +258,8 @@ class MessageChain(ChainBase): channel=channel, title="已经是最后一页了!", userid=userid)) return else: + # 加一页 + self._current_page += 1 if cache_type == "Torrent": # 发送种子数据 self.__post_torrents_message(channel=channel,