From a2d613555b9b7eb21b9978e6b48c6f4244650cb1 Mon Sep 17 00:00:00 2001 From: SeaHOH Date: Thu, 15 Dec 2022 20:04:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- local/CFWFetch.py | 4 ++-- local/__init__.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7c25d88..3595dd4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ addons: script: - export PYTHON_VERSION=3.11.1 - export PYTHON_IMPL_VERSION=cp311 - - export RELEASE_VERSION=$(grep -oP '[0-9\.ab]+' local/__init__.py) + - export RELEASE_VERSION=$(grep -oP '[\d\.]+([abc]|post|dev)?\d*' local/__init__.py) before_deploy: - python launcher/updatecas.py -u -d --all diff --git a/local/CFWFetch.py b/local/CFWFetch.py index e81c62b..c32a426 100644 --- a/local/CFWFetch.py +++ b/local/CFWFetch.py @@ -57,7 +57,7 @@ def __init__(self, cfw_params): self.headers = { 'Host': cfw_params.host, 'User-Agent': 'GotoX/ls/0.7', - 'Accept-Encoding': 'br', + 'Accept-Encoding': 'br' in decompress_readers and 'br' or 'gzip', } def __getattr__(self, name): @@ -90,7 +90,7 @@ def fetch_server_version(): if response.status != 200: logging.warning('CFW [%s] 版本检测失败:%d', worker_params.host, response.status) continue - content = decompress_readers['br'](response).read() + content = decompress_readers[response.headers['Content-Encoding']](response).read() ver = re.search(b'GotoX remote server ([\d\.]+) in CloudFlare Workers', content) if ver: ver = ver.groups()[0].decode() diff --git a/local/__init__.py b/local/__init__.py index 2de9e71..8e953b7 100644 --- a/local/__init__.py +++ b/local/__init__.py @@ -1 +1 @@ -__version__ = '3.9.0' +__version__ = '3.9.0post1'