diff --git a/README.md b/README.md index 02f1ed94..d6c3eedb 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ docker pull jxxghp/moviepilot:latest - **USER_AGENT:** CookieCloud对应的浏览器UA,可选,同步站点后可以在管理界面中修改 -- **MESSAGER:** 消息通知渠道,支持 `telegram`/`wechat`/`slack`,开启多个渠道时使用`,`分隔。同时还需要配置对应渠道的环境变量,非对应渠道的变量可删除,推荐使用`telegram` +**MESSAGER:** 消息通知渠道,支持 `telegram`/`wechat`/`slack`,开启多个渠道时使用`,`分隔。同时还需要配置对应渠道的环境变量,非对应渠道的变量可删除,推荐使用`telegram` `wechat`设置项: @@ -71,6 +71,7 @@ docker pull jxxghp/moviepilot:latest - **WECHAT_TOKEN:** WeChat消息回调的Token - **WECHAT_ENCODING_AESKEY:** WeChat消息回调的EncodingAESKey - **WECHAT_ADMINS:** WeChat管理员列表,多个管理员用英文逗号分隔(可选) +- **WECHAT_PROXY:** WeChat代理服务器(后面不要加/) `telegram`设置项: @@ -86,7 +87,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`设置项: @@ -100,7 +101,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/chain/message.py b/app/chain/message.py index e83dc3b5..25309fb9 100644 --- a/app/chain/message.py +++ b/app/chain/message.py @@ -250,14 +250,16 @@ 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( channel=channel, title="已经是最后一页了!", userid=userid)) return else: + # 加一页 + self._current_page += 1 if cache_type == "Torrent": # 发送种子数据 self.__post_torrents_message(channel=channel, 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): """