Download videos or extract audio from YouTube, Instagram, Facebook, TikTok, X (Twitter), and more — easily and fast.
Project description
Here’s your copy-paste ready README for ytmagic with all current features included:
# 🎬 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](https://github.com/yt-dlp/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 a custom folder or default to `~/Downloads`
- 🔁 **Resume interrupted downloads**
- 📊 **Show all available formats** for one or more links
---
## 🔧 Installation
Make sure you have **Python 3.7+**, `ffmpeg`, and `pip/pipx` installed.
Install `ytmagic` globally using `pipx`:
```bash
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 (or yt) command from anywhere in your terminal.
🎯 How to Use
Basic command format:
ytmagic [options] URL1 [URL2 ... URLn]
🔤 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 -p ~/Music https://youtu.be/example4
# 🎧 Downloads MP3 and saves it in ~/Music
ytmagic https://youtu.be/example5 https://youtu.be/example6
# ⬇️ Downloads multiple videos in order
ytmagic -f https://youtu.be/example7 https://youtu.be/example8
# 📊 Shows available qualities/formats for multiple videos
ytmagic --resume https://youtu.be/example9
# 🔁 Resumes interrupted download
⚙️ Command-Line Options
| Option | Description |
|---|---|
urls (positional) |
One or more video URLs (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) |
-f, --formats |
Show available formats for all given URLs |
--resume |
Resume interrupted downloads |
-v, --version |
Show ytmagic version |
📦 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
💡 Tips
- Combine options for multiple features:
ytmagic -a -q best -p ~/Music https://youtu.be/example1 https://youtu.be/example2
-
This downloads multiple best-quality audio files, converts them to MP3, and saves them to
~/Music. -
Use
-fbefore downloading if you want to check available formats:
ytmagic -f https://youtu.be/example1 https://youtu.be/example2
- Use
--resumeto continue interrupted downloads:
ytmagic --resume https://youtu.be/example1
📱 Run on Android (via Termux)
Yes — ytmagic works on Android too using Termux!
✅ Steps to Set It Up
- Install Termux from Play store.
- 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.Save downloads to phone storage:
ytmagic -p /sdcard/Download/ <URL>
6.Make media files appear in apps:
termux-media-scan /sdcard/Download/
7.(Optional) Add handy shortcuts in ~/.bashrc:
alias sc='termux-media-scan /sdcard/Music/'
alias yt='ytmagic -p /sdcard/Download/'
source ~/.bashrc
Run sc after every download so media files appear in music/video apps.
👨🔧 Built With
📜 License
MIT License — free for personal or commercial use.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ytmagic-1.2.8.tar.gz.
File metadata
- Download URL: ytmagic-1.2.8.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71c3e2792ca1295627d4875606cbf2a8c3b7227d52f6d689c3a10ff0797a0c98
|
|
| MD5 |
194ea02ab5eb5fdb6f2a3e2432d63657
|
|
| BLAKE2b-256 |
c4ee9bc75959ca2e4195e18a8d76c20bcd38a565572c5ce3d6fd4e1925d1c73e
|
File details
Details for the file ytmagic-1.2.8-py3-none-any.whl.
File metadata
- Download URL: ytmagic-1.2.8-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f5f90ecb2dfc9425e97d3e80684ee605178e32ea7395047e2182aab896969bf
|
|
| MD5 |
45e53175609e2471d1478f4e07091a9f
|
|
| BLAKE2b-256 |
6ed36f4be2df0ae72c39d6b3a6572101f374de4e2be923e050a6909e2cd01159
|