Compare commits

..

2 Commits

Author SHA1 Message Date
Nes370 a6a4308276 Update Mastodon.ts
Remove all references to video preview images.
2026-10-11 10:14:32 -07:00
Nes370 7f51092362 Update Mastodon.ts
Removed thumbnail previews for videos.
2026-10-11 09:59:10 -07:00
1 changed files with 0 additions and 11 deletions

View File

@ -8,7 +8,6 @@ import {
interface Attachment { interface Attachment {
url: string; // original media URL, ?sensitive=true stripped url: string; // original media URL, ?sensitive=true stripped
previewUrl?: string; // poster / cached preview (for video posters)
contentType: ContentType; contentType: ContentType;
} }
@ -66,10 +65,6 @@ export default class Mastodon extends ScrapeEngineBase {
post.contentType = att.contentType; post.contentType = att.contentType;
post.referrer = document.location.origin; post.referrer = document.location.origin;
if (att.contentType === "video" && att.previewUrl) {
post.extraContentUrl = att.previewUrl;
}
result.tryAddPost(post); result.tryAddPost(post);
} }
@ -104,14 +99,12 @@ export default class Mastodon extends ScrapeEngineBase {
if (!rawHref) continue; if (!rawHref) continue;
const img = a.querySelector("img"); const img = a.querySelector("img");
const preview = img?.currentSrc || img?.src;
const url = this.normalizeUrl(rawHref) || this.largestFromSrcset(img); const url = this.normalizeUrl(rawHref) || this.largestFromSrcset(img);
if (!url) continue; if (!url) continue;
add({ add({
url, url,
previewUrl: preview && preview !== url ? preview : undefined,
contentType: this.contentTypeFor(url), contentType: this.contentTypeFor(url),
}); });
} }
@ -125,12 +118,8 @@ export default class Mastodon extends ScrapeEngineBase {
const url = this.normalizeUrl(rawSrc); const url = this.normalizeUrl(rawSrc);
if (!url) continue; if (!url) continue;
// Use the poster as a thumbnail when available.
const poster = v.getAttribute("poster") || undefined;
add({ add({
url, url,
previewUrl: poster && poster !== url ? poster : undefined,
contentType: "video", contentType: "video",
}); });
} }