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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.