fix: make search usable again
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user