Download Songs, Podcasts and other audio files from Youtube. 🎵
SoundSnatch is a CLI tool that allows users to download songs, podcasts and other audio files from YouTube within seconds. With a simple and user-friendly interface, you can easily fetch and save your favorite audio content in MP3 format.
- Download Audio from YouTube: Convert YouTube videos to high-quality MP3 files.
- User-Friendly CLI: Interactive prompts with default file paths and filenames.
- Customizable Output: Choose where to save files and rename them as desired.
- ASCII Art: Stylish ASCII art banner powered by the
toilet
utility (Linux/macOS). - Cross-Platform Support: Works on Linux and macOS with easy installation scripts.
- Python 3.6+: Required to run the script and create the virtual environment.
- pip: Python package manager for installing dependencies.
- toilet (optional, Linux/macOS): For ASCII art display. Install with:
sudo apt install toilet # Ubuntu/Debian sudo pacman -S toilet # Arch Linux brew install toilet # macOS (with Homebrew)
sudo
(Linux/macOS) for installing the binary to system directories.
SoundSnatch uses installation scripts to build a binary with PyInstaller and install it to a system directory. The process uses a virtual environment and requirements.txt
for consistent dependency management.
git clone https://github.com/maskedsyntax/soundsnatch.git
cd soundsnatch
- Make the script executable:
chmod +x scripts/install.sh
- Run the script:
./scripts/install.sh
- Creates a virtual environment in
venv/
. - Installs dependencies from
requirements.txt
. - Builds the binary with PyInstaller.
- Installs the binary to
/usr/local/bin
(requiressudo
).
- Creates a virtual environment in
Run soundsnatch
from any terminal:
soundsnatch
- Launch SoundSnatch:
soundsnatch
- Enter a YouTube video URL when prompted.
- Review the fetched video info (title, URL, duration).
- Specify the save location (defaults to
~/Music
on Linux/macOS). - Rename the output MP3 file (defaults to the video title).
- Wait for the download to complete. The MP3 file will be saved to the specified location.
Example:
Enter video URL: https://www.youtube.com/watch?v=dQw4w9WgXcQ
Fetching video info...
Video info fetched:
Title: Rick Astley - Never Gonna Give You Up
Video URL: https://www.youtube.com/watch?v=dQw4w9WgXcQ
Duration: 212
✨ Where would you like to save your audio file? ~/Music
📝 What would you like to name your audio file? Never Gonna Give You Up
Download Complete! 'Rick Astley - Never Gonna Give You Up' has been successfully saved. Enjoy your audio experience! 🎧
Exit: Press Ctrl+C
to quit at any time.
- Missing
toilet
: If ASCII art fails, installtoilet
(see Prerequisites) or ignore it, as it’s cosmetic. - Invalid URL: Ensure the YouTube URL is valid and your network is active.
- Permission Errors:
- Linux/macOS: Ensure you have
sudo
privileges for/usr/local/bin
.
- Linux/macOS: Ensure you have
- Missing Dependencies: Verify
requirements.txt
includespyinstaller
andyt-dlp
. Check internet connectivity forpip
. - Virtual Environment Issues: Delete
venv/
and rerun the script to recreate it:rm -rf venv/
Contributions are welcome! Please:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature
). - Commit changes (
git commit -m 'Add your feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE
file for details.
- yt-dlp for audio downloading capabilities.
- PyInstaller for creating standalone binaries.
- toilet for ASCII art generation.