DEV Community

wangxiaolou
wangxiaolou

Posted on

How I Built a Free Watermark-Free Xiaohongshu (RedNote) Downloader — and What I Learned About Anti-Scraping

The Problem

Xiaohongshu (also known as RED or RedNote) is China's fastest-growing lifestyle platform — 300M+ monthly active users sharing beauty tutorials, product reviews, and travel content. But if you've ever tried to save a video from it, you know the pain:

  • Screen recording = terrible quality + watermark visible
  • Third-party APKs = security nightmare
  • Most "downloaders" online = sketchy ads, no preview, or straight-up broken

I built xiaohongshudownloader.com to fix this: paste a share link → see a preview (title, author, thumbnail) → download the clean MP4 or original-quality image. No sign-up, no app install, works on any device.

The Technical Challenges

1. Resolving Share Links

Xiaohongshu's share system generates short links (xhslink.com/xxx or xhslink.cn/xxx) that redirect to the actual note. But they come in multiple flavors:

  • Short links (need redirect resolution)
  • Full share text (title + emoji + URL — users paste the whole thing)
  • Explore URLs with xsec_token parameters
  • International RedNote URLs (rednote.com)

My parser handles all four formats. The tricky part: xsec_token expires, so cached tokens break. I had to implement fresh-token fetching with fallback logic.

2. Bypassing Watermarks

Here's the insight most downloaders miss: Xiaohongshu's watermark isn't burned into the original file. It's applied at the CDN layer when served through certain endpoints. The original MP4 on the CDN source is clean.

My approach: fetch the note's metadata → extract the direct CDN source URL → serve that to the user. No re-encoding, no quality loss, no watermark overlay.

(This is also why some downloads DO have watermarks — if the note is private or the CDN endpoint requires the watermarked version, I can't bypass it. I'm honest about this on the site.)

3. Anti-Scraping Countermeasures

Xiaohongshu (understandably) doesn't want mass scraping. Their defenses include:

  • Signature generation: Each API request needs a valid signature (computed client-side, changes regularly)
  • Rate limiting per IP: Too many requests = temporary blocks
  • Cookie/session validation: Requests without proper cookies get rejected
  • Short-link expiration: Tokens in URLs expire after a window

My countermeasures:

  • 24-hour response caching: Once I resolve a note, I cache the result. Same link = instant response from cache, no repeat hitting their API.
  • Request throttling: Per-IP rate limits on my end prevent abuse (and keep my IP pool healthy).
  • Graceful degradation: When a link fails (private note, expired token, timeout), I return a specific error message telling the user WHY it failed and how to fix it — instead of a generic "something went wrong."

4. Multi-Format Support

Videos are straightforward (MP4). But Xiaohongshu is heavily image-based:

  • Single photos: WebP or JPG from the CDN
  • Albums/carousels: Multiple images in order, with a "download all as ZIP" option
  • Live Photos: Not supported (honestly disclosed — these require special handling)

I also added batch mode: paste up to 8 links at once, get all results in parallel.

Architecture (Simplified)

User pastes link
    ↓
[Link Parser] → detects format, resolves redirects
    ↓
[Cache Check] → hit? return cached result
    ↓ miss
[Metadata Fetcher] → signature, cookies, API call
    ↓
[Media Extractor] → CDN source URLs (video/images)
    ↓
[Preview Card] → title, author, thumbnail, format
    ↓
[Download] → direct CDN URL or proxied stream
Enter fullscreen mode Exit fullscreen mode

The whole thing is a single Next.js app. No database — just an in-memory + Redis cache layer. Total infra cost: under $20/month at current traffic (~15k visits/month).

What Surprised Me: The Indonesian Market

I built this tool expecting Chinese diaspora and Chinese-language learners to be my audience. Wrong.

63% of my traffic comes from Indonesia. Indonesian creators and e-commerce resellers use Xiaohongshu as a product-sourcing and content-inspiration platform. They search in English and Indonesian for "download xiaohongshu video" — and found my tool.

This is a live lesson in building for a global audience: you don't always get the users you design for. Sometimes the market finds you.

Try It

If you want to test it: xiaohongshudownloader.com

  • Paste any public Xiaohongshu/RedNote share link
  • Works for videos, photos, and albums
  • Free, no sign-up, works on mobile

Building in public. Follow my progress or ask technical questions — happy to share more details about the scraping architecture in the comments.

Top comments (0)