Open Froktime opened 2 months ago
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.
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.
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 =========================
3 domains pointing towards the original image (no check watermark): ci.xiaohongshu com, sns-img-bd.xhscdn com, sns-img-al.xhscdn com Maybe any domain or all 3 img link is octet stream content type I tested changing the domain https://sns-img-bd.xhscdn.com/1040g008317hv54argq4g5n252fdhkc66m6n6tf0 (can view no download) => https://ci.xiaohongshu.com/1040g008317hv54argq4g5n252fdhkc66m6n6tf0 (cannot view self-download)
watermark at the bottom is easier to remove than in the middle https://sns-webpic-qc.xhscdn.com/202409122009/62fc71ede1fe30481e94ebcfccea3e4b/1040g008317fgs6a6ka5g5pbuvn4venama82r3eo!nd_dft_wlteh_webp_3 (bottom) https://sns-img-al.xhscdn.com/55aecc9b-df03-0ef1-a602-1d126e78035b?imageView2/2/w/1080/format/jpg (middle) both are 1 image but the link has a watermark in the middle encoding the link extension (55aecc9b-df03-0ef1-a602-1d126e78035b)
Images without specific format are mostly webp (octet stream content type/ normal webp) => Should add ?imageView2/2/w/format/png because it is the best and most original photo Additionally, it limits the automatic downloading of images.
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.