My utility format the feed url by extracting the relevant suffix from the url slug when it includes:
"/user/"
"/channel/"
"/playlist?list="
I think the newer slug format for channels is "/c/" in which case I think you do have to extract it from the HTML source, but they now include the feed URL anyway.
User : https://www.youtube.com/feeds/videos.xml?user=<XXX>
Channel : https://www.youtube.com/feeds/videos.xml?channel_id=<XXX>
Playlist : https://www.youtube.com/feeds/videos.xml?playlist_id=<XXX>