Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when attempting to download files which posses too long names #150

Open
TheThirdComputer opened this issue Aug 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@TheThirdComputer
Copy link

TheThirdComputer commented Aug 23, 2024

Describe the bug
Certain files have VERY long names which make them impossible to be saved automatically by the program.

To Reproduce

  1. Go to this post = https://kemono.su/patreon/user/2407354/post/97950126
  2. Try and attempt downloading the post complete with command 'ktoolbox download-post'
  3. One of the two files is downloaded normally, but the second one gives next error:

2024-08-23 07:45:35.880 | ERROR | ktoolbox.job.runner:processor:132 - Download failed - {'filename': '97950126_https://www.patreon.com/media-u/Z0FBQUFBQmwxM2Nwd1dnY0pCXzV4WGtOY1I2ZXFQWVBDaUprVk83cVNUSHFSUDBUTjg2OVRpSWRxLVpWVmFzaFkxNEc4eWdDMmdOZ0xkb0ZvY3dfTnRPdFZ6cHBFdklqUDVJOVFOX09kMFhvN3BPU1luOEE2VUtLdDMzdElhODF3NzJsNy1UR2JBakoxQ2FiZXJCRlNHcDBzcmVpVG15THFiZnBrcG9nRGRiQzRicDREU2VmRjRoZllMTjhYaUpOUF90YUlKNnFycGRCQkN5WnJPdVBHbm1DMnB3cUZlbnlkeS1WamZQWm1BSzB0cjNwNVFJeHl2VnExRC1Db1AxNzdZTU5Sdjg1ZVFRQThYbjIxWkozS2laSnQ2M1ZoM2hmZnZiNElTUkhoUXhaMUJEUHpxNGtmaXpXdFFpelRuMnh4c1Z0ekt1Nk5IREE=#274656918_', 'exception': OSError(22, 'Invalid argument')}

  1. When attempted to download manually, I discover the name of the file to be just way too long to be downloaded with its original name, thus my current 'prod.env' configuration being a problem:

KTOOLBOX_JOB__POST_DIRNAME_FORMAT={id} {title} {published} {user} {service}

KTOOLBOX_JOB__POST_STRUCTURE__ATTACHMENTS=./

KTOOLBOX_JOB__COUNT=1

KTOOLBOX_JOB__SEQUENTIAL_FILENAME=True

KTOOLBOX_JOB__FILENAME_FORMAT=[{title}]_{}

KTOOLBOX_JOB__ALLOW_LIST=[".rar",".zip"]

Expected behavior
A possible fix to this, could be for files which their names are identified above 256 characters or with other problems, to automatically be replaced by a single digit number to avoid these possible issues, and perhaps save the original name to its 'post.json' file.

Platform(please complete the following information):

  • OS: Windows
  • Python Version: 3.11.3
@Ljzd-PRO Ljzd-PRO added the bug Something isn't working label Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants