Compare commits

..

No commits in common. "5cc955f590ab9abc5ea43164378b66b5e0e821d5" and "0f6b6839c4de710fb7f47bf7361b73384e136542" have entirely different histories.

5 changed files with 17 additions and 53 deletions

View File

@ -1,12 +1,6 @@
# 使用官方 Python 镜像作为基础镜像
FROM python:3.13-alpine
#构建版本
ARG BUILD_SHA
ARG BUILD_TAG
ENV BUILD_SHA=$BUILD_SHA
ENV BUILD_TAG=$BUILD_TAG
# 设置工作目录
WORKDIR /app
@ -14,12 +8,17 @@ WORKDIR /app
COPY . /app
# 安装依赖
RUN pip install --no-cache-dir -r requirements.txt && \
echo "{\"BUILD_SHA\":\"$BUILD_SHA\", \"BUILD_TAG\":\"$BUILD_TAG\"}" > build.json
RUN pip install --no-cache-dir -r requirements.txt
# 时区
ENV TZ="Asia/Shanghai"
#构建版本
ARG BUILD_SHA
ARG BUILD_TAG
ENV BUILD_SHA=$BUILD_SHA
ENV BUILD_TAG=$BUILD_TAG
# 端口
EXPOSE 5005

View File

@ -34,15 +34,8 @@ from quark_auto_save import Quark, Config, MagicRename
def get_app_ver():
"""获取应用版本"""
try:
with open("build.json", "r") as f:
build_info = json.loads(f.read())
BUILD_SHA = build_info["BUILD_SHA"]
BUILD_TAG = build_info["BUILD_TAG"]
except Exception as e:
BUILD_SHA = os.getenv("BUILD_SHA", "")
BUILD_TAG = os.getenv("BUILD_TAG", "")
BUILD_SHA = os.environ.get("BUILD_SHA", "")
BUILD_TAG = os.environ.get("BUILD_TAG", "")
if BUILD_TAG[:1] == "v":
return BUILD_TAG
elif BUILD_SHA:
@ -323,9 +316,7 @@ def get_share_detail():
return jsonify(
{"success": False, "data": {"error": get_stoken.get("message")}}
)
share_detail = account.get_detail(
pwd_id, stoken, pdir_fid, _fetch_share=1, fetch_share_full_path=1
)
share_detail = account.get_detail(pwd_id, stoken, pdir_fid, _fetch_share=1)
if share_detail.get("code") != 0:
return jsonify(
@ -333,10 +324,7 @@ def get_share_detail():
)
data = share_detail["data"]
data["paths"] = [
{"fid": i["fid"], "name": i["file_name"]}
for i in share_detail["data"].get("full_path", [])
] or paths
data["paths"] = paths
data["stoken"] = stoken
# 正则处理预览

View File

@ -1220,9 +1220,9 @@
} else if (shareurl.includes(dir.fid)) {
shareurl = shareurl.match(`.*/${dir.fid}[^/]*`)[0]
} else if (shareurl.includes('#/list/share')) {
shareurl = `${shareurl.split('#')[0]}#/list/share/${dir.fid}`
shareurl = `${shareurl}/${dir.fid}-${dir.name?.replace('-', '*101')}`
} else {
shareurl = `${shareurl.split('#')[0]}#/list/share/${dir.fid}`
shareurl = `${shareurl}#/list/share/${dir.fid}-${dir.name?.replace('-', '*101')}`
}
return shareurl;
},

View File

@ -18,26 +18,8 @@ class Smartstrm:
else:
print(f"{self.plugin_name} 模块缺少必要参数: {key}")
if self.webhook and self.strmtask:
if self.get_info():
self.is_active = True
def get_info(self):
"""获取 SmartStrm 信息"""
try:
response = requests.request(
"GET",
self.webhook,
timeout=5,
)
response = response.json()
if response.get("success"):
print(f"SmartStrm 触发任务: 连接成功 {response.get('version','')}")
return response
print(f"SmartStrm 触发任务:连接失败 {response.get('message','')}")
return None
except Exception as e:
print(f"SmartStrm 触发任务:连接出错 {str(e)}")
return None
print(f"SmartStrm 触发任务: {self.strmtask} ")
self.is_active = True
def run(self, task, **kwargs):
"""

View File

@ -1,6 +1,6 @@
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
# Modify: 2025-09-05
# Modify: 2024-11-13
# Repo: https://github.com/Cp0204/quark_auto_save
# ConfigFile: quark_config.json
"""
@ -497,9 +497,7 @@ class Quark:
).json()
return response
def get_detail(
self, pwd_id, stoken, pdir_fid, _fetch_share=0, fetch_share_full_path=0
):
def get_detail(self, pwd_id, stoken, pdir_fid, _fetch_share=0):
list_merge = []
page = 1
while True:
@ -517,8 +515,6 @@ class Quark:
"_fetch_share": _fetch_share,
"_fetch_total": "1",
"_sort": "file_type:asc,updated_at:desc",
"ver": "2",
"fetch_share_full_path": fetch_share_full_path,
}
response = self._send_request("GET", url, params=querystring).json()
if response["code"] != 0:
@ -713,7 +709,6 @@ class Quark:
match_pwd = re.search(r"pwd=(\w+)", url)
passcode = match_pwd.group(1) if match_pwd else ""
# path: fid-name
# Legacy 20250905
paths = []
matches = re.findall(r"/(\w{32})-?([^/]+)?", url)
for match in matches: