There is a built-in search option for youtube-dl. Old way:
youtube-dl "gvsearch1:how to create android app in app studio"
The argument is: gvsearchX
, where gvsearch
means use google and X
is the number of results you want to download. So the above will search for "how to create android app in app studio" and download the first result.
(Update!) Seems like ytsearch (youtube search) is the better approach now:
youtube-dl "ytsearch1:how to create android app in app studio"
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
The other answer is wrong and actually misleads and wastes people's time with this "latest version" thing which is an issue on his end and has nothing to do with the question...
The actual answer is that youtube-dl names its subtitle files only with the language in it (ex:
file.en.vtt
), which means that a potentialauto-en
would be named the same way asen
, hence the resulting rule that real subtitles will always be prioritized over auto subtitles if both are asked for in the command. This is something that needs to be asked of the devs if we want to be able to do it withyoutube-dl
alone.Source :
https://github.com/ytdl-org/youtube-dl/issues/1412