about summary refs log tree commit diff stats
path: root/runsfeed
diff options
context:
space:
mode:
Diffstat (limited to 'runsfeed')
-rwxr-xr-xrunsfeed9
1 files changed, 9 insertions, 0 deletions
diff --git a/runsfeed b/runsfeed index 7bafcc0..f108031 100755 --- a/runsfeed +++ b/runsfeed
@@ -19,6 +19,8 @@ main() {
19 test -d "$(dirname "$sfeedrc")" || mkdir -p "$(dirname "$sfeedrc")" 19 test -d "$(dirname "$sfeedrc")" || mkdir -p "$(dirname "$sfeedrc")"
20 test -d "$sfeedpath" || mkdir -p "$sfeedpath" 20 test -d "$sfeedpath" || mkdir -p "$sfeedpath"
21 21
22 log Finding Invidious host...
23 get_invidious_url "https://api.invidious.io/instances.json?sort_by=health"
22 log Updating feeds... 24 log Updating feeds...
23 update "$sfeedrc" 25 update "$sfeedrc"
24 log Generating HTML... 26 log Generating HTML...
@@ -36,6 +38,13 @@ main() {
36 log Done. 38 log Done.
37} 39}
38 40
41get_invidious_url() {
42 curl -sL "$1" |
43 jq -r .[][1].uri |
44 grep -v onion |
45 head -n1 | tee /tmp/invidious.host
46}
47
39log() { 48log() {
40 printf '%s\n' "$*" >&2 49 printf '%s\n' "$*" >&2
41} 50}