fix: Adding support for unprotected youtube urls. #15
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user