This repository has been archived on 2024-08-15. You can view files and clone it, but cannot push or open issues or pull requests.
YouTube_Get_RSS_Feed/youtube-rss
2024-04-13 10:13:42 +00:00

20 lines
497 B
Bash

#!/bin/bash
rss_url='https://www.youtube.com/feeds/videos.xml?channel_id='
channel=$1
if [ ! $channel ]; then
echo "no channel given"
exit
fi
if [[ $channel =~ "https://www.youtube.com/" ]]; then
channel=$(echo $channel | cut -d '/' -f4)
fi
channel_id=$(curl -s "https://www.youtube.com/$channel" | grep -o 'externalId":".........................' | cut -d ':' -f2 | cut -d '"' -f2)
echo "Channel: "$channel
echo "Channel ID: "$channel_id
echo "RSS Feed url: "$rss_url$channel_id