StashCast is an application for downloading online media (audio/video) for offline consumption and exposing it via podcast feeds, so you can watch it later. It runs as a single user Django web app.
Demo instance running here: https://demo.stashcast.net/
The user is 'demo' and the password is 'demo' spelled backwards. The demo user can not add/remove/update content.
I created this since friends and family often send me links to listen to a single episode of a podcast via Apple Podcasts, or a single lecture on youtube. I don't want to subscribe to the show to listen to a single eposide, but I do want to listen to it - later.
- Download media from any URL supported by yt-dlp (YouTube, Vimeo, SoundCloud, Apple Podcasts episodes and thousands more), direct media URLs (a raw .mp3 or .mp4), HTML with embedded media, playlists, multiple embeds
- Multi-language support - UI and video subtitles in your preferred language (see i18n docs)
- Async background processing via task queue
- Automatic media type detection (audio/video)
- Podcast feed generation (RSS/Atom) for audio and video
- Optional transcoding via ffmpeg
- Extractive summarization from subtitles
- Bookmarklet for one-click media ingestion
- Admin interface for managing downloads
- Django commands for management via CLI instead of web
- Downloading non audio/video content. For that you may check out our sister project Savr.
- Only downloading youtube videos. yt-dlp supports thousands of of different websites.
- Subscribing to playlists. For that you could checkout TubeSync or Podsync.
- Long term archiving. While this may work for you there are other tools perhaps more suited for this. See ArchiveBox or Tube Archivist
- A playback tool. The grid and list view are good ways to view your content, but StashCast's best experience would be to use a Podcast app for playback.
The titles and artwork are invented showcase data; regenerate this image with just site-screenshots (see Marketing site).
- Python 3.13+
- yt-dlp
- ffmpeg
- just
- ruff
- gettext
- docker
- uv (only to change or upgrade dependencies)
Images are published to ghcr.io/jonocodes/stashcast for amd64 and arm64. You only need docker-compose.yml and a .env file, not the source:
curl -O https://raw.githubusercontent.com/jonocodes/stashcast/main/docker-compose.yml
curl -o .env https://raw.githubusercontent.com/jonocodes/stashcast/main/.env.example
# Edit .env: set SECRET_KEY, STASHCAST_USER_TOKEN and ALLOWED_HOSTS,
# and remove DEBUG=True (that line is for local development)
docker compose up -d
docker compose run --rm web python manage.py createsuperuserNow visit http://localhost:8000
The stack has three containers: web (gunicorn), worker (the Huey task queue) and caddy, which serves static files and media and proxies everything else to web. Data lives in ./data_docker. The web container runs migrations on every start.
The app runs as uid/gid 1000 inside the container. Set PUID and PGID in .env if your data directory should be owned by someone else. On start the container fixes ownership of the data directory, including data written by older images that ran as root.
| Tag | What it is |
|---|---|
latest |
Newest build of main |
stable |
Newest release |
X.Y (e.g. 0.2) |
Newest patch release of that minor version |
X.Y.Z (e.g. 0.2.0) |
One exact release, never rebuilt |
sha-<commit> |
One exact main build, never rebuilt |
When a site like YouTube breaks and needs a newer yt-dlp, run the Docker workflow by hand (Actions → Docker → Run workflow). It rebuilds latest, stable and X.Y with the newest yt-dlp. Pick a tag with STASHCAST_VERSION in .env (default latest).
just dev-docker # build from this checkout and run the stack
just docker-smoke # build like CI does and smoke test the imageThere is no Nix package. Run the published image with virtualisation.oci-containers, and serve static files and media with your own web server:
{
virtualisation.oci-containers.containers = let
common = {
image = "ghcr.io/jonocodes/stashcast:stable";
environmentFiles = [ "/var/lib/stashcast/stashcast.env" ]; # SECRET_KEY, ALLOWED_HOSTS, STASHCAST_USER_TOKEN
volumes = [
"/var/lib/stashcast/data:/app/data_docker"
"/var/lib/stashcast/static:/app/staticfiles"
];
};
in {
stashcast-web = common // { ports = [ "127.0.0.1:8000:8000" ]; };
stashcast-worker = common // { cmd = [ "python" "manage.py" "run_huey" ]; dependsOn = [ "stashcast-web" ]; };
};
services.caddy.virtualHosts."stashcast.example.com".extraConfig = ''
handle_path /static/* {
root * /var/lib/stashcast/static
file_server
}
handle_path /media/files/* {
root * /var/lib/stashcast/data/media
file_server
}
reverse_proxy 127.0.0.1:8000
'';
}First install yt-dlp and ffmpeg to your system however you need to, probably using your package manager.
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate# Copy example environment file
cp .env.example .env
# Edit .env and set your values
# At minimum, set:
# - STASHCAST_DATA_DIR (base path; media is stored in STASHCAST_DATA_DIR/media)
# - STASHCAST_USER_TOKEN
# - LANGUAGE_CODE (optional, default: 'en-us'. Sets UI language and video subtitle language)
# Supported: 'en' (English), 'es' (Spanish), 'pt' (Portuguese)just setup-with-packages./manage.py createsuperuserOption A: Quick Start (all services in one terminal)
just devThis starts Django server (8000), Huey worker, and test server (8001) all at once.
Option B: Manual (separate terminals)
You need to run three processes:
# Terminal 1: Django development server
./manage.py runserver
# Terminal 2: Huey worker (for background tasks)
./manage.py run_huey
# Terminal 3: Test media server (optional, for testing)
python test_server.pyAccess the admin at http://localhost:8000/admin/
- View and manage media items
- Monitor download status
- Re-fetch failed downloads
- Regenerate summaries
- View logs
- Go to
http://localhost:8000/admin/tools/bookmarklet/ - Drag the bookmarklet to your bookmarks bar
- Click it on any page with media to stash
# Stash a URL
curl "http://localhost:8000/stash/?token=YOUR_USER_TOKEN&url=https://example.com/video&type=auto"Parameters:
token(required): Your user tokenurl(required): URL to downloadtype(required):auto,audio, orvideo
- Audio feed:
http://localhost:8000/feeds/audio.xml - Video feed:
http://localhost:8000/feeds/video.xml - Combined feed:
http://localhost:8000/feeds/combined.xml
Add these URLs to your podcast app (AntennaPod, Overcast, etc.)
By default, RSS feeds are publicly accessible. To require a user token for feed access (keeping your listening activity private):
-
Set the environment variable in your
.envfile:REQUIRE_USER_TOKEN_FOR_FEEDS=true
-
Restart the service
-
Feed URLs must now include your user token:
- Audio feed:
http://localhost:8000/feeds/audio.xml?token=YOUR_USER_TOKEN - Video feed:
http://localhost:8000/feeds/video.xml?token=YOUR_USER_TOKEN - Combined feed:
http://localhost:8000/feeds/combined.xml?token=YOUR_USER_TOKEN
- Audio feed:
The home page and bookmarklet page will display the current protection status and automatically show feed URLs with the user token when enabled.
Note: All major podcast apps support query parameters in feed URLs (this is how services like Patreon and Supercast provide private feeds).
The test server serves files from demo_data/ directory on http://localhost:8001/
To add test media files:
# Add your test files to demo_data/
cp /path/to/test.mp3 demo_data/
cp /path/to/test.mp4 demo_data/Then test stashing them:
# Stash a direct video file
curl "http://localhost:8000/stash/?token=dev-user-token-change-in-production&url=http://localhost:8001/pecha-kucha-vid/vid.mp4&type=auto"
# Stash from HTML page with embedded video (StashCast will extract the video automatically)
curl "http://localhost:8000/stash/?token=dev-user-token-change-in-production&url=http://localhost:8001/pecha-kucha-vid/view.html&type=auto"Your current test files:
- Audio (direct):
http://localhost:8001/pecha-kucha-aud/aud.mp3 - Video (direct):
http://localhost:8001/pecha-kucha-vid/vid.mp4 - Video (HTML page):
http://localhost:8001/pecha-kucha-vid/view.html- Example of extracting embedded media from HTML
Download media and add it to your podcast feed (same as web interface but runs in foreground):
# Stash a direct media URL
./manage.py stash https://example.com/video.mp4
# Stash from HTML page with embedded media (auto-extracts video/audio)
./manage.py stash http://localhost:8001/pecha-kucha-vid/view.html
# Specify media type (default: auto)
./manage.py stash https://example.com/audio.mp3 --type audio
# Verbose output (shows all processing steps)
./manage.py stash https://example.com/video.mp4 --verbose
# JSON output (machine-readable)
./manage.py stash https://example.com/video.mp4 --jsonThis command performs the same pipeline as the web app's /stash/ endpoint but runs synchronously in the foreground. Supports direct media URLs, yt-dlp compatible URLs, and HTML pages with embedded media. Files are saved to the configured media directories and added to your podcast feeds.
Fetch media from URLs or local files to a custom output directory:
# Fetch from a direct URL
./manage.py fetch https://example.com/video.mp4 --outdir ./output
# Fetch from HTML page with embedded media
./manage.py fetch http://localhost:8001/pecha-kucha-vid/view.html --outdir ./output
# Fetch from a local file
./manage.py fetch /path/to/video.mp4 --outdir ./output
# The output file will be named using a slug generated from the title
# For example, "My Video.mp4" becomes "my-video.mp4"
# Specify media type (default: auto)
./manage.py fetch https://example.com/media --type audio
# Verbose output
./manage.py fetch https://example.com/video.mp4 --verbose
# JSON output
./manage.py fetch https://example.com/video.mp4 --jsonThis command is for standalone fetching without adding to podcast feeds. Supports the same URL types as the stash command (direct media, yt-dlp URLs, and HTML pages with embedded media).
Generate summaries from VTT subtitle files:
# Summarize a local VTT file
./manage.py summarize demo_data/carpool/subtitles.vtt
# Summarize from a URL
./manage.py summarize http://example.com/subtitles.vtt
# Custom number of sentences (default: 3)
./manage.py summarize demo_data/carpool/subtitles.vtt --sentences 5
# Different algorithms: lexrank (default), textrank, luhn
./manage.py summarize demo_data/carpool/subtitles.vtt --algorithm luhnClean up abandoned tmp directories from failed downloads:
# Show what would be deleted (dry run)
./manage.py cleanup_tmp --dry-run
# Delete tmp directories older than 60 minutes (default)
./manage.py cleanup_tmp
# Delete tmp directories older than 24 hours
./manage.py cleanup_tmp --max-age 1440
# Delete without confirmation prompt
./manage.py cleanup_tmp --forceSee EXAMPLES.md for more usage examples.
STASHCAST downloads media from URLs and makes it available through podcast feeds. When you submit a URL:
- Metadata is extracted (title, duration, etc.)
- Media is downloaded in the background
- Files are processed (thumbnails converted to WebP, subtitles to VTT). Subtitles are best-effort: if they fail to download (e.g. YouTube rate-limits them with HTTP 429), the media is downloaded without them
- Optional summaries are generated from subtitles
- Media becomes available in your podcast feed
For technical details, see ARCHITECTURE.md
Use admin to add/remove media or update metadata.
Use the public site to view/subscribe to your feed.
Use the bookmarklet with your api key to add media outside of admin.
Your api key is a single user secret that you can use to identify yourself, and is set via STASHCAST_USER_TOKEN. I recommend using a random string, or generate a uuid using one of these:
uuidgen
python -c 'import uuid; print(uuid.uuid4())'
See .env.example for all available configuration options.
SECRET_KEY: Django secret keyALLOWED_HOSTS: Comma-separated host names the site is served onSTASHCAST_DATA_DIR: Base directory for application data (media is stored inSTASHCAST_DATA_DIR/media; default:./data)STASHCAST_USER_TOKEN: API key for stash endpoint
DEBUG: Django debug mode (default: off;.env.exampleturns it on for development)PUID/PGID: Docker only. User and group the app runs as (default: 1000)GUNICORN_CMD_ARGS: Docker only. Extra gunicorn options, e.g.--workers 4STASHCAST_MEDIA_BASE_URL: External CDN URL for media filesSTASHCAST_DEFAULT_YTDLP_ARGS_AUDIO: Default yt-dlp arguments for audioSTASHCAST_DEFAULT_YTDLP_ARGS_VIDEO: Default yt-dlp arguments for videoSTASHCAST_DEFAULT_FFMPEG_ARGS_AUDIO: Default ffmpeg arguments for audioSTASHCAST_DEFAULT_FFMPEG_ARGS_VIDEO: Default ffmpeg arguments for videoSTASHCAST_SLUG_MAX_WORDS: Max words in slug (default: 6)STASHCAST_SLUG_MAX_CHARS: Max characters in slug (default: 40)
# Install the locked dependencies, including dev tools like coverage
just install
# Run all tests
coverage run -m pytest
coverage report -m
# Create and apply database migrations
./manage.py makemigrations
./manage.py migrateSee ARCHITECTURE.md for more details on the codebase structure and testing strategy.
Dependencies are declared with loose version ranges in pyproject.toml and locked to exact versions in uv.lock. requirements.txt and requirements-dev.txt are generated from the lock, with hashes, so Docker, CI, cPanel and local setups all install the same versions with plain pip. Don't edit them by hand.
just lock # after adding or changing a dependency in pyproject.toml
just upgrade # move everything to the newest allowed versions, then run the tests and the Docker smoke testCI fails if uv.lock or the requirements files are out of date. yt-dlp is the one exception to the lock: the Docker image always installs the newest yt-dlp, because sites like YouTube break old releases. Dependabot proposes monthly updates for GitHub Actions and the Docker base image.
StashCast uses semantic versioning. The version in pyproject.toml is the single source of truth and is shown on the About page. Bump the major version when upgrading needs manual steps, such as moving data or renaming a setting.
To release from main:
just release 0.2.0 # bumps pyproject.toml, commits, tags v0.2.0
git push origin main v0.2.0Pushing the tag runs .github/workflows/docker.yml. It runs the tests, builds and smoke-tests the image, publishes the version tags listed under Image tags, and creates a GitHub release with generated notes and the docker pull command for that version. CI rejects a tag that doesn't match pyproject.toml. Tags like v1.0.0-rc.1 publish a pre-release and leave stable alone.
The tagging rules live in scripts/docker_plan.py, with tests in scripts/test_docker_plan.py.
The home page at site/public/ is plain static HTML (no build step), deployed to GitHub Pages by .github/workflows/pages.yml on every push to main that touches it. One-time setup: in the repo settings, set Pages → Source to "GitHub Actions".
just site # serve it at http://localhost:8090
just site-screenshots # regenerate every app screenshot on the site, its social card (og.png) and docs/screenshot-grid-view.png
just site-covers # re-render the showcase cover art (rarely needed)just site-screenshots never touches your real library. It boots a throwaway instance in a temp data dir, fills it with ./manage.py seed_showcase (invented titles and artwork from media/fixtures/showcase/, media from demo_data/), captures the app with Playwright in light and dark mode, and converts the results to webp. It needs Node, ffmpeg and a Chromium that Playwright can drive: run cd site && npx playwright-core install chromium once, or point CHROME at an existing binary.
seed_showcase refuses to run against a library that already has items, unless you pass --replace (which deletes them).

