fix: Adding support for unprotected youtube urls. #15

Merged
sergiotarxz merged 1 commits from bugfix/Adding_support_for_unprotected_youtube_urls into master 2021-01-12 13:32:33 +01:00

View File

@ -42,6 +42,16 @@ sub youtube {
? @{ $ytInitialPlayerResponse->{formats} }
: ()
);
my $mime_type = $format->{mimeType} =~ s/;.*$//r;
say $mime_type;
my $extension = $mime_type =~ s/^.*?\///r =~ s/;.*$//r;
if ( defined $format->{url} ) {
return {
filename => $microformat->{title}{simpleText} . '.'
. $extension,
url => $format->{url},
};
}
my $url_data = $format->{signatureCipher};
$url_data = {
map {
@ -92,9 +102,6 @@ sub youtube {
$js->callJSFunction( $function_name_regen_sig, $url_data->{s} );
my $url = $url_data->{url} . "&sig=${signature}";
say Data::Dumper::Dumper $format;
my $mime_type = $format->{mimeType} =~ s/;.*$//r;
say $mime_type;
my $extension = $mime_type =~ s/^.*?\///r =~ s/;.*$//r;
say $url;
return {
url => $url,