deploy: sync server CloudSearch 0.5.6

This commit is contained in:
2026-06-25 02:08:39 +08:00
parent 75f5d26964
commit ce3f95b8b9
53 changed files with 2740 additions and 116 deletions
@@ -70,7 +70,7 @@ class XunleiTransfer:
# ─── 步骤 ①:获取分享详情 ─────────────────────────────────────
def _get_share_info(self, share_id: str) -> Dict[str, Any]:
def _get_share_info(self, share_id: str, passcode: str = "") -> Dict[str, Any]:
"""步骤①:获取分享详情。
GET /drive/v1/share?share_id=<share_id>
@@ -88,6 +88,8 @@ class XunleiTransfer:
"""
url = f"{XUNLEI_PAN_API}/drive/v1/share"
params: Dict[str, str] = {"share_id": share_id}
if passcode:
params["pass_code"] = passcode
headers = self.credential.get_headers()
logger.info("[XunleiTransfer] ① Fetching share info for share_id=%s", share_id)
@@ -303,6 +305,7 @@ class XunleiTransfer:
def _create_share(
self,
file_ids: List[str],
password: str = "",
expiration_days: str = "-1",
) -> Tuple[str, str]:
"""步骤④:创建新分享链接。
@@ -331,6 +334,8 @@ class XunleiTransfer:
"file_ids": file_ids,
"expiration_days": expiration_days,
}
if password:
body["pass_code"] = password
# share 操作可能需要 captcha_token
headers = self.credential.get_headers_with_captcha(action="share")
headers.setdefault("Content-Type", "application/json")
@@ -367,7 +372,7 @@ class XunleiTransfer:
share_url,
pass_code,
)
return share_url, pass_code
return share_url, pass_code or password
# ─── 公开入口 ─────────────────────────────────────────────────