Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,6 +31,13 @@ def process():
|
|
| 31 |
print('4')
|
| 32 |
|
| 33 |
# Ensure 'pdftotext.texts_from_pdf' is a valid function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
pdftext = pdftotext.texts_from_pdf(filePath)
|
| 35 |
print('5')
|
| 36 |
|
|
|
|
| 31 |
print('4')
|
| 32 |
|
| 33 |
# Ensure 'pdftotext.texts_from_pdf' is a valid function
|
| 34 |
+
filePath = filePath.replace('?dl=0', '?dl=1')
|
| 35 |
+
|
| 36 |
+
# Download the PDF
|
| 37 |
+
response = requests.get(pdf_link)
|
| 38 |
+
with open('downloaded_file.pdf', 'wb') as file:
|
| 39 |
+
file.write(response.content)
|
| 40 |
+
print(response.content)
|
| 41 |
pdftext = pdftotext.texts_from_pdf(filePath)
|
| 42 |
print('5')
|
| 43 |
|