mirror of
https://github.com/Brandon-Rozek/website-toots.git
synced 2024-11-21 15:56:29 -05:00
Changed user agent
This commit is contained in:
parent
4f75d8a45a
commit
3da97532fe
1 changed files with 5 additions and 2 deletions
|
@ -40,8 +40,11 @@ def retrieve_toots_from_server():
|
|||
response: Optional[HTTPResponse] = None
|
||||
|
||||
try:
|
||||
response = request.urlopen(url)
|
||||
except Exception:
|
||||
req = request.Request(url)
|
||||
req.add_header('User-Agent', 'Python3-Urllib/3')
|
||||
response = request.urlopen(req)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print("Unable to grab toots from Mastodon.")
|
||||
|
||||
if response is None:
|
||||
|
|
Loading…
Reference in a new issue