fix: Adding support for unprotected youtube urls.

This commit is contained in:
sergiotarxz 2021-01-12 13:30:58 +01:00
parent 82d4ddef4f
commit 11695d66dc
Signed by: sergiotarxz
GPG Key ID: E5903508B6510AC2

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,