10000 GitHub - l0n3m4n/yt2mp3: Download Youtube music video and convert to MP3
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

l0n3m4n/yt2mp3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎧 yt2mp3

Facebook X Medium Python


📜 Description

yt2mp3 is a small project cli music downloader from youtube and convert into mp3 using pytube, moviepy and tqdm python libraries.

"Converting YouTube videos on third party websites carries high risks, hackers can embed executable code or scripts within MP3 files. When you play or open such file, it could potentially execute malicious code and compromise your system."

📚 Table of Contents

🛠️ Installation

Installing virtual environment

$ sudo apt install python3.11-venv
$ python3 -m pip install virtualenv 
$ python3 -m venv venv 
$ git clone https://github.com/l0n3m4n/yt2mp3.git
$ cd yt3mp3 && source venv/bin/activate
$ pip install -r requirements.txt

⚙️ Usage

$ python3 yt2mp3.py -h, --help

        __   ______                  ______ 
.--.--.|  |_|__    |.--------.-----.|__    |
|  |  ||   _|    __||        |  _  ||__    |
|___  ||____|______||__|__|__|   __||______|
|_____|                      |__|           
                                                                         
        Author: l0n3m4n | ⚙️  v1.1 

usage: yt2mp3.py [-h] [--url URL] [-o OUTPUT]

Download a YouTube video and convert to MP3.

options:
  -h  --help        Show this help message and exit
  -u  --url         YouTube video URL
  -o  --output      Output filename for MP3

Ex: python3 yt2mp3.py -u "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -o rick_astley.mp3
$ python3 yt2mp3.py -u "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -o /save/path/music_title.mp3
        __   ______                  ______ 
.--.--.|  |_|__    |.--------.-----.|__    |
|  |  ||   _|    __||        |  _  ||__    |
|___  ||____|______||__|__|__|   __||______|
|_____|                      |__|           
                                                                         
        Author: l0n3m4n | ⚙️  v1.1 

📥 Downloading video...
Progress: 100%|############################| 3.67M/3.67M [00:00<00:00, 9.25MB/s]
💾 Video downloaded.
🎵 Converting to MP3...
Progress: 0%|##########################################| 0/179.05 [00:07<?, ?s/s]
💽 Conversion complete. MP3 saved at: ./music/music_title.mp3                                                                               
🚮 Temporary video file deleted.

💁 References

  • pytube is a genuine, lightweight, dependency-free Python library (and command-line utility) for downloading YouTube videos.
  • Moviepy allows to extract audio from a video file (like MP4) and save it as an audio file (like MP3).
  • tqdm Instantly make your loops show a smart progress meter - just wrap any iterable with tqdm(iterable), and you’re done!

📝 Todo

  • Adding progress bar
  • Add multiple URL
  • Extract MP3 metadata
  • Adding song title automatically

👨🏾‍⚖️ License

This project is under terms of the MIT License. For fixing Bugs, create issue

Releases

No releases published

Packages

No packages published

Languages

0