mirror of
https://github.com/nexus-stc/hyperboria
synced 2024-12-03 16:32:54 +01:00
10 lines
192 B
Python
10 lines
192 B
Python
|
from pdfminer.high_level import extract_text
|
||
|
|
||
|
|
||
|
def is_pdf(path_to_file):
|
||
|
try:
|
||
|
extract_text(path_to_file, maxpages=1)
|
||
|
return True
|
||
|
except Exception:
|
||
|
return False
|