clive man page

clive — (c)ommand (li)ne (v)ideo (e)xtraction tool

Synopsis

clive [<options>] [<url> | <file> ...]

Description

clive is a command line media extraction tool for YouTube and similar websites that require flash.

Background

clive originates from a simple shell script that was cooked up to work around the YouTube's flash requirement back in 2006.

Getting started

Configuring

Autodetection

clive will attempt to autodetect the required commands from the $PATH, when they have not been defined in either config file or the command line.

Configuration file

See "Files" for an example configuration file. You may want to consider adding at least the "--quvi" and "--get-with" there.

See also

"Troubleshooting", "Known Issues" and "Examples".

Options

clive expects the URLs to be separated by a newline character when the they are read from either stdin or files.

--help

Print help and exit.

--version

Print version and exit.

--license

Print license and exit.

-q, --quiet

Turn off all clive output excluding errors. Note that this switch has no effect on any of the third party commands that clive invokes.

-F, --query-formats

Query available formats to an URL. The returned string will contain an array of format strings, each separated by the '|' character. The array is created, by libquvi, from the data returned by the server. You can use these format strings with "--format".

See also "Examples" and "--format".

-f, --format arg (=default)

Download format arg of the media. The arg can also be "default", "best", "help" or "list". Note, however, that of these, the "list" and the "help" are deprecated and will be removed in the later versions of clive.

The arg value is used with all of the URLs fed to clive at runtime. If the arg is "best", libquvi will determine the "best" format available to an URL.

If the arg is "default" libquvi attempts to return an URL to whatever was deemed to be the "default" format to the URL. libquvi will switch to "default" format if the arg was unregognized or the requested arg format was unavailable.

For the above reasons, the downloaded format may be different from the requested arg format.

For details about the YouTube's "fmt" IDs, refer to:
http://en.wikipedia.org/wiki/YouTube#Qu…

See also "Examples", "--query-formats".

-O, --output-file arg

Write media to arg. Overrides "--filename-format".

-n, --no-download

Do not download the media, print details only.

--config-file arg

Path to a file to read clive arguments from. See also "Files".

Options - Configuration

The "configuration" options may be read from the config file. See "Files".

--quvi arg

arg to be invoked to start the quvi(1) command which clive uses to parse the media details. This is typically a full path to quvi(1) with any additional options. Overrides any value set by autodetection.

The following specifiers can be used in the arg:

%u .. Media stream URL

All occurences of the specifier will be replaced. clive will automatically append "--quiet" to arg.

--get-with arg

Path to a download command (e.g. wget(1) or curl(1)) with any additional arguments. clive invokes this command to download the media. Overrides any value set by autodetection.

The following specifiers are supported:

%n  Media filename (after applying --regexp and --filename-format)
%f  Path to downloaded media file (output path and %n)
%u  Media stream URL

All occurences of the specifier will be replaced.

--filename-format arg (=“%t.%s”)

Use arg to specify the media output filename format. The following specifiers are supported:

%t  Media title (after applying --regexp)
%h  Media host ID
%s  File suffix
%i  Media ID

All occurences of the specifier will be replaced.

--regexp arg (=“/(\w|\s)/g”)

Use regular expression arg to clean up the media title before it is used in the filename. The syntax supports both "i" (case-insensitive) and "g" (global or "find all").

--exec arg

Invoke arg after media download finishes. The following specifiers are supported:

%f  Path to the downloaded media file

All occurences of the specifier will be replaced.

Troubleshooting

error: specify path to quvi(1) command with --quvi

clive uses quvi(1) to parse the media details. Use the "--quvi" to specify the path. See also "Files".

error: specify path to a download command with --get-with

clive uses a 3rd party command to download the media. Use the "--get-with" to specify the path to such command. See also "Files".

HTTP/1.0 500 Internal Server Error

Any number of reasons. Some have been tracked back to unacceptable user-agent string value and mangled HTTP headers (e.g. a green-eyed HTTP proxy). See also "Known Issues".

Known Issues

Resuming partially transferred files may fail

Some websites are known to refuse to work with the HTTP requests to resume a file transfer.

Workaround

None known. You will have to remove the existing file before you try again.

HTTP user-agent

Some websites refuse to play nice with renegade user-agent strings.

Recommendations

Make sure both quvi(1) and curl(1) use the same user-agent string. Note that quvi(1) uses "Mozilla/5.0" by default. See also "Troubleshooting" for "HTTP/500".

HTTP proxy

Generally OK, although some proxies may have been configured to "cook up" the HTTP headers before they are sent back to the server. This may sometimes lead to issues with the servers.

Recommendations

If you use an HTTP proxy, make sure you have configured all of the commands that clive uses (e.g. quvi(1), curl(1), etc.) to use the same proxy.

Exit status

If you are planning to use clive for anything more peculiar, consider the following example:

* You feed clive two URLs
* The 1st one fails, quvi exits with a non-zero value
* clive proceeds to the 2nd URL, quvi now exits with zero value
* clive exits with the zero, even if the 1st URL failed

Workaround

Feed one URL at a time.

Files

Local user

* ~/.config/clive/config
* ~/.clive/config
* ~/.cliverc

System wide

* /usr/local/share/clive/config
* /etc/xdg/clive/clive.conf
* /usr/share/clive/config
* /etc/xdg/clive.conf
* /etc/clive/config

Clive_config

You can also set Clive_config, e.g.:

env CLIVE_CONFIG=/path/to/config/file clive

--config-file

Or use "--config-file", e.g.:

clive --config-file /path/to/config/file

Example config

A typical configuration file could look like:

--get-with "/usr/bin/curl -L -C - -o %f %u --user-agent Mozilla/5.0"
--quvi "/usr/bin/quvi --category-http %u"
--filename-format "%t_%i.%s"
--exec "/usr/bin/vlc %f"

Examples

Note

Put the URLs inside quotes when they are specified as the command line arguments to the program. This is the recommended practice.

clive “URL”

Typical use.

clive -f best “URL”

Download the best available format of the media.

clive -F “URL”

Query available formats to the URL. Use one of the returned format strings from this list with "--format".

clive -n “URL”

Do not download the media, print the details only.

Exit Status

clive exits with 0 on success, otherwise the code is >0. For example, if command line parsing fails, the exit status is 1.

When an error occurs in another command invoked by clive, e.g. quvi(1), clive then exits with the exit status returned by that command.

See also "Known Issues" for "Exit status".

See Also

quvi(1) curl(1)

WWW

Home  : http://clive.sourceforge.net/
gitweb: http://repo.or.cz/w/clive.git

License

clive is free software, licensed under the GPLv3+.

Author

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.

Info

2012-03-16 perl v5.24.0 User Contributed Perl Documentation