FLZ101 / dl_coursera

A simple, fast, and reliable Coursera crawling & downloading tool
MIT License
142 stars 30 forks source link

FileNotFoundError: [Errno 2] No such file or directory #5

Open Mutalpha opened 4 years ago

Mutalpha commented 4 years ago

Hi,

When attempting to download a course, I encountered the following error:

Traceback (most recent call last): File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\gfc20\Documents\Python Projects\Coursera\venv\Scripts\dl_coursera.exe__main__.py", line 9, in File "c:\users\gfc20\documents\python projects\coursera\venv\lib\site-packages\dl_coursera_run.py", line 180, in main dl_tasks = gather_dl_tasks(args['outdir'], soc) File "c:\users\gfc20\documents\python projects\coursera\venv\lib\site-packages\dl_coursera_run.py", line 89, in gather_dl_tasks dl_tasks = DLTaskGatherer(soc=soc, outdir=outdir).gather() File "c:\users\gfc20\documents\python projects\coursera\venv\lib\site-packages\dl_coursera\DLTaskGatherer.py", line 48, in gather with open(filename, 'wb') as ofs: FileNotFoundError: [Errno 2] No such file or directory: 'path\machine-learning-asset-management-alternative-data\02@textual-analysis-for-financial-applicati\02@lab-sessions\04@extra-materials-on-textual-analysis-for-\01@extra-materials-on-textual-analysis-for-.html'

I checked the directory and indeed found it empty. Below is the command used:

dl_coursera --cookies cookies.txt --slug machine-learning-asset-management-alternative-data --how builtin --outdir path

Please help and thank you in advance!

FLZ101 commented 4 years ago

You need to disable the Windows path length limit of 260 characters, and google will help you find the instructions for your Windows version.