From a6e68998d1086d100c916c6c3245bff96c5f937c Mon Sep 17 00:00:00 2001 From: Phantop Date: Fri, 21 Jun 2024 09:28:13 -0400 Subject: [PATCH] fish: add invidious miniflux instaance shuffler --- fish/functions/ytfluxfix.fish | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 fish/functions/ytfluxfix.fish diff --git a/fish/functions/ytfluxfix.fish b/fish/functions/ytfluxfix.fish new file mode 100644 index 0000000..9e4e5d9 --- /dev/null +++ b/fish/functions/ytfluxfix.fish @@ -0,0 +1,9 @@ +function ytfluxfix + for i in (eval curl (cat ~/.config/miniflux)/categories/3/feeds | jq -rc '.[] | select(.parsing_error_count!=0)' | head -n15) + set instances (curl https://redirect.invidious.io | pup noscript text{} | htmldecode | pup .instances-list a text{}) + set url (trurl -s host=(echo $instances | shuf -n1) (echo $i | jq -r .feed_url)) + set id (echo $i | jq -r .id) + eval curl "$(cat ~/.config/miniflux)/feeds/$id" -X PUT -d @(jq -rn --arg feed_url $url '$ARGS.named' | psub) + eval curl "$(cat ~/.config/miniflux)/feeds/$id/refresh" -X PUT + end +end