I tried running the CLI to download one of my medium posts via the following command:
node ./index.js https://medium.com/@ChristianWilkie/setting-up-a-free-ghost-blog-on-google-cloud-platform-and-cloudflare-c9bc79861a0e
I got an error:
PS C:\Users\chris\Desktop\medium\mediumexporter> node ./index.js https
://medium.com/@ChristianWilkie/setting-up-a-free-ghost-blog-on-google-cl
oud-platform-and-cloudflare-c9bc79861a0e
image https://cdn-images-1.medium.com/max/2000/1*4zonAsqpNEPQwT8XGNIKQQ.png 1*4zonAsqpNEPQwT8XGNIKQQ.png
something went wrong
{ Error: ENOENT: no such file or directory, open 'content\setting-up-a-free-ghost-blog-on-google-cloud-platform-and-cloudflare\images/1*4zonAsqpNEPQwT8XGNIKQQ.png'
at Object.openSync (fs.js:438:3)
at Object.writeFileSync (fs.js:1189:35)
at Object.downloadImages (C:\Users\chris\Desktop\medium\mediumexporter\lib\utils.js:20:8)
at process._tickCallback (internal/process/next_tick.js:68:7)
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path:
'content\\setting-up-a-free-ghost-blog-on-google-cloud-platform-and-cloudflare\\images/1*4zonAsqpNEPQwT8XGNIKQQ.png' }
I can add a PR with the module added in case it's helpful/for your review. I don't really write much nodejs at all so I dunno if what I wrote is terrible/buggy but it seemed to work when I tried it.
I tried running the CLI to download one of my medium posts via the following command:
node ./index.js https://medium.com/@ChristianWilkie/setting-up-a-free-ghost-blog-on-google-cloud-platform-and-cloudflare-c9bc79861a0e
I got an error:
It seems related to running it on windows and the '' in the filename of one of the images: https://cdn-images-1.medium.com/max/800/14zonAsqpNEPQwT8XGNIKQQ.png
In Windows it seems like the character isn't allowed in filenames. I noticed when I try to save it in chrome it replaces the with _
ex: 1*4zonAsqpNEPQwT8XGNIKQQ.png -> 1_4zonAsqpNEPQwT8XGNIKQQ.png
Here's a list of forbidden filename characters on Windows: https://docs.microsoft.com/en-us/windows/desktop/msi/filename
not really sure of the best solution, maybe you could use something like this: https://github.com/parshap/node-sanitize-filename
when I tried hacking it in it seemed to work:
I can add a PR with the module added in case it's helpful/for your review. I don't really write much nodejs at all so I dunno if what I wrote is terrible/buggy but it seemed to work when I tried it.
Thanks for your time! :)