Poster of Linux kernelThe best gift for a Linux geek


Section: cclive manual (1) Updated: 2010-12-17
Local index Up


cclive - video download tool  


cclive [options] [url...]  


cclive is a command line tool for downloading videos from Youtube and other similar video websites that require Adobe Flash to view the video content. It has low memory footprint compared to other similar tools. It is a rewrite of the clive software in C++.  


Print version and exit.
Print help and exit.
Print license and exit.
Print supported websites, formats and exit.
Turn on libcurl verbose output.
-q, --quiet
Turn off all output but errors.
-b, --background
Go to background after startup. Output will be written to the file specified with "--log-file".
-f, --format arg
Download arg format of the video. arg can also be "help".
-c, --continue
Resume partially downloaded video.
-W, --overwrite
Overwrite existing video.
-O, --output-file arg
Write video to arg. Overrides "--filename-format".
-n, --no-download
Do not download the video, display video details only.
Disable use of HTTP proxy. Overrides both "--proxy" and http_proxy environment settings.
--log-file arg
Write log data to arg file. Ignored unless "--background" is used. Overwrites the existing file. Default is ``cclive_log''. See also "--background" and "--update-interval".
--update-interval arg
Specify arg progressbar update interval. Default is 1 second. You can use double type values, e.g. 0.2 or 1.99.
--config-file arg
Path to a file to read cclive arguments from. The default is ``~/.ccliverc''.


You can specify these options in the configuration file.
--filename-format arg
Use arg to specify the video output filename format. The default is ``%t.%s''. The following specifiers are supported: %t video title %i video ID %h video host ID %s video file suffix

  %t    video title
  %i    video id
  %h    video host id
  %s    video file suffix

Note that all occurences of the specifier will be replaced. See also "--output-file".

--output-dir arg
Write downloaded videos to arg directory.
--regexp arg
Use regular expression arg to clean up the video title before it is used in the output filename. The default is ``/(\w|\s)/g''.

Note that the syntax supports both ``i'' (case-insensitive) and ``g'' (global or find all).

-s, --subst arg ...
Use arg substitution regular expression to replace the matched occurences in the title before it is used in the filename. More than one expression can be specified in arg if each is separated by a whitespace. Supports ``i'' (case-insensitive) and ``g'' (global, find all).

You can use the following delimiters:

  <> {} () /

Please make a note that, cclive currently considers:

  s/old/new/    Invalid
  s/old//new/   OK

--exec arg
Invoke arg after video download finishes. The following specifiers are supported:

  %f    full path to the downloaded video file

Note that all occurences of the specifier will be replaced.

--agent arg
Identify as arg to the HTTP servers.
--proxy arg
Use arg for HTTP proxy, e.g. ``http://foo:1234''. Overrides the http_proxy environment setting.
--throttle arg
Limit download transfer rate to arg KB/s. Default is 0 (disabled).
--connect-timeout arg
This option essentially wraps the CURLOPT_CONNECTTIMEOUT of libcurl. Default is 30.

  "Pass a long. It should contain the maximum time in seconds that
  you allow the connection to the server to take.

  This only limits the connection phase, once it has connected,
  this option is of no more use. Set to zero to disable connection
  timeout (it will then only timeout on the system's internal
  timeouts). See also the CURLOPT_TIMEOUT option."
        -- C<curl_easy_setopt(3)>

--transfer-timeout arg
This option essentially wraps the CURLOPT_TIMEOUT of libcurl. Default is 0 (disabled).

  "Pass a long as parameter containing the maximum time in seconds
  that you allow the libcurl transfer operation to take.

  Normally, name lookups can take a considerable time and limiting
  operations to less than a few minutes risk aborting perfectly
  normal operations. This option will cause curl to use the
  SIGALRM to enable time-outing system calls."
        -- C<curl_easy_setopt(3)>

--dns-cache-timeout arg
This option essentially wraps the CURLOPT_DNS_CACHE_TIMEOUT of libcurl. Default is 60.

  "Pass a long, this sets the timeout in seconds. Name resolves will
  be kept in memory for this number of seconds. Set to zero to
  completely disable caching, or set to -1 to make the cached
  entries remain forever. By default, libcurl caches this info
  for 60 seconds.

  The name resolve functions of various libc implementations don't
  re-read name server information unless explicitly told so
  (for example, by calling C<res_init(3)>). This may cause libcurl
  to keep using the older server even if DHCP has updated the
  server info, and this may look like a DNS cache issue to the
  casual libcurl-app user." -- C<curl_easy_setopt(3)>

--max-retries arg
Retry downloading arg times before giving up. Setting arg to zero will disable retrying. Default is 5.
--retry-wait arg
Wait arg seconds before retrying after a failed attempt. Default is 5.


cclive ""
Typical use.
cclive "" -f mp4_360p
Same but get the mp4_360p (Youtube specific) format instead. See "--support" for a complete list of websites and formats.
cclive "" -n
Do not download the video. Print the video details only.
echo "" | cclive
Yet another way to feed cclive with an URL.

You can also feed cclive several URLs on one go, either by adding each on the command line (arg1, arg2, ...) or by redirecting them, for example, from a file. Each URL must be separated with a newline (or a whitespace).

Consider the following example:

  cat >> urls.lst
  cclive < urls.lst

cclive "URL" -s "s{Alice}{Malice}"
Replace ``Alice'' in the video title with ``Malice'' before using it in the filename.
cclive "URL" -s "s{Alice}<Malice> s{wonderland}<Uberland>i"
Similar but makes two substitions, the former was explained above, the latter replaces ``Wonderland'' with ``Uberland''. Note the use of ``i'' (case-insensitive).

You can use ``g'' for global (find all), e.g. if you wanted to replace all of the ``Alice'' occurences with ``Malice'', you could use ``s{Alice}<Malice>g''.



You can specify the configurable options (see ``OPTIONS - CONFIGURATION'') in this file, e.g.:

 filename-format = %h_%i_(%t).%s
 regexp = /(\w|\pL)/g
 exec = /usr/bin/vlc %f
 proxy = http://foo:1234
 throttle = 10
 connect-timeout = 120

Note that you can use "--config-file" to specify the file.



cclive exits with 0 on success and >0 if an (unrecoverable) error occurred.  


Use the "--no-download" switch if you don't need to download the video.
You can use this switch to amp up libcurl verbosity.
Debug symbols
Compile cclive with "-g" (see "g++(1)") for debug symbols.
Other tools
Make use of such tools as strace(1), gdb(1) and valgrind(1). They may prove invaluable.




Toni Gundogdu <legatvs at sign gmail com>.

Thanks to all those who have contributed to the project by sending patches, reporting bugs and writing feedback. You know who you are.




This document was created by man2html, using the manual pages.
Time: 21:09:50 GMT, April 16, 2011