Skip to main content

Download videos or extract audio from YouTube, Instagram, Facebook, TikTok, X (Twitter), and more — easily and fast.

Project description

🎬 ytmagic

ytmagic is a simple command-line tool that lets anyone download videos or extract audio from YouTube, Instagram, Facebook, TikTok, X, and more using yt-dlp — no technical knowledge needed.

It works on Linux, macOS, and Windows.


🧠 What Can It Do?

  • ✅ Download full video with best quality
  • 🎧 Download audio only and convert it to MP3
  • 📥 Choose specific video quality like 360p, 720p, 1080p
  • 📁 Save to custom folder or default to ~/Downloads

🔧 Installation

Make sure you have Python 3.7+, ffmpeg, and pip/pipx installed.

Then install ytmagic globally using pipx:

pipx install ytmagic

Or for local testing (developer mode):

git clone https://github.com/owais-shafi/Yt_Magic.git
cd ytmagic
pipx install --force --editable .

✅ Now you can use the ytmagic command from anywhere in your terminal.


🎯 How to Use

Basic command format:

ytmagic [options] URL

🔤 Examples

ytmagic https://youtu.be/example1
# ▶️ Downloads best video+audio to ~/Downloads

ytmagic https://youtu.be/example2 -q 720
# ⬇️ Downloads 720p video

ytmagic https://youtu.be/example3 -a
# 🎵 Downloads and converts audio to MP3

ytmagic -a https://youtu.be/example4 -p ~/Music
# 🎧 Downloads MP3 and saves it in ~/Music

⚙️ Command-Line Options

Option Description
url (positional) Video URL (YouTube, Instagram, Facebook, TikTok, etc.)
-q, --quality Video quality: 360, 480, 720, 1080, or best (default: best)
-p, --path Folder to save downloaded file (default: ~/Downloads)
-a, --audio Download audio only and convert to MP3 (requires FFmpeg)

📦 Dependencies

To use the -a (audio-only MP3) option, ffmpeg must be installed on your system.

✅ Install ffmpeg:

  • Linux (Debian/Ubuntu):

    sudo apt install ffmpeg
    
  • Linux (Arch):

    sudo pacman -S ffmpeg
    
  • macOS (with Homebrew):

    brew install ffmpeg
    
  • Windows (with Chocolatey):

    choco install ffmpeg
    
  • Or download manually and add it to your system PATH.


📂 Default Output Folder

If no path is given using -p, ytmagic saves all downloads to:

~/Downloads

💡 Tip

You can combine options! For example:

ytmagic -a -q best -p ~/Music https://youtu.be/example

This downloads the best audio, converts it to MP3, and saves it in your Music folder.

To upgrade ytmagic:

pipx upgrade ytmagic

📱 Run on Android (via Termux)

Yes — ytmagic works on Android too using Termux!

✅ Steps to Set It Up:

  1. Install Termux from Play store.

  2. Open Termux and run:

    pkg update && pkg upgrade
    pkg install python ffmpeg termux-api
    pip install pipx
    pipx ensurepath
    source ~/.bashrc  # Or restart Termux
    
  3. Install ytmagic:

    pipx install ytmagic
    
  4. Grant storage access to Termux:

    termux-setup-storage
    
  5. To save downloads to your phone storage, use:

    ytmagic -p /sdcard/Download/ <URL>
    
  6. To make media files appear in your music/video apps, run:

    termux-media-scan /sdcard/Download/
    
  7. (Optional) Add handy shortcuts by editing your bash config:

    nano ~/.bashrc
    

    Add these lines at the end:

    alias sc='termux-media-scan /sdcard/Music/'
    alias yt='ytmagic -p /sdcard/Download/'
    

    Then save and apply:

    source ~/.bashrc
    

🔁 After Every Download

Run:

sc

to make the audio/video visible in your media apps. Without this, downloaded files might not appear in players.


👨‍🔧 Built With


📜 License

MIT License — free for personal or commercial use.

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

ytmagic-1.2.5.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

ytmagic-1.2.5-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file ytmagic-1.2.5.tar.gz.

File metadata

  • Download URL: ytmagic-1.2.5.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ytmagic-1.2.5.tar.gz
Algorithm Hash digest
SHA256 699ff442fb5ab9c0f1e8064cfa6ffb117d8e9758f10a2e396d471592ef3f1a71
MD5 d9f6dcc764ab3912da92f7f877ff8ada
BLAKE2b-256 5f6e6409ffacf7f852ee2dabadd9a070e706fc9aa825d55dac26ad84f116c5d8

See more details on using hashes here.

File details

Details for the file ytmagic-1.2.5-py3-none-any.whl.

File metadata

  • Download URL: ytmagic-1.2.5-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ytmagic-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 08f755191b77da07f002b9c3e6730b1ecc00d176ed06c8825fdb98c52636d894
MD5 41a3f33239da34531e8cb53140b8fc20
BLAKE2b-256 6b9b194f6a609e55b8fe4d265b70bd6a5df35aec4dd531c8957c7316e0bd1e05

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