Skip to content

Commit

Permalink
fix: bangumi.get_cid use get_download_url instead of initial state
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo2011 committed Feb 3, 2025
1 parent ff42cf1 commit b8805bb
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions bilibili_api/bangumi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1450,12 +1450,7 @@ async def get_cid(self) -> int:
Returns:
int: cid
"""
content, content_type = await self.get_episode_info()
if content_type == InitialDataType.NEXT_DATA:
return content["props"]["pageProps"]["dehydratedState"]["queries"][0][
"state"
]["data"]["result"]["play_view_business_info"]["episode_info"]["cid"]
return content["epInfo"]["cid"]
return (await self.get_download_url())["play_view_business_info"]["episode_info"]["cid"]

async def get_bangumi(self) -> "Bangumi":
"""
Expand Down

0 comments on commit b8805bb

Please sign in to comment.