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

The `extra.filename` property is missing from the callback argument of the `defineSubtitlesHandler` method.

Open wujekbogdan opened this issue 1 year ago • 6 comments

According to the defineSubtitlesHandler docs documentation, the callback function's argument should include an extra.filename property. While the extra object is present, it only contains videoHash and videoSize, vut filename is always undefined.

builder.defineSubtitlesHandler((args) => {
  console.log(args.extra.filename); // undefined
  // ...
})

wujekbogdan avatar Jul 21 '24 12:07 wujekbogdan

what stremio client app are you using for tests? what platform is it from? what version is the app?

the extra properties may or may not be included depending on the app and its capabilities, wether it is connected to a local streaming server or not, this is why it is called "extra", but we cannot assist or investigate without knowing the exact platform and app version that is making the requests to the addon

jaruba avatar Jul 21 '24 14:07 jaruba

  • I'm not using a local streaming server. I'm streaming from Torrentio + Real Debrid
  • macOS desktop app
  • Streamio 4.4.168
  • WebUI 4.4.172
  • Server 4.20.8

// EDIT: I've just tried a few public domain movies, and the filename property is there.

wujekbogdan avatar Jul 21 '24 16:07 wujekbogdan

I've just tried a few public domain movies, and the filename property is there.

@wujekbogdan the desktop app has built-in local streaming server. the streaming server is responsible for making torrents streamable. and while it's doing that it also gets the filename from the torrent which is passed to the subtitles addon. but for HTTP streams, the addon that returns the stream is responsible for providing the filename.

Torrentio / public domain movies addons provide torrents. while Torrentio + RD provides HTTP streams.

dexter21767-dev avatar Jul 23 '24 04:07 dexter21767-dev

Does it mean then it is technically impossible to retrieve files names from HTTP streams or is it just outside Streamio control and has to be addressed by the plugin developer?

wujekbogdan avatar Jul 23 '24 08:07 wujekbogdan

Let me bump the thread. I found a similar issue here: https://github.com/mhdzumair/MediaFusion/issues/214.

From what I understand, it's not that HTTP streams can't provide the file name; it seems that this feature is missing in stremio-core, but it’s technically feasible. Am I right? Should I report the issue on streamio-core?

wujekbogdan avatar Oct 27 '24 09:10 wujekbogdan

@wujekbogdan in the case of http streams, the streams are handled by the video player itself and not stremio. that's why it's not as straight forward to provide the file name. but for torrents, stremio uses it's own torrent engine, which allows it to easily access the filename and other info and provide them directly to the addons.

dexter21767-dev avatar Mar 05 '25 19:03 dexter21767-dev