make regex slightly more robust

This commit is contained in:
Valentin Boettcher 2024-11-06 16:22:05 -05:00
parent 8a1c30198f
commit d443b0e239
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE

View file

@ -63,7 +63,7 @@ def get_download_link(text):
text = quopri.decodestring(text).decode("utf-8", errors="ignore")
logger.debug(text)
m = re.search(r'''href="(https://.*\.amazon\..*?)"''', text)
m = re.search(r'''href="(https://.*\.amazon\..*\.pdf.*?)"''', text)
if not m:
return None, None