Skip to content

About

๐ŸŽฌ Download watermark-free videos and images from Xiaohongshu (RED) and X / Twitter. Built with React and Cloudflare Workers.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

MMD โ€” Ming Media Downloader

English ยท ็ฎ€ไฝ“ไธญๆ–‡

Download watermark-free videos and images from Xiaohongshu (RED) and X / Twitter.

Paste a Xiaohongshu or X share link/text to extract original images and videos (watermark-free), with multi-resolution selection, download history, and shareable parse results.

Features

  • Multi-platform support โ€” Parses Xiaohongshu notes (video + images) and X/Twitter tweets (video + images)
  • Watermark-free downloads โ€” The server fetches original media directly, with no watermark added
  • Multi-resolution selection โ€” Shows all available video resolutions (1080p / 720p / 480p, etc.) with file sizes
  • Smart URL extraction โ€” Paste share text containing a link; the URL is detected and extracted automatically
  • Share parse results โ€” Generates an 8-character share code (stored in KV for 7 days) that others can open directly
  • Download history โ€” Keeps the last 10 records locally, with one-click re-parsing
  • Real-time download progress โ€” Streaming progress bar based on ReadableStream
  • PWA support โ€” Works offline, installable to desktop, with automatic update prompts
  • Dark mode โ€” Follows the system theme, adapting to light and dark styles
  • Responsive design โ€” Built on the Geist design language, fully adapted for mobile and desktop

Tech Stack

Layer Technology Notes
Frontend React 19 + TypeScript + Vite 8 Modern SPA framework
Build Vite + LightningCSS + pnpm Fast builds and CSS processing
PWA vite-plugin-pwa + Workbox Offline caching and auto updates
Styling Geist design system + CSS Variables Light/dark themes, responsive layout
Backend Cloudflare Workers Serverless edge computing
Storage Cloudflare KV Caching and share-code storage
Deployment Cloudflare Workers (single deployment) Frontend assets + API in one Worker, global edge

Getting Started

Requires Node.js โ‰ฅ 20 and pnpm โ‰ฅ 9.

pnpm install
pnpm dev        # frontend :5173 + backend :8787, /api/* proxied automatically
pnpm build      # typecheck + production bundle into dist/
pnpm test       # all main tests (pre-commit runs it automatically)
pnpm release    # build + deploy assets + API as one Worker

Additional test commands: test:full (incl. fallback tests), test:worker, test:frontend, test:fallback, test:watch.

Pre-commit hook (.githooks/pre-commit) runs lint โ†’ build โ†’ test on every commit. Skip with git commit --no-verify.

Worker tests run in the Miniflare (workerd) runtime with real Cloudflare Workers APIs such as HTMLRewriter and KVNamespace. Frontend tests use a jsdom environment.

Project Structure

ming-media-downloader/
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ src/                      # React SPA (entry main.tsx, hooks, components)
โ”‚   โ”œโ”€โ”€ public/                   # Static assets (icons, etc.)
โ”‚   โ”œโ”€โ”€ tests/                    # jsdom tests
โ”‚   โ”œโ”€โ”€ index.html                # SPA entry
โ”‚   โ”œโ”€โ”€ vite.config.ts            # Build config (dev proxy /api โ†’ :8787; outDir ../dist)
โ”‚   โ””โ”€โ”€ tsconfig.*.json           # Frontend typecheck
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts              # Entry point + routing (/api/*; other paths โ†’ SPA assets)
โ”‚   โ”‚   โ”œโ”€โ”€ parse.ts              # Parse orchestration
โ”‚   โ”‚   โ”œโ”€โ”€ rednote.ts            # Xiaohongshu parser
โ”‚   โ”‚   โ”œโ”€โ”€ twitter.ts            # X/Twitter parser
โ”‚   โ”‚   โ”œโ”€โ”€ handlers.ts           # Image / download proxies
โ”‚   โ”‚   โ”œโ”€โ”€ cache.ts              # KV cache
โ”‚   โ”‚   โ””โ”€โ”€ utils.ts              # CORS / JSON helpers
โ”‚   โ”œโ”€โ”€ tests/                    # workerd tests
โ”‚   โ”œโ”€โ”€ cloudflare.config.ts      # cf deploy/dev config (KV MMD_CACHE + ASSETS binding)
โ”‚   โ””โ”€โ”€ wrangler.toml             # Kept in sync for vitest-pool-workers
โ”œโ”€โ”€ dist/                         # Frontend build output (deployed as Worker assets)
โ”œโ”€โ”€ vitest.*.config.ts            # Test configs (root, per runtime)
โ”œโ”€โ”€ tsconfig.json / tsconfig.test.json
โ”œโ”€โ”€ scripts/                      # PWA icon generation
โ””โ”€โ”€ package.json                  # pnpm dev / release / test

Deploy with pnpm release (or cd backend && cf deploy): it builds the frontend and ships assets + API as one Worker.

Cloudflare resources required:

  • KV Namespace MMD_CACHE โ€” Caches parse results and share codes (expires after 7 days by default)
  • Browser Rendering (optional) โ€” Puppeteer rendering for Xiaohongshu SSR fallback

Deployment Configuration

Bind the following resources to the Worker in the Cloudflare Dashboard:

Binding Type Notes
MMD_CACHE KV Namespace Cache and share storage (required)
BROWSER_RENDERING Browser Rendering SSR fallback rendering (optional)

Architecture

User browser (React SPA + PWA)
    โ”‚
    โ”‚ /api/parse, /api/download, /api/image-proxy, /api/share
    โ–ผ
Cloudflare Worker (static assets + API)
    โ”‚
    โ”œโ”€โ”€ parse.ts โ†’ rednote.ts (SSR HTML parsing)
    โ”‚             โ†’ twitter.ts (fxtwitter API)
    โ”œโ”€โ”€ cache.ts โ†’ KV (MMD_CACHE)
    โ”œโ”€โ”€ handlers.ts โ†’ image proxy / download proxy
    โ””โ”€โ”€ utils.ts โ†’ URL parsing / CORS

API Endpoints

Method Path Description
GET /api/parse?url=... Parse a media link
GET /api/image-proxy?url=... Image proxy (Xiaohongshu Referer)
GET /api/download?url=...&name=... Media proxy download
POST /api/share Create a share link
GET /api/share?id=... Fetch a shared result

Acknowledgements

About

๐ŸŽฌ Download watermark-free videos and images from Xiaohongshu (RED) and X / Twitter. Built with React and Cloudflare Workers.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages