aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortrizen <trizen@protonmail.com>2020-08-08 10:46:05 +0300
committerJesús <heckyel@hyperbola.info>2020-08-14 14:39:29 -0500
commit187d7126312f810f4f84f3652cdbb49c0057b37b (patch)
tree6700d665f8f5716150f4d1a0d37514d6d2cbe2ad /lib
parent9b080e31689d973f51d82a3cf8e2b0c461798b65 (diff)
downloadfair-viewer-187d7126312f810f4f84f3652cdbb49c0057b37b.tar.lz
fair-viewer-187d7126312f810f4f84f3652cdbb49c0057b37b.tar.xz
fair-viewer-187d7126312f810f4f84f3652cdbb49c0057b37b.zip
- Changed the default API host to `invidious.snopyta.org`.
The instance `invidio.us` seems to be down at the moment. Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'lib')
-rw-r--r--lib/WWW/FairViewer.pm10
1 files changed, 8 insertions, 2 deletions
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);