From 187d7126312f810f4f84f3652cdbb49c0057b37b Mon Sep 17 00:00:00 2001 From: trizen Date: Sat, 8 Aug 2020 10:46:05 +0300 Subject: - Changed the default API host to `invidious.snopyta.org`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The instance `invidio.us` seems to be down at the moment. Signed-off-by: Jesús --- lib/WWW/FairViewer.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/WWW/FairViewer.pm b/lib/WWW/FairViewer.pm index f9894ea..bb23de7 100644 --- a/lib/WWW/FairViewer.pm +++ b/lib/WWW/FairViewer.pm @@ -497,6 +497,10 @@ sub get_api_url { my $host = $self->get_api_host; + # Remove whitespace (if any) + $host =~ s/^\s+//; + $host =~ s/\s+\z//; + $host =~ s{/+\z}{}; # remove trailing '/' if ($host =~ m{^[-\w]+(?>\.[-\w]+)+\z}) { # no protocol specified @@ -504,9 +508,11 @@ sub get_api_url { } # After October 1st, the invidio.us API will no longer work. - # Starting with September 30th, use "invidious.snopyta.org" instead. - if (time > 1601424000 and $host =~ m{^https://(?:www\.)?invidio\.us\b}) { + # Use "invidious.snopyta.org" instead. + if ($host =~ m{^https://(?:www\.)?invidio\.us\b}) { $host = "https://invidious.snopyta.org"; + ##print STDERR ":: Changing the API host to $host\n"; + $self->set_api_host($host); } join('', $host, $self->get_api_path); -- cgit v1.2.3