Adding Support for xiaohongshu.com Website
describe the feature you'd like to see
With a monthly visitation of 300 million in China, and the expectation of even more traffic in the future, support for this site is of great importance.
additional context
https://www.xiaohongshu.com/
https://github.com/imputnet/cobalt/issues/new?assignees=&labels=service+request&projects=&template=service-request.yml&title=add+support+for+%5Bservice+name%5D
@Springshen please add some example links
from #1055:
link samples
shortlink: http://xhslink.com/a/HFNEzlEk7tP3 share button copies this, so if cobalt can detect the link from this thatd be cool ig: 88 Kimmich发布了一篇小红书笔记,快来看吧! 😆 uvdE5BDEqh0P51h 😆 http://xhslink.com/a/HFNEzlEk7tP3,复制本条信息,打开【小红书】App查看精彩内容! note that share text link contains a , (not a ,), which social media like Discord parse into the link, and they know this, so they seem to split off everything after ,.
I just now noticed og:video tag contains the full video link lol
Once you fetch the HTML page from xiaohongshu.com, the data is stored in the window.__INITIAL_STATE__ object after page load, you can get everything you need.
window.__INITIAL_STATE__.note.noteDetailMap["note_id"].note.imageListis an image array for image noteswindow.__INITIAL_STATE__.note.noteDetailMap["note_id"].note.video.media.streamis the video URLs for video notes
Here is how it look like for image notes:
And here is how it look like for video notes:
You can try it on your browser console!
Reference: JoeanAmier/XHS-Downloader
thanks, will make a pr tomorrow (at my time)
we added support for xiaohongshu in 10.6! it's already available on https://cobalt.tools, go try it!