fix(media utils): use 0.jpg instead of sddefault for youtube thumbnails, some wouldn't load the specific sd res

This commit is contained in:
plebeius.eth
2024-01-03 13:28:56 +01:00
parent 8d0e73bc0c
commit 8bcded4237

View File

@@ -41,7 +41,7 @@ const getCommentMediaInfo = (comment: Comment) => {
if (['youtube.com', 'www.youtube.com', 'youtu.be'].includes(host)) {
const videoId = host === 'youtu.be' ? url.pathname.slice(1) : url.searchParams.get('v');
patternThumbnailUrl = `https://img.youtube.com/vi/${videoId}/sddefault.jpg`;
patternThumbnailUrl = `https://img.youtube.com/vi/${videoId}/0.jpg`;
} else if (host.includes('streamable.com')) {
const videoId = url.pathname.split('/')[1];
patternThumbnailUrl = `https://cdn-cf-east.streamable.com/image/${videoId}.jpg`;