Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Youtube_MP3_Audio_Download python file #512

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Amazing Python Projects_Scripts/Youtube mp3 download/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Youtube MP3 Audio Download
The ```Youtube_mp3_download.py``` is to convert youtube video format to mp3 format

# Requirement
Any system with python 3 (preferably 3.6 or higher) and terminal.

# Usage
- Navigate to the file directory where the downloaded file (the script file) is stored.
- Run the file, using `python youtube_mp3_download.py <your youtube's url>` and run.
- Wait for sometime, and Whola!! your youtube audio is downloaded.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#This program is to convert youtube video format to mp3 format
import youtube_dl
import sys


#to choose the best audio format available , the 'preffereddcode' will be mp3 and rest will be as it is
ydl_opts = {
'format': 'bestaudio/best' ,
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '192',
}],
}

if __name__ == '__main__':
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
filenames = sys.argv[1:]
ydl.download(filenames)

#For output type python youtube mp3 download followed by <your youtube's url>