HOW TO DOWNLOAD AUDIO FROM YOUTUBE USING PYTHON ONLY FIVE LINES

 

 How to download audio from YouTube using Python step by step

#1 Installing requirements 

Then open cmd and type

#1 pip install pafy

#2 pip install youtube-dl

then Enter

#2 Creating a folder and files

First, make one and give a name to the folder for store Audios


Then open folder on Code Editor and create .py file


#3 Write code and run it

Write Code:

import pafy 
  
url = input("PASTE URL :")
video = pafy.new(url)
  
bestaudio = video.getbestaudio()
bestaudio.download()



Paste URL

Open folder and see reasult

If you have any problem then contact me on telegram @odewithyash





0 Comments