Created
June 17, 2011 04:30
-
-
Save ishiduca/1030874 to your computer and use it in GitHub Desktop.
ブラウザのCookieを使ってDLする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use HTTP::Cookies::Safari; | |
use WWW::Pixiv::Download; | |
my $illust_id = shift || die qq(! failed: "illust_id" not found.\n); | |
my $cookie_jar = HTTP::Cookies::Safari->new; | |
$cookie_jar->load( "$ENV{HOME}/Library/Cookies/Cookies.plist" ); | |
my $client = WWW::Pixiv::Download->new; | |
$client->user_agent->cookie_jar( $cookie_jar ); | |
$client->download($illust_id); | |
__END__ | |
ブラウザ(この場合サファリ)のCookieを使ってログイン状態にもっていく。 | |
$client->login を省略する分速いかというと、Cookieの読み込みが重かったりして、、、 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment