You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
peertube-bashscripts/peertube_list_channels.sh

27 lines
565 B

CONFIG_FILE_PATH=pt.conf
if [ ! -f $CONF_FILE_PATH ]; then echo "Config file not found...." && exit 1; fi
PT_HOST=$(cat $CONFIG_FILE_PATH | jq -r .host)
PT_ACCESS_TOKEN=$(cat $CONFIG_FILE_PATH | jq -r .access_token)
echo Fetching User....
TMPF=$(mktemp)
curl -sn -H "Authorization: Bearer $PT_ACCESS_TOKEN" https://$PT_HOST/api/v1/users/me > $TMPF
echo
echo Username: $(cat $TMPF | jq -r .username)
echo Channels: $(cat $TMPF | jq -r .videoChannels[].name)
echo Channel ID: $(cat $TMPF | jq -r .videoChannels[].id)
echo
# debug
#echo $(cat $TMPF | jq)