Do not use deprecated PyPDF2 things

This commit is contained in:
2023-02-05 00:35:51 +01:00
parent b9fdcb2cef
commit 23cad3acb7

View File

@ -145,11 +145,11 @@ def download_ov_land(bundesland: str) -> List[OvRow]:
for chunk in r.iter_content(chunk_size=8192):
f.write(chunk)
pdf = PyPDF2.PdfFileReader(f)
pdf = PyPDF2.PdfReader(f)
valid = False
for page in pdf.pages:
page_num = pdf.getPageNumber(page)
text = page.extractText()
page_num = pdf.get_page_number(page)
text = page.extract_text()
if len(text) < 100:
if text.strip().replace(' ', '') == 'Ortsverzeichnis':