3 WWW::Quvi - Perl extension interface for libquvi
8 my $q = new WWW::Quvi::Query;
9 my $m = $query->parse($url);
10 croak "error: $q->{errmsg}" unless $q->{ok};
14 WWW::Quvi provides a Perl interface to libquvi, a small C library for
15 parsing Flash media stream URLs.
19 This module provides a Perl interface to libquvi. This documentation
20 contains the Perl specific details and some sample code. The libquvi
21 documentation should be consulted for the API details at
22 L<http://quvi.sourceforge.net/>.
24 =head1 WWW::Quvi::version
26 A wrapper function that returns WWW::Quvi version and libquvi version
29 WWW::Quvi::version; # Module version
30 WWW::Quvi::version(WWW::Quvi::ModuleVersion); # Ditto.
31 WWW::Quvi::version(WWW::Quvi::libquviVersion);
32 WWW::Quvi::version(WWW::Quvi::libquviVersionLong);
34 =head1 WWW::Quvi::Options
36 A container hash for the options used with libquvi that would normally
37 (using the C API) be set with C<quvi_setopt(3)>.
39 $opts->{verbose_libcurl} = 1; # Default: 0
40 $opts->{user_agent} = 'Foo/1.0'; # Default: ""
41 $opts->{http_proxy} = 'http://foo:1234'; # Default: ""
42 $opts->{category} = WWW::Quvi::ProtoHttp; # Default: ProtoAll
43 $opts->{resolve} = 0; # Default: 1
44 $opts->{format} = 'best'; # Default: "default"
45 $opts->{verify} = 0; # Default: 1
47 =head1 WWW::Quvi::Media
49 A container hash that holds the parsed media details accessible using
52 $media->{content_length} - Content length as returned by the server
53 $media->{thumbnail_url} - Thumbnail URL (if any)
54 $media->{content_type} - Content-type as returned by the server
55 $media->{file_suffix} - File suffix parsed from the content-type
56 $media->{start_time} - Start time for media (if any)
57 $media->{page_title} - Media title
58 $media->{page_url} - Page URL
59 $media->{duration} - Duration in msec (if any)
60 $media->{host} - Host string
61 $media->{url} - Media stream URL
62 $media->{id} - Media ID
64 =head1 WWW::Quvi::Query
68 =item parse($url) [function]
70 Parse media details for URL. Returns WWW::Quvi::Media object.
72 my $m = $q->parse($url);
74 =item ($domain, $formats) next_website() [function]
76 Return next supported website (domain, formats). These values are
77 returned by the libquvi webscripts.
79 Note that C<formats> no practical use since libquvi 0.2.17. This
80 function is most useful for listing the available support.
82 Use the C<formats> function (below) instead if you need to know which
83 formats are available to an URL.
86 my ($d,$f) = $q->next_website;
87 print "$d\t$f\n" if $q->{ok};
90 =item formats($url) [function]
92 Returns a string containing a list of available formats to an URL. Each
93 format ID is separated by a pipe character.
95 my $fmts = $q->formats($url);
96 croak "error: $q->{errmsg}" unless $q->{ok};
97 print "$_\n" foreach (split /\|/, $fmts);
99 =item set_opts($opts) [function]
101 Set Query options (see also L</WWW::Quvi::Options>).
103 =item supported($url) [function]
105 Returns a non-zero value if the URL is not supported.
109 Non-zero if an error occurred.
111 =item errmsg [variable]
113 Last error message. Check L</ok> flag for errors.
115 croak $q->{errmsg} unless $q->{ok};
117 =item quvi_code [variable]
119 Last libquvi returned code.
121 =item resp_code [variable]
123 Last response (assumed HTTP) code returned by the server.
127 =head1 NOT IMPLEMENTED
131 =item B<Linked list interface>
133 =item B<Network interface>
135 =item B<Media segments>
143 Home : http://www-quvi.sourceforge.net/
144 gitweb: http://repo.or.cz/w/www-quvi.git
148 WWW::Quvi is free software, licensed under the LGPLv2.1+.
156 Toni Gundogdu <legatvs at sign gmail com>