YchKhan commited on
Commit
ad19789
·
verified ·
1 Parent(s): fc23b79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -147,9 +147,12 @@ def analyze_pdf_novelty(patent_background, pdf_url):
147
  try:
148
  # Disable SSL warnings
149
  urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
150
-
 
 
 
151
  # Download PDF
152
- response = requests.get(pdf_url, timeout=10, verify=False)
153
  if response.status_code != 200:
154
  return {"error": f"Failed to download PDF (status code: {response.status_code})"}
155
 
 
147
  try:
148
  # Disable SSL warnings
149
  urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
150
+ headers = {
151
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
152
+ "Accept": "application/pdf"
153
+ }
154
  # Download PDF
155
+ response = requests.get(pdf_url, headers=headers, timeout=10, verify=False)
156
  if response.status_code != 200:
157
  return {"error": f"Failed to download PDF (status code: {response.status_code})"}
158