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
This commit is contained in:
Shinei Nouzen
2026-07-02 09:58:21 +05:30
parent 2c97ca2dd8
commit 4293683ae4
2 changed files with 29 additions and 59 deletions
+22 -55
View File
@@ -1414,31 +1414,18 @@ docker build -t miruroapi .
docker run -p 3000:3000 miruroapi docker run -p 3000:3000 miruroapi
``` ```
### ⚡ Cloudflare Worker (Streaming Works!) ### ⚡ Cloudflare Worker (Experimental)
> **Streaming endpoints work on Workers** — requests to Miruro bypass Cloudflare bot detection because Workers run on Cloudflare's edge network (edge-to-edge traffic is trusted). > **⚠️ Note:** Cloudflare Workers are blocked by both AniList and Miruro. Worker IPs are detected as automated and rejected with HTTP 403. The Worker remains in the repo for reference but is not recommended as a streaming fix.
```bash
# Install wrangler CLI
npm install -g wrangler
# Login to Cloudflare
wrangler login
# Deploy
wrangler deploy worker.js --name miruroapi
```
Your API is live at: `https://miruroapi.YOUR_SUBDOMAIN.workers.dev`
| Feature | Vercel | Cloudflare Worker | | Feature | Vercel | Cloudflare Worker |
|---------|--------|-------------------| |---------|--------|-------------------|
| Streaming (pipe) | Blocked (403) | Works | | AniList endpoints | Works | Blocked (403) |
| Streaming (pipe) | Blocked (403) | Blocked (403) |
| Cold starts | ~500ms | Zero | | Cold starts | ~500ms | Zero |
| Free tier | Unlimited | 100K req/day | | Free tier | Unlimited | 100K req/day |
| npm deps | Yes | No (native fetch) |
> See `worker.js` for the full Worker implementation with 15 endpoints. > See `worker.js` for the Worker implementation. For streaming, use FlareSolverr or self-host instead.
--- ---
@@ -1518,42 +1505,9 @@ Cloudflare detects:
- Missing browser fingerprint headers - Missing browser fingerprint headers
- Non-residential traffic patterns - Non-residential traffic patterns
#### Fix 1: Cloudflare Worker (Best — Free, Works!) #### Fix 1: FlareSolverr (Best — Free, Works!)
Workers run on Cloudflare's edge network. Edge-to-edge requests are trusted — no bot detection. FlareSolverr runs a headless browser that bypasses Cloudflare automatically. This is the most reliable fix.
```bash
# 1. Install wrangler
npm install -g wrangler
# 2. Login
wrangler login
# 3. Deploy
wrangler deploy worker.js --name miruroapi
# 4. Your streaming now works at:
# https://miruroapi.YOUR_SUBDOMAIN.workers.dev/api/episodes/20
```
**Cost:** Free (100K requests/day). No API key needed.
#### Fix 2: ScraperAPI (Paid — $49/month)
ScraperAPI proxies your requests through residential IPs, bypassing Cloudflare.
```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:** $49/month (premium plan required for protected domains like Miruro).
#### Fix 3: 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
@@ -1570,9 +1524,22 @@ FLARESOLVERR_URL=http://your-server-ip:8191
- Public IP address - Public IP address
- Docker installed - Docker installed
#### Fix 4: Self-Host the Entire API #### Fix 2: ScraperAPI (Paid — $49/month)
If you run the API on your own VPS (not Vercel), requests come from your residential/datacenter IP which may not be blocked. 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
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
+7 -4
View File
@@ -202,15 +202,18 @@ Error responses:
## Cloudflare Worker Architecture (v2.3.1) ## Cloudflare Worker Architecture (v2.3.1)
The Worker edition (`worker.js`) runs the same API on Cloudflare's edge network. Key difference: **streaming endpoints work** because edge-to-edge requests bypass Cloudflare bot detection. The Worker edition (`worker.js`) runs the same API on Cloudflare's edge network. **⚠️ Experimental** — testing shows that both AniList and Miruro block CF Worker IPs (HTTP 403).
### Why Workers Work ### Why Workers Don't Work (Current)
``` ```
Vercel (datacenter IP) → miruro.to → Cloudflare WAF → 403 Blocked Vercel (datacenter IP) → miruro.to → Cloudflare WAF → 403 Blocked
Cloudflare Worker (edge) → miruro.to → Cloudflare internal network → 200 OK Cloudflare Worker (edge) → miruro.to → Cloudflare bot detection → 403 Blocked
Cloudflare Worker (edge) → graphql.anilist.co → AniList blocks worker IPs → 403 Blocked
``` ```
Cloudflare Worker IPs are recognized as automated traffic and blocked by both services.
### Worker Runtime Differences ### Worker Runtime Differences
| Feature | Express (Node.js) | Cloudflare Worker | | Feature | Express (Node.js) | Cloudflare Worker |
@@ -241,7 +244,7 @@ Cloudflare Worker (edge) → miruro.to → Cloudflare internal network → 200 O
| `GET /api/episodes/:id` | Episode list (pipe) | | `GET /api/episodes/:id` | Episode list (pipe) |
| `GET /api/watch/:provider/:anilistId/:category/:slug` | Streaming sources (pipe) | | `GET /api/watch/:provider/:anilistId/:category/:slug` | Streaming sources (pipe) |
### Deploy ### Deploy (Experimental)
```bash ```bash
npm install -g wrangler npm install -g wrangler