Stremio / stremio-addon-sdk

🧙 A Node.js SDK for creating and publishing Stremio add-ons
https://www.stremio.com/addon-sdk
MIT License
693 stars 182 forks source link

Q: Read/write stremio watched status #212

Open mpetuska opened 1 year ago

mpetuska commented 1 year ago

Is it possible to read and write "watched" status via stremio addon api? I'd like to implement an addon for bidirectional sync between stremio and GoogleTV watchlist.

jaruba commented 1 year ago

This is not possible yet, but it's a really cool idea that could be extended into various use cases (such as recommendation catalogs based on what users watch)

It would theoretically already be possible if a user shares the credentials as there are APIs used internally for retrieving the library items and marking episode progress, but this is obviously a security risk

I'd say that we should leave this issue open and we will think of ways that we could share relevant data with addons in the future

mpetuska commented 1 year ago

The safest way would probably be an internal integration like Trakt scrobbing and would be ideal, but if the team has no capacity for it I'm happy to give it a stab myself once required addon APIs are available.

mpetuska commented 1 year ago

In the meantime could you point me to the watched status APIs you've mentioned? I'll probably implement a private version of the addon for personal use until you can figure out secure ways to obtain tokens.

jaruba commented 1 year ago

There is no documentation for the internal APIs (towards Stremio servers), you can although inspect the page of the web versions when using ur account to extract the session token and see how they interact with the API:

Alternatively, the Stremio Core (written in Rust) is open source and can be seen here: https://github.com/stremio/stremio-core

The core is meant to handle all API communication for all our apps (although it is currently only used in the Android TV app), so the relevant code regarding the APIs is part of it too.

Jenrykster commented 1 year ago

I'm also interested in this API capability, I created an addon that updates Anilist but it's using the subtitles handler to make the requests. That feels way too hacky (and also doesn't work when the user manually marks an episode/movie as watched).

jaruba commented 1 year ago

@Jenrykster for ur case it would be better if addons supported playback events, this is planned but unfortunately not a high priority, as the new redesign releases are taking a lot of our time right now

I am also hoping we implement it sooner rather than later, as community developer interest is quite high

yoanhg421 commented 1 year ago

I made an add on the provides sources for a very old TV show. it was marking the episodes as watched while I was using the IMDB id prefixed but, during the later seasons the episodes are either broken down into parts or edited together in a way that doesn't match IMDB so I added an catalog and meta handler but now it doesn't mark the episodes as watched and it's kind of funky trying to add the series to the library.

I have seen other addons like One Pace that can provide custom catalog and meta, while providing the ability to save progress.

Am I missing a property or something?

All the videos have a [name, url, season, episode, releaseDate] set, but the release date is the same in all of them for simplicity sake.

dexter21767-dev commented 1 year ago

@yoanhg421 i would suggest opening a separate issue for your problem. and in the new issue, can u please provide a link to the addon so we can test it and see what is missing if any?

yoanhg421 commented 1 year ago

@dexter21767-dev Thank you. after a lot fiddling it looks like it was cache on the app. after resetting it looks like I can mark episodes as watched once again.