Skip to main content
Lumenfetch logo

Lumenfetch: YouTube Downloader

Save any YouTube video as .mp4 or .mp3, with quality picker, subtitles, and playlists,
right from your terminal.

Release CI Python Platform License Status


English | Bahasa Indonesia


Table of Contents


About

Lumenfetch is a lightweight Python CLI that downloads YouTube videos as MP4 or extracts their audio as MP3. Just paste a link and it auto-detects the title, duration, and estimated file size, then offers the relevant quality options. Powered by yt-dlp under the hood, plus curl_cffi to pass YouTube's bot checks.

"One command, straight to MP4/MP3."


Features

Downloading

Feature Description
MP4 video Quality Best/1080p/720p/480p/360p/Worst, thumbnail auto-embedded
MP3 audio Bitrate Best/320kbps/192kbps/128kbps
Playlists First video only by default; --playlist all for the whole list
Auto M3U Audio playlists (--playlist all) also write an .m3u file
Subtitles and metadata Download subtitles and embed into MP4, optional via flags
Safe filenames Illegal characters sanitized, duplicates get (1), (2) suffixes
Browser/file cookies Optional, for age-restricted or private videos, from Chrome/Firefox/Edge/etc. or a cookies.txt file

Detection and Options

Feature Description
Auto-detect Title, duration, and size estimates detected automatically
Dynamic options Quality menu adapts itself (video vs audio)
Size and time estimates Shown next to every quality option, computed from yt-dlp data plus your own past download speeds
Clipboard auto-paste A valid link in your clipboard is offered right away, never asked twice for the same content

Reliability

Feature Description
Auto-retry and resume Connection errors retried with exponential backoff (default 3x); partial .part files resumed, not restarted
Doctor lumenfetch --doctor diagnoses setup (ffmpeg, deps, cookies, network)
Self-update notice Tells you when a newer lumenfetch is on PyPI
yt-dlp update check Checks PyPI for a newer yt-dlp on every start, silently ignored when offline

Interface and Settings

Feature Description
Real-time progress Speed, size, and ETA via rich
English/Indonesian UI Display language via --ui-lang id, LUMENFETCH_LANG, or remembered setting
Download history Last 20 entries, viewable anytime with the history command (history clear wipes it)
Persistent settings Download folder, max retry, auto-paste, and naming template remembered

Requirements

Dependency Minimum Version Notes
Python 3.9 Required
Internet connection any Required
Libraries see notes yt-dlp, rich, curl_cffi, auto-installed with lumenfetch, no manual install needed
ffmpeg any Not required to install manually, see the note below

Never used a terminal? Start here

Opening a terminal on Windows
  1. Press the Windows key, type PowerShell, then press Enter
  2. A black/blue window opens. Type all python ... / pip ... commands from this guide there, then press Enter
Opening a terminal on macOS
  1. Press Cmd + Space, type Terminal, then press Enter
  2. Type the commands from this guide there, then press Enter
Opening a terminal on Linux

Press Ctrl + Alt + T, or find the "Terminal" app in your app menu.

No Python yet?

  1. Open python.org/downloads and download the latest version
  2. Windows only: on the first installer screen, tick "Add Python to PATH" before clicking Install
  3. After installing, open a terminal (see above) and check with:
python --version
# or
python3 --version

If a version number shows up (e.g. Python 3.12.1), you're ready.


Installation

Option A: Install from PyPI (easiest)

  1. Run:
pip install lumenfetch
  1. The lumenfetch command works from any terminal, continue to Usage

Option B: Build from source (for development / reading the code)

1. Get the code

I have Git installed
git clone https://github.com/nekonaru/lumenfetch.git
cd lumenfetch
I don't have Git
  1. Open the repository page on GitHub
  2. Click the green Code button, then choose Download ZIP
  3. Extract the downloaded ZIP to a folder of your choice
  4. In a terminal, enter the extracted folder, e.g.:
cd Downloads/lumenfetch-main

2. Install dependencies and verify

pip install -e .
ruff check .

This also registers the lumenfetch command, but it uses the code straight from this folder, handy if you want to modify the code and see results without reinstalling.

3. Run it

lumenfetch

Any change to the code takes effect immediately, no reinstall needed.


Usage

First launch

  1. Run:
lumenfetch
  1. Paste a YouTube URL when asked, or answer y if the clipboard already holds one:
Enter YouTube URL (q: quit, history, settings, help): https://youtube.com/watch?v=...
  1. Choose an output type:
Choose output type:
  [1] Video (MP4)
  [2] Audio (MP3)
  1. Choose a quality (size and ETA estimates included):
Choose Quality:
  [1] Best   (default)  (~147.8 MB, ~31 seconds)
  [2] 1080p              (~147.8 MB, ~31 seconds)
  [3] 720p               (~81.1 MB, ~17 seconds)
  [4] 480p               (~42.9 MB, ~9 seconds)
  1. Confirm the filename, then the download runs with a real-time progress bar (speed, size, ETA). Press Ctrl+C anytime to cancel safely.
Done!
   File  : C:\Users\user\Downloads\YouTube_Lofi-Hip-Hop-Radio_2026.mp4
   Size: 81.1 MB
   Time : 17 seconds

Everyday use

  • Run lumenfetch with no arguments for the interactive Q&A mode
  • Type history to see your last 20 downloads, history clear to wipe them
  • Type settings to change the download folder, max retry, auto-paste, naming template, and cookies
  • Type help for the full command list inside the prompt
  • Run lumenfetch --doctor to diagnose your setup (ffmpeg, deps, cookies, network) and exit

Automatic Resume

If a download stops halfway (connection drops, terminal closed), the partial .part file stays on disk.

Just run the same URL again and yt-dlp resumes from where it stopped instead of starting over. Connection errors are also retried automatically with exponential backoff (2s, 4s, 8s, up to 30s).


Saved Preferences

Your download folder, max retry, auto-paste, naming template, and cookies choice are saved automatically in your user config dir and reused as defaults next session:

OS Config location
Windows %APPDATA%\lumenfetch\config.json
macOS ~/Library/Application Support/lumenfetch/config.json
Linux ~/.config/lumenfetch/config.json

Detailed logs live in lumenfetch.log in the same folder (run with -v/--verbose for debug level).


Display Language

The CLI (menus, prompts, messages, and --help text) is available in English (default) and Bahasa Indonesia.

lumenfetch --ui-lang id              # Bahasa Indonesia, remembered for next sessions
lumenfetch --ui-lang en              # back to English
LUMENFETCH_LANG=id lumenfetch        # via environment variable (Windows: set LUMENFETCH_LANG=id)

Priority order: --ui-lang, then LUMENFETCH_LANG env, then ui_lang in user config, then default en.


Playlist

A playlist URL downloads only the first video by default (with a warning), so one URL never silently floods your folder. To grab the whole list as indexed files:

lumenfetch "https://youtube.com/playlist?list=PLxxxxxx" --playlist all -y

Batch Download

Put one URL per line in a text file (# = comment), then:

lumenfetch --batch daftar.txt --jobs 2

Cookies

Age-restricted or private videos need a login. If you hit such errors, enable one of these:

A. Browser cookies

  1. Open Lumenfetch, type settings
  2. Pick [5] Use browser/file cookies
  3. Pick the browser where you're logged into YouTube (Chrome/Firefox/Edge/Brave/Opera/Vivaldi/Safari)
  1. Install the "Get cookies.txt LOCALLY" extension (Chrome/Edge/Firefox)
  2. Open youtube.com (make sure you're logged in), click the extension, then Export and save e.g. D:\cookies.txt
  3. In Lumenfetch: settings, then [5], then [1] Disable, then enter the cookie file path
  4. Or via CLI: lumenfetch <URL> --cookies-file D:\cookies.txt

Non-Interactive Mode

Besides the Q&A mode, Lumenfetch also runs via command line arguments, handy for scheduling (cron/Task Scheduler) or calling from other scripts.

lumenfetch "https://youtube.com/watch?v=..." -t video -f mp4 -q 720p -y

Available arguments

Argument Description
url YouTube video/playlist URL. Filling this enables non-interactive mode when combined with other flags.
-t/--type {video,audio} Output type
-f/--format {mp4,mp3} Output format
-q/--quality Video quality (Best/1080p/720p/480p/360p/Worst) or MP3 bitrate (Best/320kbps/192kbps/128kbps)
-o/--output Custom output folder
--cookies Browser cookies (chrome/firefox/edge/brave/opera/vivaldi/safari/none)
--cookies-file Netscape-format cookie file
--max-retry Connection retry count
--playlist {single,all} Playlist mode
--subs Download subtitles when available
--sub-langs Subtitle languages, comma-separated (default: en,id)
--embed-subs Embed subtitles into the MP4 file
--embed-metadata Embed metadata (title/artist) into the output file
--sponsorblock [cats...] Skip SponsorBlock segments (e.g. --sponsorblock sponsor intro outro)
--write-info-json Save video metadata as .info.json next to the file
--batch Text file with URLs (one per line)
--jobs N Batch parallelism 1-4 (default 1)
--limit-rate Throttle download speed (e.g. 512K, 2M)
--concurrent-fragments N Download HLS fragments in parallel (1-10, default 1)
--no-overwrites Skip download if the output file already exists
--playlist-items Only download these playlist items (e.g. 1-3,7, playlist URLs)
--no-clipboard Don't offer clipboard content
--ui-lang {en,id} Display language (default en, remembered after being set)
--doctor Diagnose setup (ffmpeg, deps, cookies, network) and exit
-y/--yes Skip the filename confirmation
-v/--verbose Detailed logging to file + console
--history Show history and exit
--version Show the version

More examples

# Audio only, best bitrate
lumenfetch "https://youtube.com/watch?v=..." -t audio -q 320kbps -y

# Whole playlist as MP4
lumenfetch "https://youtube.com/playlist?list=PLxxx" --playlist all -y

# With subtitles embedded
lumenfetch "https://youtube.com/watch?v=..." -t video --subs --embed-subs -y

# Throttle to 1 MB/s and skip existing files
lumenfetch "https://youtube.com/watch?v=..." -t video --limit-rate 1M --no-overwrites -y

# Batch of URLs, 2 at a time
lumenfetch --batch daftar.txt --jobs 2

# See all options
lumenfetch --help

Output Structure

Filenames follow the template in settings (default: %(platform)s_%(title)s_%(year)s):

YouTube_Lofi-Hip-Hop-Radio_2026.mp4
YouTube_Lofi-Hip-Hop-Radio_2026.mp3

Default Folder per OS

OS Default folder
Windows C:\Users\<username>\Downloads
macOS /Users/<username>/Downloads
Linux /home/<username>/Downloads

Change it anytime via the settings command ([1]), absolute paths and ~ are both accepted.


Troubleshooting

Problem Solution
ModuleNotFoundError: No module named 'yt_dlp' / 'rich' / 'curl_cffi' Re-run pip install lumenfetch (or pip install -r requirements.txt from source)
HTTP Error 403: Forbidden Update yt-dlp: pip install --upgrade yt-dlp
Sign in to confirm you're not a bot Enable Cookies above (browser or file)
Private / unavailable content Private/age-restricted video, enable Cookies above
Format not available for this content Try another quality
Connection trouble keeps showing Check your connection, or raise max_retry via settings
Downloaded video has no sound Rare since ffmpeg is bundled, but if it happens, restart the app (the bundle re-downloads automatically if corrupted)
Naming template rejected in settings Only %(platform)s, %(title)s, %(year)s are allowed, rejected automatically on typos so filenames never break
Playlist with N videos Only the first video by default. Use --playlist all for all of them as indexed files
ffmpeg not found Install system ffmpeg first (lighter), the bundled fallback is automatic. Check with ffmpeg -version
YouTube needs a JavaScript runtime Install Deno (winget install DenoLand.Deno) or Node.js, required to solve YouTube signature challenges

Important Notes

  • Only YouTube links are accepted (youtube.com, youtu.be, music.youtube.com), other platforms are rejected with a clear message, not a crash
  • A Sign in to confirm you're not a bot message means YouTube is challenging automated requests: install/update curl_cffi + yt-dlp, then enable cookies
  • This tool is for downloading videos you have the right to save (your own uploads, Creative Commons, offline watching). Respect creators' copyright

Built With

Python yt-dlp Rich curl-cffi


Project Structure

lumenfetch/
├── assets/
│   ├── logo.png               # project logo
│   └── lumenfetch.ico         # icon for the Windows exe build
├── core/
│   ├── constants.py           # single source of truth (version, formats, limits)
│   ├── errors.py              # central error taxonomy (classification + friendly messages)
│   ├── i18n.py                # UI strings (English default, Indonesian via --ui-lang)
│   ├── cli.py                 # argument parsing + non-interactive choice building
│   ├── doctor.py              # setup diagnosis (ffmpeg, deps, cookies, network)
│   ├── ffmpeg.py              # system ffmpeg first, bundled fallback
│   ├── log.py                 # central file logging
│   ├── downloader.py          # MP4 download / MP3 extract + resume + retry backoff
│   ├── detector.py            # YouTube video info detection
│   ├── options.py             # interactive menus and prompts (rich)
│   ├── update_checker.py      # auto-check for newer yt-dlp on PyPI
│   └── utils.py               # filename sanitizing, size formatting, user config
├── tests/
│   ├── conftest.py            # global fixtures (no-sleep) + SAMPLE_VIDEO_FORMATS
│   ├── test_utils.py
│   ├── test_detector.py
│   ├── test_downloader.py
│   ├── test_options.py
│   ├── test_main.py
│   └── test_features.py       # features (CLI, backoff, batch, ffmpeg, cookies, log)
├── .github/
│   └── workflows/
│       ├── publish.yml        # release: build exe + publish to PyPI
│       └── tests.yml          # CI: test & lint
├── main.py                    # entry point, CLI args, batch, main loop
├── requirements.txt           # dependency list (for manual reference)
├── pyproject.toml             # package metadata + entry point + ruff config
├── lumenfetch.spec            # PyInstaller spec for the Windows exe
├── CONTRIBUTING.md            # contribution guide (English)
├── CONTRIBUTING.id.md         # contribution guide (Bahasa Indonesia)
├── CHANGELOG.md               # version history (English)
├── CHANGELOG.id.md            # version history (Bahasa Indonesia)
├── SECURITY.md                # vulnerability reporting policy
├── LICENSE
├── README.md                  # main documentation (English)
└── README.id.md               # documentation (Bahasa Indonesia)

Module separation principles

Module Principle
constants.py Shared values (version, formats, limits) so modules never drift
errors.py Central error classification used by detector and downloader together
detector.py Purely detects YouTube video info, never downloads anything
downloader.py Purely MP4/MP3 processing and progress, never shows menus
options.py All user interaction and menus, no download logic
utils.py Pure helpers (sanitizing, formatting, config read/write), knows nothing about CLI or network
main.py Ties everything together via CLI and the main loop

Development

Adding a new user-facing string

  1. Add the English string to core/i18n.py (English is the source)
  2. Add the Bahasa Indonesia pair right next to it
  3. Use the t("your_key") lookup in the code

Adding a feature

  1. Decide which core/ module it belongs to (see the module separation principles above)
  2. Add tests in tests/
  3. Run pytest tests/ -v and ruff check . before pushing

Testing

Unit tests per module (filename sanitizing, naming templates, duplicate resolving, size/duration formatting, config, YouTube URL validation, yt-dlp opts, CLI, etc.).

pip install -e .[dev]
pytest tests/ -v
ruff check .
Check Requirement
pytest tests/ -v Full suite passes
Coverage gate CI runs pytest --cov=core --cov-fail-under=80, must stay at or above 80%
ruff check . Zero issues

Lint is enforced through pyproject.toml (ruff, line-length 120, rules E, F, I, B, UP).


Continuous Integration

Workflow Purpose
tests.yml pytest (Python 3.9-3.14, coverage gate 80%) and ruff on every push and pull request to main
publish.yml On release published: builds lumenfetch.exe (with the logo icon), attaches it to the release, publishes to PyPI via trusted publishing

Contributing

Want to help develop Lumenfetch? Read CONTRIBUTING.md for the project structure and contribution flow.


FAQ

Is this legal / safe to use?

This tool uses the same requests your browser makes when you watch YouTube, so it doesn't hack anything. But use it responsibly: download for personal/offline use, and respect creators' copyright. Don't re-upload or sell other people's content.

Do I need a YouTube account?

No, not for public videos. You only need to be logged in (via cookies) for age-restricted or private videos you have access to.

Private / deleted video, can it be downloaded?

No. Only content that your account can actually watch can be downloaded.

Why is the process slow?

Download speed follows your connection. Connection errors are retried automatically with backoff, and interrupted downloads resume instead of restarting.

Which quality should I pick?
  • Want the best available: Best
  • Want smaller files for phone storage: 720p or 480p
  • Audio only for music/podcasts: MP3 320kbps

Author

Nicolas Dwi Dharma
Nicolas Dwi Dharma
github.com/nekonaru

License

Distributed under the MIT License. See LICENSE for more information.

Metadata

Release files for lumenfetch 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lumenfetch 2.3.0
File Size Uploaded Provenance Actions
lumenfetch-2.3.0.tar.gz 377.8 kB With provenance Details for lumenfetch-2.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lumenfetch 2.3.0
File Interpreter ABI Platform Actions
lumenfetch-2.3.0-py3-none-any.whl Python 3 none any Details for lumenfetch-2.3.0-py3-none-any.whl

Total release size: 432.5 kB

Release files / lumenfetch-2.3.0.tar.gz

Download URL lumenfetch-2.3.0.tar.gz
Size 377.8 kB
Tags Source
SHA-256 checksum
How to use checksums
522108f9f4f9646a527428169b2d962c1f20d414d6ff7c05752e8ac632d3188e
BLAKE2b-256 checksum
How to use checksums
16cebccb19a3442c6b8ded656976556bd876d7c2685fc0427128416e12d2b339
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / lumenfetch-2.3.0-py3-none-any.whl

Download URL lumenfetch-2.3.0-py3-none-any.whl
Size 54.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07bd146fa2dc6bc42525db3563240b974af59c18810cfcffac78185148aeec9b
BLAKE2b-256 checksum
How to use checksums
c23c20abf65ac6dd90184c3d1427a05ce8d02cda95fe84c4101ccd1adce95fb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for lumenfetch 2.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lumenfetch-2.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page