youtube-urls-feed/scripts/allow-user-videos.sh

13 lines
365 B
Bash
Raw Normal View History

2024-08-18 08:01:36 +03:00
#!/usr/bin/env bash
USER_ID="$1"
echo "${USER_ID}" |egrep "^([a-zA-Z0-9@]+)$" >/dev/null
if [ "$?" -eq "0" ]
then
CHANNEL_URL="https://www.youtube.com/${USER_ID}/videos"
2024-08-30 05:52:40 +03:00
yt-dlp --netrc --netrc-location /root/.netrc --verbose --flat-playlist --print id "${CHANNEL_URL}" | tee "allowed-channels/${USER_ID}.txt"
2024-08-18 08:01:36 +03:00
else
echo "Missing a valid channel URL" >&2
fi