dgorissen / coursera-dl

A script for downloading course material (video's, pdfs, quizzes, etc) from coursera.org
http://dirkgorissen.com/2012/09/07/coursera-dl-a-coursera-download-script/
GNU General Public License v3.0
1.74k stars 300 forks source link

Command line option for file name trimming in long paths to prevent long path issues in Windows #54

Closed ilfats closed 11 years ago

ilfats commented 11 years ago

Added a command line option -t to set maximum path length. File names in long paths will be truncated to fit the specified maximum length. The recommended parameter is 259. Directory names are not affected as trimming folder names would require more changes in different parts of the code. So if file name can't be trimmed to fit the specified length, it is not changed and file will not be downloaded just as it happened before this fix. However, my ~20 courses downloaded fine with "-t 259".

dgorissen commented 11 years ago

Cool, thanks very much. I will merge this but modify it slightly so path clipping happens automatically on windows and filename clipping on both windows and lniux (with an explicit option of turning it off). Given how many people bump into this it seems better.


Web / Blog : http://dirkgorissen.com Twitter : https://twitter.com/elazungu

On Mon, Jun 10, 2013 at 4:50 PM, ilfats notifications@github.com wrote:

Added a command line option -t to set maximum path length. File names in long paths will be truncated to fit the specified maximum length. The recommended parameter is 259. Directory names are not affected as trimming folder names would require more changes in different parts of the code. So if file name can't be trimmed to fit the specified length, it is not changed and file will not be downloaded just as it happened before this fix. However, my ~20 courses downloaded fine with "-t 259".


You can merge this Pull Request by running

git pull https://github.com/ilfats/coursera-dl master

Or view, comment on, or merge it at:

https://github.com/dgorissen/coursera-dl/pull/54

Commit Summary

Added long path trimming option to avoid long path issues in Windows

File Changes

M courseradownloader/courseradownloader.py (38)

Patch Links:

https://github.com/dgorissen/coursera-dl/pull/54.patch https://github.com/dgorissen/coursera-dl/pull/54.diff