Omar ID EL MOUMEN commited on
Commit
26aea4d
·
1 Parent(s): 07e2819

Updated no title case

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -98,7 +98,7 @@ async def extract_text_pdf(id_doc: str):
98
  for title in titles:
99
  if title[0] == 1:
100
  main_titles.append(title[1])
101
- return {"message": main_titles, "pub_id": id_doc, "error": False}
102
  else:
103
  print("ID: " + id_doc)
104
  print("URL: " + f"http://arxiv.org/pdf/{id_doc}")
 
98
  for title in titles:
99
  if title[0] == 1:
100
  main_titles.append(title[1])
101
+ return {"message": main_titles, "pub_id": id_doc, "error": False} if len(main_titles) > 0 else {"message": f"No titles, document of {doc.page_count} pages", "pub_id": id_doc, "error": False}
102
  else:
103
  print("ID: " + id_doc)
104
  print("URL: " + f"http://arxiv.org/pdf/{id_doc}")