Get notified when a new drop is available on Twitch or Kick https://ttvdrops.lovinator.space/
  • Python 84.6%
  • HTML 15.1%
  • XSLT 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Joakim Hellsén b4fd80ce4a
All checks were successful
Deploy to Server / deploy (push) Successful in 39s
Build Docker image / build (push) Successful in 1m7s
Improve CSS
2026-11-30 21:46:17 +01:00
.github Fix tests? 2026-11-19 17:58:29 +01:00
.vscode Publish to Bluesky; TwitchDropsMiner is the authoritative source for channels 2026-11-21 21:14:39 +01:00
chzzk Improve CSS 2026-11-30 21:46:17 +01:00
config Add sitemap for Chzzk; hide testing and add more fields for SunkwiBot importer 2026-11-30 19:23:33 +01:00
core Improve CSS 2026-11-30 21:46:17 +01:00
kick Add benefits page; move breadcrumbs and make thumbnails 2026-11-30 02:53:09 +01:00
static Undo Bootstrap 2026-11-28 06:51:47 +01:00
templates Improve CSS 2026-11-30 21:46:17 +01:00
tools Allow channels to have several display names 2026-11-20 19:29:36 +01:00
twitch Add sitemap for Chzzk; hide testing and add more fields for SunkwiBot importer 2026-11-30 19:23:33 +01:00
youtube Kill the navbar and other stuff :( 2026-11-28 21:26:52 +01:00
.dockerignore Fix venv install and gunicorn control socket 2026-11-19 02:46:46 +01:00
.env.example Publish to Bluesky; TwitchDropsMiner is the authoritative source for channels 2026-11-21 21:14:39 +01:00
.git-blame-ignore-revs Ignore previous commit when using git blame 2026-07-21 04:17:48 +02:00
.gitattributes Add .gitattributes to mark JSON files as linguist-generated 2026-03-31 21:56:39 +02:00
.gitignore Add history to Twitch drops 2026-11-19 17:41:01 +01:00
.pre-commit-config.yaml Allow channels to have several display names 2026-11-20 19:29:36 +01:00
compose.yaml Add history to Twitch drops 2026-11-19 17:41:01 +01:00
conftest.py Cache everything 2026-11-17 06:30:00 +01:00
Dockerfile Fix venv install and gunicorn control socket 2026-11-19 02:46:46 +01:00
LICENSE Add MIT License to the project 2026-07-21 18:00:23 +02:00
manage.py Cache everything 2026-11-17 06:30:00 +01:00
pyproject.toml Kill the navbar and other stuff :( 2026-11-28 21:26:52 +01:00
README.md Add benefits page; move breadcrumbs and make thumbnails 2026-11-30 02:53:09 +01:00

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"
    }
  }
}

Similar projects

Other sites that track Twitch drops:

Contributing

Contributions are welcome! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Install dependencies with uv sync
  4. Rename .env.example to .env and configure PostgreSQL
  5. Make your changes
  6. Run tests with uv run pytest
  7. Submit a pull request

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.

  1. Create .env and set DJANGO_SECRET_KEY, the Twitch credentials, and DEBUG=False for production:

    cp .env.example .env
    

    Keep DEBUG=True for local testing; otherwise ALLOWED_HOSTS is fixed to ttvdrops.lovinator.space. POSTGRES_PASSWORD must be non-empty because the database container does not fall back to defaults.

  2. compose.yaml is pinned to the production layout:

    • /mnt/Docker/Data/ttvdrops/app for media/, staticfiles/ and datasets/
    • /mnt/Docker/Data/ttvdrops/postgres for PostgreSQL (mounted at /var/lib/postgresql, since PG 18 keeps PGDATA in 18/docker)
    • /mnt/Docker/Data/ttvdrops/valkey for Valkey
    • /mnt/fourteen/Data/Responses for pending/, imported/ and broken/
    • container user 1001:1002 (UID 1001, GID of the responses group)

    Make sure those directories exist and are writable by that user, or edit the bind mounts and user: in compose.yaml to match your host.

  3. Start the stack. The image comes from the Forgejo registry:

    docker compose pull
    docker compose up -d
    

    Log in first if the registry is private:

    docker login git.lovinator.space
    
  4. 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 pghistory context 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 {} \;