Who complains is JSON::MaybeXS. Because it is asked to decode the following:
{args: {raw_player_response:window.ytplayer.bootstrapPlayerResponse} }; if(window.ytcsi)window.ytcsi.tick("cfg",null,"")}
that could be the wrong response signifying an outdated scrapper (likely). On the other hand, it looks to me to be wrong JSON but I am not a JSON expert. The first part is JSON and can be fixed with quoting all strings (no?). The rest looks like broken javascript.
It will give you a nice excuse to avoid the seaside and open up a terminal window to crack it ...
bw, bliako
#EDIT: here is what lies in line 298 sub _get_args { my ($self, $content) = @_; my $data; for my $line (split "\n", $content) { next unless $line; if ($line =~ /the uploader has not made this video available i +n your country/i) { croak 'Video not available in your country'; } # The following regex looks like it is asking for trouble # memo-to-self: can't parse javascript with regex... elsif ($line =~ /^.+ytplayer\.config\s*=\s*(\{.*})/) { print STDERR "BBBBB: |||$1|||\n"; ($data, undef) = JSON->new->utf8(1)->decode_prefix($1); # +<<< 298 last; } } croak 'failed to extract JSON data' unless $data->{args}; return $data->{args}; }
In reply to Re: youtube parser/scrabber
by bliako
in thread youtube parser/scrabber
by igoryonya
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |