Use TwitterBot user agent (lie)
This commit is contained in:
parent
f44dbeec01
commit
ab3dd09251
1 changed files with 2 additions and 4 deletions
|
@ -232,16 +232,14 @@ def preview_url(
|
|||
try:
|
||||
with httpx.Client(
|
||||
headers={
|
||||
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0"
|
||||
# "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0"
|
||||
"User-Agent": "TwitterBot/1.0"
|
||||
},
|
||||
timeout=60,
|
||||
follow_redirects=False
|
||||
) as client:
|
||||
response = client.get(
|
||||
url,
|
||||
headers={
|
||||
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0"
|
||||
},
|
||||
)
|
||||
if response.status_code not in range(200, 400):
|
||||
response.raise_for_status()
|
||||
|
|
Loading…
Reference in a new issue