I have tried the following code to download a video in YouTube and it is working, but I want to save the video at a particular location. Now it is saving the video in
Path = "The Path That You Want"
Location = '%s \%(extractor)s-%(id)s-%(title)s.%(ext)s'.replace("%s ", Path)
ytdl_format_options = {
'outtmpl': Location
}
with youtube_dl.YoutubeDL(ytdl_format_options) as ydl:
ydl.download(['https://www.youtube.com/watch?v=n06H7OcPd-g'])
I personally don't know the library very well, but here is my knowledge the youtube_dl have ytdl_format_options it gives you the options to add some I don't know what it called but let say parameters like above outtmp1 give you the option to specify the location, id, title, or quiet to see the log or not and there is so much more. almost everything you can get it from this URL:https://github.com/ytdl-org/youtube-dl/blob/master/README.md#format-selection