实现文件下载功能,添加下载文件方法和相关的文件信息获取逻辑。更新主驱动类以支持文件下载,并在工具类中实现文件下载的进度条显示。
This commit is contained in:
5
_api.py
5
_api.py
@@ -336,6 +336,11 @@ class API:
|
||||
}
|
||||
return await self._make_request("POST", "upload/v2/file/single/create", json=data, data=file)
|
||||
|
||||
async def download_file(self, fileId: int) -> Dict[str, Any]:
|
||||
"""下载文件"""
|
||||
params = {"fileId": fileId}
|
||||
return await self._make_request("GET", "api/v1/file/download_info", params=params)
|
||||
|
||||
async def create_offline_downlod(self, url: str, dirID: int, fileName: Optional[str] = None, callBackUrl: Optional[str] = None) -> Dict[str, Any]:
|
||||
"""创建离线下载任务"""
|
||||
data: Dict[str, Any] = {
|
||||
|
||||
Reference in New Issue
Block a user