Skip to main content

Cross-platform media downloader for YouTube and Spotify

Project description

๐Ÿ’Ž CrystalMedia

A hyper-interactive terminal downloader for YouTube MP4/MP3 with a live Rich UI.

License: MIT Python


โšก Jump To


๐Ÿš€ 30-Second Quick Start

# From PyPI (recommended)
pip install crystalmedia
crystalmedia

# From source
git clone https://github.com/Thegamerprogrammer/CrystalMedia.git
cd CrystalMedia
pip install .
crystalmedia

On first launch, CrystalMedia runs a dependency preflight/status check and self-healing diagnostics. Runtime auto-install of dependencies is disabled for packaging safety; install/update dependencies through pip.


๐ŸŽฎ Interactive Walkthrough

When the app starts, the flow is designed to feel game-like and guided:

  1. Splash appears (CrystalMedia logo + version)
  2. Main menu opens (YouTube Video / YouTube Music / Spotify / Exit)
  3. You choose:
    • Single item or playlist
    • URL
    • MP4 quality or MP3 bitrate
    • JavaScript runtime preference (Auto / Deno-first / Node-first)
  4. Live UI kicks in:
    • Header panel with current context
    • Progress panel (single progress bar)
    • Download Log panel (bounded recent yt-dlp events)
  5. On completion, timeout prompt waits for input (or auto-returns)

โŒจ๏ธ Controls Cheatsheet

Action Key
Move up/down in menu โ†‘ / โ†“
Select menu item Enter
Skip wait timer / continue now Any key or Enter
Interrupt current flow Ctrl + C

๐Ÿง  Download Modes

๐ŸŽฌ YouTube Video (MP4)

  • Quality presets: low โ†’ best available
  • Single or playlist
  • Remux/postprocess handling with ffmpeg

๐ŸŽต YouTube Music (MP3)

  • Bitrate presets: 96 โ†’ 320 kbps
  • Single or playlist
  • Audio extraction postprocessing

๐ŸŽง Spotify (Exportify-first Playlist Mode)

  • Single track: reads Spotify metadata and downloads via yt-dlp search (with automatic browser-cookie fallback for age-restricted YouTube matches).
  • Playlist/album: Exportify CSV is the primary path.
    1. Open your playlist URL in CrystalMedia.
    2. CrystalMedia opens vendor/exportify/index.html helper + Exportify in browser.
    3. Export the same playlist and save CSV in ./csv (next to CrystalMedia.py).
    4. Filename matching is used as a hint; CrystalMedia will still try the newest CSV if names do not match.
    5. CrystalMedia reads that CSV and downloads each song via yt-dlp search.

If no CSV is found, CrystalMedia attempts direct Spotify page scraping fallback.

๐Ÿช Age-restricted YouTube matches (Spotify fallback)

  • CrystalMedia now auto-tries yt-dlp --cookies-from-browser profiles when YouTube returns age/sign-in restrictions.
  • For best results, sign in to YouTube in your normal (non-incognito) browser profile first.
  • If browser-cookie extraction still fails, export a Netscape cookies file and pass it manually in yt-dlp workflows.

๐Ÿ–ฅ๏ธ Live UI Preview

CrystalMedia uses a fixed Rich layout to keep output readable:

  • Header panel: logo + current download context
  • Progress panel: one progress bar (download/processing/merging)
  • Download Log panel: compact rolling logs with truncation + color tags

This minimizes noisy terminal spam and keeps the interface focused.


๐Ÿ“ Output Structure

CrystalMedia/
โ”œโ”€โ”€ downloads/
โ”‚   โ”œโ”€โ”€ YT VIDEO/
โ”‚   โ”‚   โ”œโ”€โ”€ Single/
โ”‚   โ”‚   โ””โ”€โ”€ Playlist/
โ”‚   โ”œโ”€โ”€ YT MUSIC/
โ”‚   โ”‚   โ”œโ”€โ”€ Single/
โ”‚   โ”‚   โ””โ”€โ”€ Playlist/
โ”‚   โ””โ”€โ”€ SPOTIFY/
โ”‚       โ”œโ”€โ”€ Single/
โ”‚       โ””โ”€โ”€ Playlist/
โ””โ”€โ”€ logs/
    โ”œโ”€โ”€ log.txt
    โ”œโ”€โ”€ crash.txt
    โ””โ”€โ”€ deps.txt

๐Ÿ›  Requirements

  • Python 3.8+
  • Internet connection
  • FFmpeg (app can help bootstrap if missing)

โ— MIT License + Legal Warning

CrystalMedia is released under the MIT License (see LICENSE).

Important warning

  • The MIT License allows broad use/modification/distribution of this software.
  • It does not grant rights to download copyrighted media without permission.
  • You are solely responsible for how you use this tool and for compliance with local laws/platform terms.

Use responsibly and only with content you are authorized to download.


๐Ÿงฏ Troubleshooting

  • If terminal rendering looks off after a resize, return to the main menu and start the download again.
  • Check CrystalMedia/logs/crash.txt for error traces and CrystalMedia/logs/deps.txt for dependency snapshots after startup.


PRs are welcome for UI polish, reliability improvements, and Spotify-mode recovery when upstream ecosystem changes stabilize.

๐Ÿงพ Exportify CSV (Playlist) Quick Notes

  • CSV files must be in ./csv (relative to where you run CrystalMedia.py).
  • Leave filename blank in prompt to auto-detect latest CSV in ./csv that matches playlist name.
  • Playlist title is auto-derived from the Spotify playlist link and used for fuzzy CSV matching.

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

crystalmedia-3.1.9.tar.gz (46.2 kB view details)

Uploaded Source

Built Distribution

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

crystalmedia-3.1.9-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

Details for the file crystalmedia-3.1.9.tar.gz.

File metadata

  • Download URL: crystalmedia-3.1.9.tar.gz
  • Upload date:
  • Size: 46.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for crystalmedia-3.1.9.tar.gz
Algorithm Hash digest
SHA256 384956abd635ce452b7a1bf4fa373eae7c3bf61635d26fb6975f0d1804816cbd
MD5 91bc86979527dad072a7b3b5bfc06c82
BLAKE2b-256 06ddd70d5599993a5eb6fa1917792037721f74e7833194dd64e28bfb2d6b6869

See more details on using hashes here.

File details

Details for the file crystalmedia-3.1.9-py3-none-any.whl.

File metadata

  • Download URL: crystalmedia-3.1.9-py3-none-any.whl
  • Upload date:
  • Size: 33.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for crystalmedia-3.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f66a6c1f0efd41244bd98b97469ed4f62ef8e3be79d0b2ab2d0c700e00e255ce
MD5 bb0db8fd651065179e41eeaf1a2a8af9
BLAKE2b-256 2c532d69054d8d45bc9013441af25ea008cadd75f68082d6f4135db145f4dacf

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