feat: add pure Python COS upload and improve login detection
- feat(cos): add cos_upload.py for direct file upload without browser
- implements COS V1 signature algorithm with temporary credentials
- upload_image() pipeline: get_upload_info → sign → PUT to COS
- feat(api): auto-load cookies from file when cookies arg is omitted
- both Hunyuan3DAPI and Hunyuan3DAPIComplete now fall back to
~/.config/hunyuan3dweb/cookies.txt automatically
- fix(login): strengthen login-state detection using both URL and DOM
- checks "login" not in page.url AND no login button on page
- docs: update README / README_CN with COS upload examples
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+6
-2
@@ -34,8 +34,12 @@ class Hunyuan3DAPI:
|
||||
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
|
||||
})
|
||||
|
||||
if cookies:
|
||||
self.set_cookies(cookies)
|
||||
try:
|
||||
cookie_value = cookies if cookies is not None else load_cookies_from_file()
|
||||
except FileNotFoundError:
|
||||
cookie_value = None
|
||||
if cookie_value:
|
||||
self.set_cookies(cookie_value)
|
||||
|
||||
def set_cookies(self, cookies: str):
|
||||
"""设置Cookie"""
|
||||
|
||||
Reference in New Issue
Block a user