Skip to content

Commit

Permalink
chg: [rssfind] set coherent User-Agent headers
Browse files Browse the repository at this point in the history
  • Loading branch information
adulau committed Mar 3, 2024
1 parent 848b96a commit 149c6b4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bin/rssfind.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def findfeeds(url=None, disable_strict=False):
if url is None:
return None

raw = requests.get(url).text
raw = requests.get(url, headers=headers).text
results = []
discovered_feeds = []
html = bs4(raw, features="lxml")
Expand Down Expand Up @@ -52,9 +52,12 @@ def findfeeds(url=None, disable_strict=False):

version = "0.2"

feedparser.USER_AGENT = (
"rssfind.py " + version + " +https://github.com/adulau/rss-tools"
)
user_agent = f"rssfind.py {version} +https://github.com/adulau/rss-tools"

feedparser.USER_AGENT = user_agent


headers = {"User-Agent": user_agent}

usage = "Find RSS or Atom feeds from an URL\nusage: %prog [options]"

Expand Down

0 comments on commit 149c6b4

Please sign in to comment.