From 20771b1e045ede64b05018af4fb7dd160452ea89 Mon Sep 17 00:00:00 2001 From: Florian Stecker Date: Thu, 2 Jan 2025 22:37:20 +0100 Subject: [PATCH] Parallel sync --- podcast | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/podcast b/podcast index 4230375..0fee2e6 100755 --- a/podcast +++ b/podcast @@ -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 0 9 | 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