reddsaver icon indicating copy to clipboard operation
reddsaver copied to clipboard

--human-readable flag tries to create invalid filenames on Windows

Open nathanielhudson opened this issue 3 years ago • 2 comments
trafficstars

Hello!

I'm using Windows 10. Reddscaver, when using the --human-readable flag, will try to faithfully reproduce Reddit post titles as filenames that include invalid characters like "?". This results in a "WARN reddsaver::download] Could not create a file with the name: reddsaver/exampleSubreddit/this_is_an_example?_t3_abcdef.jpg. Skipping" and nothing is saved.

Ideally Reddsaver would strip invalid characters before attempting to save.

nathanielhudson avatar Feb 27 '22 15:02 nathanielhudson

Actually, it looks like it's stripping some invalid characters, but missing some others (on windows).

https://github.com/manojkarthick/reddsaver/blob/e2e7573b9ed20a370db9f25077a0f430562aabce/src/download.rs#L380

nathanielhudson avatar Feb 27 '22 15:02 nathanielhudson

Thanks! Would you be able to share a link to an example post that causes this issue? I don’t use a Windows PC so I haven’t encountered the issue.

manojkarthick avatar Feb 27 '22 16:02 manojkarthick