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 is a Perl extension interface for libquvi.
24 This module provides a Perl interface to libquvi. This documentation
25 contains the Perl specific details and some sample code. The libquvi
26 documentation should be consulted for the API details at
27 L<http://quvi.googlecode.com/>.
29 =head1 WWW::Quvi::version
31 A wrapper function that returns WWW::Quvi version and libquvi version
37 print WWW::Quvi::version; # Module version
38 print WWW::Quvi::version (WWW::Quvi::ModuleVersion); # Same as above.
39 print WWW::Quvi::version (WWW::Quvi::libquviVersion);
40 print WWW::Quvi::version (WWW::Quvi::libquviVersionLong);
42 =head1 WWW::Quvi::Options
44 A container hash for the options used with libquvi that would normally
45 (using the C API) be set with C<quvi_setopt(3)>.
52 my $opts = new WWW::Quvi::Options;
54 $opts->{user_agent} = 'Foo/1.0'; # Default: ""
55 $opts->{http_proxy} = 'http://foo:1234'; # Default: ""
56 $opts->{format} = 'hd'; # Default: "default"
57 $opts->{verify} = 0; # Default: 1
58 $opts->{verbose_libcurl} = 1; # Default: 0
60 =head1 WWW::Quvi::Video
62 A container hash that holds the parsed video details.
72 =head1 WWW::Quvi::Link
74 A container hash that holds the parsed video link details. A member of
75 the L</WWW::Quvi::Video> hash.
78 $video->{link}->{content_type}
79 $video->{link}->{file_suffix}
80 $video->{link}->{length_bytes}
84 =head1 WWW::Quvi::Query
86 Glues the above together.
88 # An Options instance is required.
89 # See WWW::Quvi::Options above for the available keys.
91 my $opts = new WWW::Quvi::Options;
93 # Initializes libquvi (quvi_init), croaks if that fails.
95 my $query = new WWW::Quvi::Query;
99 my $url = "http://www.youtube.com/watch?v=DUM1284TqFc";
100 my $video = $query->parse ($url, $opts);
103 # Do whatever with the parsed video details.
106 die "libquvi: error: $query->{last_error}";
107 # Other things to check:
108 # * $query->{quvi_code}
109 # * $query->{resp_code}
112 # Iterate supported websites:
115 my ($done, $domain, $formats) = $query->next_website;
119 print "$domain\t$formats\n";
122 =head1 NOT IMPLEMENTED
128 e.g. quvi_callback_status, quvi_callback_write.
130 =item B<Video segments>
132 libquvi supports these for historical reasons only. Basically each
133 video would have one or more video segments which had to be
134 downloaded as separately.
140 Toni Gundogdu <legatvs at sign gmail com>.
144 Copyright (C) 2010 Toni Gundogdu.
146 This program is free software: you can redistribute it and/or modify
147 it under the terms of the GNU General Public License as published by
148 the Free Software Foundation, either version 3 of the License, or
149 (at your option) any later version.
151 This program is distributed in the hope that it will be useful,
152 but WITHOUT ANY WARRANTY; without even the implied warranty of
153 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
154 GNU General Public License for more details.
156 You should have received a copy of the GNU General Public License
157 along with this program. If not, see L<http://www.gnu.org/licenses/>.
161 E<lt>http://www-quvi.googlecode.com/E<gt>
163 E<lt>http://quvi.googlecode.com/E<gt>
165 E<lt>git://repo.or.cz/www-quvi.gitE<gt>