Marthee commited on
Commit
f79d675
·
verified ·
1 Parent(s): 8624b22

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -53,17 +53,21 @@ def download_pdf():
53
  # Parse and decode pdfLink safely
54
  # full_query_string = request.query_string.decode()
55
  # parsed_params = urllib.parse.parse_qs(full_query_string)
56
- # print(parsed_params)
57
  # encoded_pdf_link = parsed_params.get('pdfLink', [None])[0]
58
- # Get PDF link and keyword from finddata()
59
- pdf_link = finddata()
60
 
61
- if not pdf_link:
62
- return "Missing pdfLink parameter.", 400
63
 
64
- # Decode the URL-encoded PDF link
65
  # pdf_link = urllib.parse.unquote(encoded_pdf_link)
66
  # print("Extracted PDF Link:", pdf_link)
 
 
 
 
67
 
68
  try:
69
  # Use InitialMarkups to extract content
 
53
  # Parse and decode pdfLink safely
54
  # full_query_string = request.query_string.decode()
55
  # parsed_params = urllib.parse.parse_qs(full_query_string)
56
+ # # print(parsed_params)
57
  # encoded_pdf_link = parsed_params.get('pdfLink', [None])[0]
58
+ # # Get PDF link and keyword from finddata()
59
+ # # pdf_link = finddata()
60
 
61
+ # if not encoded_pdf_link:
62
+ # return "Missing pdfLink parameter.", 400
63
 
64
+ # # Decode the URL-encoded PDF link
65
  # pdf_link = urllib.parse.unquote(encoded_pdf_link)
66
  # print("Extracted PDF Link:", pdf_link)
67
+ pdf_link = request.get_json()
68
+ if not pdf_link:
69
+ return "Missing pdfLink in request body.", 400
70
+
71
 
72
  try:
73
  # Use InitialMarkups to extract content