Skip to content

Commit

Permalink
Fixed the JSON parsing for some videos that include the characters "<…
Browse files Browse the repository at this point in the history
…" and ">".

One such video is: https://yewtu.be/watch?v=LDAYYaV51xs

Which generated the following warning:

	[JSON]: illegal backslash escape sequence in string, at character offset 21419 (before "\\<3"}]},"trackingPa...") at /usr/share/perl5/site_perl/JSON.pm line 190.
  • Loading branch information
trizen committed Dec 25, 2023
1 parent fb6a4c6 commit ec857b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/WWW/PipeViewer/InitialData.pm
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ sub _get_initial_data {

$json =~ s{\\x([[:xdigit:]]{2})}{chr(hex($1))}ge;
$json =~ s{\\u([[:xdigit:]]{4})}{chr(hex($1))}ge;
$json =~ s{\\(["&])}{$1}g;
$json =~ s{\\(["&<>])}{$1}g;

my $hash = parse_utf8_json_string($json);
return $hash;
Expand Down

0 comments on commit ec857b8

Please sign in to comment.