r0oth3x49 / acloud-dl

A cross-platform python based utility to download courses from acloud.guru for personal offline use.
MIT License
351 stars 142 forks source link

Fix for long paths and filenames in Windows #35

Closed freddy2659 closed 4 years ago

freddy2659 commented 4 years ago

Current solution is to shorten the filename to 100 chars + '.' + extension if the length is > 110.

See 'AWS Certified Advanced Networking - Specialty 2020\03 Configure Network Integration with Application Services\013 Maintaining Transport Layer Security All the Way to Your Container Using the Network Load Balanc....txt' for more information.

r0oth3x49 commented 4 years ago

@jonohein nice one to use the range input, thanks for that. if you can make a bit cleaner and explain then i will merge the PR or i will do it by my self.

if os.name == "nt" and len(filepath) > 250:
    filepath = u"\\\\?\\{}".format(filepath)
freddy2659 commented 4 years ago

How's that? I've tested the change and it's working correctly