Is there a utility that can search YouTube from the command line, and then either view or download the search results according to user input?
$ youtube-search madonna 1 Madonna - Hung Up (Official Music Video) madonna ♩ 180M views 9 years ago https://www.youtube.com/watch?v=EDwb9jOVRtU "Hung Up" by Madonna from Confessions On A Dance Floor, available now. 2 Madonna - Like A Prayer (Official Music Video) madonna ♩ 69M views 9 years ago https://www.youtube.com/watch?v=79fzeNUqQbQ 2006 WMG Like A Prayer. etc.
And then you can enter:
- "v1" to view video 1 (with VLC, etc.)
- "d1-3" to download videos 1-3 (with youtube-dl, etc.)
- "n" to view next page of search results
What I tried so far:
googler works partially with YouTube, but for some reason only shows two search results when searching for "Madonna". Also there is not the choice between view and download.
youtube-dl has a search function, but doesn't seem to print the search results nor accept user input.
youtube-dl -j ytsearch:madonna lists metadata about search results, but doesn't seem to contain the video link, title and description that would be desired.