From cf4d1d67c7d548dfd1fa4527b7f13006bcf16518 Mon Sep 17 00:00:00 2001 From: jeancf Date: Wed, 30 Nov 2022 20:52:36 +0100 Subject: [PATCH] Test requests.head for deredir() --- twoot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twoot.py b/twoot.py index a4eca29..12982c9 100755 --- a/twoot.py +++ b/twoot.py @@ -188,7 +188,7 @@ def deredir_url(url): ret = None try: # Download the page - ret = requests.get(url, headers=headers, timeout=5) + ret = requests.head(url, headers=headers, timeout=5) except: # If anything goes wrong keep the URL intact return url