Update DeGourou/setup/fulfill.py (#4)

add filename truncation to ensure safe filenames

might come back and add filesytem checking later to determine safe filename length

Reviewed-on: https://gitea.com/bipinkrish/DeGourou/pulls/4
Co-authored-by: TheSquashy <thesquashy@noreply.gitea.com>
Co-committed-by: TheSquashy <thesquashy@noreply.gitea.com>
This commit is contained in:
TheSquashy 2024-06-08 08:16:03 +00:00 committed by bipinkrish
parent 7984a6d655
commit ea970edbd9

View file

@ -16,6 +16,8 @@ from .libadobe import sendHTTPRequest_DL2FILE
from .libadobeFulfill import buildRights, fulfill
from .libpdf import patch_drm_into_pdf
maxlen = 60 # probably a good middle ground? will work on ext3/4, ntfs, win10/11 and probably mac
#######################################################################
@ -49,7 +51,7 @@ def download(replyData):
except:
book_name = "Book"
book_name = book_name[0:maxlen]
# Download eBook:
print(download_url)