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
I guess you are a bit confused, try this code, end to end
from __future__ import unicode_literals
import youtube_dl
import urllib
import shutil
ydl_opts = {}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download(['https://www.youtube.com/watch?v=n06H7OcPd-g'])
#Moving your source file to destination folder
source_file = 'C:\Users\Sharmili Nag\Aahatein - Agnee (splitsvilla 4 theme song) Best audio quality-n06H7OcPd-g.mp4'
destination_folder = 'C:\Users\Sharmili Nag\Desktop\Aahatein - Agnee (splitsvilla 4 theme song) Best audio quality-n06H7OcPd-g.mp4'
shutil.move(source_file, destination_folder)
In case this code worked out for you, kindly mark the answer as correct.