Merge pull request #323 from helloteemo/fix/xiaohongshu_img
feat: 解决小红书图片水印问题
This commit is contained in:
commit
1a776ee968
|
@ -198,7 +198,12 @@ class XiaoHongShuClient(AbstractApiClient):
|
|||
Returns:
|
||||
|
||||
"""
|
||||
data = {"source_note_id": note_id}
|
||||
data = {
|
||||
"source_note_id": note_id,
|
||||
"image_formats": ["jpg", "webp", "avif"],
|
||||
"extra": {"need_body_topic": 1},
|
||||
"xsec_source": "pc_feed",
|
||||
}
|
||||
uri = "/api/sns/web/v1/feed"
|
||||
res = await self.post(uri, data)
|
||||
if res and res.get("items"):
|
||||
|
|
|
@ -32,6 +32,10 @@ async def update_xhs_note(note_item: Dict):
|
|||
image_list: List[Dict] = note_item.get("image_list", [])
|
||||
tag_list: List[Dict] = note_item.get("tag_list", [])
|
||||
|
||||
for img in image_list:
|
||||
if img.get('url_default') != '':
|
||||
img.update({'url': img.get('url_default')})
|
||||
|
||||
video_url = ''
|
||||
if note_item.get('type') == 'video':
|
||||
videos = note_item.get('video').get('media').get('stream').get('h264')
|
||||
|
|
Loading…
Reference in New Issue