From ea970edbd9c2835e45fba7ed851e7c6354bc5667 Mon Sep 17 00:00:00 2001 From: TheSquashy Date: Sat, 8 Jun 2024 08:16:03 +0000 Subject: [PATCH] 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 Co-committed-by: TheSquashy --- DeGourou/setup/fulfill.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DeGourou/setup/fulfill.py b/DeGourou/setup/fulfill.py index dcd4fd0..f5a9ce6 100644 --- a/DeGourou/setup/fulfill.py +++ b/DeGourou/setup/fulfill.py @@ -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)