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

web stremio don´t work in catalog #861

Closed
manupython84 opened this issue Jul 8, 2024 · 1 comment
Closed

web stremio don´t work in catalog #861

manupython84 opened this issue Jul 8, 2024 · 1 comment

Comments

@manupython84
Copy link

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants