fix: make search usable again

This commit is contained in:
Max Richter
2025-11-05 00:42:53 +01:00
parent 7664abe089
commit 581f1c1926
9 changed files with 120 additions and 62 deletions

View File

@@ -74,6 +74,11 @@ export interface PageInfo {
resultsPerPage: number;
}
export async function getYoutubeVideoCover(id: string): Promise<ArrayBuffer> {
const res = await fetch(`https://i.ytimg.com/vi/${id}/maxresdefault.jpg`);
return res.arrayBuffer();
}
export async function getYoutubeVideoDetails(
id: string,
): Promise<Item> {
@@ -81,6 +86,5 @@ export async function getYoutubeVideoDetails(
`${BASE_URL}videos?part=snippet%2CcontentDetails%2Cstatistics&id=${id}&key=${YOUTUBE_API_KEY}`,
);
const json = await response.json();
return json?.items[0];
}