aboutsummaryrefslogtreecommitdiff
path: root/macos.local/flake/home/scripts/yt-to-rss.py.org
blob: 619c6dd2871e26ab370a8bf8d2e018d8d8802a4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#+title: YouTube Channel to RSS Link

Quick script to get the RSS link for a YouTube channel so I don't have to visit the website.

#+begin_src python
  import requests
  from bs4 import BeautifulSoup
  import sys

  channel_link = sys.argv[1]

  response = requests.get(channel_link)
  soup = BeautifulSoup(response.content, "html.parser")
  rss_link = soup.find("link", title="RSS")
  rss_url = rss_link.get("href")

  print(rss_url)

#+end_src