how can I set default download location in youtube-dl so that everything that I download with youtube-dl goes into that default directory?
This is the EXACT ANOTHER USEFUL method to download your video into a desired DIRECTORY, and also keep the native filename of the download.
This is your config file below:
-o %userprofile%/Desktop/DL/%(title)s-%(id)s.%(ext)s
Options found here Config here
Batch File setup:
::Variables: Set program="%USERPROFILE%\Desktop\YOUTUBE-DL\v20201209\youtube-dl.exe" Set option=best SET MYPATH="%USERPROFILE%\Desktop\YOUTUBE-DL\v20201209\config" SET MYCONFIG="--config-location" SET MYDLDIR="%USERPROFILE%\Desktop\DL" SET INSTR='%%(title)s-%%(id)s.%%(ext)s' MKDIR "%USERPROFILE%\Desktop\DL" ::Ask user for input. Set /P youtubelink=[Past Link]: :: For use of config file, for default download location. %program% -f %option% "%youtubelink%" "%MYCONFIG%" "%MYPATH%" :: There are many ways to accomplish this: :: For Batch File, NOTE extra (%) character needed. :: "%program%" -f "option" --merge-output-format mp4 -o "%MYDLDIR%"\%%(title)s-%%(id)s.%%(ext)s %youtubelink% :: or this use of variable :: "%program%" -f "option" --merge-output-format mp4 -o "%MYDLDIR%"\%INSTR% %youtubelink%
NOTE: The use of "quotes" when there are spaces in your variable options.
Final Message:
Create the config file, put it in a folder (directory) that you wish to refer to it. Go to your youtube-dl.exe file and pass the "parameters" listed above to it using your CMD or a batch file. Done. (contribution, and being kind)