13 lines
320 B
Bash
13 lines
320 B
Bash
|
#!/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"
|
||
|
yt-dlp -v --flat-playlist --print id "${CHANNEL_URL}" | tee "allowed-channels/${USER_ID}.txt"
|
||
|
else
|
||
|
echo "Missing a valid channel URL" >&2
|
||
|
fi
|