A Python script that allows you to download audio from YouTube videos and spotify playlists and convert them to MP3 format using yt_dlp
and pydub
.
- Downloads audio from YouTube videos in MP3 format.
- Allows batch downloading from a list of URLs.(spotify option)
- Outputs high-quality MP3 files.
- Python 3.9+
- Libraries:
spotipy
aria2c
: (optional but faster)yt_dlp
: For downloading YouTube videos.pydub
: For converting and handling audio files.ffmpeg
orlibav
: Required bypydub
for audio processing.
- Clone the repository:
git clone https://github.com/Yoshk4e/ytmp3.git cd ytmp3
pip install yt_dlp pydub spotipy
Download from FFmpeg.org and add it to your PATH.
sudo apt update
sudo apt install ffmpeg
brew install ffmpeg
install chocolaty in powershell first by using:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Then type in powershell:
choco install aria2
or
choco install aria2c
python ytmp3.py
THE SCRIPT USES A LICENSING SYSTEM
I'm very sorry but i had to do this because if i die the server will stop after some time
SO
I'M NOT RESPONSIBLE OF WHAT YOU DO WITH THE SCRIPT IF I DIED AND YOU REMOVED THE LICESNSING LOGIC
LICENSE:
LICENSE-WR2KL8Z9XVM
NOTE: YOU SHOULD GET YOUR CLIENT_ID AND CLIENT_SECRET FROM SPOTIFY DEVS WEBSITE AND CHANGE THEM IN THE SCRIPT ACCORDINGLY
THIS SCRIPT IS AN OLD COLLAB BETWEEN ME AND ONE OF MY BSFs
Some videos may not download due to region restrictions or YouTube's protections. Use a VPN or proxy if needed.
The update function is broken for some reaseon feel free to fix it as of now i can't fix it so just manual update
Contributions are welcome! Feel free to fork this repository, make changes, and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
This script is intended for personal use only. Ensure compliance with YouTube's Terms of Service.