BurningSands70 / stremio-downloader

An application that allows downloading streams from Stremio.
256 stars 21 forks source link

Download fails with unsupported characters in titles #10

Closed dewrano closed 4 years ago

dewrano commented 4 years ago

Hi,

Thank you for streamio-downloader. I've noticed an issue where download fails if there's an unsupported character in the title. Example: The title for Brooklyn Nine-Nine S01E15 is "Operation: Broken Feather". The colon in the title results in the file not being downloaded on Windows; an empty file with 0 bytes is generated.

Using regex to replace colons on the following line allowed me to successfully download the file: https://github.com/BurningSands70/stremio-downloader/blob/22dec1f68758099a32e35dbedf7c88dfe6cbe025/lib/inject.html#L47

Auroric commented 4 years ago

@dewrano I'm having the same issue, do you mind sending how you did the regex to remove the colon? I don't have much experience with js and would greatly appreciate the help. Thanks!

sleeyax commented 4 years ago

@Auroric haven't tried it yet, but const title = $('#windowTitle').text().trim().replace(/:/g, " ") should replace all colons with spaces

Auroric commented 4 years ago

To be completely safe, I got it to replace all non-alphanumeric characters with spaces: const title = $('#windowTitle').text().trim().replace(/[\W_]+/g," ") Just tested it and it's now working fine.

BurningSands70 commented 4 years ago

I don't think we need to break the title for this to work..

Basically, the illegal characters on Windows are: < > : " / \ | ? * And on OSX / Linux only: /

I'll fix it, but not sure when I'll get a chance to rebuild the project in order to make a new release..

BurningSands70 commented 4 years ago

This is the proper solution imo: https://github.com/BurningSands70/stremio-downloader/commit/6ca03a6dfbd6ef488ca5f1c1f0f0848eb581ac09

BurningSands70 commented 4 years ago

I'll try to make a new release with this change by the end of the month.. Sorry, I simply might not be able to sooner as I'm stuck away from home.

BurningSands70 commented 4 years ago

I've just released v1.0.5 that should fix this bug: https://github.com/BurningSands70/stremio-downloader/releases/tag/v1.0.5

Please test it and reopen this issue if the problem persists.