This repository has been archived on 2021-11-29. You can view files and clone it, but cannot push or open issues or pull requests.
rsstube-bash-old/scripts/url-extractors/youtube

24 lines
718 B
Plaintext

if [[ $url == *"youtube.com/channel/"* ]]
then
channel_id=${url#*youtube.com/channel/}
channel_id=${channel_id%%/*}
channel_id=${channel_id%%\?*}
channel_id=${channel_id%%\&*}
rss="https://www.youtube.com/feeds/videos.xml?channel_id=$channel_id"
url_ext=$rss
elif [[ $url == *"youtube.com/user/"* ]]
then
username=${url#*youtube.com/user/}
username=${username%%/*}
username=${username%%\?*}
username=${username%%\&*}
rss="https://www.youtube.com/feeds/videos.xml?user=$username"
url_ext=$rss
elif [[ $url == *"youtube.com/playlist/?list="* || $url == *"youtube.com/"*"&list="* ]]
then
list=${url#*list=}
list=${list%%&*}
rss="https://www.youtube.com/feeds/videos.xml?playlist_id=$list"
url_ext=$rss
fi