stremio-addon-sdk icon indicating copy to clipboard operation
stremio-addon-sdk copied to clipboard

Subtitles Encoding issues

Open svetlozardraganov opened this issue 11 months ago • 0 comments

Hello,

I'm working on a addon for Cyrillic subtitles and I stuck on encoding issues I don't know how to resolve on my own. Any help would be greatly appreciated.

I found a workaround but it's not ideal and I prefer to resolve the issue rather relying on a workaround. The encoding issue occurs only when working with buffer(memory). When subtitles are downloaded to a file, extracted to a local folder and uploaded to file-sharing service it works as a charm. However when downloading and extracting to buffer/memory it doesn't work.

The interesting part is it doesn't work in Stremio only. If I print the subtitles in NodeJS console it works fine. If I download and open the uploaded subtitles it work fine. If I load the subtitles in VLC it works fine. I tried adding "http://127.0.0.1:11470/subtitles.vtt?from=" as a prefix to the subtitles-URL but unfortunately it doesn't help.

Here is a simplified version of my addon: https://github.com/svetlozardraganov/stremio-hello-world

To switch between buffer and file approach enable/disable the following lines in addons.js

const subtitles_module = require('./lib/subtitles_from_buffer') //<<<<<<<< Load Subs from Buffer
// const subtitles_module = require('./lib/subtitles_from_file')      //<<<<<<<< Load Subs from File

Play any move and the addon will load the following subtitles automatically: https://yavka.net/subs/19089/BG

svetlozardraganov avatar Mar 17 '24 14:03 svetlozardraganov