| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Net::NicoVideo::Content::ThumbInfo; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1466
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
44
|
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
31
|
|
|
5
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
65
|
|
|
6
|
|
|
|
|
|
|
$VERSION = '0.28'; |
|
7
|
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use base qw(Net::NicoVideo::Content Class::Accessor::Fast); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
130
|
|
|
9
|
1
|
|
|
1
|
|
8
|
use XML::TreePP; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
24
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
13
|
use vars qw(@Members); |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
365
|
|
|
12
|
|
|
|
|
|
|
@Members = qw( |
|
13
|
|
|
|
|
|
|
video_id |
|
14
|
|
|
|
|
|
|
title |
|
15
|
|
|
|
|
|
|
description |
|
16
|
|
|
|
|
|
|
thumbnail_url |
|
17
|
|
|
|
|
|
|
first_retrieve |
|
18
|
|
|
|
|
|
|
length |
|
19
|
|
|
|
|
|
|
movie_type |
|
20
|
|
|
|
|
|
|
size_high |
|
21
|
|
|
|
|
|
|
size_low |
|
22
|
|
|
|
|
|
|
view_counter |
|
23
|
|
|
|
|
|
|
comment_num |
|
24
|
|
|
|
|
|
|
mylist_counter |
|
25
|
|
|
|
|
|
|
last_res_body |
|
26
|
|
|
|
|
|
|
watch_url |
|
27
|
|
|
|
|
|
|
thumb_type |
|
28
|
|
|
|
|
|
|
embeddable |
|
29
|
|
|
|
|
|
|
no_live_play |
|
30
|
|
|
|
|
|
|
tags |
|
31
|
|
|
|
|
|
|
user_id |
|
32
|
|
|
|
|
|
|
); |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(@Members); |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# DEPRECATED |
|
38
|
|
|
|
|
|
|
sub is_failure { |
|
39
|
0
|
|
|
0
|
0
|
|
$_[0]->is_error; |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub members { # implement |
|
43
|
0
|
|
|
0
|
0
|
|
my @copy = @Members; |
|
44
|
0
|
|
|
|
|
|
@copy; |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub parse { # implement |
|
48
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
49
|
0
|
0
|
|
|
|
|
$self->load($_[0]) if( defined $_[0] ); |
|
50
|
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
my $tpp = XML::TreePP->new( force_array => 'tags' ) |
|
52
|
|
|
|
|
|
|
->parse($self->_decoded_content); |
|
53
|
|
|
|
|
|
|
|
|
54
|
0
|
|
0
|
|
|
|
my $params = $tpp->{nicovideo_thumb_response} || {}; |
|
55
|
0
|
|
0
|
|
|
|
my $thumb = $params->{thumb} || {}; |
|
56
|
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
for my $name ( ($self->members) ){ |
|
58
|
0
|
0
|
|
|
|
|
$self->$name( $thumb->{$name} ) |
|
59
|
|
|
|
|
|
|
if( $self->can($name) ); |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# status |
|
63
|
0
|
|
0
|
|
|
|
my $status = $params->{'-status'} || ''; |
|
64
|
0
|
0
|
|
|
|
|
if( lc($status) eq 'ok' ){ |
|
65
|
0
|
|
|
|
|
|
$self->set_status_success; |
|
66
|
|
|
|
|
|
|
}else{ |
|
67
|
0
|
|
|
|
|
|
$self->set_status_error; |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
return $self; |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
|
75
|
|
|
|
|
|
|
__END__ |