A compact Flask service that
- normalises and republishes selected Nyaa RSS feeds (SubsPlease 1080p & common English‑dub releases),
- exposes direct torrent‑download endpoints, and
- keeps itself awake via an asynchronous uptime pinger.
The repo ships with a Dockerfile and Procfile, so you can launch locally, in Docker, or in a single click on Koyeb.
| Feature | Details |
|---|---|
| 📰 RSS Rebroadcast | /rss/sub and /rss/dub fetch Nyaa RSS, rewrite titles (season/episode detection) and rewrite torrent links to point to your server. |
| 📥 Torrent Proxy | /torrents/<id>.torrent or /torrents/<filename> downloads the .torrent from Nyaa and streams it to the client. |
| 🔄 Uptime Monitor | A background aiohttp task pings URL_TO_MONITOR every CHECK_INTERVAL seconds to stop free hosts from sleeping. |
| 🐳 Docker & Koyeb‑ready | Containerised build with tiniest footprint. One‑click deploy badge included. |
.
├── app.py # Main Flask application (edit config here)
├── Dockerfile # Python 3.12‑slim container spec
├── Procfile # web: gunicorn app:app (example)
├── requirements.txt # aiohttp, Flask, pattern, requests, etc.
└── README.md # You’re reading it
app = Flask(__name__)
app.secret_key = "REPLACE_ME" # 👉 Mandatory – use env var in production
URL_TO_MONITOR = "https://example.com/" # 👉 Site to ping for uptime
CHECK_INTERVAL = 360 # 👉 Seconds between pingsYou can hard‑code values or override with environment variables:
export SECRET_KEY="$(openssl rand -base64 32)"
export URL_TO_MONITOR="https://my‑frontend.vercel.app/"
export CHECK_INTERVAL=300# 1 Clone
git clone https://github.com/ArihantSharma/RSS_Auto.git
cd anime‑rss‑proxy
# 2 Python env
python3 -m venv .venv
source .venv/bin/activate
# 3 Deps
pip install -r requirements.txt
# 4 Config (optional – see above)
# 5 Run
python app.py # http://127.0.0.1:5000# Build
docker build -t anime‑rss‑proxy .
# Run (port 8080 outside)
docker run -p 8080:5000 \ \
-e SECRET_KEY="$(openssl rand -base64 32)" \ \
-e URL_TO_MONITOR="https://my‑frontend.vercel.app/" \ \
anime‑rss‑proxyNow open http://localhost:8080/rss/sub.
During the wizard, add
SECRET_KEY,URL_TO_MONITOR, andCHECK_INTERVALin Environment Variables.
| Method | Path | Purpose |
|---|---|---|
GET |
/ |
Simple HTML index (template). |
GET |
/rss/sub |
Returns SubsPlease 1080p feed (first 30 items), with titles normalised. |
GET |
/rss/dub |
Returns common English‑dub feed (first 30 items). |
GET |
/torrents/<int:id> |
Streams the torrent whose Nyaa ID equals id. |
GET |
/torrents/<filename> |
Streams torrent file matching filename (e.g. abc123.torrent). |
Right now the endpoints return up to 30 items (hard‑coded in app.py). If you need classic pagination, extend ?page=/?per_page=fetch_and_parse_rss()—the helper already slices to 30 items, so swapping that for a paginator is trivial.
- Add more RSS suppliers or switch to Jikan/MyAnimeList.
- Replace the naive background thread with APScheduler, Celery or Quart if you move to async Flask.
- Cache results with Redis to avoid hammering Nyaa.
- Unit‑test with
pytestand automate via GitHub Actions.
MIT — do what you like, just keep the copyright‐notice.
Pull requests are welcome! Please:
- Fork → feature branch → PR.
- Follow PEP 8 + 120‑col style.
- Add context and docs for new endpoints.
Enjoy & happy anime binge‑automation! 🎉