From c072be6652d3e7b04014ef83a552228ff7eb214a Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Wed, 13 Jan 2021 09:22:00 +0100 Subject: [PATCH] Reduccing verbosity. --- lib/Peertube/DL/Downloaders.pm | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/lib/Peertube/DL/Downloaders.pm b/lib/Peertube/DL/Downloaders.pm index f511b76..6011805 100644 --- a/lib/Peertube/DL/Downloaders.pm +++ b/lib/Peertube/DL/Downloaders.pm @@ -31,14 +31,6 @@ sub youtube { my $microformat = $ytInitialPlayerResponse->{microformat}{playerMicroformatRenderer}; $ytInitialPlayerResponse = $ytInitialPlayerResponse->{streamingData}; - say Data::Dumper::Dumper [ - scalar @{ $ytInitialPlayerResponse->{adaptiveFormats} } - ? @{ $ytInitialPlayerResponse->{adaptiveFormats} } - : (), - scalar @{ $ytInitialPlayerResponse->{formats} } - ? @{ $ytInitialPlayerResponse->{formats} } - : () - ]; if ( defined $options->{format} ) { my $format = $options->{format}; @@ -51,7 +43,6 @@ sub youtube { : () ); my $mime_type = $format->{mimeType} =~ s/;.*$//r; - say $mime_type; my $extension = $mime_type =~ s/^.*?\///r =~ s/;.*$//r; if ( defined $format->{url} ) { return { @@ -73,8 +64,6 @@ sub youtube { $url_data }; - say Data::Dumper::Dumper $url_data; - my ($player_url) = $response->decoded_content =~ m/"jsUrl"\s*:\s*("[^"]+")/; $player_url = JSON::from_json( $player_url, { allow_nonref => 1 } ); @@ -109,21 +98,12 @@ sub youtube { my $signature = $js->callJSFunction( $function_name_regen_sig, $url_data->{s} ); my $url = $url_data->{url} . "&sig=${signature}"; - say Data::Dumper::Dumper $format; say $url; return { url => $url, filename => $microformat->{title}{simpleText} . '.' . $extension, }; } else { - say Data::Dumper::Dumper [ - scalar @{ $ytInitialPlayerResponse->{adaptiveFormats} } - ? @{ $ytInitialPlayerResponse->{adaptiveFormats} } - : (), - scalar @{ $ytInitialPlayerResponse->{formats} } - ? @{ $ytInitialPlayerResponse->{formats} } - : () - ]; my @formats = map { { id => $_->{itag}, @@ -135,7 +115,7 @@ sub youtube { ), ( ( defined $_->{qualityLabel} ) - ? ( qualityLabel => int( $_->{qualityLabel} ) ) + ? ( qualityLabel => $_->{qualityLabel} =~ s/p$//r ) : () ), (