blob: 8b414e10c09e7264e9ceb277ceb7dfeca5a85044 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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]()
|