diff options
author | Case Duckworth | 2022-07-18 09:33:09 -0500 |
---|---|---|
committer | Case Duckworth | 2022-07-18 09:33:09 -0500 |
commit | 99dd02979bd263b80fad9b4859ddcaed58e46cc0 (patch) | |
tree | 4a901ee5f925a1ef5ac4836ff06e1bf66ca88973 /runsfeed | |
parent | Filter titles and things (diff) | |
download | sfeed-99dd02979bd263b80fad9b4859ddcaed58e46cc0.tar.gz sfeed-99dd02979bd263b80fad9b4859ddcaed58e46cc0.zip |
Convert youtube -> invidious
Diffstat (limited to 'runsfeed')
-rwxr-xr-x | runsfeed | 9 |
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 | ||
41 | get_invidious_url() { | ||
42 | curl -sL "$1" | | ||
43 | jq -r .[][1].uri | | ||
44 | grep -v onion | | ||
45 | head -n1 | tee /tmp/invidious.host | ||
46 | } | ||
47 | |||
39 | log() { | 48 | log() { |
40 | printf '%s\n' "$*" >&2 | 49 | printf '%s\n' "$*" >&2 |
41 | } | 50 | } |