Skip to content

Files

Latest commit

 

History

History

Youtube-Audio-Downloader

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

How To Download Audio Of A YouTube Video?

  1. Setup python and pip if you haven’t already

  2. Install virtualenv

pip install virtualenv

  1. Create Virtual environment

virtualenv venv

  1. Activate virtual environment
  • source venv/bin/activate (Linux)
  • venv\Scripts\activate (Windows)
  1. Install requirements

pip install -r requirements.txt

  1. Specify url of the YouTube video whoose audio you want (in YouTubeAudioDownloader.py)

ex: url = "https://www.youtube.com/watch?v=ZSXN_dpG5jk"

  1. Run YouTubeAudioDownloader.py

YouTubeAudioDownloader.py Output

You will find file of .webm format downloaded in the same folder.

How To convert .webm to .mp3 format?

  1. Install moviepy in the same environment

pip install moviepy==1.0.3

  1. Specify path of .webm file (in WebmToMp3.py)

ex: clip = mp.AudioFileClip("C:/Users/sejal/Desktop/YouTube Audio Downloader/Rainbow.webm").subclip()

  1. Specify path where .mp3 file should be saved (in WebmToMp3.py)

ex: clip.write_audiofile("C:/Users/sejal/Desktop/YouTube Audio Downloader/rainbow.mp3")

  1. Run WebmToMp3.py

YouTube Audio Downloader Folder