Skip to content
New issue

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

Fix xiaohongshu #1363

Open
Froktime opened this issue Sep 12, 2024 · 2 comments
Open

Fix xiaohongshu #1363

Froktime opened this issue Sep 12, 2024 · 2 comments

Comments

@Froktime
Copy link

Froktime commented Sep 12, 2024

photo at the article/post link

https://sns-img-al.xhscdn.com/55aecc9b-df03-0ef1-a602-1d126e78035b?imageView2/2/w/1080/format/jpg
(watermark is in the middle of the image)
=>
https://ci.xiaohongshu.com/1040g008317fgs6a6ka5g5pbuvn4venama82r3eo?imageView2/2/w/format/png
I searched from a website specializing in downloading photos on xiaohongshu
I noticed its domain (ci.xiaohongshu) and how they give the best photos (png).
+++++++++++++
+++++++++++++

photo at account link (has watermark in bottom corner)
https://www.xiaohongshu.com/user/profile/5c4513db00000000060230c6

https://sns-webpic-qc.xhscdn.com/202409120153/90a336806a14f43a338a5165a5d3bc4a/1040g008317hv54argq4g5n252fdhkc66m6n6tf0!nc_n_webp_mw_1
Images are resized by default to 640px wide and webp
=>
https://sns-img-bd.xhscdn.com/1040g008317hv54argq4g5n252fdhkc66m6n6tf0 (by other's script, domain sns-img-bd.xhscdn com)
This is the thumbnail of the video so it is jpg
https://sns-img-bd.xhscdn.com/1040g008317hv54argq4g5n252fdhkc66m6n6tf0?imageView2/2/w/format/png
png colors are brighter than jpg

This is a photo post (has watermark in bottom corner)
1/
https://sns-webpic-qc.xhscdn.com/202409120153/bc8b9009a3e9cdc683cf575e81b527bf/1040g2sg317k2p5sbgs705n252fdhkc66bu3alo8!nc_n_webp_mw_1
=> https://sns-img-al.xhscdn.com/1040g2sg317k2p5sbgs705n252fdhkc66bu3alo8 (by your script, sns-img-al.xhscdn com)
Auto-download, Webp + application/octet stream content type, no view on any browser

2/
https://sns-webpic-qc.xhscdn.com/202409121825/5879f0290d7edd91ccf51656cf30f43a/1040g0083106bbsrp626g5p478o87otig6kjnr2o!nd_dft_wlteh_webp_3
=>
https://sns-img-al.xhscdn.com/1040g0083106bbsrp626g5p478o87otig6kjnr2o
Webp, can view on web


Original post
https://www.xiaohongshu.com/discovery/item/66c40a32000000001d016b9c?source=webshare&xsec_token=AB4IHM8VYFEOtPtbbZLtlj0jzwTxS7HMyh9IDcJAndEBg=&xsec_source=pc_share

http://sns-webpic-qc.xhscdn.com/202409121936/a0fcd72a3e61e54ba1e5519bc4033bc8/110/0/01e6c4049f66c596001000000001916db21a13_0.jpg!nd_prv_wlteh_webp_3

https://sns-webpic-qc.xhscdn.com/202409121934/b7ed24c3ada7c58b4636cf9c593559df/110/0/01e6c4049f66c596001000000001916db21a13_0.jpg!nc_n_webp_mw_1
=> original img????
This is another type of image on xiaohongshu that has an image extension attached but I don't know what the original image is.

======================== Summary =========================

I think you can fix a few first, problems like images with watermarks in the middle or images with format extensions will be considered later.

@qsniyg
Copy link
Owner

qsniyg commented Nov 13, 2024

Sorry, I can't really fix the other issues as they all give me 403, in fact even visiting the main site results in broken images, so I guess my IP must be banned. But I've added support for the sns-img-al domain.

@Froktime
Copy link
Author

Froktime commented Nov 20, 2024

Sorry, I can't really fix the other issues as they all give me 403, in fact even visiting the main site results in broken images, so I guess my IP must be banned. But I've added support for the sns-img-al domain.

I think you just need to add ?imageView2/2/w/format/png to the original link and it's ok. Hmm referer is also quite important for some links.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants