3 WWW::Quvi - Perl extension interface for libquvi
8 my $opts = new WWW::Quvi::Options;
9 my $query = new WWW::Quvi::Query;
10 my $video = $query->parse ($url, $opts);
15 die "libquvi: error: $query->{last_error}";
20 WWW::Quvi provides a Perl interface to libquvi, a library for parsing video
25 This module provides a Perl interface to libquvi. This documentation
26 contains the Perl specific details and some sample code. The libquvi
27 documentation should be consulted for the API details at
28 L<http://quvi.sourceforge.net/>.
30 =head1 WWW::Quvi::version
32 A wrapper function that returns WWW::Quvi version and libquvi version
38 print WWW::Quvi::version; # Module version
39 print WWW::Quvi::version (WWW::Quvi::ModuleVersion); # Same as above.
40 print WWW::Quvi::version (WWW::Quvi::libquviVersion);
41 print WWW::Quvi::version (WWW::Quvi::libquviVersionLong);
43 =head1 WWW::Quvi::Options
45 A container hash for the options used with libquvi that would normally
46 (using the C API) be set with C<quvi_setopt(3)>.
53 my $opts = new WWW::Quvi::Options;
55 $opts->{user_agent} = 'Foo/1.0'; # Default: ""
56 $opts->{http_proxy} = 'http://foo:1234'; # Default: ""
57 $opts->{format} = 'hd'; # Default: "default"
58 $opts->{verify} = 0; # Default: 1
59 $opts->{verbose_libcurl} = 1; # Default: 0
60 $opts->{shortened} = 0; # Default: 1
61 $opts->{category} = WWW::Quvi::ProtoAll; # Default: ProtoHttp
63 =head1 WWW::Quvi::Video
65 A container hash that holds the parsed video details.
76 =head1 WWW::Quvi::Link
78 A container hash that holds the parsed video link details. A member of
79 the L</WWW::Quvi::Video> hash.
82 $video->{link}->{content_type}
83 $video->{link}->{file_suffix}
84 $video->{link}->{length_bytes}
88 =head1 WWW::Quvi::Query
90 Glues the above together.
92 # An Options instance is required.
93 # See WWW::Quvi::Options above for the available keys.
95 my $opts = new WWW::Quvi::Options;
97 # Initializes libquvi (quvi_init), croaks if that fails.
99 my $query = new WWW::Quvi::Query;
103 my $url = "http://www.youtube.com/watch?v=DUM1284TqFc";
104 my $video = $query->parse ($url, $opts);
107 # Do whatever with the parsed video details.
110 croak "libquvi: error: $query->{last_error}";
111 # Other things to check:
112 # * $query->{quvi_code}
113 # * $query->{resp_code}
116 # Iterate supported websites:
119 my ($done, $domain, $formats) = $query->next_website;
123 print "$domain\t$formats\n";
126 # Check if URL is supported. Make a note of "compressed" URLs, as
127 # this function fails with most of them. Refer to the libquvi C API
131 $query->supported("http://dai.ly") != WWW::Quvi::OK
132 ? $query->{last_error}
135 =head1 NOT IMPLEMENTED
141 e.g. quvi_callback_status, quvi_callback_write.
143 =item B<Video segments>
145 libquvi supports these for historical reasons only. Each
146 video would have one or more video segments which had to be
147 downloaded separately from different URLs.
153 Toni Gundogdu <legatvs at sign gmail com>
157 E<lt>http://www-quvi.googlecode.com/E<gt>
159 E<lt>http://repo.or.cz/w/www-quvi.gitE<gt>