This program simplifies the process of searching, downloading and converting Youtube videos to MP3 files from the command-line. All you need is the video URL or the name of the artist/track you’re looking for.
The program will attempt to retrieve data for a song matching the provided input by querying the iTunes API and use the data to find a corresponding YouTube video, if a URL is not provided. The video will then be downloaded, converted, and the gathered data will be used to populate the metadata of the MP3.
Once finished, the resulting MP3 file will be saved to your Downloads directory, with the following file-structure
Note: If a URL is provided and no match is found for the song data, the program will prompt the user for the track/artist and the YouTube thumbnail will be used as the album artwork.
You can install the program with the following command:
1$ pip install yt2mp3
The program can be executed via the as follows:
1$ yt2mp3 [-options]
|Specify the track name query
|Specify the artist name query
|Specify a Youtube URL or ID
|Specify a Youtube playlist URL or ID
|Overwrite the file if one exists in output directory
|Specify the resolution for the cover-art
|Suppress program command-line output
|Display a command-line progress bar
|Show the version number and exit
|Display information on usage and functionality
Note: Displaying the progress bar with the
-v, --verbose flag currently has a significant impact on download performance, due to #180.
Further documentation is available on Read The Docs
If you’d like to contribute to the project, you can download and install the program with the following commands:
1# Clone the repository / most up to date is on saftyBranch2$ git clone https://github.com/tterb/yt2mp334# Navigate to the directory5$ cd yt2mp367# Install program dependencies8$ pip install -r requirements.txt