vladocar/screenshoteer

Unauthorized characters in file names on windows

marcuslindh opened this issue · 2 comments

Command:
screenshoteer --url https://vk.se
OS:
Windows 10

output:
https://vk.se true (node:32328) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'C:\Users\marcu\Desktop\Västerbottens-Kuriren | Västerbottens nyhetsportal undefined 1543958297443.png' -- ASYNC -- at Page.<anonymous> (C:\Users\marcu\AppData\Roaming\npm\node_modules\screenshoteer\node_modules\puppeteer\lib\helper.js:144:27) at C:\Users\marcu\AppData\Roaming\npm\node_modules\screenshoteer\index.js:45:16 at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) (node:32328) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:32328) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

this character "|" you can not have in a file / folder name on windows

+1 on this. Seeing the exact same thing.
Looks like an image is written using the <title> tag. As such, sites like msn.com and disney.com, which use the pipe (!) character in their titles, run afoul of Windows file naming rules.

I imagine a simple "Windows filename-safe" regex can alleviate this.

Great tool, thanks!

I just updated 1.0.3 version with filename-safe regex.