From 539a940bc7a823460ba3f07a932ea3c4763229e1 Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Sat, 26 Dec 2020 05:01:48 +0100 Subject: [PATCH] Adding https support. (Missing because a module was not being installed.) --- README.md | 2 +- bin/peertube-dl | 4 ++++ cpanfile | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 17732de..18c3aa2 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ There is two alternative ways: ### System install ``` -sudo apt install perl make libwww-perl liburi-encode-perl libjson-perl +sudo apt install perl make libwww-perl liburi-encode-perl libjson-perl liblwp-protocol-https-perl perl Makefile.PL make make install diff --git a/bin/peertube-dl b/bin/peertube-dl index 228e68e..6fba420 100755 --- a/bin/peertube-dl +++ b/bin/peertube-dl @@ -21,6 +21,7 @@ my %handlers = ( die "No url passed" unless @ARGV; +my $handled = 0; for my $x ( keys %handlers ) { if ( $response->decoded_content =~ m/$handlers{$x}{reg}/ ) { eval { $handlers{$x}{subr}->( $ua, $response ); }; @@ -28,10 +29,13 @@ for my $x ( keys %handlers ) { say $@; } else { last; + $handled = 1; } } } +say "The url could not be handled, post a issue on https://gitea.sergiotarxz.freemyip.com/sergiotarxz/Peertube-dl/issues telling me the url which does not allow you to download the video so I add support for it." unless $handled; + package Peertube::Downloaders { sub gocdn { diff --git a/cpanfile b/cpanfile index 14ce1d6..036fd97 100644 --- a/cpanfile +++ b/cpanfile @@ -1,3 +1,4 @@ requires 'LWP::UserAgent'; requires 'URI::Encode'; requires 'JSON'; +requires 'LWP::Protocol::https';