Permalink
Browse files

ニコ動の変更に追従。HTML によるゲスト判定をしないように。

  • Loading branch information...
1 parent b203ed1 commit 6905d89a09d309e7186bcedc4e33e3dd3a9b6e91 @cho45 cho45 committed Oct 31, 2009
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/WWW/NicoVideo/Download.pm
View
6 lib/WWW/NicoVideo/Download.pm
@@ -12,7 +12,9 @@ use Any::Moose;
has 'email', is => 'rw', isa => 'Str';
has 'password', is => 'rw', isa => 'Str';
has 'user_agent', is => 'rw', isa => 'LWP::UserAgent', default => sub {
- LWP::UserAgent->new( cookie_jar => {} );
+ my $ua = LWP::UserAgent->new( cookie_jar => {} );
+ push @{ $ua->requests_redirectable }, 'POST';
+ $ua;
};
sub download {
@@ -56,7 +58,7 @@ sub prepare_download {
sub is_logged_out {
my($self, $res) = @_;
- $res->content =~ qr|<strong>ゲスト</strong>|;
+ $res->headers->header('x-niconico-authflag') eq '0';
}
sub login {

0 comments on commit 6905d89

Please sign in to comment.