Fix link generation

The old method which channel IDs are obtained via username was
unreliable.  Occasionally it resulted in a big blob of json being put
into your links file.  This patch fixes that, using a different method
of getting a channel ID from a username.
This commit is contained in:
Theo Henson
2020-06-06 02:14:36 -04:00
parent 805b114913
commit ffe6be54a3

4
subs
View File

@@ -62,8 +62,8 @@ gen_links() {
esac
# otherwise we are given a username, we must find out its channel ID
curl -sfL --retry 10 "https://youtube.com/user/$line/about" | grep channel_id | \
sed -e 's|www\.||' -e 's|.*href="||' -e 's|">.*||' >>"$SUBS_LINKS"
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"
done <"$SUBS_FILE"
}