From 99dd02979bd263b80fad9b4859ddcaed58e46cc0 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 18 Jul 2022 09:33:09 -0500 Subject: Convert youtube -> invidious --- runsfeed | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'runsfeed') diff --git a/runsfeed b/runsfeed index 7bafcc0..f108031 100755 --- a/runsfeed +++ b/runsfeed @@ -19,6 +19,8 @@ main() { test -d "$(dirname "$sfeedrc")" || mkdir -p "$(dirname "$sfeedrc")" test -d "$sfeedpath" || mkdir -p "$sfeedpath" + log Finding Invidious host... + get_invidious_url "https://api.invidious.io/instances.json?sort_by=health" log Updating feeds... update "$sfeedrc" log Generating HTML... @@ -36,6 +38,13 @@ main() { log Done. } +get_invidious_url() { + curl -sL "$1" | + jq -r .[][1].uri | + grep -v onion | + head -n1 | tee /tmp/invidious.host +} + log() { printf '%s\n' "$*" >&2 } -- cgit 1.4.1-21-gabe81