Sorien / plugin.video.sl

MIT License
10 stars 18 forks source link

More info about the Solocoo API #65

Closed michaelarnauts closed 3 years ago

michaelarnauts commented 3 years ago

Hi @Sorien and @cache-sk,

I've discovered your add-ons while I was working on my add-on (plugin.video.tvvlaanderen) for TV Vlaanderen that seems to be using the same API.

There are also more add-ons that use the same API:

My initial goal was to create a base Add-on that could be used for all providers that use the solocoo api. There could be a build system that would package all the different add-ons for all the operators, there are quite a few of them. I have a repo for that here: https://github.com/add-ons/plugin.video.solocoo, but there is no code there yet.

Now, my add-on is functional, and it doesn't have any requirements on a remote server to fetch the EPG data from (this is really important for me, as I want to include my addon in the Kodi repository). I want to use only the solocoo API for this, so nothing self-hosted on a remote server.

I'm now looking at the API that is being used for the EPG, and it seems there are two api's. One is on https://tvapi.solocoo.tv and the other is on https://m7be2.solocoo.tv/m7be2iphone/capi.aspx. The last one seems to be on a different subdomain for each provider, but the API looks like to be the same.

I've tried to do everything with the first API (since it's global and could be easily reused), but I've noticed that I don't have an description for the EPG when using that API, while there is a EPG description on the other API (capi.aspx). So I'm looking into that, and I then stumbled upon this code in your add-on:

            is_stream = (len(data[1]) > (idx >> 5)) and (data[1][idx >> 5] & (1 << (idx & 31)) > 0)
            is_live = (len(data[3][0]) > (idx >> 5)) and (data[3][0][idx >> 5] & (1 << (idx & 31)) > 0)
            is_replayable = (c['flags'] & 2048) > 0
            is_pin_protected = (c['flags'] & 256) > 0

Do you know more about the data[3] fields? I don't really find a logic in them, but they do seem to indicate if a channel is in your package.

I think it might be a good idea to work together on this?

Sorien commented 3 years ago

that code was probably found in their web player in some JS file and rewrote to python I can't find original source but some pieces can be found at https://livetv.skylink.sk/static/js/Channels/channels.api.ts

I don't have any active subscription to that service so I can't help you more :/

michaelarnauts commented 3 years ago

Ow, nice, thanks for pointing me there. I didn't know they also host the .map files, so a clear source code can be constructed!

Sorien commented 3 years ago

yeah that's something new :)