.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "WWW::NicoVideo::Download 3pm" .TH WWW::NicoVideo::Download 3pm "2016-12-04" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" WWW::NicoVideo::Download \- Download FLV/MP4/SWF files from nicovideo.jp .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use WWW::NicoVideo::Download; \& \& my $client = WWW::NicoVideo::Download\->new( \& email => \*(Aqyour\-email@example.com\*(Aq, \& password => \*(AqPASSWORD\*(Aq, \& ); \& \& $client\->download("smNNNNNN", \e&callback); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" WWW::NicoVideo::Download is a module to login, request and download video files from Nico Nico Douga. .SH "METHODS" .IX Header "METHODS" .IP "new" 4 .IX Item "new" .Vb 1 \& $client = WWW::NicoVideo::Download\->new(%options); .Ve .Sp Creates a new WWW::NicoVideo::Download instance. \f(CW%options\fR can take the following parameters and they can also be set and get using accessor methods. .IP "email, password" 4 .IX Item "email, password" Sets and gets email and password to login Nico Nico Douga. Required if the User Agent object doesn't have the valid session or cookie to login to the site. .IP "user_agent" 4 .IX Item "user_agent" Sets and gets LWP::UserAgent object to use to send \s-1HTTP\s0 requests to nicovideo.jp server. If you want to reuse the browser Cookie that has the signed-in state, you can set the Cookie to the UserAgent object here. .Sp .Vb 7 \& # 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 ); .Ve .IP "download" 4 .IX Item "download" .Vb 1 \& $client\->download($video_id, $file_path); .Ve .Sp Prepares the download by logging in and requesting the \s-1FLV API,\s0 and then download the video file. The second parameter is passed to LWP::UserAgent's \fIrequest()\fR method, so you can pass either local file path to be saved, or a callback function. .IP "prepare_download" 4 .IX Item "prepare_download" .Vb 1 \& my $url = $client\->prepare_download($video_id); .Ve .Sp Prepares the download and returns the \s-1URL\s0 of the actual video. See \&\fIeg/fetch\-video.pl\fR how to make use of this method. .SH "AUTHOR" .IX Header "AUTHOR" Tatsuhiko Miyagawa .PP Original download code for Plagger was written by Yusuke Wada and the command line tool written by woremacx. .SH "LICENSE" .IX Header "LICENSE" This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO"