Omnibus commited on
Commit
e1d439c
·
1 Parent(s): 7beb5cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -9
app.py CHANGED
@@ -106,9 +106,11 @@ def read_pdf_online(url):
106
  print(f"reading {url}")
107
  response = requests.get(url, stream=True)
108
  text=""
 
109
 
110
- if response.status_code == 200:
111
- try:
 
112
  with open(f"test.pdf", "wb") as f:
113
  f.write(response.content)
114
  #f.close()
@@ -121,13 +123,16 @@ def read_pdf_online(url):
121
  text = f'{text}\n{page.extract_text()}'
122
  print(f"PDF_TEXT:: {text}")
123
  return text
124
- except Exception as e:
125
- print (e)
126
- return e
127
- else:
128
- text = response.status_code
129
- print(text)
130
- return text
 
 
 
131
 
132
  VERBOSE = True
133
  MAX_HISTORY = 100
 
106
  print(f"reading {url}")
107
  response = requests.get(url, stream=True)
108
  text=""
109
+ #################
110
 
111
+ #####################
112
+ try:
113
+ if response.status_code == 200:
114
  with open(f"test.pdf", "wb") as f:
115
  f.write(response.content)
116
  #f.close()
 
123
  text = f'{text}\n{page.extract_text()}'
124
  print(f"PDF_TEXT:: {text}")
125
  return text
126
+ else:
127
+ text = response.status_code
128
+ print(text)
129
+ return text
130
+
131
+
132
+ except Exception as e:
133
+ print (e)
134
+ return e
135
+
136
 
137
  VERBOSE = True
138
  MAX_HISTORY = 100