1=head1 NAME 2 3quvi - query media tool 4 5=head1 SYNOPSIS 6 7quvi [options] [url ...] [file ...] 8 9=head1 DESCRIPTION 10 11quvi is a command line tool for parsing flash media stream URLs. 12It supports many websites including YouTube and Dailymotion. 13 14=head1 COMMAND LINE PARSER 15 16GNU gengetopt is very flexible. 17 18=head2 Example 19 20 quvi --category http --category rtmp --verbosity debug \ 21 --export-level +errors --feature -verify --feature -resolve 22 23=head2 Same as above but with short options 24 25 quvi -c http -c rtmp -v debug -l +errors -e -verify -e -resolve 26 27=head2 Or even simply 28 29 quvi -ch -cr -vd -l+ -e-v -e-r 30 31=head1 OPTIONS 32 33quvi reads standard input by default. It can also read the URLs from 34files but expects each URL to be separated by a newline character. 35 36=head2 -h, --help 37 38Print help and exit. 39 40=head2 --version 41 42Print program version and exit. 43 44=head2 --license 45 46Print license and exit. 47 48=head2 --support [I<arg>] 49 50Print supported hosts and exit. If I<arg> is present, the program 51checks whether the I<arg> is supported. 52 53The default behaviour, without an I<arg>, causes quvi to print the 54supported websites. The B<first> string is the domain string which 55is, in fact, a (Lua) pattern used to match the URL to a libquvi 56script. The B<second> string is, I<now obsolete> (see below), an 57array containing the supported formats specific to the host. 58 59Use C<--query-formats> if you need to check an URL for the available 60formats. 61 62See also L</EXAMPLES>. 63 64=head2 -e, --feature I<arg> 65 66Enable or disable a feature. See also L</EXAMPLES>. Possible values: 67 68=head3 resolve (default) 69 70Resolve HTTP directions, e.g. shortened URLs. See below. 71 72=head3 -resolve 73 74Do not resolve HTTP redirections. When used, quvi will not be able to 75resolve most of the "shortened URLs" produced by different URL shortening 76services. 77 78Note that libquvi scripts that explicitly (need to) resolve redirections 79will continue to do so even if this switch is used. 80 81=head3 verify (default) 82 83Verify media stream URL after parsing. See below. 84 85=head3 -verify 86 87Do not verify media stream URL after parsing. When used, some 88media details, e.g. content length, will not become available. 89 90Note that libquvi skips the verification automatically with all 91non-HTTP media stream URLs. 92 93=head3 proxy (default) 94 95Use a HTTP proxy with connections if it is defined using either 96the C<--proxy> or the B<http_proxy> value. See below. 97 98=head3 -proxy 99 100Disable use of a HTTP proxy completely. Proxy will not be used even 101if it is defined in B<http_proxy>. 102 103=head2 -d, --export-format I<arg> (=json) 104 105Set the interchange format in which the data is to be printed. 106Possible values: 107 108 json .. Print in JSON (default) 109 xml .. Print in XML 110 111=head2 -l, --export-level I<arg> (=media) 112 113Set level of the exported interchange data. Possible values: 114 115 media .. Media only (default) 116 +errors .. Media and error messages 117 118See also C<--export-format>. 119 120=head2 -v, --verbosity I<arg> (=verbose) 121 122Set the verbosity level of the printed messages. Possible values: 123 124 debug .. Everything, including libcurl generated messages 125 verbose .. Most messages (default) 126 quiet .. Errors and warnings only 127 mute .. Nothing at all 128 129=head2 --exec I<arg> 130 131Invoke I<arg> after each successfully parsed URL. The following 132specifiers are supported: 133 134 %u .. Media stream URL 135 %t .. Media title 136 %e .. Media file suffix (extension) 137 %h .. Media thumbnail URL 138 139Note that I<each> occurence of the specifier will be replaced within 140the I<arg>. quvi accepts multiple occurrences of C<--exec>. See also 141L</EXAMPLES>. 142 143=head2 -c, --category I<arg> (=all) 144 145Enable the level of the libquvi script categories. By default, all of the 146categories levels are enabled. Possible values: 147 148 http .. HTTP category scripts only 149 rtmp .. RTMP ... 150 rtsp .. RTSP ... 151 mms .. MMS ... 152 all .. All of the above 153 154quvi accepts multiple occurrences of C<--category>. See also L</EXAMPLES>. 155 156 157=head2 -F, --query-formats 158 159Query available formats to the URL. The returned array is created 160from the data returned by the server. You can use the 161I<format strings> in this array with C<--format>. 162 163The available formats are determined by the I<libquvi script> 164responsible for parsing the media details. 165 166See also C<--format>. 167 168=head2 -f, --format I<arg> (=default) 169 170Query media details for the format I<arg>. The I<arg> may also be 171C<default> or C<best>. The I<arg> value is used with B<all> of the 172URLs fed to quvi. 173 174If the I<arg> is C<best>, the I<libquvi script> responsible for parsing 175the media details will determine the C<best> format available to an URL. 176 177If the I<arg> is C<default> the I<libquvi script> attempts to return an 178URL to whatever it deemed to be the C<default> format for the URL. 179 180The I<libquvi script> will return the C<default> format if the I<arg> 181was unrecognized or the requested format was not available. 182 183You can find more information about the YouTube specific "fmt" IDs at: 184 <http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs> 185 186See also C<--query-formats>. 187 188=head2 --agent I<arg> (=Mozilla/5.0) 189 190Identify quvi as I<arg> to the HTTP servers. Default is "Mozilla/5.0". 191 192=head2 --proxy I<arg> 193 194Use proxy for HTTP connections, e.g. "http://foo:1234". You can also 195define B<http_proxy> environment setting to for the same effect. 196 197=head2 --connect-timeout I<seconds> 198 199Maximum seconds allowed connection to server take. Default is 30. 200 201=head1 DEPRECATED 202 203The following options have been marked as "deprecated" and will be 204removed in the later versions of quvi. 205 206=head2 --no-proxy 207 208Disable use of HTTP proxy completely. Proxy will not be used even 209if it is defined in B<http_proxy>. Use C<--feature> instead. 210 211=head2 -r, --no-resolve 212 213Do not resolve HTTP redirections. When used, quvi will not be able 214to resolve most of the "shortened URLs" produced by different URL 215shortening services. 216 217Note that libquvi scripts that explicitly (need to) resolve 218redirections will continue to do so even if this switch is used. 219Use C<--feature> instead. 220 221=head2 -n, --no-verify 222 223Do not verify media stream URL after parsing. When used, some 224media details, e.g. content length, will not become available. 225 226Note that libquvi skips the verification automatically with all 227non-HTTP media stream URLs. Use C<--feature> instead. 228 229=head2 -q, --quiet 230 231Turn off all output printed to stderr (excl. any errors). 232If C<--verbose-libcurl> is specified, libcurl will continue 233to print messages to stderr. The media details will still 234be printed to stdout. Use C<--verbosity> instead. 235 236=head2 --verbose-libcurl 237 238Turn on libcurl verbose mode. Use C<--verbosity> instead. 239 240=head2 --xml 241 242Print the media details (and errors, if C<--export-level=+errors> is specified) 243in XML. Use C<--export-format> instead. 244 245=head2 --category-http 246 247Enable category HTTP webscripts. This is the default category. 248Use C<--category> instead. 249 250=head2 --category-mms 251 252Enable category MMS webscripts. Use C<--category> instead. 253 254=head2 --category-rtsp 255 256Enable category RTSP webscripts. Use C<--category> instead. 257 258=head2 --category-rtmp 259 260Enable category RTMP webscripts. Use C<--category> instead. 261 262=head2 --category-all 263 264Enable all categories of webscripts. Use C<--category> instead. 265 266=head1 EXAMPLES 267 268Always quote the URLs in the command line as seen below. Many URLs 269contain parameters that may otherwise cause the shell to behave 270with unexpected results. 271 272=head2 quvi "URL" 273 274Typical use. 275 276=head2 quvi -d xml "URL" 277 278Same but print the results in XML. 279 280=head2 quvi -f best "URL" 281 282Get for the best available format of the media. This assumes E<gt>1 283formats are supported, otherwise will fallback to default format. 284 285=head2 quvi -F "URL" 286 287Query available formats to the URL. Use one of the returned format 288strings from this list with C<--format>. 289 290=head2 quvi --support 291 292Print the supported websites. The domain strings are patterns. 293 294=head2 quvi --support -c rtmp -c mms 295 296Same but print only those from the RTMP and the MMS categories. 297 298=head2 quvi --support "URL" 299 300Check whether the URL is supported. This does not require an Internet 301connection but will fail with most "shortened" URLs. 302 303=head2 quvi -vm -e-r -e-v "URL" --exec "echo %t" --exec "vlc %u" 304 305Mute message output (-vm), do not resolve HTTP redirections (-e-r) and 306skip media stream URL verification (-e-v). Print media title using 307echo(1), open media stream URL in vlc(1). 308 309=head1 FILES 310 311=head2 $HOME/.quvirc 312 313Most of the command line options can also be defined in the 314configuration file. For example: 315 316 agent = foo/1.0 # --agent 317 proxy = http://foo:1234 # --proxy 318 319You can also use $QUVI_HOME instead of $HOME. 320 321=head1 ENVIRONMENT 322 323=head2 quvi 324 325=head3 QUVI_HOME 326 327Path to the directory with the configuration file. If set, quvi 328command uses this instead of $HOME. 329 330=head2 libquvi 331 332=head3 LIBQUVI_SCRIPTSDIR 333 334Path to the libquvi-scripts directory. Overrides the libquvi default 335search paths for the scripts, e.g.: 336 337 env LIBQUVI_SCRIPTSDIR=/dir/with/quvi/lua/scripts/ quvi 338 339Make sure it points to a directory containing the lua/ directory with the 340expected "util/*.lua" and "website/quvi/*.lua" scripts that are normally 341installed with libquvi-scripts. 342 343For a totorial that covers these steps, see the libquvi C API 344documentation at: 345 346 <http://quvi.sourceforge.net/doc/> 347 348=head3 LIBQUVI_SHOW_SCANDIR 349 350If set, libquvi prints the lua script search paths to the stderr. 351 352=head3 LIBQUVI_SHOW_SCRIPT 353 354If set, the lua scripts found by libquvi are printed to the stderr. 355 356 env LIBQUVI_SHOW_SCRIPT=1 quvi 357 358=head2 libcurl 359 360=head3 http_proxy 361 362http_proxy value is used if defined. Note, however, that C<--proxy> and 363C<--feature -proxy> both override this behaviour. 364 365=head1 EXIT STATUS 366 367quvi exits with 0 on success and E<gt>0 if an error occurred. 368 369 QUVI_OK = 0x00 370 QUVI_MEM = 0x01, Memory allocation failed 371 (or invalid quvi command line option) 372 QUVI_BADHANDLE = 0x02, Bad session handle 373 QUVI_INVARG = 0x03, Invalid function (or command line) arg 374 QUVI_CURLINIT = 0x04, libcurl initialization failed 375 QUVI_LAST = 0x05, Indicates end of list iteration 376 QUVI_ABORTEDBYCALLBACK= 0x06, Aborted by callback function 377 QUVI_LUAINIT = 0x07, Lua initialization failure 378 QUVI_NOLUAWEBSITE = 0x08, Failed to find lua webscripts 379 QUVI_NOLUAUTIL = 0x09, Failed to find the utility scripts 380 -- 381 QUVI_NOSUPPORT = 0x41, libquvi does not support the host 382 QUVI_CALLBACK = 0x42, network callback error occurred 383 QUVI_ICONV = 0x43, libiconv error occurred 384 QUVI_LUA = 0x44, lua error occurred 385 386=head1 WWW 387 388 Home : http://quvi.sourceforge.net/ 389 gitweb: http://repo.or.cz/w/quvi-tool.git 390 391=head1 LICENSE 392 393quvi is free software, licensed under the LGPLv2.1+. 394 395=head1 SEE ALSO 396 397libquvi(3), libquvi-scripts(7) 398 399=head1 AUTHOR 400 401Toni Gundogdu E<lt>legatvs at sign gmail comE<gt> 402 403Thanks to all those who have contributed to the project by sending patches, 404reporting bugs and writing feedback. You know who you are. 405