How to fix clickbait titles when subscribing to YouTube channels via Newsboat
Clickbait titles (and thumbnails) sucks. And those who use clickbait tactics sucks even more! I usually just boycott crap like that. However, I can make rare exceptions, if the content brings enough value to me.
And I’ve made one exception so far. It’s a channel that I’ve been following for more than a decade. They originally didn’t use crap tactics like this, but they apparently feel that they now have to, thanks to the scumbag algorithm that YouTube uses to make life miserable for everyone.
DeArrow to the rescue
DeArrow is an open source browser extension, for crowdsourcing better titles and thumbnails on YouTube. The goal is to replace clickbait titles and thumbnails with accurate titles and thumbnails.
They also provide a free API for everyone to use. This means that you could write a script for Newsboat, that replaces clickbait titles with better titles. And this is exactly what Ordoviz on Mastodon did.
The script comes in two versions, and they can both be found on GitHub:
The version with support for Shorts, simply removes any Shorts videos from the feed. A request made by me!
Installation
Save the script with whatever filename you prefer. I choose the name newsboat_dearrow.py
. Don’t forget to make the script executable:
$ chmod +x <FILE>
Not wanting to see the original title next to the new one, I removed the part {title_element.text}
from this line (I left the ◎
character, so I know when the title has been modified):
title_element.text = f"{new_title} ◎ {title_element.text}"
Usage
Apply the script to the beginning of every source in your urls
file, that you wish to use it for:
filter:~/Scripts/newsboat_dearrow.py:https://www.youtube.com/feeds/videos.xml?channel_id=UCXuqSBlHAE6Xw-yeJA0Tunw "~Linus Tech Tips"
Note that this makes the update of the feed a little bit slower. My recommendation is to only add the filter to problematic feeds.