diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-12-06 00:19:57 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-12-06 00:19:57 +0100 |
| commit | e85ea1e8f94934f12444cc508584ed3bee0a72b0 (patch) | |
| tree | 381aa2fc56a319b7e8b4efd60c0fabe47e6046aa /blog | |
| parent | efe6f0326400fd02b14ccaaed451eb9b306c7fe5 (diff) | |
| download | cacharle.xyz-e85ea1e8f94934f12444cc508584ed3bee0a72b0.tar.gz cacharle.xyz-e85ea1e8f94934f12444cc508584ed3bee0a72b0.tar.bz2 cacharle.xyz-e85ea1e8f94934f12444cc508584ed3bee0a72b0.zip | |
Addec youtube subscribtions to RSS blog post draft
Diffstat (limited to 'blog')
| -rw-r--r-- | blog/youtube_to_rss.md | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/blog/youtube_to_rss.md b/blog/youtube_to_rss.md new file mode 100644 index 0000000..8b414e1 --- /dev/null +++ b/blog/youtube_to_rss.md @@ -0,0 +1,56 @@ +# Convert your Youtube subsciptions to RSS feeds + +> Fun fact: I'm such a zoomer that I only discovered RSS recently (which is [years] old). + +## Get all subscription + +You probably could do some fancy stuff with the google API but it would probably be overkill. +Go to <https://youtube.com/feed/channels>, scroll to the bottom (Good luck if you got 1000+, your middle finger wight get cramped). +Right click on something that is not a link or an image and select `Save as`, give a name to the file and save it. + +## Parse list of subscription + +Now let's get a tiny bit fancy with Python and BeautifulSoup. + +Download Python from [here](https://www.python.org/downloads/) (If you're on Linux, you can install it from your package manager). Make sure you install Python3.\* and not Python2. + +Download BeautifulSoup with pip `pip3 install bs4` (sure?) + +```python +#!/usr/bin/env python3 + + +from bs4 import BeautifulSoup + +BeautifulSoup(content) + +... +``` + +You can download this script [here](extract_channels.py), +it's a bit different from the one in this article, +read the code before running it if you want to make sure their isn't any shenenigans. + +``` +$ curl -O https://cacharle.xyz/blog/extract_channels.py +$ chmod +x extract_channels.py +$ ./extract_channels.py < channels.html +``` + +## Choose the channel to add to your feeds + +Now comes the tedious and cringing part where you need to through aaaall your old and obscure subscription and filter the bad ones out. +> Protip: If you want to automate this part you can ask Google to do it for you since they know you better than yourself by now. + +## Get channel feed + +I guess most RSS reader understand the HTML /balise/ `<link rel="alternate" type="application/rss" .../>` but [newsboat]() (which I use) doesn't unfortunatly. +We can get the url to a channel feed with a simple `curl` into `grep`. + +``` +curl <CHANNEL_URL> | grep -E '<link rel="alternate".*rss/> +``` + +## Sources + +* [luke smith]() |
