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.googlecode.com/>.
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.
75 =head1 WWW::Quvi::Link
77 A container hash that holds the parsed video link details. A member of
78 the L</WWW::Quvi::Video> hash.
81 $video->{link}->{content_type}
82 $video->{link}->{file_suffix}
83 $video->{link}->{length_bytes}
87 =head1 WWW::Quvi::Query
89 Glues the above together.
91 # An Options instance is required.
92 # See WWW::Quvi::Options above for the available keys.
94 my $opts = new WWW::Quvi::Options;
96 # Initializes libquvi (quvi_init), croaks if that fails.
98 my $query = new WWW::Quvi::Query;
102 my $url = "http://www.youtube.com/watch?v=DUM1284TqFc";
103 my $video = $query->parse ($url, $opts);
106 # Do whatever with the parsed video details.
109 croak "libquvi: error: $query->{last_error}";
110 # Other things to check:
111 # * $query->{quvi_code}
112 # * $query->{resp_code}
115 # Iterate supported websites:
118 my ($done, $domain, $formats) = $query->next_website;
122 print "$domain\t$formats\n";
125 # Check if URL is supported. Make a note of "compressed" URLs, as
126 # this function fails with most of them. Refer to the libquvi C API
130 $query->supported("http://dai.ly") != WWW::Quvi::OK
134 =head1 NOT IMPLEMENTED
140 e.g. quvi_callback_status, quvi_callback_write.
142 =item B<Video segments>
144 libquvi supports these for historical reasons only. Each
145 video would have one or more video segments which had to be
146 downloaded separately from different URLs.
152 Toni Gundogdu <legatvs at sign gmail com>
156 E<lt>http://www-quvi.googlecode.com/E<gt>
158 E<lt>http://repo.or.cz/w/www-quvi.gitE<gt>