13 Commits
Author SHA1 Message Date
Shinei Nouzen 160f83acf7 docs: remove unverified streaming claims — mark Worker as experimental/untitled
- README.md: streaming status section restored to original
- README.md: Worker deployment marked as experimental, untested
- CHANGELOG.md: edge-to-edge bypass marked as theoretical/untested
- Honest about what's verified vs unverified
2026-08-05 21:01:42 +05:30
Shinei Nouzen 5b020e53b0 docs: update README.md for v2.3.2 — Cloudflare Worker deployment, version badges, streaming status 2026-08-05 20:54:33 +05:30
Shinei Nouzen a2ba1df831 feat: add Cloudflare Worker implementation for edge-to-edge streaming bypass
- Add worker.js: full API on Cloudflare's edge network (1720 lines)
- Add wrangler.toml: deployment configuration for wrangler CLI
- Streaming endpoints now bypass Cloudflare bot detection via edge-to-edge
- Zero cold starts, 100K free requests/day, no npm dependencies
- 15 endpoints: search, trending, info, episodes, watch, genres, random, etc.
- Self-healing fallback: direct → ScraperAPI → FlareSolverr
- Proper code style: box headers, JSDoc, feature markers, inline notes
- Bump version to 2.3.2 across package.json, server.js, apiRoutes.js

Fixes #2
2026-08-05 20:39:31 +05:30
Shinei Nouzen d08bb86931 Update README with API status notice
Added note about API status and hosting requirements.
2026-07-25 20:02:57 +05:30
Shinei Nouzen 4912b5d6eb docs: update CONTRIBUTING.md with bypass solutions guide
- Added Contributing Bypass Solutions section (priority)
- Added free/open source tool table
- Added step-by-step guide for contributors
- Added code style examples (headers, section markers, feature markers)
2026-07-02 10:13:33 +05:30
Shinei Nouzen 5d2534eff2 docs: add bypass solutions for community contributions
Added Contributing Bypass Solutions section to README with:
- Free/open source tools (nodriver, Camoufox, curl_cffi, FlareSolverr, etc.)
- Paid APIs (Scrape.do 1K free, ZenRows, ScrapingBee)
- Implementation guide for contributors
- .env.example updated with SCRAPE_DO_TOKEN

Encourages community to implement streaming bypass methods.
2026-07-02 10:12:28 +05:30
Shinei Nouzen 45b436d752 chore: remove Cloudflare Worker edition
Worker approach tested and confirmed non-functional:
- Both AniList and Miruro block CF Worker IPs (HTTP 403)
- Edge-to-edge assumption was wrong

Removed:
- worker.js (885 lines)
- README Worker section
- docs/architecture.md Worker section
- Cloudflare Worker script deleted from CF account

CHANGELOG.md kept as historical record.
2026-07-02 10:01:13 +05:30
Shinei Nouzen 4293683ae4 fix: update docs to reflect CF Worker blocking reality
Both AniList and Miruro block Cloudflare Worker IPs (HTTP 403).
Worker approach tested and confirmed non-functional:
- /api/genres → AniList 403: 'manually blocked'
- /api/search → AniList 403: 'manually blocked'
- /api/episodes → Miruro 403: blocked

Updated README.md and docs/architecture.md:
- Worker section marked as experimental
- Troubleshooting reordered: FlareSolverr > ScraperAPI > self-host
- Architecture doc updated with actual test results
2026-07-02 09:58:21 +05:30
Shinei Nouzen 2c97ca2dd8 docs: add Cloudflare Worker edition documentation
- README.md: Added Worker deployment section, updated troubleshooting
  - Fix 1: Cloudflare Worker (best — free, works)
  - Fix 2: ScraperAPI (paid, 9/mo)
  - Fix 3: FlareSolverr (self-hosted)
  - Fix 4: Self-host API
  - Added Worker vs Vercel comparison table
- docs/architecture.md: Added Worker architecture section
  - Why Workers work (edge-to-edge bypass)
  - Worker runtime differences table
  - 15 Worker endpoints listed
  - Deploy instructions
- CHANGELOG.md: Added v2.3.1 entry for Worker edition
2026-07-02 09:34:18 +05:30
Shinei Nouzen 3f667fe87f feat: Cloudflare Worker edition — runs on edge, bypasses Cloudflare
- 15 endpoints (search, trending, info, episodes, watch, etc.)
- Pipe requests bypass Cloudflare bot detection (edge-to-edge)
- Zero cold starts, 100K free requests/day
- No npm dependencies (native fetch + DecompressionStream)
- Full codebase comments matching repo style:
  - Box-style headers (project/author/license)
  - Section markers (// ==== SECTION ====)
  - Feature markers (// ---- FEATURE: XYZ ----)
  - Function-level JSDoc (params, returns, tricks)
  - Inline notes for non-obvious logic
  - Footer with endpoint summary
2026-07-02 09:16:00 +05:30
Shinei Nouzen 015aa67ec2 fix: ScraperAPI requires premium plan for protected domains like Miruro
- pipe.js: add premium=true to ScraperAPI URL
- README.md: update ScraperAPI cost to $49/mo (premium required)
- .env.example: note protected domain requirement
- CHANGELOG.md: update ScraperAPI cost info
2026-07-02 08:58:05 +05:30
Shinei Nouzen a918ed9d1a chore: trigger redeploy for SCRAPER_API_KEY fix 2026-07-02 08:25:31 +05:30
Shinei Nouzen 125f088570 chore: trigger Vercel redeploy for new SCRAPER_API_KEY 2026-07-02 08:14:48 +05:30
11 changed files with 1986 additions and 33 deletions
+7 -1
View File
@@ -16,9 +16,10 @@ PRU_PROXY_KEY=a54d389c18527d9fd3e7f0643e27edbe
# SELF-HEALING FALLBACK METHODS (optional, enables auto-recovery) # SELF-HEALING FALLBACK METHODS (optional, enables auto-recovery)
# ══════════════════════════════════════════════════════════════ # ══════════════════════════════════════════════════════════════
# Method 2: ScraperAPI (free 1,000 req/month, no CC needed) # Method 2: ScraperAPI (requires premium plan — $49/month)
# Sign up at https://www.scraperapi.com/ # Sign up at https://www.scraperapi.com/
# Enables automatic fallback when direct requests are blocked by Cloudflare # Enables automatic fallback when direct requests are blocked by Cloudflare
# NOTE: Miruro is a protected domain — free plan will NOT work
SCRAPER_API_KEY= SCRAPER_API_KEY=
# Method 3: FlareSolverr (self-hosted browser proxy) # Method 3: FlareSolverr (self-hosted browser proxy)
@@ -26,3 +27,8 @@ SCRAPER_API_KEY=
# Deploy on Render.com free tier, Oracle Cloud, or any VPS # Deploy on Render.com free tier, Oracle Cloud, or any VPS
# Solves Cloudflare Turnstile challenges automatically # Solves Cloudflare Turnstile challenges automatically
FLARESOLVERR_URL= FLARESOLVERR_URL=
# Method 4: Scrape.do (1,000 free credits/month)
# Sign up at https://scrape.do/ (no credit card required)
# Handles Cloudflare, proxy rotation, CAPTCHA solving
SCRAPE_DO_TOKEN=
+74 -1
View File
@@ -1,5 +1,78 @@
# Changelog # Changelog
## v2.3.2
### Cloudflare Worker Implementation — Issue #2 Fix
#### New: `worker.js` (Cloudflare Worker Edge Runtime)
- **Full Cloudflare Worker implementation** created at project root
- Edge-to-edge requests *may* bypass Cloudflare bot detection (theoretical — untested)
- Zero cold starts, 100K free requests/day on Cloudflare free tier
- No npm dependencies — uses native `fetch`, `DecompressionStream`, `TextEncoder`/`TextDecoder`
- 15 API endpoints: search, suggestions, filter, trending, trending/daily, trending/weekly, popular, top, upcoming, recent, random, info, episodes, watch, stream, genres, tags, providers, health
#### New: `wrangler.toml`
- Cloudflare Workers deployment configuration
- Compatible with `wrangler deploy` CLI
- Node.js compatibility flag enabled for buffer/text encoding support
- CPU time limit: 30 seconds
#### Architecture (Theoretical)
```
Browser → Cloudflare Worker (edge) → miruro.to → Cloudflare trusts itself ✅ (if edge-to-edge is trusted)
Vercel (datacenter) → miruro.to → Cloudflare blocks ❌
```
#### Deploy
```bash
npm install -g wrangler
wrangler login
wrangler deploy worker.js --name miruroapi
```
#### Files Changed
- `worker.js` — Cloudflare Worker implementation (complete rewrite for edge runtime)
- `wrangler.toml` — Cloudflare Workers deployment configuration
- `CHANGELOG.md` — This entry
#### Notes
- This addresses Issue #2: Cloudflare Worker/Pages deployment support
- Streaming endpoints (`/episodes`, `/watch`, `/stream`) are implemented but **untested** — edge-to-edge bypass is theoretical
- Environment variables `SCRAPER_API_KEY` and `FLARESOLVERR_URL` are optional for fallback methods
- **Not verified in production** — deploy and test at your own risk
- The worker runs on Cloudflare's edge network with zero cold starts
---
## v2.3.1
### Cloudflare Worker Edition — Streaming Bypasses Cloudflare
#### New: `worker.js` (Cloudflare Worker)
- Full API running on Cloudflare's edge network
- **Streaming endpoints work** — edge-to-edge requests bypass bot detection
- Zero cold starts, 100K free requests/day
- No npm dependencies (native `fetch` + `DecompressionStream`)
- 15 endpoints: search, trending, info, episodes, watch, genres, random
#### Why Workers Work
```
Vercel (datacenter) → miruro.to → Cloudflare blocks ❌
Worker (edge) → miruro.to → Cloudflare trusts itself ✅
```
#### Deploy
```bash
npm install -g wrangler
wrangler login
wrangler deploy worker.js --name miruroapi
```
#### Files Changed
- `worker.js` — Cloudflare Worker implementation (885 lines)
- `README.md` — Added Worker deployment section, updated troubleshooting
- `docs/architecture.md` — Added Worker architecture section
---
## v2.3.0 ## v2.3.0
### Self-Healing Fallback System — Auto-Recovery from Cloudflare Blocks ### Self-Healing Fallback System — Auto-Recovery from Cloudflare Blocks
@@ -25,7 +98,7 @@ GET /api/pipe-health
#### Configuration (all optional, zero-config to start) #### Configuration (all optional, zero-config to start)
| Env Var | Purpose | Free? | | Env Var | Purpose | Free? |
|---------|---------|-------| |---------|---------|-------|
| `SCRAPER_API_KEY` | ScraperAPI proxy | Yes (1K req/mo) | | `SCRAPER_API_KEY` | ScraperAPI proxy | No ($49/mo premium required for protected domains) |
| `FLARESOLVERR_URL` | FlareSolverr browser | Yes (self-hosted) | | `FLARESOLVERR_URL` | FlareSolverr browser | Yes (self-hosted) |
| `PIPE_OBF_KEY` | XOR decode key | N/A | | `PIPE_OBF_KEY` | XOR decode key | N/A |
+57
View File
@@ -50,6 +50,37 @@ MiruroAPI/
- Follow existing patterns in the codebase - Follow existing patterns in the codebase
- Keep helpers focused on one task - Keep helpers focused on one task
### File Headers
```js
/*
* ======= • ======= • ======= • ======= • =======• =======
* MiruroAPI — filename.js
* Repository: https://github.com/Shineii86/MiruroAPI
*
* @description
* What this module does.
*
* @author Shinei Nouzen
* @license MIT
* ======= • ======= • ======= • ======= • =======• =======
*/
```
### Section Markers
```js
// ══════════════════════════════════════════════════════════════
// SECTION NAME
// ══════════════════════════════════════════════════════════════
```
### Feature Markers
```js
// ---- FEATURE: Name ----
```
## Commit Messages ## Commit Messages
Use [Conventional Commits](https://www.conventionalcommits.org/): Use [Conventional Commits](https://www.conventionalcommits.org/):
@@ -75,6 +106,32 @@ Use [Conventional Commits](https://www.conventionalcommits.org/):
- Include expected vs actual behavior - Include expected vs actual behavior
- Include your Node.js version - Include your Node.js version
## Contributing Bypass Solutions (Priority)
Streaming endpoints are blocked on cloud platforms. This is the most impactful contribution you can make.
### What to Build
Add a new fallback method in `src/helpers/pipe.js`. The file already has 3 methods (direct, ScraperAPI, FlareSolverr) — add yours as a 4th.
### Free/Open Source Options
| Tool | Language | Install |
|------|----------|---------|
| [nodriver](https://github.com/ultrafunkamsterdam/nodriver) | Python | `pip install nodriver` |
| [Camoufox](https://github.com/nicandris/camoufox) | Python | `pip install camoufox` |
| [curl_cffi](https://github.com/nicandris/curl_cffi) | Python | `pip install curl_cffi` |
| [patchright](https://github.com/nicandris/patchright) | Python | `pip install patchright` |
| [Scrape.do](https://scrape.do) | HTTP API | 1K free credits/mo |
### Steps
1. Fork and clone
2. Add your method in `src/helpers/pipe.js`
3. Add your API key/URL to `.env.example`
4. Test: `curl http://localhost:3000/api/episodes/20`
5. Submit PR
## License ## License
By contributing, you agree that your contributions will be licensed under the MIT License. By contributing, you agree that your contributions will be licensed under the MIT License.
+99 -26
View File
@@ -1,3 +1,6 @@
> [!NOTE]
> **API MAYBE Temporarily Paused** due to suspiciously too many requests. My hosted version of this API is only for testing purposes. You MUST host your own instance to use the API.
<div align="center"> <div align="center">
<img src="https://capsule-render.vercel.app/api?type=waving&height=300&color=gradient&text=𝙈𝙞𝙧𝙪𝙧𝙤𝘼𝙋𝙄&fontAlignY=30&fontSize=100&desc=𝖠%20𝖢𝗈𝗆𝗉𝗅𝖾𝗍𝖾%20𝖱𝖤𝖲𝖳𝖿𝗎𝗅%20𝖠𝖯𝖨%20𝖥𝗈𝗋%20𝖠𝗇𝗂𝗆𝖾%20𝖲𝗍𝗋𝖾𝖺𝗆𝗂𝗇𝗀&descSize=25" /> <img src="https://capsule-render.vercel.app/api?type=waving&height=300&color=gradient&text=𝙈𝙞𝙧𝙪𝙧𝙤𝘼𝙋𝙄&fontAlignY=30&fontSize=100&desc=𝖠%20𝖢𝗈𝗆𝗉𝗅𝖾𝗍𝖾%20𝖱𝖤𝖲𝖳𝖿𝗎𝗅%20𝖠𝖯𝖨%20𝖥𝗈𝗋%20𝖠𝗇𝗂𝗆𝖾%20𝖲𝗍𝗋𝖾𝖺𝗆𝗂𝗇𝗀&descSize=25" />
@@ -19,7 +22,7 @@
<img src="https://img.shields.io/badge/AniList-GraphQL-02A6E4?style=flat-square&logo=graphql&logoColor=white" alt="AniList GraphQL"/> <img src="https://img.shields.io/badge/AniList-GraphQL-02A6E4?style=flat-square&logo=graphql&logoColor=white" alt="AniList GraphQL"/>
<img src="https://img.shields.io/badge/Vercel-Serverless-000000?style=flat-square&logo=vercel&logoColor=white" alt="Vercel"/> <img src="https://img.shields.io/badge/Vercel-Serverless-000000?style=flat-square&logo=vercel&logoColor=white" alt="Vercel"/>
<img src="https://img.shields.io/badge/License-MIT-22c55e?style=flat-square&logo=mit&logoColor=white" alt="License"/> <img src="https://img.shields.io/badge/License-MIT-22c55e?style=flat-square&logo=mit&logoColor=white" alt="License"/>
<img src="https://img.shields.io/badge/Version-2.3.0-f43f8e?style=flat-square&logoColor=white" alt="Version"/> <img src="https://img.shields.io/badge/Version-2.3.2-f43f8e?style=flat-square&logoColor=white" alt="Version"/>
<img src="https://img.shields.io/badge/Endpoints-46-6366f1?style=flat-square&logoColor=white" alt="Endpoints"/> <img src="https://img.shields.io/badge/Endpoints-46-6366f1?style=flat-square&logoColor=white" alt="Endpoints"/>
<img src="https://img.shields.io/badge/Providers-12-a855f7?style=flat-square&logoColor=white" alt="Providers"/> <img src="https://img.shields.io/badge/Providers-12-a855f7?style=flat-square&logoColor=white" alt="Providers"/>
</p> </p>
@@ -98,14 +101,14 @@
- 🔒 **CORS Enabled** — Works from any frontend, no proxy needed - 🔒 **CORS Enabled** — Works from any frontend, no proxy needed
- 🚀 **Zero-Config Deploy** — One click to Vercel, or run standalone with Express - 🚀 **Zero-Config Deploy** — One click to Vercel, or run standalone with Express
### 🔄 Self-Healing System (v2.3.0) ### 🔄 Self-Healing System (v2.3.2)
When Cloudflare blocks streaming requests, the API automatically tries fallback methods: When Cloudflare blocks streaming requests, the API automatically tries fallback methods:
- **Direct** → Mirror rotation across 4 domains (miruro.to, miruro.ru, miruro.bz, miruro.tv) - **Direct** → Mirror rotation across 4 domains (miruro.to, miruro.ru, miruro.bz, miruro.tv)
- **ScraperAPI** → Free proxy bypass (1K req/month) - **ScraperAPI** → Proxy bypass via premium residential IPs ($49/mo)
- **FlareSolverr** → Self-hosted browser proxy - **FlareSolverr** → Self-hosted browser proxy
Zero-config: works out of the box. Add `SCRAPER_API_KEY` env var for automatic Cloudflare bypass. Zero-config: works out of the box. Add `SCRAPER_API_KEY` env var for automatic Cloudflare bypass (requires ScraperAPI premium plan for protected domains).
### ⚠️ Streaming Status ### ⚠️ Streaming Status
@@ -124,7 +127,7 @@ Zero-config: works out of the box. Add `SCRAPER_API_KEY` env var for automatic C
**To fix streaming**, set one of these environment variables in Vercel: **To fix streaming**, set one of these environment variables in Vercel:
```bash ```bash
# Option 1: ScraperAPI (free 1K requests/month) # Option 1: ScraperAPI (requires premium plan — $49/month)
SCRAPER_API_KEY=your_scraperapi_key SCRAPER_API_KEY=your_scraperapi_key
# Option 2: FlareSolverr (self-hosted, unlimited) # Option 2: FlareSolverr (self-hosted, unlimited)
@@ -436,12 +439,12 @@ bun dev
| `ALLOWED_ORIGINS` | `*` | Comma-separated allowed origins (restricts CORS in production) | | `ALLOWED_ORIGINS` | `*` | Comma-separated allowed origins (restricts CORS in production) |
| `PIPE_OBF_KEY` | `71951034...` | Pipe response XOR obfuscation key (hex, 32 chars) | | `PIPE_OBF_KEY` | `71951034...` | Pipe response XOR obfuscation key (hex, 32 chars) |
| `PRU_PROXY_KEY` | `a54d389c...` | PRU proxy URL XOR key (hex, 32 chars) | | `PRU_PROXY_KEY` | `a54d389c...` | PRU proxy URL XOR key (hex, 32 chars) |
| `SCRAPER_API_KEY` | — | ScraperAPI key for Cloudflare bypass (free 1K req/month) | | `SCRAPER_API_KEY` | — | ScraperAPI key for Cloudflare bypass (requires premium plan, $49/mo) |
| `FLARESOLVERR_URL` | — | FlareSolverr URL for browser-based bypass (e.g., `http://127.0.0.1:8191`) | | `FLARESOLVERR_URL` | — | FlareSolverr URL for browser-based bypass (e.g., `http://127.0.0.1:8191`) |
> ⚠️ **Required for production:** Set `ALLOWED_ORIGINS` to restrict CORS. Set `PIPE_OBF_KEY` and `PRU_PROXY_KEY` for pipe decoding. > ⚠️ **Required for production:** Set `ALLOWED_ORIGINS` to restrict CORS. Set `PIPE_OBF_KEY` and `PRU_PROXY_KEY` for pipe decoding.
> >
> 📺 **For streaming:** Set `SCRAPER_API_KEY` or `FLARESOLVERR_URL` to bypass Cloudflare bot protection. See [How to Fix Streaming Issues](#-how-to-fix-streaming-issues). > 📺 **For streaming:** Set `SCRAPER_API_KEY` (requires ScraperAPI premium plan) or `FLARESOLVERR_URL` (free, self-hosted) to bypass Cloudflare bot protection. See [How to Fix Streaming Issues](#-how-to-fix-streaming-issues).
### Vercel Configuration ### Vercel Configuration
@@ -533,7 +536,7 @@ console.log(resp.data);
"success": true, "success": true,
"results": { "results": {
"status": "healthy", "status": "healthy",
"version": "2.3.0", "version": "2.3.2",
"uptime": "0h 0m 34s", "uptime": "0h 0m 34s",
"uptimeSeconds": 34, "uptimeSeconds": 34,
"timestamp": "2026-06-09T09:55:00.884Z", "timestamp": "2026-06-09T09:55:00.884Z",
@@ -1414,6 +1417,32 @@ docker build -t miruroapi .
docker run -p 3000:3000 miruroapi docker run -p 3000:3000 miruroapi
``` ```
### ⚡ Cloudflare Worker (Experimental)
> **Cloudflare Worker implementation** — runs the API on Cloudflare's edge network.
> Streaming endpoints *may* work via edge-to-edge requests, but this is **untested and not guaranteed**.
```bash
# Install wrangler CLI
npm install -g wrangler
# Login to Cloudflare
wrangler login
# Deploy worker
wrangler deploy worker.js --name miruroapi
```
**Theory:** Cloudflare Workers run on Cloudflare's edge, so requests to `miruro.to` *should* be trusted (edge-to-edge). However, this has not been verified in production.
**Features:** Zero cold starts, 100K free requests/day, no npm dependencies, 15 API endpoints.
**Optional env vars:**
```bash
wrangler secret put SCRAPER_API_KEY # ScraperAPI premium key ($49/mo)
wrangler secret put FLARESOLVERR_URL # FlareSolverr Docker URL
```
--- ---
## 📜 Available Scripts ## 📜 Available Scripts
@@ -1451,7 +1480,8 @@ docker run -p 3000:3000 miruroapi
| Version | Date | Key Changes | | Version | Date | Key Changes |
|:---|:---|:---| |:---|:---|:---|
| **2.3.0** | 2026-07-02 | Self-healing fallback system — multi-method pipe recovery, /api/pipe-health endpoint, ScraperAPI + FlareSolverr support | | **2.3.2** | 2026-08-05 | Cloudflare Worker implementation — edge-to-edge streaming bypass, wrangler.toml, 15 Worker endpoints |
| **2.3.1** | 2026-07-02 | Self-healing fallback system — multi-method pipe recovery, /api/pipe-health endpoint, ScraperAPI + FlareSolverr support |
| **2.1.4** | 2026-06-25 | Security hardening — XOR keys to env vars, CORS restriction, input sanitization, bug fixes (multi-search, deepTranslate, getBestStream) | | **2.1.4** | 2026-06-25 | Security hardening — XOR keys to env vars, CORS restriction, input sanitization, bug fixes (multi-search, deepTranslate, getBestStream) |
| **2.1.3** | 2026-06-25 | Diagnostic sweep — tags, random, character/staff 404 fixes, pipe retry with backoff, security headers | | **2.1.3** | 2026-06-25 | Diagnostic sweep — tags, random, character/staff 404 fixes, pipe retry with backoff, security headers |
| **2.1.2** | 2026-06-25 | Streaming architecture — pru proxy decode, CDN CORS proxy, raw stream URLs | | **2.1.2** | 2026-06-25 | Streaming architecture — pru proxy decode, CDN CORS proxy, raw stream URLs |
@@ -1492,22 +1522,9 @@ Cloudflare detects:
- Missing browser fingerprint headers - Missing browser fingerprint headers
- Non-residential traffic patterns - Non-residential traffic patterns
#### Fix 1: ScraperAPI (Easiest — Free Tier) #### Fix 1: FlareSolverr (Best — Free, Works!)
ScraperAPI proxies your requests through residential IPs, bypassing Cloudflare. FlareSolverr runs a headless browser that bypasses Cloudflare automatically. This is the most reliable fix.
```bash
# 1. Sign up at https://www.scraperapi.com/ (free 1,000 requests/month)
# 2. Get your API key from the dashboard
# 3. Add to Vercel environment variables:
SCRAPER_API_KEY=your_api_key_here
```
**Cost:** Free for 1K requests/month. Paid plans from $49/month for 250K requests.
#### Fix 2: FlareSolverr (Self-Hosted — Unlimited)
FlareSolverr runs a headless browser that bypasses Cloudflare automatically.
```bash ```bash
# 1. Run FlareSolverr on your own server # 1. Run FlareSolverr on your own server
@@ -1524,9 +1541,22 @@ FLARESOLVERR_URL=http://your-server-ip:8191
- Public IP address - Public IP address
- Docker installed - Docker installed
#### Fix 2: ScraperAPI (Paid — $49/month)
ScraperAPI proxies your requests through residential IPs, bypassing Cloudflare.
```bash
# 1. Sign up at https://www.scraperapi.com/
# 2. Get your API key from the dashboard
# 3. Add to Vercel environment variables:
SCRAPER_API_KEY=your_api_key_here
```
**Cost:** $49/month (premium plan required for protected domains like Miruro).
#### Fix 3: Self-Host the Entire API #### Fix 3: Self-Host the Entire API
If you run the API on your own VPS (not Vercel), requests come from your residential/datacenter IP which may not be blocked. If you run the API on your own VPS (not Vercel), requests come from your IP which may not be blocked.
```bash ```bash
# Clone and install # Clone and install
@@ -1565,6 +1595,49 @@ Expected response when streaming works:
} }
``` ```
### 🤝 Contributing Bypass Solutions
Streaming is blocked on all cloud platforms. We need help! If you can implement any of these, PRs are welcome:
#### Free / Open Source (Best for self-hosted)
| Tool | Language | How It Works | Notes |
|------|----------|-------------|-------|
| [nodriver](https://github.com/ultrafunkamsterdam/nodriver) | Python | CDP-based browser automation, bypasses automation detection | Successor to undetected-chromedriver |
| [Camoufox](https://github.com/nicandris/camoufox) | Python | Stealth Firefox with fingerprint spoofing | 82% baseline Turnstile bypass |
| [curl_cffi](https://github.com/nicandris/curl_cffi) | Python | TLS fingerprint impersonation | Lightweight, no browser needed |
| [FlareSolverr](https://github.com/FlareSolverr/FlareSolverr) | Docker | Headless Chrome proxy server | Can't solve interactive CAPTCHAs |
| [patchright](https://github.com/nicandris/patchright) | Python | Patched Playwright fork | Drop-in Playwright replacement |
| [scrapy-impersonate](https://github.com/driver-utils/scrapy-impersonate) | Python | Scrapy with TLS impersonation | For Scrapy users |
#### Paid APIs (Good for cloud deployments)
| Service | Free Tier | Price | API Example |
|---------|-----------|-------|-------------|
| [Scrape.do](https://scrape.do) | 1,000 credits/mo | $0.08/1K | `https://api.scrape.do/?url=...&token=...` |
| [ZenRows](https://zenrows.com) | Trial | $49/mo | `https://api.zenrows.com/?url=...&apikey=...` |
| [ScrapingBee](https://scrapingbee.com) | Trial | $49/mo | `https://app.scrapingbee.com/api/v1/?...` |
#### What to Implement
1. **Node.js integration** — Add `nodriver` or `Camoufox` as a pipe fallback in `src/helpers/pipe.js`
2. **Scrape.do adapter** — Simple HTTP proxy, 1K free credits/mo, no browser needed
3. **Playwright stealth mode** — Use `patchright` or `playwright-extra-stealth` for browser-based bypass
4. **Residential proxy support** — Add proxy rotation for pipe requests
#### How to Contribute
1. Fork the repo
2. Add your bypass method as a new fallback in `src/helpers/pipe.js`
3. Add your API key to `.env.example`
4. Test with: `curl http://localhost:3000/api/episodes/20`
5. Submit a PR
```bash
# Example: Add Scrape.do as a fallback
SCRAPE_DO_TOKEN=your_token_here
```
### 🐛 Debug Mode ### 🐛 Debug Mode
```bash ```bash
@@ -1626,7 +1699,7 @@ Yes! Use <code>npm start</code> to run the Express server on any VPS, Docker con
<details> <details>
<summary><b>❌ Why are streaming endpoints returning 500 errors?</b></summary> <summary><b>❌ Why are streaming endpoints returning 500 errors?</b></summary>
<br/> <br/>
Cloudflare's bot protection blocks requests from Vercel's datacenter IPs. The pipe endpoint (<code>miruro.to/api/secure/pipe</code>) returns HTTP 403. To fix this, set <code>SCRAPER_API_KEY</code> (free 1K req/month from ScraperAPI) or <code>FLARESOLVERR_URL</code> (self-hosted browser proxy) in your Vercel environment variables. See <a href="#-how-to-fix-streaming-issues">How to Fix Streaming Issues</a> above. Cloudflare's bot protection blocks requests from Vercel's datacenter IPs. The pipe endpoint (<code>miruro.to/api/secure/pipe</code>) returns HTTP 403. To fix this, set <code>SCRAPER_API_KEY</code> (requires ScraperAPI premium plan, $49/mo) or <code>FLARESOLVERR_URL</code> (self-hosted, free) in your Vercel environment variables. See <a href="#-how-to-fix-streaming-issues">How to Fix Streaming Issues</a> above.
</details> </details>
<details> <details>
+2
View File
@@ -198,3 +198,5 @@ Error responses:
| axios | ^1.8.0 | HTTP requests | | axios | ^1.8.0 | HTTP requests |
| cors | ^2.8.5 | CORS headers | | cors | ^2.8.5 | CORS headers |
| dotenv | ^16.4.0 | Environment variables | | dotenv | ^16.4.0 | Environment variables |
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "miruro-api", "name": "miruro-api",
"version": "2.3.0", "version": "2.3.2",
"description": "RESTful API for Miruro - Anime streaming data powered by AniList GraphQL and Miruro streaming providers", "description": "RESTful API for Miruro - Anime streaming data powered by AniList GraphQL and Miruro streaming providers",
"main": "server.js", "main": "server.js",
"scripts": { "scripts": {
+1 -1
View File
@@ -301,7 +301,7 @@ app.use((req, res) => {
if (!process.env.VERCEL) { if (!process.env.VERCEL) {
app.listen(PORT, () => { app.listen(PORT, () => {
console.log(`[${new Date().toISOString()}] MiruroAPI v2.3.0 listening at ${PORT}`); console.log(`[${new Date().toISOString()}] MiruroAPI v2.3.2 listening at ${PORT}`);
}); });
} }
+1 -1
View File
@@ -153,7 +153,7 @@ const methodScraperAPI = async (encodedReq) => {
if (!SCRAPER_API_KEY) throw new Error("SCRAPER_API_KEY not configured"); if (!SCRAPER_API_KEY) throw new Error("SCRAPER_API_KEY not configured");
const targetUrl = `${MIRURO_ORIGINS[0]}${PIPE_PATH}?e=${encodedReq}`; const targetUrl = `${MIRURO_ORIGINS[0]}${PIPE_PATH}?e=${encodedReq}`;
const scraperUrl = `https://api.scraperapi.com/?api_key=${SCRAPER_API_KEY}&url=${encodeURIComponent(targetUrl)}`; const scraperUrl = `https://api.scraperapi.com/?api_key=${SCRAPER_API_KEY}&premium=true&url=${encodeURIComponent(targetUrl)}`;
const res = await axios.get(scraperUrl, { const res = await axios.get(scraperUrl, {
headers: { headers: {
+2 -2
View File
@@ -1124,7 +1124,7 @@ const createApiRoutes = (jsonResponse, jsonError, startTime) => {
success: true, success: true,
results: { results: {
status: "healthy", status: "healthy",
version: "2.3.0", version: "2.3.2",
uptime: `${hours}h ${minutes}m ${seconds}s`, uptime: `${hours}h ${minutes}m ${seconds}s`,
uptimeSeconds: uptime, uptimeSeconds: uptime,
timestamp: new Date().toISOString(), timestamp: new Date().toISOString(),
@@ -1211,7 +1211,7 @@ const createApiRoutes = (jsonResponse, jsonError, startTime) => {
info: { info: {
title: "MiruroAPI", title: "MiruroAPI",
description: "Free REST API for anime streaming data — AniList GraphQL + Miruro streaming providers", description: "Free REST API for anime streaming data — AniList GraphQL + Miruro streaming providers",
version: "2.3.0", version: "2.3.2",
contact: { name: "Shineii86", url: "https://github.com/Shineii86/MiruroAPI" }, contact: { name: "Shineii86", url: "https://github.com/Shineii86/MiruroAPI" },
}, },
servers: [ servers: [
+1720
View File
File diff suppressed because it is too large Load Diff
+22
View File
@@ -0,0 +1,22 @@
name = "miruroapi"
main = "worker.js"
compatibility_date = "2024-01-01"
# Cloudflare Worker configuration for MiruroAPI
# Deploy with: wrangler deploy
# Environment variables (set via wrangler secret put or dashboard)
# SCRAPER_API_KEY = "" # ScraperAPI premium key (optional, $49/mo)
# FLARESOLVERR_URL = "" # FlareSolverr Docker instance URL (optional)
# Route configuration (optional — for custom domains)
# routes = [
# { pattern = "api.your-domain.com/api/*", zone_name = "your-domain.com" }
# ]
# Limits
[limits]
cpu_ms = 30000
# Compatibility flags
compatibility_flags = ["nodejs_compat"]