🚀 MEGA.nz to Cloudflare Index
Index your MEGA.nz files using Cloudflare Workers for faster browsing, improved stability, and direct downloads with MEGA download quota bypass.
⚠️ Experimental: This project is still under development and may not work in all situations. Use it at your own risk.
📖 How It Works
Two modes are available:
- MEGA Shared Link + Account mode
- MEGA Shared Link Only mode — no MEGA account required
🚀 Shared Link Only — Easy Deployment
Use this if you only want to access public MEGA shared links.
- Copy the latest "worker.js" from this repository.
- Sign in to your Cloudflare Dashboard.
- Go to Workers & Pages → Create Application.
- Select Start with Hello World! → Get Started.
- Deploy the Worker and open Edit Code.
- Replace the default "worker.js" with the copied code.
- Click Deploy and then Visit.
No environment variables or secrets are required.
🔐 MEGA Shared Link + Account Mode
- Open the "MEGA Index Code Generator" (https://developeranaz.github.io/webapps/mega.nz/).
- Enter your MEGA account email and password.
- Select a template theme.
- Generate your custom "worker.js".
- Deploy the generated Worker through your Cloudflare Dashboard.
⚠️ Disable ad blockers or browser extensions that block external scripts while using the generator.
🔗 What It Does
- Paste a public "mega.nz" link on the landing page.
- Browse MEGA shared folders through a clean file index.
- Open individual file links and view file name and size.
- Download files directly through the Cloudflare Worker.
- Supports HTTP Range Requests for resumable and multi-threaded downloads.
- Designed to provide MEGA download quota bypass through your own deployed Worker.
- Works with large files and compatible download managers.
⚡ Performance Test
The Worker was tested with Google Colab and "aria2" using 13 parallel connections.
- Average download speed: 44 MiB/s
- Multi-threaded connections: 13
- Large file tested: 6+ GB
- Result: Large-file download completed successfully.
Temporary "Got EOF" errors may occur on some parallel connections and do not necessarily affect the final download.
🛠️ Manual Deployment
For users familiar with Node.js:
npm install
npx wrangler login
npx wrangler deploy
Local development:
npm install
npm run dev
Requires Node.js and a Cloudflare account.
⚠️ License & Responsibility
Provided as-is for personal use. Respect MEGA's terms of service and the rights of file owners. This project is experimental and may change or stop working as MEGA or Cloudflare services change.
No comments or reviews, maybe you want to be first?