Skip to content

Commit 1decb32

Browse files
authored
Fix request header to avoid 403 forbidden
1 parent 0a3a362 commit 1decb32

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/pyVinted/requester.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ class Requester:
1010
def __init__(self):
1111

1212
self.HEADER = {
13-
"User-Agent": "PostmanRuntime/7.28.4", # random.choice(USER_AGENTS),
13+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
14+
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9",
15+
"Referer": "https://www.google.com/",
16+
"Connection": "keep-alive",
1417
"Host": "www.vinted.fr",
1518
}
1619
self.VINTED_AUTH_URL = "https://www.vinted.fr/"
@@ -26,7 +29,10 @@ def setLocale(self, locale):
2629
"""
2730
self.VINTED_AUTH_URL = f"https://{locale}/"
2831
self.HEADER = {
29-
"User-Agent": "PostmanRuntime/7.28.4", # random.choice(USER_AGENTS),
32+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
33+
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9",
34+
"Referer": "https://www.google.com/",
35+
"Connection": "keep-alive",
3036
"Host": f"{locale}",
3137
}
3238
self.session.headers.update(self.HEADER)

0 commit comments

Comments
 (0)