From 76535d7e05905afd8383589a3872f0dfd7aa9c56 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sat, 26 Nov 2022 11:01:51 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20Update=20to=20v1.2.17?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagermaid/__init__.py | 2 +- pagermaid/__main__.py | 2 +- pagermaid/config.py | 8 ++++++++ pagermaid/modules/reload.py | 2 +- requirements.txt | 4 ++-- utils/docker-config.sh | 5 ++--- utils/install.sh | 7 ++++--- 7 files changed, 19 insertions(+), 11 deletions(-) diff --git a/pagermaid/__init__.py b/pagermaid/__init__.py index 997dcf0..6a121dd 100644 --- a/pagermaid/__init__.py +++ b/pagermaid/__init__.py @@ -15,7 +15,7 @@ from pyrogram import Client from pyromod.listen.temp_fix import temp_fix -pgm_version = "1.2.16" +pgm_version = "1.2.17" CMD_LIST = {} module_dir = __path__[0] working_dir = getcwd() diff --git a/pagermaid/__main__.py b/pagermaid/__main__.py index 6d9576c..3906af8 100644 --- a/pagermaid/__main__.py +++ b/pagermaid/__main__.py @@ -29,7 +29,7 @@ async def main(): import_module(f"pagermaid.modules.{module_name}") except BaseException as exception: logs.info(f"{lang('module')} {module_name} {lang('error')}: {type(exception)}: {exception}") - for plugin_name in plugin_list: + for plugin_name in plugin_list.copy(): try: import_module(f"plugins.{plugin_name}") except BaseException as exception: diff --git a/pagermaid/config.py b/pagermaid/config.py index 146392b..4b09124 100644 --- a/pagermaid/config.py +++ b/pagermaid/config.py @@ -59,6 +59,8 @@ class Config: SILENT = strtobool(os.environ.get("PGM_PGM_SILENT", config["silent"]), True) PROXY_ADDRESS = os.environ.get("PGM_PROXY_ADDRESS", config["proxy_addr"]) PROXY_PORT = os.environ.get("PGM_PROXY_PORT", config["proxy_port"]) + PROXY_HTTP_ADDRESS = os.environ.get("PGM_PROXY_HTTP_ADDRESS", config["http_addr"]) + PROXY_HTTP_PORT = os.environ.get("PGM_PROXY_HTTP_PORT", config["http_port"]) PROXY = None if PROXY_ADDRESS and PROXY_PORT: PROXY = dict( @@ -66,6 +68,12 @@ class Config: hostname=PROXY_ADDRESS, port=int(PROXY_PORT) ) + elif PROXY_HTTP_ADDRESS and PROXY_HTTP_PORT: + PROXY = dict( + scheme="http", + hostname=PROXY_HTTP_ADDRESS, + port=int(PROXY_HTTP_PORT) + ) GIT_SOURCE = os.environ.get("PGM_GIT_SOURCE", config["git_source"]) GIT_SOURCE = GIT_SOURCE.replace("TeamPGM/PagerMaid_Plugins/", "TeamPGM/PagerMaid_Plugins_Pyro/") try: diff --git a/pagermaid/modules/reload.py b/pagermaid/modules/reload.py index b396174..fd7ccd2 100644 --- a/pagermaid/modules/reload.py +++ b/pagermaid/modules/reload.py @@ -31,7 +31,7 @@ async def reload_all(): importlib.reload(module) except BaseException as exception: logs.info(f"{lang('module')} {module_name} {lang('error')}: {type(exception)}: {exception}") - for plugin_name in pagermaid.modules.plugin_list: + for plugin_name in pagermaid.modules.plugin_list.copy(): try: plugin = importlib.import_module(f"plugins.{plugin_name}") if plugin_name in loaded_plugins: diff --git a/requirements.txt b/requirements.txt index fe353a5..3daf84e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -pyrogram==2.0.61 +pyrogram==2.0.63 TgCrypto==1.2.5 Pillow>=8.4.0 pytz>=2021.3 @@ -9,4 +9,4 @@ httpx apscheduler sqlitedict casbin==1.17.4 -sentry-sdk==1.11.0 +sentry-sdk==1.11.1 diff --git a/utils/docker-config.sh b/utils/docker-config.sh index f036acf..5da01da 100644 --- a/utils/docker-config.sh +++ b/utils/docker-config.sh @@ -13,11 +13,10 @@ configure () { echo "生成配置文件中 . . ." cp config.gen.yml $config_file - echo "api_id、api_hash 申请地址: https://my.telegram.org/" - printf "请输入应用程序 api_id:" + printf "请输入应用程序 api_id(不懂请直接回车):" read -r api_id <&1 sed -i "s/ID_HERE/$api_id/" $config_file - printf "请输入应用程序 api_hash:" + printf "请输入应用程序 api_hash(不懂请直接回车):" read -r api_hash <&1 sed -i "s/HASH_HERE/$api_hash/" $config_file printf "请输入应用程序语言(默认:zh-cn):" diff --git a/utils/install.sh b/utils/install.sh index 8b0937a..b7d8d7b 100644 --- a/utils/install.sh +++ b/utils/install.sh @@ -268,11 +268,10 @@ configure() { config_file=config.yml echo "生成配置文件中 . . ." cp config.gen.yml config.yml - echo "api_id、api_hash 申请地址: https://my.telegram.org/" - printf "请输入应用程序 api_id:" + printf "请输入应用程序 api_id(不懂请直接回车):" read -r api_id <&1 sed -i "s/ID_HERE/$api_id/" $config_file - printf "请输入应用程序 api_hash:" + printf "请输入应用程序 api_hash(不懂请直接回车):" read -r api_hash <&1 sed -i "s/HASH_HERE/$api_hash/" $config_file printf "请输入应用程序语言(默认:zh-cn):" @@ -372,6 +371,8 @@ login_screen() { screen -x -S userbot -p 0 -X stuff "$phonenum" screen -x -S userbot -p 0 -X stuff $'\n' + screen -x -S userbot -p 0 -X stuff "y" + screen -x -S userbot -p 0 -X stuff $'\n' sleep 2