dobomode / coursera-scraper

A lightweight Node.js app to fetch assets / videos for Coursera courses.
MIT License
43 stars 14 forks source link

[SOLVED] BUG: coursera-scraper fails to download when title includes colon ':' #5

Closed phk-himself closed 3 years ago

phk-himself commented 3 years ago

First, thanks a lot for the good tool.

One bug I found in Windows, using latest verison of Node is that if the title of a module contains a colon, the tool will fail when trying to create the corresponding directory.

    Module #02 - Episode 2: Meeting the CFO (Day 3)
      Video #01 - Downloading 720p lecture video
Error: ENOENT: no such file or directory, mkdir 'C:\Users\REDACTED\Documents\Coursera\leadership-21st-century\Week 02\02 - Episode 2: Meeting the CFO (Day 3)'
Unable to download video.

Course used for the example is: leadership-21st-century

Possible solution would be to replace forbidden filename characters when creating files and directories.

VBodrov commented 3 years ago

Same problem here. Is there workaround to skip videos with «:» in caption?

dobomode commented 3 years ago

Hi everyone, I am a bit short on time this week. This should be an easy fix - care to submit a pull request?