For this file-name Yemin 245. Bölüm.mp4 having UTF characters the following code in my web-extension works fine in Google Chrome and the file gets downloaded (EDIT: No matter what filename I use this is resulting in error, it seems some update in Firefox broke this). But, firefox fails with error Unchecked lastError value: Error: filename must not contain illegal characters:
So your samples, when pasted don’t have the double whitespace mentioned on stackoverflow. I can reproduce with the text one<space><space>two.txt. Not sure what this is about, but I think you should create a ticket on bugzilla. This doesn’t seem right. You can work arround this by changing your script to replace consecutive whitespace characters with just a single one: