Skip to content

Commit

Permalink
✨ 增加接口获取下载直链
Browse files Browse the repository at this point in the history
  • Loading branch information
Quan666 committed Nov 6, 2022
1 parent 74bf784 commit 3b4fabb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions pikpakapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,3 +503,17 @@ async def file_move_or_copy_by_path(
else:
result = await self.file_batch_copy(ids=from_ids, to_parent_id=to_parent_id)
return result

async def get_download_url(self, id: str) -> Dict[str, Any]:
"""
id: str - 文件id
获取文件的下载链接
返回结果中的 web_content_link 字段
"""
result = await self._request_get(
url=f"https://{self.PIKPAK_API_HOST}/drive/v1/files/{id}?usage=FETCH",
headers=self.get_headers(),
proxies=self.proxy,
)
return result
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "PikPakAPI"
version = "0.1.0"
version = "0.1.1"
description = "PikPakAPI"
authors = ["Quan666 <[email protected]>"]
license = "GPL-3.0-only"
Expand Down

0 comments on commit 3b4fabb

Please sign in to comment.