Merge pull request 'fix: Adding support for unprotected youtube urls.' (#15) from bugfix/Adding_support_for_unprotected_youtube_urls into master
Reviewed-on: https://gitea.sergiotarxz.freemyip.com/sergiotarxz/Peertube-dl/pulls/15
This commit is contained in:
commit
135a251e11
@ -42,6 +42,16 @@ sub youtube {
|
|||||||
? @{ $ytInitialPlayerResponse->{formats} }
|
? @{ $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};
|
my $url_data = $format->{signatureCipher};
|
||||||
$url_data = {
|
$url_data = {
|
||||||
map {
|
map {
|
||||||
@ -92,9 +102,6 @@ sub youtube {
|
|||||||
$js->callJSFunction( $function_name_regen_sig, $url_data->{s} );
|
$js->callJSFunction( $function_name_regen_sig, $url_data->{s} );
|
||||||
my $url = $url_data->{url} . "&sig=${signature}";
|
my $url = $url_data->{url} . "&sig=${signature}";
|
||||||
say Data::Dumper::Dumper $format;
|
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;
|
say $url;
|
||||||
return {
|
return {
|
||||||
url => $url,
|
url => $url,
|
||||||
|
Loading…
Reference in New Issue
Block a user