Skip to content
BackendOct 17, 2025 (first commit)

Terabox Gateway

Terabox link resolver & streaming API

Terabox Gateway is a Python/Flask service that takes a Terabox share link and returns direct, streamable media URLs. It handles link resolution, metadata extraction, and CORS-safe responses, and is deployed across Vercel and Render for redundancy.

Terabox Gateway preview

01

Overview

Terabox Gateway turns opaque Terabox share links into usable, direct media URLs that frontends can stream or download. The API abstracts away Terabox's resolution flow, returns clean JSON with metadata, and is designed to be consumed by any client. It runs on both Vercel (serverless) and Render (persistent) so a provider outage doesn't take the service down.

02

Features

  • Resolve Terabox share links to direct stream/download URLs
  • Return file metadata (name, size, type) alongside URLs
  • CORS-enabled JSON responses for browser clients
  • Dual deployment on Vercel and Render for redundancy
  • Lightweight caching of resolved links to reduce latency
  • Structured error responses with clear status codes

03

Architecture

  • Flask application exposing a small, well-documented REST surface
  • Link resolution layer that follows Terabox share redirects
  • Response caching to avoid repeated resolution of the same link
  • Serverless deployment on Vercel for edge proximity
  • Persistent deployment on Render as a fallback origin
  • Cloudflare in front for caching, TLS, and DDoS protection

04

Screenshots

API response JSON for a resolved Terabox link
Resolver endpoint returning direct media URLs and metadata
Deployment diagram across Vercel and Render
Redundant deployment across two cloud providers

05

Tech Stack

PythonFlaskREST APIVercelRenderCloudflare

06

Challenges Solved

Fragile resolution flow

Terabox's share flow changes often. The resolver is isolated behind one module so upstream changes only touch one file, and failures degrade to a clear error rather than a crash.

Provider availability

A single host is a single point of failure. Deploying to both Vercel and Render with a shared contract lets clients fall over automatically.

Cold-start latency

Serverless cold starts hurt perceived speed on the resolver. A short TTL cache on resolved links absorbs repeat requests and keeps p99 low.