leotaku / kojirou

Generate perfectly formatted Kindle e-books from MangaDex manga
MIT License
94 stars 9 forks source link

Downloads fail if Manga name contains illegal characters #4

Closed dkuester closed 2 years ago

dkuester commented 2 years ago

If the Manga contains an illegal character, like in Deadpool: Samurai (https://mangadex.org/title/ef6319e9-9986-4990-a69b-2791d9af8846/), the download fails. At least on Windows, filenames and directories cannot contain colons.

Here's the full error message: Error: write: mkdir kindle/documents/Deadpool: Samurai: The directory name is invalid.

leotaku commented 2 years ago

That is annoying... I'll probably solve this by implementing some custom filename normalisation.

For the time being, you should be able to sidestep this issue by not enabling kindle-folder-mode and manually setting the output directory. E.g.:

kojirou f6319e9-9986-4990-a69b-2791d9af8846 -l en -o 'Deadpool - Samurai'
leotaku commented 2 years ago

Illegal characters will now be replaced based on the value of runtime.GOOS and a hardcoded list of transformations. Most characters are replaced by their corresponding Unicode full width equivalents.