<h1 id="how-i-watch-youtube-with-newsboat">How I watch youtube with <code>newsboat</code></h1>
<p>I find that the youtube web ui is designed to keep users on the site by feeding them an unending stream of information. Bright colors, distracting thumbnails, peanut galleries, etc. I prefer to consume my videos in the same way I consume everything else: via RSS.</p>
<p>RSS is my favorite way of aggregating things that other people have made because it allows me, the user, to interact with their things</p>
<p>The only dependencies not on a standard UNIX system are <code>newsboat</code> and a video player. I also use <code>yt-dlp</code> to download videos for later viewing. I like <code>mpv</code> but you can substitute your own.</p>
<pre><code>$ sudo $pkgmrg install newsboat mpv yt-dlp</code></pre>
<h1 id="getting-rss-feeds-from-youtube">Getting RSS feeds from youtube</h1>
<p>Youtube (currently) provides RSS feeds for channels.</p>
<h2 id="finding-youtube-channel-id">Finding Youtube channel ID</h2>
<p>Sometimes channels have vanity URLs that can make it difficult to find the channel ID. Other times, the URL contains the channel ID. All youtube channel IDs start with the string <code>UC</code> so we can easily grep for them.</p>
<pre><code>$ curl https://www.youtube.com/c/RMCRetro | grep --color &quot;href=\&quot;https://www.youtube.com/channel/UC\&quot;&quot;
[ lots of nonsense ]
href=&quot;https://www.youtube.com/channel/UCLEoyoOKZK0idGqSc6Pi23w&quot;
[ lots of nonsense ]</code></pre>
<p>In order to turn this channel ID into something useful, we create the following URL:</p>
<pre><code>https://www.youtube.com/feeds/videos.xml?channel_id=UCLEoyoOKZK0idGqSc6Pi23w</code></pre>
<p><a href="https://takeout.google.com/">Google takeout can also be used to export youtube subscriptions.</a></p>
<p>The export format is a CSV that contains the channel IDs for all of our subscriptions.</p>
<pre><code>Channel Id,Channel Url,Channel Title
UCLEoyoOKZK0idGqSc6Pi23w,http://www.youtube.com/channel/UCLEoyoOKZK0idGqSc6Pi23w,RMC - The Cave</code></pre>
<h1 id="newsboat-url-list">Newsboat url list</h1>
<p>Newsboat reads it’s list of URLs from <code>~/.config/newsboat/urls</code>. Every url we add to this list will be automaticlly fetched. You can make separate URL lists for your list of videos and list of standard text based RSS feeds</p>
<p>If you have an exported CSV, you can easily modify it so that newsboat will accept it as a list of URLs by deleting row 1, column 1+comma, and replacing the comma between the URL and channel name with a tab character. Doing a <code>sed 's/channel\//feeds\/videos.xml?channel_id=/g'</code> on the file is an easy way to replace the website URL with the feed url. Newsboat only reads the first field of every row so the channel name can be kept for easier subscription management.</p>
<pre><code>http://www.youtube.com/feeds/videos.xml?channel_id=UCLEoyoOKZK0idGqSc6Pi23w     RMC - The Cave</code></pre>
<h1 id="newsboat-config">Newsboat config</h1>
<p>In order to play videos, we need to add some macros to the newsboat config file at <code>~/.config/newsboat/config</code></p>
<p>Mine looks like this.</p>
<pre><code># load URLS on launch
auto-reload  yes

# vim binds
bind-key j down
bind-key k up
bind-key j next articlelist
bind-key k prev articlelist
bind-key J next-feed articlelist
bind-key K prev-feed articlelist
bind-key G end
bind-key g home
bind-key d pagedown
bind-key u pageup
bind-key l open
bind-key h quit
bind-key a toggle-article-read
bind-key n next-unread
bind-key N prev-unread
bind-key D pb-download
bind-key U bashow-urls
bind-key x pb-delete

# macro setup
browser linkhandler
macro , open-in-browser

# launch video player
macro v set browser &quot;setsid -f mpv&quot; ; open-in-browser ; set browser linkhandler

# download video
macro d set browser &quot;yt-dlp&quot;; open-in-browser ; set browser linkhandler

# download audio only
macro a set browser &quot;yt-dlp --embed-metadata -xic -f bestaudio/best&quot; ; open-in-browser ; set browser linkhandler</code></pre>
<h1 id="video-demo">Video demo</h1>
<p>This is a demo of using newsboat with videos. In order to execute the macros, you type <code>,</code> then <code>v</code> or whatever other letter you set the macro to.</p>
<p><a href="https://hackerpublicradio.org/eps/hpr3695/newsboat.webm">video in webm format</a> your web browser or operating system does not support free video codecs :(</p>
<h1 id="a-url-list-to-get-you-started">A url list to get you started</h1>
<pre><code>https://www.youtube.com/feeds/videos.xml?channel_id=UC3ts8coMP645hZw9JSD3pqQ        Andreas Kling
https://www.youtube.com/feeds/videos.xml?channel_id=UC9-y-6csu5WGm29I7JiwpnA        Computerphile
https://www.youtube.com/feeds/videos.xml?channel_id=UC15BJjhPr4d5gTClhmC4HRw        Elliot Coll
https://www.youtube.com/feeds/videos.xml?channel_id=UCxQKHvKbmSzGMvUrVtJYnUA        Learn Linux TV
https://www.youtube.com/feeds/videos.xml?channel_id=UCm9K6rby98W8JigLoZOh6FQ        LockPickingLawyer
https://www.youtube.com/feeds/videos.xml?channel_id=UCl2mFZoRqjw_ELax4Yisf6w        Louis Rossmann
https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA        Luke Smith
https://www.youtube.com/feeds/videos.xml?channel_id=UC7YOGHUfC1Tb6E4pudI9STA        Mental Outlaw
https://www.youtube.com/feeds/videos.xml?channel_id=UCjFaPUcJU1vwk193mnW_w1w        Modern Vintage Gamer
https://www.youtube.com/feeds/videos.xml?channel_id=UCLEoyoOKZK0idGqSc6Pi23w        RMC - The Cave
https://www.youtube.com/feeds/videos.xml?channel_id=UC4rqhyiTs7XyuODcECvuiiQ        Scott The Woz
https://www.youtube.com/feeds/videos.xml?channel_id=UC5I2hjZYiW9gZPVkvzM8_Cw        Techmoan
https://www.youtube.com/feeds/videos.xml?channel_id=UCy0tKL1T7wFoYcxCe0xjN6Q        Technology Connections
https://www.youtube.com/feeds/videos.xml?channel_id=UC8uT9cgJorJPWu7ITLGo9Ww        The 8-Bit Guy
https://www.youtube.com/feeds/videos.xml?channel_id=UC5UAwBUum7CPN5buc-_N1Fw        The Linux Experiment
https://www.youtube.com/feeds/videos.xml?channel_id=UCFMx-JitepTttWc-ABHhu8A        This Week in Retro
https://www.youtube.com/feeds/videos.xml?channel_id=UCsnGwSIHyoYN0kiINAGUKxg        Wolfgang&#39;s Channel
https://www.youtube.com/feeds/videos.xml?channel_id=UCJ8V9aiz50m6NVn0ix5v8RQ        decino                </code></pre>
