Installation:
1
|
|
Usage:
Download a video: viddl-rb http://www.youtube.com/watch?v=QH2-TGUlwu4
Viddl-rb supports the following command line options:
1 2 3 4 5 6 7 8 9 10 11 |
|
Library Usage:
1 2 3 4 |
|
The ViddlRb module has the following module public methods:
get_urls_names(url)
– Returns an array of one or more hashes that has the keys :url which points to the download url and :name which points to the name (which is a filename safe version of the video title with a file extension). Returns nil if the url is not recognized by any plugins.
get_urls_exts(url)
– Same as get_urls_names but with just the file extension (for example “.mp4”) instead of the full filename, and the :name key is replaced with :ext. Returns nil if the url is not recognized by any plugins.
get_urls(url)
– Returns an array of download urls for the specified video url. Returns nil if the url is not recognized by any plugins.
get_names(url)
– Returns an array of filenames for the specified video url. Returns nil if the url is not recognized by any plugins.
io=(io_object)
– By default all plugin output to stdout will be suppressed when the library is used. If you are interested in the output of a plugin, you can set an IO object that will receive all plugin output using this method.
Requirements:
- curl/wget/aria2c or the progress bar gem
- Nokogiri
- ffmpeg if you want to extract audio tracks from the videos