mirror of
https://github.com/dnslin/aria2bot.git
synced 2026-01-11 20:12:20 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c16213179c | ||
|
|
5a505fda66 |
@@ -83,6 +83,10 @@ class OneDriveClient(CloudStorageBase):
|
|||||||
def _get_account(self) -> Account:
|
def _get_account(self) -> Account:
|
||||||
"""获取或创建 Account 实例"""
|
"""获取或创建 Account 实例"""
|
||||||
if self._account is None:
|
if self._account is None:
|
||||||
|
# 确保 token 已从文件加载到缓存
|
||||||
|
if not self._token_backend.has_data:
|
||||||
|
self._token_backend.load_token()
|
||||||
|
|
||||||
# 公共客户端只需要 client_id,不需要 client_secret
|
# 公共客户端只需要 client_id,不需要 client_secret
|
||||||
credentials = (self.config.client_id,)
|
credentials = (self.config.client_id,)
|
||||||
self._account = Account(
|
self._account = Account(
|
||||||
|
|||||||
@@ -199,8 +199,8 @@ class DownloadHandlersMixin:
|
|||||||
text = f"✅ *下载完成*\n📄 {safe_name}\n📦 大小: {task.size_str}\n🆔 GID: `{task.gid}`"
|
text = f"✅ *下载完成*\n📄 {safe_name}\n📦 大小: {task.size_str}\n🆔 GID: `{task.gid}`"
|
||||||
try:
|
try:
|
||||||
await _bot_instance.send_message(chat_id=chat_id, text=text, parse_mode="Markdown")
|
await _bot_instance.send_message(chat_id=chat_id, text=text, parse_mode="Markdown")
|
||||||
# 注意:自动上传已在 _auto_refresh_task 中通过 _coordinated_auto_upload 处理
|
# 触发自动上传(如果配置了的话)
|
||||||
# 这里不再单独触发,避免重复上传
|
await self._coordinated_auto_upload(chat_id, task.gid, task, _bot_instance)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(f"发送完成通知失败 (GID={task.gid}): {e}")
|
logger.warning(f"发送完成通知失败 (GID={task.gid}): {e}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user