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
youtube_dl has a giant list of options: https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L128-L278
youtube_dl
But I don't see any that control the output directory. So you can move the file afterward. For that, see: How to move a file in Python.