优化github升级地址
This commit is contained in:
parent
250833c9e6
commit
9e1cf558de
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/tmp/dr_py-main/
|
||||
/tmp/dr_py.zip
|
||||
@ -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 });
|
||||
}
|
||||
}
|
||||
|
||||
@ -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即可正常检测升级
|
||||
|
||||
|
||||
@ -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}')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user