From 9e1cf558de9f2aa8f162614c8e4886b4ec9c5e38 Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Sun, 23 Apr 2023 21:35:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96github=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ libs/alist.js | 2 +- readme.md | 2 +- utils/update.py | 8 +++++--- 4 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01c1d84 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/tmp/dr_py-main/ +/tmp/dr_py.zip \ No newline at end of file diff --git a/libs/alist.js b/libs/alist.js index bb34f8e..aac1458 100644 --- a/libs/alist.js +++ b/libs/alist.js @@ -483,7 +483,7 @@ function getAll(otid,tid,drives,path){ return JSON.stringify({ 'list': [vod] }); }catch (e) { print(e.message); - let list = [{vod_name:'无数据,防无限请求',type_name: "文件夹",vod_id:'no_data',vod_remarks:'不要点,会崩的',vod_pic:'https://ghproxy.com/https://raw.githubusercontent.com/hjdhnx/dr_py/main/404.jpg',vod_actor:e.message,vod_director: tid,vod_content: otid}]; + let list = [{vod_name:'无数据,防无限请求',type_name: "文件夹",vod_id:'no_data',vod_remarks:'不要点,会崩的',vod_pic:'https://ghproxy.com/https://raw.githubusercontent.com/hjdhnx/dr_py/main/static/img/404.jpg',vod_actor:e.message,vod_director: tid,vod_content: otid}]; return JSON.stringify({ 'list': list }); } } diff --git a/readme.md b/readme.md index cff5171..6670561 100644 --- a/readme.md +++ b/readme.md @@ -55,7 +55,7 @@ #### 项目修复 进入容器drpy项目根目录执行以下代码 ```shell -cd utils && rm update.py && wget https://code.gitlink.org.cn/api/v1/repos/hjdhnx/dr_py/raw/master/utils/update.py +cd utils && rm update.py && wget https://ghproxy.com/https://raw.githubusercontent.com/hjdhnx/dr_py/main/utils/update.py ``` 执行后重启9001或者docker即可正常检测升级 diff --git a/utils/update.py b/utils/update.py index fcce20b..1d00dcc 100644 --- a/utils/update.py +++ b/utils/update.py @@ -74,7 +74,8 @@ def getOnlineVer(): msg = '' try: # r = requests.get('https://gitcode.net/qq_32394351/dr_py/-/raw/master/js/version.txt',timeout=(2,2)) - r = requests.get('https://code.gitlink.org.cn/api/v1/repos/hjdhnx/dr_py/raw/master/js/version.txt',timeout=(2,2)) + # r = requests.get('https://code.gitlink.org.cn/api/v1/repos/hjdhnx/dr_py/raw/master/js/version.txt',timeout=(2,2)) + r = requests.get('https://ghproxy.com/https://raw.githubusercontent.com/hjdhnx/dr_py/main/js/version.txt',timeout=(2,2)) ver = r.text except Exception as e: # print(f'{e}') @@ -146,7 +147,7 @@ def force_copy_files(from_path, to_path, exclude_files=None): def copy_to_update(): base_path = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) # 上级目录 tmp_path = os.path.join(base_path, f'tmp') - dr_path = os.path.join(tmp_path, f'dr_py') + dr_path = os.path.join(tmp_path, f'dr_py-main') if not os.path.exists(dr_path): # print(f'升级失败,找不到目录{dr_path}') logger.info(f'升级失败,找不到目录{dr_path}') @@ -169,7 +170,8 @@ def download_new_version(): tmp_path = os.path.join(base_path, f'tmp') os.makedirs(tmp_path,exist_ok=True) # url = 'https://gitcode.net/qq_32394351/dr_py/-/archive/master/dr_py-master.zip' - url = 'https://code.gitlink.org.cn/api/v1/repos/hjdhnx/dr_py/archive/master.zip' + # url = 'https://code.gitlink.org.cn/api/v1/repos/hjdhnx/dr_py/archive/master.zip' + url = 'https://ghproxy.com/https://github.com/hjdhnx/dr_py/archive/refs/heads/main.zip' # tmp_files = os.listdir(tmp_path) # for tp in tmp_files: # print(f'清除缓存文件:{tp}')