Created
August 7, 2022 15:13
-
-
Save rajendrakumaryadav/637e47569dd02153eab0aab25427cfb7 to your computer and use it in GitHub Desktop.
Extact audio using yt-dlp, pass the urls as comma seperated form.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yt_dlp | |
url = input("Enter the URL of the video: ") | |
URLS = [] | |
URLS.append(url) | |
ydl_opts = { | |
'format': 'mp3/bestaudio/best', | |
'postprocessors': [{ | |
'key': 'FFmpegExtractAudio', | |
'preferredcodec': 'mp3', | |
}] | |
} | |
with yt_dlp.YoutubeDL(ydl_opts) as ydl: | |
error_code = ydl.download(URLS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment