From ac33cb54b97ce1ec21bc92853cdaf778c80d3b2b Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sat, 27 Jul 2024 15:05:01 +0200 Subject: [PATCH] update headers --- app/cron_reddit_tracker.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/cron_reddit_tracker.py b/app/cron_reddit_tracker.py index c3b8bed..76979b9 100644 --- a/app/cron_reddit_tracker.py +++ b/app/cron_reddit_tracker.py @@ -38,8 +38,12 @@ def get_updated_post_data(permalink): # Create a dictionary of existing posts for faster lookup and update existing_posts = {post['id']: post for post in existing_data} +headers = { + 'User-Agent': 'python:myapp:v1.0 (by /u/mrahimi114313)' +} + # Send a GET request to the API -response = requests.get(url, headers={'User-agent': 'Mozilla/5.0'}) +response = requests.get(url, headers=headers) counter = 0 # Check if the request was successful