retrospect-addon / plugin.video.retrospect

Retrospect is a Kodi video add-on which allows you to watch streams of a number of free and publicly available online TV stream sites.
https://www.rieter.net/content/
GNU General Public License v3.0
112 stars 36 forks source link

SVT Play / TV4 Play GRAPHQL #1659

Closed rgainza closed 7 months ago

rgainza commented 1 year ago

Feature Request

Is your feature request related to a problem? Please describe

The navigation is probably hindered by the structure of the API since Kodi is one thing and the web complete other matter. Controlling the content you fetch through correct requests might make it easier to structurize the navigation.

Describe the solution you'd like

Send queries to the APIs instead of the standard sha256 hash used by the website that are linked to predetermined structure of the api.

Describe alternatives you've considered

Use your free time however you like!

Additional context

Nothing to add

Maybe other services use GRAPHQL as well. Makes things a lot easier to handle.

basrieter commented 1 year ago

I what way is the navigation hindered?

rgainza commented 1 year ago

It works the way you have it today. It's just a suggestion.

If you get control, you can choose to get more information from the API. Get smoother navigation page to page. Eq TvShow => showSeasons => showEpisodes

basrieter commented 1 year ago

The GraphQL api they have is not always as extensive as you might think. It is very tailored down to match the website.

rgainza commented 1 year ago

Just to be clear. Have you figured out how to make GraphQL queries without sha256hash? Everything can be fetched very efficiently from what my knowledge in GraphQL goes.

basrieter commented 1 year ago

Of course, but GraphQL is just a language. What data is available and how it is structured is up to who ever is implementing it in their infrastructure.

rgainza commented 1 year ago

I'm a bit confused. You can always fetch the same information from the same type. So that makes GraphQL by itself very extensive. I thought it was a good suggestion. That way you could easily create operations that would make it easier to match the information Kodi can add.

To me when I read the python code it looks like you copied the hash and operation names instead of creating them yourselves making you forced to use that structure which was queried for from using that hash.

basrieter commented 1 year ago

I know I use the hashes, because those queries are cached and fast and in 90% of the cases contain all data Retropect needs. Your suggestion is to try to create a new nesting structure using actual GraphQL queries. But that is not always possible.

For example: if there is no GraphQL query that returns all seasons for a show then even a custom query won't fix that. GraphQL defines certain queryies. The hashed queries only represent an easy way of determining what data to include for a certain query.

rgainza commented 1 year ago

The hashes also predetermine the structure in which way the data will be presented forcing you to fetch the data after that structure. Yeah obviously cache might be a good reason for using the same hashes, but I'd argue that you might have created a plugin that would quickly get those queires cached as well seeing the many users that it has.

Your example is very dooming for a streaming service and I get you probably made that just to make the point clear, but let me answer you anyway. In those cases you handle the exceptions with other queries to get the seasons. If it works for the streaming service. It will work in other cases.

EDIT: Let me add a perfect example for where this could improve the plugin. TV4 does not list the id on the hash query for movies and episodes that are live. Instead they do it on the next page. Change the query and you can already get on the main page.

basrieter commented 7 months ago

I guess this issue is no longer relevant as both TV4 and SVT changed significantly since 2022