- Python 84.6%
- HTML 15.1%
- XSLT 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github | ||
| .vscode | ||
| chzzk | ||
| config | ||
| core | ||
| kick | ||
| static | ||
| templates | ||
| tools | ||
| twitch | ||
| youtube | ||
| .dockerignore | ||
| .env.example | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| compose.yaml | ||
| conftest.py | ||
| Dockerfile | ||
| LICENSE | ||
| manage.py | ||
| pyproject.toml | ||
| README.md | ||
ttvdrops.lovinator.space
Track limited-time free rewards across Twitch, Kick, and Chzzk.
Streaming platforms often give away free in-game items, channel perks, and other rewards (called "drops") to viewers who meet certain conditions, like watching a streamer play a game for a set amount of time (Time-Based Drops) or subscribing to a participating channel (Subscription-Based Drops). These offers are organized into "Drops Campaigns": collections of rewards distributed during a specified time period, each with its own start and end dates and requirements. Campaigns are only available for a limited window and can be scattered across different platforms, making them easy to miss.
ttvdrops.lovinator.space monitors these campaigns across multiple platforms, archives their data for historical reference, and lets you subscribe to RSS/Atom feeds so you never miss a new offer. All historical campaign data is available as open datasets licensed under CC0.
Contact
Found a bug or have an idea? Please open an issue. Include as much detail as possible, including what you expected, what happened, and steps to reproduce.
You can also email tlovinator@gmail.com or reach out on Discord (TheLovinator).
Features
- Multi-platform: Twitch, Kick, and Chzzk
- RSS/Atom feeds: Subscribe to campaigns, games, organizations, and rewards
- MCP server: Search drops, rewards, games, organizations, and dates from AI clients at
/mcp - Historical archive: Past campaigns remain searchable and downloadable
- Search & browse: Find campaigns by game, organization, channel, or reward
- Open data: All data is freely available under CC0
MCP server
The site exposes an MCP server at
https://ttvdrops.lovinator.space/mcp for AI clients. It is read-only and
unauthenticated, matching the public website and API. Human-readable
documentation is at
/docs/mcp/, and a
machine-readable server card is served from
/.well-known/mcp/server-card.json.
Available tools:
search_drops: Search campaigns by text, platform, status, game, organization, and date.list_drops_between_dates: List campaigns running during an inclusive date range.get_drop: Get a campaign's rewards, watch requirements, channels, and links.search_games: Find Twitch games and Kick categories with campaign counts.search_organizations: Find Twitch and Kick organizations with campaign counts.get_stats: Get campaign counts by platform and status.
Add it to an MCP client configuration as a Streamable HTTP server:
{
"mcpServers": {
"ttvdrops": {
"type": "http",
"url": "https://ttvdrops.lovinator.space/mcp"
}
}
}
Project links
- Website: ttvdrops.lovinator.space
- Repository: github.com/TheLovinator1/ttvdrops
- Issue tracker: github.com/TheLovinator1/ttvdrops/issues
- Donate: github.com/sponsors/TheLovinator1
- License: MIT (code), CC0 (data)
Similar projects
Other sites that track Twitch drops:
- twitchdrops.app
- Fenrisapps Twitch Drops
- twitch-drops-api (the API that powers some of these tools)
- Drop Hunter
- BadgeEmoteHQ
- Drop Lookout
- DropScope
Contributing
Contributions are welcome! Here's how to get started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Install dependencies with
uv sync - Rename .env.example to .env and configure PostgreSQL
- Make your changes
- Run tests with
uv run pytest - Submit a pull request
Docker (recommended)
Docker Compose runs PostgreSQL, Valkey, Gunicorn, a Celery worker, and Celery Beat. The
image includes git and pg_dump, so no host-side programs are needed.
-
Create
.envand setDJANGO_SECRET_KEY, the Twitch credentials, andDEBUG=Falsefor production:cp .env.example .envKeep
DEBUG=Truefor local testing; otherwiseALLOWED_HOSTSis fixed tottvdrops.lovinator.space.POSTGRES_PASSWORDmust be non-empty because the database container does not fall back to defaults. -
compose.yamlis pinned to the production layout:/mnt/Docker/Data/ttvdrops/appformedia/,staticfiles/anddatasets//mnt/Docker/Data/ttvdrops/postgresfor PostgreSQL (mounted at/var/lib/postgresql, since PG 18 keepsPGDATAin18/docker)/mnt/Docker/Data/ttvdrops/valkeyfor Valkey/mnt/fourteen/Data/Responsesforpending/,imported/andbroken/- container user
1001:1002(UID 1001, GID of theresponsesgroup)
Make sure those directories exist and are writable by that user, or edit the bind mounts and
user:incompose.yamlto match your host. -
Start the stack. The image comes from the Forgejo registry:
docker compose pull docker compose up -dLog in first if the registry is private:
docker login git.lovinator.space -
Optional: create an admin and follow the logs:
docker compose exec web python manage.py createsuperuser docker compose logs -f web celery-worker celery-beat
The site is published on 127.0.0.1:8000 (edit the web port mapping in
compose.yaml to change it). /static/ and /media/ are under
/mnt/Docker/Data/ttvdrops/app, so point the reverse proxy there. All data is on host
bind mounts, so docker compose down and down -v leave it untouched.
| Action | Command |
|---|---|
| Stop | docker compose down |
| Stop and remove containers | docker compose down -v (data stays on the bind mounts) |
| Shell in the web container | docker compose exec web sh |
| Run a management command | docker compose exec web python manage.py <command> |
| Import pending drops | docker compose exec web python manage.py better_import_drops /srv/ttvdrops/responses/pending --recursive |
| Create a database backup | docker compose exec celery-worker python manage.py backup_db |
| Flower task monitor | docker compose --profile monitoring up -d, then open http://127.0.0.1:5555 |
Migrating from the host install
Move the host install's data directory into the bind mount before the first start:
sudo mkdir -p /mnt/Docker/Data/ttvdrops
sudo mv ~/.local/share/TTVDrops /mnt/Docker/Data/ttvdrops/app
# Keep the old proxy path working, or update the proxy roots instead.
sudo ln -s /mnt/Docker/Data/ttvdrops/app ~/.local/share/TTVDrops
Restore an existing PostgreSQL dump before starting the app:
pg_dump -Fc -U ttvdrops ttvdrops > /tmp/ttvdrops.dump
docker compose up -d db
docker compose exec -T db pg_restore -U ttvdrops -d ttvdrops --clean --if-exists < /tmp/ttvdrops.dump
docker compose pull
docker compose up -d
TL;DR (Arch Linux + PostgreSQL, host install)
Install and initialize Postgres, then start the service:
sudo pacman -S postgresql
sudo -u postgres initdb -D /var/lib/postgres/data
sudo systemctl enable --now postgresql
Create a local role and database:
sudo -u postgres createuser -P ttvdrops
sudo -u postgres createdb -O ttvdrops ttvdrops
Point Django at the unix socket used by Arch (/run/postgresql):
POSTGRES_USER=ttvdrops
POSTGRES_PASSWORD=your_password
POSTGRES_DB=ttvdrops
POSTGRES_HOST=/run/postgresql
POSTGRES_PORT=5432
Linux (Systemd)
sudo useradd --create-home --home-dir /home/ttvdrops --shell /bin/fish ttvdrops
sudo passwd ttvdrops
sudo usermod -aG wheel ttvdrops
su - ttvdrops
git clone https://git.lovinator.space/TheLovinator/ttvdrops.git
cd ttvdrops
uv sync --no-dev
# Modify .env with the correct database credentials and other settings, then run migrations:
uv run python manage.py migrate
Install the systemd service from the repo:
sudo install -m 0644 tools/systemd/ttvdrops.socket /etc/systemd/system/ttvdrops.socket
sudo install -m 0644 tools/systemd/ttvdrops.service /etc/systemd/system/ttvdrops.service
Enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable --now ttvdrops.socket
sudo systemctl enable --now ttvdrops.service
curl --unix-socket /run/ttvdrops/ttvdrops.sock https://ttvdrops.lovinator.space
Enable Celery worker and Beat services:
sudo install -m 0644 tools/systemd/ttvdrops-celery-worker.service /etc/systemd/system/
sudo install -m 0644 tools/systemd/ttvdrops-celery-beat.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now ttvdrops-celery-worker.service
sudo systemctl enable --now ttvdrops-celery-beat.service
Set TTVDROPS_PENDING_DIR in .env to the directory where Twitch JSON drop files are dropped:
TTVDROPS_PENDING_DIR=/mnt/fourteen/Data/Responses/pending
Development
uv run python manage.py createsuperuser
uv run python manage.py makemigrations
uv run python manage.py migrate
uv run python manage.py collectstatic
uv run python manage.py runserver
uv run pytest
Celery
Celery powers all periodic and background work. Three services are required:
| Service file | Queues | Purpose |
|---|---|---|
ttvdrops-celery-worker.service |
imports, api-fetches, default |
Twitch/Kick/Chzzk imports, backup |
ttvdrops-celery-beat.service |
- | Periodic task scheduler (Beat) |
Start workers manually during development:
# All-in-one worker (development)
uv run celery -A config worker --queues imports,api-fetches,image-downloads,default --loglevel=info
# Beat scheduler (requires database Beat tables, run migrate first)
uv run celery -A config beat --scheduler django_celery_beat.schedulers:DatabaseScheduler --loglevel=info
# Monitor tasks in the browser (optional)
uv run celery -A config flower
Periodic tasks configured via CELERY_BEAT_SCHEDULE:
| Task | Schedule | Queue |
|---|---|---|
twitch.tasks.scan_pending_twitch_files |
every 10 s | imports |
kick.tasks.import_kick_drops |
:01/:16/:31/:46 | api-fetches |
chzzk.tasks.discover_chzzk_campaigns |
every 2 h | api-fetches |
twitch.tasks.backup_database |
daily 02:15 UTC | default |
twitch.tasks.download_all_images |
Sunday 04:00 UTC | image-downloads |
twitch.tasks.import_chat_badges |
Sunday 03:00 UTC | api-fetches |
Image downloads also run immediately on record creation via post_save signals
(Game, DropCampaign, DropBenefit, RewardCampaign).
When BLUESKY_ENABLED=true, new Twitch and Kick campaigns also enqueue a
core.tasks.publish_bluesky_post job on the default queue. Chzzk drops are not
posted. Historical replay via build_history suppresses these jobs automatically.
Import Drops
uv run python manage.py better_import_drops <file|dir> [--recursive] [--verbose] [--crash-on-error] [--skip-broken-moves] [--keep-files]
Post drops to Bluesky
Create an app password in Bluesky under Settings → Privacy and Security →
App Passwords, then add this to .env:
BLUESKY_ENABLED=true
BLUESKY_HANDLE=your-handle.bsky.social
BLUESKY_APP_PASSWORD=xxxx-xxxx-xxxx-xxxx
BLUESKY_SERVICE_URL=https://bsky.social
With that enabled, every newly imported campaign is posted to Bluesky once. A
BlueskyPost row records the platform/drop pair so retries and imports cannot
create duplicate posts.
Bluesky lets clients supply createdAt, so older drops can be backdated. Use
backfill_bluesky to fill the feed backwards; timestamped posts appear at their
original position in chronological feeds:
# Preview everything that would be posted
uv run python manage.py backfill_bluesky --dry-run
# Post all unposted drops as fast as Bluesky accepts them, oldest discovery first
uv run python manage.py backfill_bluesky
# One platform, only the last 30 days, newest first, at most 50 posts
uv run python manage.py backfill_bluesky --platform twitch --days 30 --order newest --limit 50
# Use campaign start dates instead of discovery dates
uv run python manage.py backfill_bluesky --timestamp start --since 2025-01-01 --until 2025-12-31
Useful options: --platform {all,twitch,kick},
--timestamp {discovered,start}, --order {oldest,newest}, --limit N,
--days N, --since ISO, --until ISO, and --dry-run.
Posts are sent back-to-back. Bluesky's documented write limit is 5,000
points/hour, with each record create costing 3 points (~1,666/hour); if you hit
it, the client honors Retry-After/backoff on HTTP 429 instead of giving up. A
session is reused for the whole backfill run and refreshed automatically.
Build history from old response files
build_history replays historical Twitch JSON files and backdates their
django-pghistory events to the timestamp embedded in each filename.
uv run python manage.py build_history <file|dir> [--recursive] [--dry-run]
- The default path is
TTVDROPS_IMPORTED_DIR. - Source files are strictly read-only: they are never moved, renamed, or deleted.
- Files without a parsable timestamp are copied to
history_missing_timestamp/<relative source path>/in the project directory and skipped. The originals stay where they are. - Completed files are recorded in
pghistorycontext metadata, so a rerun resumes automatically without reprocessing them.
Browse the resulting changelog at /twitch/history/. Campaign, game,
organization, channel, and reward-campaign detail pages also link to their own
history pages.
Backfill history only
To add historical events to a database that already contains live data without changing the live archive tables:
uv run python manage.py build_history <file|dir> --recursive --history-only
History-only mode writes pghistory event rows and leaves campaigns, drops,
benefits, games, organizations, and channels untouched. It is resumable and
backdates events to the filename timestamps. Missing channel display names fall
back to the lowercase login in source files; replayed events keep the existing
display name and accumulate every observed name in the channel's
display_names list, so localized names such as 象先輩 and the login
zousenpai are both retained.
To delete all existing pghistory events and contexts first, then rebuild the timeline from the files:
uv run python manage.py build_history <file|dir> --recursive --history-only --reset-history
--reset-history deletes live-import history too. It does not modify the live
campaign/drop/game rows.
Replace cached images
Re-download already-cached Twitch images from their normalized high-resolution URLs:
uv run python manage.py replace_downloaded_images
uv run python manage.py replace_downloaded_images --model games
uv run python manage.py replace_downloaded_images --dry-run
The command replaces the original file, removes stale WebP/AVIF variants, and
regenerates missing modern-format files. Use --include-missing to also fill in
records that do not have a local image yet.
The conversion command also generates 64×85 WebP/AVIF thumbnails for game box art, which the dashboard uses instead of the full 600×800 originals. Run it once after deploying to backfill existing images:
uv run python manage.py convert_images_to_modern_formats
Import Chat Badges
Import Twitch's global chat badges for archival and reference:
uv run python manage.py import_chat_badges
Requires TWITCH_CLIENT_ID and TWITCH_CLIENT_SECRET environment variables to be set.
Create DB Backup
Create a zstd-compressed SQL dump (only twitch_ tables) in the datasets directory:
uv run python manage.py backup_db
Optional arguments:
uv run python manage.py backup_db --output-dir "<path>" --prefix "ttvdrops"
How the duck does permissions work on Linux?
sudo chown -R ttvdrops:http /mnt/Docker/Data/ttvdrops/app/media/
sudo find /mnt/Docker/Data/ttvdrops/app/media -type d -exec chmod 2775 {} \;
sudo find /mnt/Docker/Data/ttvdrops/app/media -type f -exec chmod 664 {} \;
sudo chown -R ttvdrops:http /mnt/Docker/Data/ttvdrops/app/datasets/
sudo find /mnt/Docker/Data/ttvdrops/app/datasets -type d -exec chmod 2775 {} \;
sudo find /mnt/Docker/Data/ttvdrops/app/datasets -type f -exec chmod 664 {} \;