diff options
author | trizen <trizen@protonmail.com> | 2020-11-04 14:25:02 +0200 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-11-09 17:43:06 -0500 |
commit | f141f51a9613c9d74680b1c9eb923ca7f20f901b (patch) | |
tree | 574b4b8efbb008e3643d7fdd51c2f788d5c5393a /lib/WWW/FairViewer | |
parent | c624698bdb859e1ac1f86659b92e0fd802be0f51 (diff) | |
download | fair-viewer-f141f51a9613c9d74680b1c9eb923ca7f20f901b.tar.lz fair-viewer-f141f51a9613c9d74680b1c9eb923ca7f20f901b.tar.xz fair-viewer-f141f51a9613c9d74680b1c9eb923ca7f20f901b.zip |
- Stricter selection of a random invidious instance (with api_host => "auto").
Ensure that a randomly selected invidious actually works, by making a search request with keyword "test".
Additionally, in the selection of instances, only include instances with "weeklyRatio = success" and "dailyRatios[0] = "success" (in addition to "statusClass = sucess").
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'lib/WWW/FairViewer')
-rw-r--r-- | lib/WWW/FairViewer/Utils.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/WWW/FairViewer/Utils.pm b/lib/WWW/FairViewer/Utils.pm index ccb5800..0144aec 100644 --- a/lib/WWW/FairViewer/Utils.pm +++ b/lib/WWW/FairViewer/Utils.pm @@ -223,6 +223,8 @@ Returns true if a given result has entries. sub has_entries { my ($self, $result) = @_; + $result // return 0; + if (ref($result->{results}) eq 'HASH') { foreach my $type (qw(comments videos playlists)) { @@ -247,7 +249,6 @@ sub has_entries { } return 1; # maybe? - #ref($result) eq 'HASH' and ($result->{results}{pageInfo}{totalResults} > 0); } =head2 normalize_video_title($title, $fat32safe) |