mirror of
https://github.com/Phantop/dotfiles
synced 2024-11-19 21:32:48 +00:00
fish: add invidious miniflux instaance shuffler
This commit is contained in:
parent
d9ab785667
commit
a6e68998d1
9
fish/functions/ytfluxfix.fish
Normal file
9
fish/functions/ytfluxfix.fish
Normal file
|
@ -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
|
Loading…
Reference in a new issue