Skip to content

Commit

Permalink
Merge pull request #33 from mhdzumair/main
Browse files Browse the repository at this point in the history
Add support for getting media url for download link
  • Loading branch information
Quan666 authored May 28, 2024
2 parents 55111d5 + ae1ed38 commit fcd3fa3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pikpakapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,15 +606,16 @@ async def file_move_or_copy_by_path(
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]:
async def get_download_url(self, file_id: str) -> Dict[str, Any]:
"""
id: str - 文件id
获取文件的下载链接
返回结果中的 web_content_link 字段
Returns the file details data.
1. Use `medias[0][link][url]` for streaming with high speed in streaming services or tools.
2. Use `web_content_link` to download the file
"""
result = await self._request_get(
url=f"https://{self.PIKPAK_API_HOST}/drive/v1/files/{id}?usage=FETCH",
url=f"https://{self.PIKPAK_API_HOST}/drive/v1/files/{file_id}?_magic=2021&thumbnail_size=SIZE_LARGE",
)
return result

Expand Down

0 comments on commit fcd3fa3

Please sign in to comment.