Skip to content

Commit d006774

Browse files
committed
fix: use comprehensive headers to bypass Substack 403 Forbidden protection
1 parent cef3700 commit d006774

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

run_job.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,19 @@
3232

3333
groq_client = Groq(api_key=GROQ_API_KEY) if GROQ_API_KEY else None
3434

35-
# User-Agent más realista para evitar bloqueos (403 Forbidden)
35+
# User-Agent y headers avanzados para evitar bloqueos (403 Forbidden)
3636
HEADERS = {
3737
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
3838
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8',
3939
'Accept-Language': 'es-ES,es;q=0.9,en;q=0.8',
40+
'Referer': 'https://www.google.com/',
41+
'Connection': 'keep-alive',
42+
'Upgrade-Insecure-Requests': '1',
43+
'Sec-Fetch-Dest': 'document',
44+
'Sec-Fetch-Mode': 'navigate',
45+
'Sec-Fetch-Site': 'cross-site',
46+
'Sec-Fetch-User': '?1',
47+
'Cache-Control': 'max-age=0',
4048
}
4149

4250
# ── Helpers ───────────────────────────────────────────────────────────────────

0 commit comments

Comments
 (0)