You can use the following switch:
--playlist-items ITEM_SPEC Playlist video items to download. Specify
indices of the videos in the playlist
separated by commas like: "--playlist-items
1,2,5,8" if you want to download videos
indexed 1, 2, 5, 8 in the playlist. You can
specify range: "--playlist-items
1-3,7,10-13", it will download the videos
at index 1, 2, 3, 7, 10, 11, 12 and 13.
So it would be:
youtube-dl -f 22 --playlist-items 7-X https://www.youtube.com/playlist?list=PLO-hrPk0zuI18xlF_480s6UiaGD7hBqJa
where X is the number of videos in the playlist.
Playlist
youtube-dl -f FORMAT -ciw --output '%(title)s.%(ext)s' --playlist-start NUMBER-START --playlist-end NUMBER-END <url-of-playlist>
...where <url-of-playlist>
is replaced by the URL of the playlist, replace FORMAT
with any available video format, for example 18
, NUMBER-START
is the number of the video in the playlist to start downloading first, and NUMBER-END
is the number of the video in the playlist to download last.
Channel
If a channel has more than one playlist, click on the first playlist and download all the videos in the selected playlist using the above command. Then repeat for each playlist in the channel.
Explanation
-f, --format FORMAT
video format code. The -F option (capital F) displays all available video
formats for a video link. Example: youtube-dl -F <url-of-video>
-c, --continue
force resume of partially downloaded files
-i, --ignore-errors
continue on download errors, for example to skip unavailable videos
in a channel
-w, --no-overwrites
do not overwrite files
Convert all the video titles to lowercase
youtube-dl -f FORMAT -ciw --output '%(title)s.%(ext)s' --playlist-start NUMBER-START --playlist-end NUMBER-END <url-of-playlist>
find -type f -exec rename 'y/A-Z/a-z/' {} +
Explanation
--output '%(title)s.%(ext)s'
output file name(s) as the name of the video, followed by a dot character and the video's extension
find -type f
Find all files.
y/source/destination/
Transliterate the characters in the pattern space which appear in source
to the corresponding character in destination.
Best Answer
This answer won't work on older versions of youtube-dl. You need to update youtube-dl to the latest version. You can either install the latest version of youtube-dl locally inside a Python virtual environment (virtualenv), or you can download the latest version of youtube-dl and install it with
pip
(sudo apt remove youtube-dl && sudo apt install python-pip && pip install --user youtube-dl
). youtube-dl is also a snap package. To install it type:Open the terminal and type:
...where
<url-of-channel>
is replaced by the URL of the channel.Note: If you are downloading a lot of videos, you should change directories to the directory where you want to save the videos before you start downloading them.
Explanation