Skip to content

Commit 3a15384

Browse files
committed
chore: set api captions Access-Control-Allow-Origin to all
1 parent f8296a5 commit 3a15384

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/routes/invidious_routes/captions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ captionsHandler.get("/:videoId", async (c) => {
6464
invidiousAvailableCaptionsArr.push({
6565
label: caption_track.name.text || "",
6666
languageCode: caption_track.language_code,
67-
url: `/api/v1/captions/${videoId}?label=${
67+
url: `${config.server.base_path}/api/v1/captions/${videoId}?label=${
6868
encodeURIComponent(caption_track.name.text || "")
6969
}`,
7070
});
@@ -89,6 +89,7 @@ captionsHandler.get("/:videoId", async (c) => {
8989
if (filterSelected.length == 0) throw new HTTPException(404);
9090

9191
c.header("Content-Type", "text/vtt; charset=UTF-8");
92+
c.header("Access-Control-Allow-Origin", "*");
9293
return c.body(
9394
await handleTranscripts(innertubeClient, videoId, filterSelected[0]),
9495
);

0 commit comments

Comments
 (0)