Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subtitles Handler not being called? #58

Closed
DeadalusVIII opened this Issue Mar 11, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@DeadalusVIII
Copy link

DeadalusVIII commented Mar 11, 2019

Hi,

I am trying to create a subtitle add-on, but I am having trouble getting the call to the defined handler. I've followed the documentation and tried starting from code generated by the the addon-bootstrap, which generated the following code:

const { addonBuilder } = require("stremio-addon-sdk")

// Docs: https://github.com/Stremio/stremio-addon-sdk/blob/master/docs/api/responses/manifest.md
const manifest = {
	"id": "community.TestCoolAddon",
	"version": "0.0.1",
	"catalogs": [],
	"resources": [
		"subtitles"
	],
	"types": [
		"movie",
		"series"
	],
	"name": "Test-Cool-Addon",
	"description": "A nice first addon.",
	"idPrefixes": [
		"tt"
	]
}
const builder = new addonBuilder(manifest)

builder.defineSubtitlesHandler(({type, id}) => {
	console.log("request for subtitles: "+type+" "+id)
	// Docs: https://github.com/Stremio/stremio-addon-sdk/blob/master/docs/api/requests/defineSubtitlesHandler.md
	return Promise.resolve({ subtitles: [] })
})

module.exports = builder.getInterface()

The add-on loads without issues, but the handler defined for the subtitles is not called (I've tried the 'stream' handler, and it was called). Am I missing something?

I looked around for examples featuring subtitles, but I couldn't find any (aside from the documentation), so I'm kind of lost on this matter.

@core1024

This comment has been minimized.

Copy link
Member

core1024 commented Mar 11, 2019

This is an issue in Stremio. It looks like only the first add-on, that provides subtitles is called.
Expect a fix to be rolled soon.
Meanwhile you can test your add-on by disabling all other subtitles related add-ons, namely the Open subtitles one.

You can find the subtitles related documentation here.

@DeadalusVIII

This comment has been minimized.

Copy link
Author

DeadalusVIII commented Mar 11, 2019

Ah, too bad. I'll try that, then. Thanks for the quick response.

@core1024

This comment has been minimized.

Copy link
Member

core1024 commented Mar 13, 2019

The issue is fixed in staging. After a couple of hours it will be available to all users.

Bare in mind that the subtitles resource is identified by OpenSubtitles hash and not IMDB ID, so global idPrefixes in your manifest would not match any subtitles.

If your add-on provides only subtitles I suggest you to remove the idPrefixes property from your manifest.

@core1024 core1024 closed this Mar 13, 2019

@Ivshti

This comment has been minimized.

Copy link
Contributor

Ivshti commented Mar 14, 2019

@DeadalusVIII we've decided we're making some changes to the way subtitles are requested, that will be rolled out on monday:

https://github.com/Stremio/stremio-addon-sdk/releases/tag/v1.1.4
https://github.com/Stremio/stremio-addon-sdk/blob/v1.1.4/docs/api/requests/defineSubtitlesHandler.md

we've exchanged the place of the opensubtitles hash and the videoId, to make the request consistent with other add-on system requests

@DeadalusVIII

This comment has been minimized.

Copy link
Author

DeadalusVIII commented Mar 14, 2019

Makes sense. Thank you for the heads-up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.