hareku / fanbox-dl

Pixiv Fanbox Downloader
MIT License
143 stars 17 forks source link

Backspace control character (U+0008) in string breaks filepath.Join #38

Open S52968 opened 3 months ago

S52968 commented 3 months ago

I don't know why but Fanbox allows the backspace character in titles.

Line 83 of client.go has an error because filepath.Join() loses the slash when the previous string terminates with a backspace control character.

For example: filepath.Join("ab", "test.txt") is expected to result in ab/test.txt (since you can't see the backspace), but instead you get abtest.txt.

I think it's a bug in the package, but it can be circumvented by removing non-printable characters. I'm not a Go dev but I messed around a little bit and used this code: https://gosamples.dev/remove-non-printable-characters/ and got it to work.