Skip to main content

Download YouTube videos and transcode to H.265/HEVC with NVIDIA NVENC — a localhost web app.

Project description

FetchForge

Requires an NVIDIA GPU with NVENC. The H.265 transcode uses hardware hevc_nvenc and has no CPU-encode fallback — without an NVIDIA card the transcode path cannot run (download + audio-extract still work). macOS has no NVIDIA GPUs, so the transcode is Windows/Linux only.

FetchForge is a localhost web app that downloads YouTube videos and playlists and transcodes them to H.265/HEVC using NVIDIA NVENC hardware encoding. Single videos, full playlists with pipeline mode, and local-file conversion. Smart auto-analysis picks CQ, maxrate, and preset from the source.

Install & launch

With pip (recommended):

pip install fetchforge
fetchforge

The browser opens automatically at http://localhost:8765. On Windows, if an NVENC-capable ffmpeg isn't already present, FetchForge downloads one on first run. On Linux, install ffmpeg from your package manager first (sudo dnf install ffmpeg / sudo apt install ffmpeg) and make sure the NVIDIA driver is loaded. macOS has no NVIDIA GPU, so the H.265 transcode can't run there, but download and audio-extract still work and just need ffmpeg (brew install ffmpeg).

Output files land in the current directory — run fetchforge from wherever you want downloads/ to appear.

From source (clone):

git clone https://github.com/prekabreki/fetchforge
cd fetchforge
./launch.sh        # Windows: launch.bat

"Update yt-dlp" in the UI is a no-op for pip installs — update with pip install -U fetchforge (or pip install -U "yt-dlp[default]").

Stack

  • Backendfetchforge/server.py (FastAPI + uvicorn, fully async)
  • Frontendfetchforge/index.html (single file, vanilla JS + SSE, no build step)
  • CLI entry pointfetchforge/cli.py, exposed as the fetchforge console script (also runnable as python -m fetchforge)
  • Downloaderyt-dlp[default], a regular dependency (pulled in by pip, not bundled)
  • Encoder — ffmpeg + hevc_nvenc (NVENC); auto-downloaded to a per-user cache on Windows, expected on PATH on Linux
  • Packagingpyproject.toml; pip install fetchforge for the package, pip install -e . for an editable clone
  • Launcherslaunch.bat (Windows) / launch.sh (Linux/macOS) for the clone workflow: create/reuse a venv, pip install -e ., open the browser, run python -m fetchforge

What's NOT in the repo (gitignored)

These are restored locally — they're either rebuildable, regenerable, or sensitive.

Path Why ignored
_internal/ Optional manual ffmpeg override for a source clone on Windows — pip installs auto-provision ffmpeg into %LOCALAPPDATA%\FetchForge\ffmpeg instead
yt-dlp.exe Optional manual override; the normal path gets yt-dlp as a pip dependency, updated via pip install -U, not a dropped binary
cookies.txt YouTube auth cookies (sensitive — never commit)
history.json Last 50 downloaded URLs (per-machine state)
logs/ Runtime logs
downloads/ Output MP4s

cookies.txt, history.json, logs/, and downloads/ are runtime state and live under the current working directory you launch fetchforge from. _internal/ and yt-dlp.exe are the two exceptions: they're optional manual overrides FetchForge looks for next to the installed package itself, not the cwd — the normal pip install path never needs them.

First-run setup on a new machine

  1. pip install fetchforge.
  2. Run fetchforge. On Windows it downloads an NVENC-capable ffmpeg build automatically the first time it's needed. On Linux, install ffmpeg from your package manager first and confirm the NVIDIA driver is loaded — FetchForge won't fetch a build for you there.
  3. (Optional) Upload a cookies.txt via the Authentication card if you need age-restricted, private, or members-only content — see Cookies below for how to get one.

Working from a clone instead: run ./launch.sh (or launch.bat on Windows) — it sets up a .venv, installs the package in editable mode, and starts the server the same way.

Cookies

Public videos need no cookies. Cookies are only necessary for age-restricted, private, or members-only videos, which require a logged-in YouTube session.

To get a cookies.txt:

  1. Install a cookies-export browser extension — Get cookies.txt LOCALLY for Chrome/Edge, or cookies.txt for Firefox.
  2. Log in to YouTube in that browser.
  3. Open the extension on a youtube.com tab and export in Netscape format — that's your cookies.txt.
  4. Upload the file via the Authentication card in the FetchForge UI.

The file grants access to your YouTube account, so treat it as a secret: it's gitignored and stays on your machine — don't share or commit it. Re-export it if it stops working; YouTube rotates cookies periodically.

Features

  • Sequential or pipelined playlist processing — pipeline mode runs download and encode concurrently with a maxsize=1 queue (downloader stays at most one video ahead of the encoder)
  • Smart pre-download skip — checks for existing <title>_h265.mp4 before downloading, skips if ≥85% of expected size
  • Two encode tunesuhq (Smart Auto, archival quality) and hq (NLE-friendly, ~4–6× speed, capped at source bitrate)
  • HDR / 10-bit passthrough — auto-detected; outputs yuv420p10le + main10
  • Wake-lock during jobs — ref-counted; Windows SetThreadExecutionState re-asserted every 30s, Linux holds a systemd-inhibit process
  • Post-job shutdown — UI countdown with cancel button; shutdown /s /t 0 (Windows) / systemctl poweroff (Linux) if not cancelled
  • Local conversion mode — point at files or folders, batch-encode without downloading

Repository conventions

  • Issue tracking: GitHub Issues. Run python tools/issue-ready.py for available work (open issues, dependencies satisfied), or gh issue list.
  • Personal-use only — no auth, no multi-user, no cloud deploy.
  • Per-user runtime state is gitignored (see table above) and preserved locally, never pushed.

See CLAUDE.md for full architecture: endpoint table, SSE event types, encode parameter logic, and the Python <3.12 f-string gotcha that bit this codebase.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fetchforge-2.0.0.tar.gz (70.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fetchforge-2.0.0-py3-none-any.whl (60.9 kB view details)

Uploaded Python 3

File details

Details for the file fetchforge-2.0.0.tar.gz.

File metadata

  • Download URL: fetchforge-2.0.0.tar.gz
  • Upload date:
  • Size: 70.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fetchforge-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d605633be0a300f932c262aaf1e5268a43381ed2e98e8098e2ae5724f85d459d
MD5 4405f8a6730458d8b653e12b69bbe175
BLAKE2b-256 f36902d2b5f4505751a601bee33bb9f33f03ca94309128b2de1e484ecb2147ff

See more details on using hashes here.

File details

Details for the file fetchforge-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: fetchforge-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 60.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fetchforge-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fff7afb1e49fae9ae6914b39d22d7c1231629945122e27fbaa285fa9c8d38fb2
MD5 26689c61831d4104894d549bfd7304bc
BLAKE2b-256 54ab854ddc1d2cad330d5917aecdbb6a30e510351801c615b2516cc8f2bf414c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page