Parallel sync

This commit is contained in:
Florian Stecker 2025-01-02 22:37:20 +01:00
parent 13dc837a52
commit 143fa6383e

View File

@ -3,10 +3,10 @@
cd "$(dirname "$(realpath "$0")")"
if [ "$1" == "sync" ]; then
cat "urls"| while read url; do
curl -s -o .tmp.rss-file "$url"
name="$(cat .tmp.rss-file | xq -r '.rss.channel.title')"
mv .tmp.rss-file "${name}.rss"
cat urls | xargs -d '\n' curl -Z $(seq 1 $(wc -l <urls) | xargs -I{} echo -o .tmp.{}.rss-file)
for file in .tmp.*.rss-file; do
name="$(cat "$file" | xq -r '.rss.channel.title')"
mv "$file" "${name}.rss"
echo "Updated \"$name\""
done
elif [ "$1" == "play" ]; then