diff options
author | trizen <trizen@protonmail.com> | 2020-08-08 10:46:05 +0300 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-08-14 14:39:29 -0500 |
commit | 187d7126312f810f4f84f3652cdbb49c0057b37b (patch) | |
tree | 6700d665f8f5716150f4d1a0d37514d6d2cbe2ad | |
parent | 9b080e31689d973f51d82a3cf8e2b0c461798b65 (diff) | |
download | fair-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>
-rwxr-xr-x | bin/fair-viewer | 2 | ||||
-rwxr-xr-x | bin/gtk-fair-viewer | 2 | ||||
-rw-r--r-- | lib/WWW/FairViewer.pm | 10 |
3 files changed, 10 insertions, 4 deletions
diff --git a/bin/fair-viewer b/bin/fair-viewer index 0f2d8de..40689e5 100755 --- a/bin/fair-viewer +++ b/bin/fair-viewer @@ -213,7 +213,7 @@ my %CONFIG = ( cache_dir => undef, # API - api_host => "https://invidio.us", + api_host => "https://invidious.snopyta.org", # Others autoplay_mode => 0, diff --git a/bin/gtk-fair-viewer b/bin/gtk-fair-viewer index e75766b..9a5f545 100755 --- a/bin/gtk-fair-viewer +++ b/bin/gtk-fair-viewer @@ -205,7 +205,7 @@ my %CONFIG = ( comments_order => 'top', # valid values: time, relevance # API - api_host => "https://invidio.us", + api_host => "https://invidious.snopyta.org", # URI options thumbnail_type => 'medium', 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); |