CoolFace
Apppublic

srrexus/otakudesu

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
App README

Otakudesu Scraper API

FastAPI scraper untuk otakudesu.blog. Deploy ke Hugging Face Spaces (Docker SDK).

Endpoints

  • —GET /api/home — ongoing + complete preview
  • —GET /api/ongoing?page=1
  • —GET /api/complete?page=1
  • —GET /api/anime-list — alphabetical index
  • —GET /api/jadwal-rilis
  • —GET /api/genres
  • —GET /api/genres/{slug}?page=1
  • —GET /api/search?q=
  • —GET /api/anime/{slug} — detail + episode list + batch link
  • —GET /api/episode/{slug} — player iframe, mirrors, download links
  • —GET /api/batch/{slug} — batch download links
  • —POST /api/mirror?data_content={base64} — resolves a mirror's data-content (from /api/episode) into an embeddable iframe HTML
  • —GET /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/ping every PING_INTERVAL_SECONDS (default 600) to prevent the Space from sleeping.
  • —PING_INTERVAL_SECONDS (optional): default 600.

Deploy to Hugging Face Spaces

  1. 1.Create a new Space, SDK = Docker.
  2. 2.Push this folder (Dockerfile already listens on port 7860).
  3. 3.Set SELF_URL in Space secrets/variables to your Space's public URL once known.
  4. 4.(Optional) Set up an external cron (e.g. UptimeRobot, cron-job.org) hitting /api/ping every 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

bash
pip install -r requirements.txt
uvicorn app.main:app --reload

Notes

  • —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/mirror replicates 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/episode or 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 — set CF_PROXY_URL to route requests through a Cloudflare Worker.