From 21d148a871955482243aba26f6fbf3e44f21ef21 Mon Sep 17 00:00:00 2001 From: farfun <1007530194@qq.com> Date: Thu, 26 Dec 2024 17:17:21 +0800 Subject: [PATCH] add --- logs/all.log | 3 +++ logs/funbuild.log | 3 +++ pyproject.toml | 2 +- src/fundrive/drives/baidu/drive.py | 9 ++++++--- uv.lock | 2 +- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/logs/all.log b/logs/all.log index aa2244c..b0bdefb 100644 --- a/logs/all.log +++ b/logs/all.log @@ -7,3 +7,6 @@ 2024-12-26 17:07:40.207 |INFO | funbuild.core.core : core: 86 | funbuild | - fundrive build 2024-12-26 17:07:40.208 |INFO | funbuild.core.core : core: 74 | funbuild | - fundrive pull 2024-12-26 17:07:48.466 |INFO | funbuild.core.core : core: 78 | funbuild | - fundrive push +2024-12-26 17:17:12.377 |INFO | funbuild.core.core : core: 86 | funbuild | - fundrive build +2024-12-26 17:17:12.377 |INFO | funbuild.core.core : core: 74 | funbuild | - fundrive pull +2024-12-26 17:17:21.113 |INFO | funbuild.core.core : core: 78 | funbuild | - fundrive push diff --git a/logs/funbuild.log b/logs/funbuild.log index aa2244c..b0bdefb 100644 --- a/logs/funbuild.log +++ b/logs/funbuild.log @@ -7,3 +7,6 @@ 2024-12-26 17:07:40.207 |INFO | funbuild.core.core : core: 86 | funbuild | - fundrive build 2024-12-26 17:07:40.208 |INFO | funbuild.core.core : core: 74 | funbuild | - fundrive pull 2024-12-26 17:07:48.466 |INFO | funbuild.core.core : core: 78 | funbuild | - fundrive push +2024-12-26 17:17:12.377 |INFO | funbuild.core.core : core: 86 | funbuild | - fundrive build +2024-12-26 17:17:12.377 |INFO | funbuild.core.core : core: 74 | funbuild | - fundrive pull +2024-12-26 17:17:21.113 |INFO | funbuild.core.core : core: 78 | funbuild | - fundrive push diff --git a/pyproject.toml b/pyproject.toml index 77c46ce..f1c8ba7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "fundrive" -version = "1.2.89" +version = "1.2.90" description = "fundrive" readme = "README.md" requires-python = ">=3.8" diff --git a/src/fundrive/drives/baidu/drive.py b/src/fundrive/drives/baidu/drive.py index 6ec4743..1097910 100644 --- a/src/fundrive/drives/baidu/drive.py +++ b/src/fundrive/drives/baidu/drive.py @@ -1,13 +1,13 @@ import os from typing import List, Optional +from fundrive.core import BaseDrive, DriveFile +from fundrive.core.base import get_filepath from fundrives.baidu import BaiduPCSApi, PcsFile from funget import download +from funsecret import read_secret from funutil import getLogger -from fundrive.core import BaseDrive, DriveFile -from fundrive.core.base import get_filepath - logger = getLogger("fundrive") @@ -26,6 +26,9 @@ def __init__(self, *args, **kwargs): self.drive: BaiduPCSApi = None def login(self, bduss, stoken, ptoken, *args, **kwargs) -> bool: + bduss = bduss or read_secret("fundrive", "baidu", "bduss") + stoken = stoken or read_secret("fundrive", "baidu", "stoken") + ptoken = ptoken or read_secret("fundrive", "baidu", "ptoken") self.drive = BaiduPCSApi(bduss=bduss, stoken=stoken, ptoken=ptoken) return True diff --git a/uv.lock b/uv.lock index c7b59b7..35488b1 100644 --- a/uv.lock +++ b/uv.lock @@ -451,7 +451,7 @@ wheels = [ [[package]] name = "fundrive" -version = "1.2.89" +version = "1.2.90" source = { virtual = "." } dependencies = [ { name = "funget" },