You've already forked FrameTour-RenderWorker
Compare commits
2 Commits
9158854411
...
a6263398ed
| Author | SHA1 | Date | |
|---|---|---|---|
| a6263398ed | |||
| 885b69233a |
@@ -9,6 +9,7 @@ import os
|
||||
import logging
|
||||
import subprocess
|
||||
from typing import Optional
|
||||
from urllib.parse import unquote
|
||||
|
||||
import requests
|
||||
|
||||
@@ -85,6 +86,7 @@ def upload_file(url: str, file_path: str, max_retries: int = 5, timeout: int = 6
|
||||
|
||||
# 检查是否使用 rclone 上传
|
||||
if os.getenv("UPLOAD_METHOD") == "rclone":
|
||||
logger.info(f"Uploading to: {url}")
|
||||
result = _upload_with_rclone(url, file_path)
|
||||
if result:
|
||||
return True
|
||||
@@ -144,6 +146,7 @@ def _upload_with_rclone(url: str, file_path: str) -> bool:
|
||||
for src, dst in replace_list:
|
||||
new_url = new_url.replace(src, dst)
|
||||
new_url = new_url.split("?", 1)[0] # 移除查询参数
|
||||
new_url = unquote(new_url) # 解码 URL 编码的字符(如 %2F -> /)
|
||||
|
||||
if new_url == url:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user