We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
现在有些图片获取的原图链接可能会报 404
例如如下链接(包含 notes_pre_post ) http://sns-webpic-qc.xhscdn.com/202502091552/692128172967b167daf2193fb398949c/notes_pre_post/1040g3k831chsvi310s704a7j5nkdj1mv2v81c8g!nd_dft_wlteh_webp_3
http://sns-webpic-qc.xhscdn.com/202502091552/692128172967b167daf2193fb398949c/notes_pre_post/1040g3k831chsvi310s704a7j5nkdj1mv2v81c8g!nd_dft_wlteh_webp_3
如果使用下面方法获取,则会报404: http://sns-img-hw.xhscdn.com/1040g3k831chsvi310s704a7j5nkdj1mv2v81c8g
http://sns-img-hw.xhscdn.com/1040g3k831chsvi310s704a7j5nkdj1mv2v81c8g
实际它的原图应该是: http://sns-img-hw.xhscdn.com/notes_pre_post/1040g3k831chsvi310s704a7j5nkdj1mv2v81c8g 或 https://ci.xiaohongshu.com/notes_pre_post/1040g3k831chsvi310s704a7j5nkdj1mv2v81c8g
http://sns-img-hw.xhscdn.com/notes_pre_post/1040g3k831chsvi310s704a7j5nkdj1mv2v81c8g
https://ci.xiaohongshu.com/notes_pre_post/1040g3k831chsvi310s704a7j5nkdj1mv2v81c8g
修复代码为,修改 help.py 中 get_trace_id 方法 https://github.com/ReaJason/xhs/blob/613036c431f1f8b68d6d4e8125e20629679bee41/xhs/help.py#L97
help.py
get_trace_id
def get_trace_id(img_url: str): trace_id = img_url.split("/")[-1].split("!")[0] if "spectrum" in img_url: return "spectrum/" + trace_id # 增加此处代码 if "notes_pre_post" in img_url: return "notes_pre_post/" + trace_id return trace_id
临时修改方法:
def get_trace_id(img_url: str): trace_id = img_url.split("/")[-1].split("!")[0] if "spectrum" in img_url: return "spectrum/" + trace_id if "notes_pre_post" in img_url: return "notes_pre_post/" + trace_id return trace_id xhs.help.get_trace_id = get_trace_id
The text was updated successfully, but these errors were encountered:
No branches or pull requests
现在有些图片获取的原图链接可能会报 404
例如如下链接(包含 notes_pre_post )
http://sns-webpic-qc.xhscdn.com/202502091552/692128172967b167daf2193fb398949c/notes_pre_post/1040g3k831chsvi310s704a7j5nkdj1mv2v81c8g!nd_dft_wlteh_webp_3
如果使用下面方法获取,则会报404:
http://sns-img-hw.xhscdn.com/1040g3k831chsvi310s704a7j5nkdj1mv2v81c8g
实际它的原图应该是:
http://sns-img-hw.xhscdn.com/notes_pre_post/1040g3k831chsvi310s704a7j5nkdj1mv2v81c8g
或
https://ci.xiaohongshu.com/notes_pre_post/1040g3k831chsvi310s704a7j5nkdj1mv2v81c8g
修复代码为,修改
help.py
中get_trace_id
方法https://github.com/ReaJason/xhs/blob/613036c431f1f8b68d6d4e8125e20629679bee41/xhs/help.py#L97
临时修改方法:
The text was updated successfully, but these errors were encountered: