mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-04-13 16:26:01 +00:00
Test requests.head for deredir()
This commit is contained in:
parent
43d46a1b20
commit
cf4d1d67c7
2
twoot.py
2
twoot.py
@ -188,7 +188,7 @@ def deredir_url(url):
|
|||||||
ret = None
|
ret = None
|
||||||
try:
|
try:
|
||||||
# Download the page
|
# Download the page
|
||||||
ret = requests.get(url, headers=headers, timeout=5)
|
ret = requests.head(url, headers=headers, timeout=5)
|
||||||
except:
|
except:
|
||||||
# If anything goes wrong keep the URL intact
|
# If anything goes wrong keep the URL intact
|
||||||
return url
|
return url
|
||||||
|
Loading…
x
Reference in New Issue
Block a user