POSIX-ify latest commit

This commit is contained in:
2020-06-06 10:25:05 -05:00
parent 489ac3804e
commit 04b7a64c38

11
subs
View File

@@ -63,7 +63,16 @@ gen_links() {
# otherwise we are given a username, we must find out its channel ID
curl -sfL --retry 10 "https://youtube.com/user/$line/about" | \
echo "https://youtube.com/feeds/videos.xml?channel_id=$(grep -ohm 1 'channel\/UC......................' | tail -c 25)" >>"$SUBS_LINKS"
while read -r line ; do
case $line in
*channel/UC??????????????????????*)
line=${line##*channel/}
line=${line%%\"*}
printf 'https://youtube.com/feeds/videos.xml?channel_id=%s\n' \
"$line" >>"$SUBS_LINKS"
break
esac
done
done <"$SUBS_FILE"
}