Stremio / stremio-bugs

🐛 Post bug reports in Issues here
65 stars 10 forks source link

web stremio don´t work in catalog #861

Closed manupython84 closed 2 months ago

manupython84 commented 2 months ago

I have an addon that offers a catalog with channels. everything works ok in the stremio app but in web.stremio.com the links of the channels are not loaded when I choose one which does not happen in the desktop app which works perfectly. This is the catalog builder:

builder.defineCatalogHandler(async ({ id, type, extra, config }) => { if (config.key && keys.includes(config.key)) { if (id === "channels_catalog") { try { const channels = await obtenerCanales(); console.log('Canales después de obtenerCanales:');

            const metas = Object.keys(channels).map(key => {
                const channelGroup = channels[key];
                return {
                    id: `channel_${key}`,
                    type: "tv",
                    name: channelGroup.nombre,
                    poster: channelGroup.logo,
                };
            });
            return { metas };
        } catch (err) {
            console.log("Error fetching channels from database:", err);
            return Promise.reject(new Error('Error fetching channels from database.'));
        }
    } else {
        return { metas: [] };
    }
} else {
    return Promise.reject(new Error('Addon key missing or invalid.'));
}

});

I have seen that when I click on the channel inside my catalog the StreamHandler that I have defined does not enter because a request is not made from web.stremio.com thing that if it happens when I do it from the desktop app I receive in the hadler this data: ID: channel_La1 Type: tv

this is my handler: builder.defineStreamHandler(async ({ id }) => {

if (config.key && keys.includes(config.key)) {
    if (id.startsWith("channel_")) { .....

My question is what is the difference between the web and the desktop app when requesting links?

when I use web.stremio the streamhandler does not enter at any moment

TRtomasz commented 2 months ago

Please open issue in https://github.com/Stremio/stremio-addon-sdk and fix your code formatting.