Skip to content

Return valid error message for No valid URL to decipher #246

@unixfox

Description

@unixfox

For this error:

Error: No valid URL to decipher
    at Player.decipher (https://cdn.jsdelivr.net/gh/LuanRT/[email protected]/deno/src/core/Player.ts:138:13)
    at Format.decipher (https://cdn.jsdelivr.net/gh/LuanRT/[email protected]/deno/src/parser/classes/misc/Format.ts:248:19)
    at youtubePlayerParsing (file:///tmp/deno-compile-invidious_companion/invidious-companion/src/lib/helpers/youtubePlayerHandling.ts:113:30)
    at eventLoopTick (ext:core/01_core.js:179:7)
    at async file:///tmp/deno-compile-invidious_companion/invidious-companion/src/routes/youtube_api_routes/player.ts:43:13
    at async dispatch (https://jsr.io/@hono/hono/4.7.4/src/compose.ts:51:17)
    at async bearerAuth (https://jsr.io/@hono/hono/4.7.4/src/middleware/bearer-auth/index.ts:157:5)
    at async dispatch (https://jsr.io/@hono/hono/4.7.4/src/compose.ts:51:17)
    at async logger (https://jsr.io/@hono/hono/4.7.4/src/middleware/logger/index.ts:91:5)
    at async dispatch (https://jsr.io/@hono/hono/4.7.4/src/compose.ts:51:17)

Return a valid error message to invidious like in

if (config.jobs.youtube_session.po_token_enabled && !tokenMinter) {
return c.json({
playabilityStatus: {
status: "ERROR",
reason: TOKEN_MINTER_NOT_READY_MESSAGE,
errorScreen: {
playerErrorMessageRenderer: {
reason: {
simpleText: TOKEN_MINTER_NOT_READY_MESSAGE,
},
subreason: {
simpleText: TOKEN_MINTER_NOT_READY_MESSAGE,
},
},
},
},
});
}

return c.json({
    playabilityStatus: {
        status: "ERROR",
        reason: TOKEN_MINTER_NOT_READY_MESSAGE,
        errorScreen: {
            playerErrorMessageRenderer: {
                reason: {
                    simpleText: TOKEN_MINTER_NOT_READY_MESSAGE,
                },
                subreason: {
                    simpleText: TOKEN_MINTER_NOT_READY_MESSAGE,
                },
            },
        },
    },
});

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions