3 WWW::Quvi - Perl extension interface for libquvi
8 my $opts = new WWW::Quvi::Options;
9 my $query = new WWW::Quvi::Query;
10 my $media = $query->parse ($url, $opts);
15 die "libquvi: error: $query->{last_error}";
20 WWW::Quvi provides a Perl interface to libquvi, a small C library for
21 parsing Flash media stream URLs.
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
35 WWW::Quvi::version; # Module version
36 WWW::Quvi::version(WWW::Quvi::ModuleVersion); # Ditto.
37 WWW::Quvi::version(WWW::Quvi::libquviVersion);
38 WWW::Quvi::version(WWW::Quvi::libquviVersionLong);
40 =head1 WWW::Quvi::Options
42 A container hash for the options used with libquvi that would normally
43 (using the C API) be set with C<quvi_setopt(3)>.
45 $opts->{verbose_libcurl} = 1; # Default: 0
46 $opts->{user_agent} = 'Foo/1.0'; # Default: ""
47 $opts->{http_proxy} = 'http://foo:1234'; # Default: ""
48 $opts->{category} = WWW::Quvi::ProtoHttp; # Default: ProtoAll
49 $opts->{format} = 'best'; # Default: "default"
50 $opts->{resolve} = 0; # Default: 1
51 $opts->{verify} = 0; # Default: 1
53 =head1 WWW::Quvi::Media
55 A container hash that holds the parsed media details accessible using
58 $media->{start_time} - Start time for media (if any)
59 $media->{page_url} - Page URL
60 $media->{title} - Media title
61 $media->{host} - Host ID
62 $media->{id} - Media ID
63 $media->{ok} - Non-zero value if parsing succeeded
67 A container hash that holds the parsed media url details. A member of
68 the L</WWW::Quvi::Media> hash.
70 $url->{content_type} - Content-type as returned by the server
71 $url->{file_suffix} - File suffix parsed from the content-type
72 $url->{length_bytes} - Content length as returned by the server
73 $url->{url} - Media stream URL
75 =head1 WWW::Quvi::Query
77 Glues the above together.
79 # An Options instance is required.
80 # See WWW::Quvi::Options above for the available keys.
81 my $opts = new WWW::Quvi::Options;
83 # Initializes libquvi (quvi_init), croaks if that fails.
84 my $query = new WWW::Quvi::Query;
87 my $url = "http://www.youtube.com/watch?v=DUM1284TqFc";
88 my $media = $query->parse ($url, $opts);
91 # Do whatever with the parsed media details.
94 croak "libquvi: error: $query->{last_error}";
95 # Other things to check:
100 # Iterate supported websites:
103 my ($done, $domain, $formats) = $query->next_website;
105 print "$domain\t$formats\n";
108 # Check if URL is supported. Make a note of "compressed" URLs, as
109 # this function fails with most of them. Refer to the libquvi C API
113 $query->supported("http://dai.ly") != WWW::Quvi::OK
114 ? $query->{last_error}
117 =head1 NOT IMPLEMENTED
121 =item B<Linked list interface>
123 =item B<Network interface>
125 =item B<Media segments>
133 Home : http://www-quvi.sourceforge.net/
134 gitweb: http://repo.or.cz/w/www-quvi.git
138 WWW::Quvi is free software, licensed under the LGPLv2.1+.
146 Toni Gundogdu <legatvs at sign gmail com>