1.6 KiB
YouTube Subscriptions to OPML
This repo contains a small collection of scripts that I used to turn my YouTube subscriptions into an OPML file for import in to Feedbin.
Dependencies
The scripts have only been run on a Linux system using GNU coreutils. They will probably need some tweaking to run on other UNIX-like systems.
Usage
-
Visit your subscriptions page
-
Repeatedly scroll to the end of the page to make them all load
-
Run the following in the JavaScript console to copy the list of subscriptions to you clipboard as JSON array:
copy(JSON.stringify(Array.from(new Set(Array.prototype.map.call(document.querySelectorAll('a.channel-link'), (link) => link.href))).filter((x) => !x.includes('/channel/')), null, 2))
Note: I only tested the above on Firefox.
Also why do this instead of processing the subscriptions.csv from Google Takeout?
- Takeout generates multiple gigabytes of archives I have to download to get the CSV file.
- It's slow to generate. This process can be done whenever you want.
-
Paste the list of subscriptions into
subscriptions.json
. -
Run
make fetch
to fetch the channel pages of all the subscriptions. This only needs to be run once. -
Run
make channel-json
to extract info from each channel page. -
Run
make subscriptions.opml
to generate the OPML file.