Skip to content

Commit cd3895f

Browse files
committed
refactor: remove yt metadata parser
1 parent bbd0a3f commit cd3895f

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/parser/metadata.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -143,30 +143,10 @@ export default class MetadataParser {
143143
if (metaImage) {
144144
return new URL(metaImage, this.#bookmark.url).href;
145145
}
146-
const youtubeThumbnail = this.#getYouTubeThumbnail();
147-
if (youtubeThumbnail) {
148-
return youtubeThumbnail;
149-
}
150146
const src = this.#searchPagePreview();
151147
return src ? new URL(src, this.#bookmark.url).href : null;
152148
}
153149

154-
/**
155-
* Gets YouTube video thumbnail URL from video ID.
156-
* @returns {string|null} The YouTube thumbnail URL, or null if not a YouTube video.
157-
* @private
158-
*/
159-
#getYouTubeThumbnail() {
160-
const { url } = this.#bookmark;
161-
if (!url) return null;
162-
const youtubeMatch = url.match(/(?:youtube\.com\/.*[?&]v=|youtu\.be\/)([^"&?/\s]{11})/);
163-
if (youtubeMatch?.[1]) {
164-
return `https://img.youtube.com/vi/${youtubeMatch[1]}/maxresdefault.jpg`;
165-
}
166-
167-
return null;
168-
}
169-
170150
/**
171151
* Retrieves the domain from the bookmark URL.
172152
* @returns {string} The domain of the bookmark URL.

0 commit comments

Comments
 (0)