srrexus/otakudesu
0
Otakudesu Scraper API
FastAPI scraper untuk otakudesu.blog. Deploy ke Hugging Face Spaces (Docker SDK).
Endpoints
GET /api/home— ongoing + complete previewGET /api/ongoing?page=1GET /api/complete?page=1GET /api/anime-list— alphabetical indexGET /api/jadwal-rilisGET /api/genresGET /api/genres/{slug}?page=1GET /api/search?q=GET /api/anime/{slug}— detail + episode list + batch linkGET /api/episode/{slug}— player iframe, mirrors, download linksGET /api/batch/{slug}— batch download linksPOST /api/mirror?data_content={base64}— resolves a mirror'sdata-content(from/api/episode) into an embeddable iframe HTMLGET /api/ping— health check / keep-alive target
Env vars
CF_PROXY_URL(optional): Cloudflare Worker forward-proxy prefix, e.g.https://your-worker.workers.dev/?url=. If unset, requests go directly to otakudesu.blog with browser-like headers.SELF_URL(optional, for HF Spaces): your own Space URL, e.g.https://username-space.hf.space. Enables an internal auto-ping loop to/api/pingeveryPING_INTERVAL_SECONDS(default 600) to prevent the Space from sleeping.PING_INTERVAL_SECONDS(optional): default600.
Deploy to Hugging Face Spaces
- Create a new Space, SDK = Docker.
- Push this folder (Dockerfile already listens on port 7860).
- Set
SELF_URLin Space secrets/variables to your Space's public URL once known. - (Optional) Set up an external cron (e.g. UptimeRobot, cron-job.org) hitting
/api/pingevery 5-10 min as a second layer of keep-alive, since free Spaces can still sleep regardless of internal pings if there's zero external traffic.
Local run
pip install -r requirements.txt
uvicorn app.main:app --reloadNotes
- Download links (
link.desustream.com/?id=...) are a redirect layer — the final host URL (Mega/GoFile/etc.) is resolved by following the redirect, not present directly in scraped HTML. /api/mirrorreplicates the site's own two-step AJAX flow (fetch nonce, then fetch embed HTML) — required because mirror iframes aren't in the initial page HTML, only the default player is.- If
/api/episodeor any endpoint returns empty/stripped data on Render or another host but works locally, the target server is likely serving a cached/bot-detected variant due to missing browser-like headers or a flagged IP — setCF_PROXY_URLto route requests through a Cloudflare Worker.
