youtube-dl | Download playlist in respective directory

Have you checked the documentation? Specifically the -o, --output option. Using that, you should be able to do:

youtube-dl -o '/home/me/%(playlist_title)s/%(playlist_index)s_%(title)s.%(ext)s'

That said, please be sure to respect the owner's rights with any videos you use this program for.


See Output template examples. https://github.com/ytdl-org/youtube-dl/blob/master/README.md#output-template-examples

# Download YouTube playlist videos in separate directory indexed by video order in a playlist
$ youtube-dl -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re

# Download all playlists of YouTube channel/user keeping each playlist in separate directory:
$ youtube-dl -o '%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/user/TheLinuxFoundation/playlists

My example.

youtube-dl -ci -o "~/dl.folder/%(playlist_title)s/%(title)s-%(id)s.%(ext)s" --write-sub --convert-subs srt -k --download-archive archive.txt --proxy socks5://127.0.0.1:1080/ https://www.youtube.com/channel/UCzBGtBze1AIcDmRwD2ZjiAA

-o, --output TEMPLATE Output filename template, see the "OUTPUT TEMPLATE" for all the info

~

-c, --continue Force resume of partially downloaded files. By default, youtube-dl will resume downloads if possible.

~

-i, --ignore-errors Continue on download errors, for example to skip unavailable videos in a playlist

~

--download-archive FILE Download only videos not listed in the archive file. Record the IDs of all downloaded videos in it.

~

--proxy URL Use the specified HTTP/HTTPS/SOCKS proxy. To enable SOCKS proxy, specify a proper scheme. For example socks5://127.0.0.1:1080/. Pass in an empty string (--proxy "") for direct connection

~

--write-sub Write subtitle file

~

-k, --keep-video Keep the video file on disk after the post-processing; the video is erased by default

~

--convert-subs FORMAT Convert the subtitles to other format (currently supported: srt|ass|vtt|lrc)

ref:

https://ytdl-org.github.io/youtube-dl/index.html

https://github.com/ytdl-org/youtube-dl/blob/master/README.md

https://github.com/ytdl-org/youtube-dl/blob/master/README.md#output-template

youtube-dl --help (youtube-dl --version 2019.08.13)