🚀 Convert Terabox Links to Direct Download Links Instantly ⚡ High Speed • 🔗 API Ready • 🛠 Developer Friendly
A lightweight Cloudflare Worker that extracts direct download links from Terabox (formerly Dubox) shared URLs and serves them via a proxy endpoint for seamless playback or download.
Made By BIZ FACTORY 🚀
- Extract file info (name, size, thumbnail, direct link) from Terabox share links.
- Proxy the actual download through your own domain (bypasses CORS and cookie restrictions).
- Supports range requests → enables video seeking and partial downloads.
- Fully CORS-enabled for frontend integration.
- Built with security & performance in mind.
- Log in to Terabox in your browser.
- Open DevTools (
F12) → Application → Cookies →https://www.terabox.com. - Copy the full Cookie string (contains
Nus=etc.).
-
Install Wrangler CLI:
npm install -g wrangler
-
Clone or create a new Worker project:
wrangler init terabox-downloader cd Terabox-Downloader-API-bizft -
Replace
src/worker.jswith the provided code. -
Set your cookie as a secret (never hardcode it!):
wrangler secret put ENTE_YOUR_TERABOX_COOKIES
→ Paste your full Terabox cookie when prompted.
-
Deploy:
wrangler deploy
- Go to Cloudflare Dashboard → Workers.
- Create a new Worker.
- Paste the code into the editor.
- Replace this line:
with your actual cookie OR (better) use environment variables:
const COOKIE = "ENTE_YOUR_TERABOX_COOKIES"
- In the Worker settings → Environment variables → Secrets
- Add a secret named
TERABOX_COOKIEwith your cookie value. - Then update the code to:
(Note: You’ll need to pass
const COOKIE = env.TERABOX_COOKIE; // if using env
envinto thefetchhandler — see Wrangler docs for module syntax.)
Request:
{
"link": "https://terabox.com/s/your-share-link"
}Response:
{
"file_name": "example.mp4",
"file_size": "1.25 GB",
"size_bytes": 1342177280,
"thumbnail": "https://.../thumb.jpg",
"download_link": "https://.../file.mp4?auth=...",
"proxy_url": "https://your-worker.your-subdomain.workers.dev/proxy?url=...&file_name=example.mp4"
}✅ Use
proxy_urlin your frontend for direct playback/download without CORS issues.
Query Params:
url(required): The direct Terabox download link (dlink)file_name(optional): Filename forContent-Disposition
Example:
GET /proxy?url=https://.../file.mp4&file_name=my_video.mp4
Supports byte-range requests → works with
<video>tags and download managers.
- Your Terabox cookie grants full access to your account. Treat it like a password.
- Never expose the raw
dlinkpublicly — always use the/proxyendpoint. - The Worker includes CORS headers for safe cross-origin usage.
<video controls src="https://your-worker.proxy/proxy?url=ENCODED_DLINK&file_name=video.mp4"></video>Or fetch file info:
const res = await fetch('https://your-worker.proxy', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ link: 'https://terabox.com/s/abc123' })
});
const data = await res.json();
console.log(data.proxy_url); // Use this for download/playback| Issue | Solution |
|---|---|
Invalid link |
Ensure the Terabox link is public and valid |
Failed to extract tokens |
Cookie may be expired — re-login and update it |
| Video won’t seek | Ensure your player supports range requests (most do) |
| 403 Forbidden | Terabox may block non-browser User-Agents — try updating User-Agent |
✨ Developed with ❤️ by BIZ FACTORY
Your go-to source for smart tools, automation scripts, and cloud-native solutions.
🔔 Stay updated — Join our Telegram channel for the latest releases, tips, and exclusive utilities!