I don't know about the first, but the second can be easily done with youtube-dl
:
sudo apt-get install youtube-dl
I've copied the help text about formating here:
Video Format Options:
-f, --format FORMAT video format code, specifiy the order of
preference using slashes: "-f 22/17/18"
--all-formats download all available video formats
--prefer-free-formats prefer free video formats unless a specific one
is requested
--max-quality FORMAT highest quality format to download
-F, --list-formats list all available formats (currently youtube
only)
So you can use --max-quality
to get the maximum quality format. On a personal note, I find youtube-dl
very easy to use (I just type yo and Tab in terminal and it auto-completes it for me). It can also download every video by a specific channel and has a multitude of options.
I believe you can set it to continue downloads with the -c
option and if you do that for a channel, it should download only new ones if in the same directory as the others were downloaded to, but have not tried it in practice. If you can, then you can run youtube-dl
on a script and it will only download the files when there are new ones.
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"
Best Answer
youtube-dl
youtube-dl is a small command-line program to download videos from YouTube, Vimeo and a few more sites. It is included in the Ubuntu repositories, so you may install it by typing:
vimeo-dl
vimeo-dl is a stand-alone command-line program to download videos from Vimeo. It is not included in the Ubuntu repositories, therefore you must download and save the script somewhere and make it executable by typing: