| WWW::NicoVideo::Download(3pm) | User Contributed Perl Documentation | WWW::NicoVideo::Download(3pm) |
WWW::NicoVideo::Download - Download FLV/MP4/SWF files from nicovideo.jp
use WWW::NicoVideo::Download;
my $client = WWW::NicoVideo::Download->new(
email => 'your-email@example.com',
password => 'PASSWORD',
);
$client->download("smNNNNNN", \&callback);
WWW::NicoVideo::Download is a module to login, request and download video files from Nico Nico Douga.
$client = WWW::NicoVideo::Download->new(%options);
Creates a new WWW::NicoVideo::Download instance. %options can take the following parameters and they can also be set and get using accessor methods.
# use Safari sesssions
use HTTP::Cookies::Safari;
my $cookie_jar = HTTP::Cookies::Safari->new(
file => "$ENV{HOME}/Library/Cookies/Cookies.plist",
);
my $client = WWW::NicoVideo::Download->new;
$client->user_agent->cookie_jar( $cookie_jar );
$client->download($video_id, $file_path);
Prepares the download by logging in and requesting the FLV API, and then download the video file. The second parameter is passed to LWP::UserAgent's request() method, so you can pass either local file path to be saved, or a callback function.
my $url = $client->prepare_download($video_id);
Prepares the download and returns the URL of the actual video. See eg/fetch-video.pl how to make use of this method.
Tatsuhiko Miyagawa <miyagawa@cpan.org>
Original download code for Plagger was written by Yusuke Wada and the command line tool written by woremacx.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| 2016-12-04 | perl v5.24.1 |