diff --git a/pikpakapi/__init__.py b/pikpakapi/__init__.py index afef9ad..db9c443 100644 --- a/pikpakapi/__init__.py +++ b/pikpakapi/__init__.py @@ -99,7 +99,11 @@ def get_headers(self, access_token: Optional[str] = None) -> Dict[str, str]: Returns the headers to use for the requests. """ headers = { - "User-Agent": self.build_custom_user_agent(), + "User-Agent": ( + self.build_custom_user_agent() + if self.captcha_token + else "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" + ), "Content-Type": "application/json; charset=utf-8", } @@ -662,7 +666,7 @@ async def get_download_url(self, file_id: str) -> Dict[str, Any]: result = await self._request_get( url=f"https://{self.PIKPAK_API_HOST}/drive/v1/files/{file_id}?", ) - + self.captcha_token = None return result async def file_rename(self, id: str, new_file_name: str) -> Dict[str, Any]: