Here’s a detailed README.md file for your GitHub repository:
ytaudio is a simple command-line tool that allows users to download audio from YouTube videos easily. It uses pytubefix
, a modified version of pytube
, to handle YouTube's latest streaming changes. The script supports both Windows PowerShell and Linux Terminal, making it a versatile tool for audio extraction.
✅ Download high-quality audio from YouTube videos
✅ Simple command-line interface for quick execution
✅ Supports Windows (PowerShell) & Linux (Terminal)
✅ Handles YouTube URL validation
✅ Uses pytubefix
for reliable downloading
Ensure Python 3.x is installed on your system. You can download it from python.org.
Run the following command to install pytubefix
:
pip install pytubefix
Run the following command to install colorama
:
pip install colorama
By default, the script saves downloaded audio files in:
# Windows
DOWNLOAD_PATH = 'C:\Users\USER\Music'
# Linux
DOWNLOAD_PATH = '/home/USER/Music'
If you want to change the download location:
- Open
ytaudio.py
in a text editor. - Modify the
DOWNLOAD_PATH
variable to your desired folder. Example:
DOWNLOAD_PATH = "D:\\Music"
- Save the file, and the audio will be downloaded to the new location.
To download audio from a YouTube link, use:
python ytaudio.py "https://youtu.be/your_video_id"
If no URL is provided, the script will prompt you to enter one manually.
To simplify usage, add a PowerShell function:
- Open PowerShell and edit your profile:
notepad $PROFILE
- Add the following function at the end:
function ytaudio { python "C:\path\to\ytaudio.py" $args }
- Save the file and refresh your profile:
. $PROFILE
- Now, you can run:
ytaudio "https://youtu.be/your_video_id"
To make ytaudio
a terminal command:
- Open your terminal and edit your
.bashrc
or.zshrc
file:nano ~/.bashrc # For Bash users nano ~/.zshrc # For Zsh users
- Add the following alias at the end:
alias ytaudio='python3 /path/to/ytaudio.py'
- Save and reload the profile:
source ~/.bashrc # or source ~/.zshrc
- Now, you can run:
ytaudio "https://youtu.be/your_video_id"
Processing...
Song Title - Artist
Downloading...
Download Complete: D:\Music
Pull requests and improvements are welcome! Feel free to fork the project and contribute.
This project is licensed under the MIT License.
Let me know if you need any modifications! 🚀