Merge pull request #331 from helloteemo/feature/xiaohognshu_get_image

fix: 小红书下载新版本使用>3.10特性, 降低使用版本
This commit is contained in:
程序员阿江-Relakkes 2024-07-12 10:16:44 +08:00 committed by GitHub
commit e26c2aaf2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -129,7 +129,7 @@ class XiaoHongShuClient(AbstractApiClient):
return await self.request(method="POST", url=f"{self._host}{uri}",
data=json_str, headers=headers)
async def get_note_media(self, url: str) -> bytes | None:
async def get_note_media(self, url: str) -> Union[bytes, None]:
async with httpx.AsyncClient(proxies=self.proxies) as client:
response = await client.request("GET", url, timeout=self.timeout)
if not response.reason_phrase == "OK":