Here is a short guide on how to import export your youtube subscription rss feed, and import them back into newsboat.

First go to in your browser. On the bottom of the page you can download all your subscriptions in a single file, by 'Export subscriptions'. (go ahead download your subscriptions)

If you open your exported rss feed in a text editor (eg.vim) you will see something similar to this :


From the above youtube spaghetti we can extract information to generate a proper RSS feed for the newsboat application.

we see tags starting with '<outline' containing a title and xmlUrl property that we can extract and use for the RSS feed.

First we need to reformat the data a bit, and have each line start with an '<outline' tag. we will do that using sed. Here we search for the first "less than" character, ..and we replace it with a carriage return character \r', followed by a 'less than' character. we add the 'g' (global) to the expression to perform this action on each occurence of the '<' less than character. (see below)

sed -n 's/</\r</g'

Next we capture the title and url of the RSS the feed, by using Sed and capture groups. Each group that we wish to capture is marked by left and right parentethis.

sed -n 's/^.title="([^"])".xmlUrl="(.)".*$/\2 "~\1" "(Youtube)"/p' youtube.rss >> urls