修正token不配置的问题
This commit is contained in:
@@ -82,6 +82,8 @@ def download_file_with_requests(url, full_path):
|
||||
from urllib.parse import urlparse, parse_qs, urlencode, urlunparse
|
||||
def add_token_to_url(url: str, token: str) -> str:
|
||||
# 在URL中添加或更新token参数
|
||||
if token is None or len(token) == 0:
|
||||
return url
|
||||
parsed_url = urlparse(url)
|
||||
query_params = parse_qs(parsed_url.query)
|
||||
query_params['token'] = token
|
||||
|
||||
@@ -13,9 +13,10 @@ settings = Dynaconf(
|
||||
)
|
||||
# print(settings)
|
||||
|
||||
|
||||
class CivitaiConfig:
|
||||
api_endpoint: str = settings.civitai.api_endpoint
|
||||
token: str = settings.civitai.token
|
||||
token: str = settings.civitai.get("token", "")
|
||||
json_cache_dir: pathlib.Path = pathlib.Path(__file__).parent.parent / "json_cache"
|
||||
aria2_extra_args: list[str] = settings.aria2.extra_args or []
|
||||
max_retry: int = settings.aria2.max_retry or 5
|
||||
|
||||
Reference in New Issue
Block a user