crumpled paper texture

Fetchy

An ad-free, open-source media extractor engineered to bypass scraper traps across Instagram, TikTok, YouTube, and Facebook. Ephemeral edge proxying via Cloudflare Workers and Upstash.

NextjsTypescriptTailwindcssRedisVercel

Web App

411 views

RepositoryLive Site

The web utilities we use daily shouldn't feel like a hostage situation.

If you search for a video downloader today, you are greeted by one of the scummiest corners of the modern internet. Deceptive green "DOWNLOAD NOW" buttons hiding trojans. Aggressive full-page redirect cascades. Unskippable countdown timers designed to juice display ad impressions. By the time you get your 10-second video, your browser has stored fifty tracking cookies and prompted you three times to enable push notifications.

Fetchy was born as an act of defiance. No ads. No telemetry. No account creation. No artificial wait timers. Just an open-source, edge-accelerated extraction engine that pulls pristine, full-bitrate media and gets out of your way in under two seconds.

Fetchy Interface


The Cat-and-Mouse Game: Reverse-Engineering Big Tech

Social media platforms treat media extraction as an adversarial battleground. Trillion-dollar platforms like Meta and ByteDance constantly alter internal APIs, obfuscate JSON payloads, and deploy bot-fingerprinting firewalls.

Here is how Fetchy negotiates the extraction mechanics across each platform:


The Core Architectural Bottleneck: Bandwidth & IP Leaks

When designing a media downloader, naive architecture kills you in one of two ways:

  1. Proxying everything through your server: If a user downloads a 200MB 4K reel and your Next.js server streams the bytes, your bandwidth bills skyrocket and server memory bottlenecks instantly.
  2. Handing the raw CDN link to the user: If you simply forward Instagram's raw CDN link to the user's browser, the download fails. Meta's CDNs validate origin headers, enforce strict CORS boundaries, and token-expire links within seconds. Furthermore, exposing raw upstream URLs risks leaking the scraper proxy's network identity.

The Fix: Ephemeral Signed CDN Tokens on Cloudflare Workers

Fetchy solves this with a zero-bandwidth edge proxy architecture:

[User Browser]
      │
      │ 1. POST /api/fetch (Target URL)
      ▼
[Next.js Scraper Core]
      │
      │ 2. Scrapes & resolves upstream media stream
      │ 3. Signs an ephemeral access token into Cloudflare KV (TTL: 10 min)
      │ 4. Returns signed proxy link: gofetchy.app/dl/{token}
      ▼
[User Browser clicks Download]
      │
      │ 5. GET gofetchy.app/dl/{token}
      ▼
[Cloudflare Edge Worker]
      │
      │ 6. Validates token in KV
      │ 7. Streams media directly from upstream at 100MB/s (Rewriting headers on the fly)
      ▼
[User Downloads Clean MP4 at Line Speed]

By offloading the actual file streaming to Cloudflare Workers at the network edge:

  • The origin Next.js server uses virtually 0 MB of bandwidth for media transfers.
  • Upstream platforms see Cloudflare's massive edge IP pools rather than a single predictable scraper IP.
  • The user gets full CDN line-speed downloads with proper Content-Disposition filename headers.

Unified API Contract

Regardless of whether Fetchy is parsing a TikTok slideshow, an Instagram Reel, or a 4K YouTube clip, the API returns a standardized response envelope:

Sample API Response: POST /api/fetch
{
  "success": true,
  "platform": "instagram",
  "author": {
    "username": "natgeo",
    "avatar": "https://img.gofetchy.app/proxy/avatar.jpg"
  },
  "title": "Chasing the Northern Lights in Tromsø",
  "media": [
    {
      "type": "video",
      "quality": "1080p",
      "format": "mp4",
      "size": 42105920,
      "downloadUrl": "https://gofetchy.app/dl/7f3a9e1b-signed"
    }
  ],
  "metrics": {
    "executionTimeMs": 184
  }
}

The Evolution: From Naive Script to "Neon" Architecture

Fetchy has been rebuilt three times, each version marking a major technical milestone:

  • v1 (The Naive Monolith): Node.js + Express with server-rendered EJS templates. Downloaded videos by buffering the entire file into server RAM before serving. Crashed whenever someone tried downloading a video longer than 3 minutes.
  • v2 (The Framework Shift): Rebuilt with Next.js and Tailwind CSS. Introduced client-side rendering and basic error handling, but still suffered from tight platform coupling and IP blocks.
  • v3 (Neon - Current): Complete architectural reboot. Next.js 15, Turbopack, Cloudflare Worker edge streaming, Upstash Redis rate limiting, and the build-time plugin compiler.

The Retrospective

  • The best feature is what you omit: In an ecosystem plagued by ad popups and dark patterns, having the discipline to ship a clean, respectful product turns users into passionate advocates.
  • Push bytes to the edge early: Trying to stream heavy binary files through serverless lambdas is an anti-pattern. Putting Cloudflare Workers in front of upstream streams saved hundreds of dollars in compute and bandwidth.
  • Design for volatility: Scraping APIs will break—it is an inevitability, not an exception. Isolating platforms into autonomous meta.ts modules means a breaking change on TikTok never takes down Instagram or YouTube.

Visit the live app at gofetchy.app or explore the full source code on GitHub.