Do not use deprecated PyPDF2 things
This commit is contained in:
@ -145,11 +145,11 @@ def download_ov_land(bundesland: str) -> List[OvRow]:
|
|||||||
for chunk in r.iter_content(chunk_size=8192):
|
for chunk in r.iter_content(chunk_size=8192):
|
||||||
f.write(chunk)
|
f.write(chunk)
|
||||||
|
|
||||||
pdf = PyPDF2.PdfFileReader(f)
|
pdf = PyPDF2.PdfReader(f)
|
||||||
valid = False
|
valid = False
|
||||||
for page in pdf.pages:
|
for page in pdf.pages:
|
||||||
page_num = pdf.getPageNumber(page)
|
page_num = pdf.get_page_number(page)
|
||||||
text = page.extractText()
|
text = page.extract_text()
|
||||||
|
|
||||||
if len(text) < 100:
|
if len(text) < 100:
|
||||||
if text.strip().replace(' ', '') == 'Ortsverzeichnis':
|
if text.strip().replace(' ', '') == 'Ortsverzeichnis':
|
||||||
|
Reference in New Issue
Block a user