Capture YouTube titles from Discord's embed cache
This commit is contained in:
@@ -885,3 +885,9 @@
|
||||
font: 400 11px/1.5 ui-monospace, Menlo, monospace;
|
||||
color: var(--color-neutral-500);
|
||||
}
|
||||
|
||||
.vk-media-viewer-title {
|
||||
font: 600 13px/1.5 ui-monospace, Menlo, monospace;
|
||||
color: var(--color-text);
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
@@ -2669,6 +2669,18 @@
|
||||
}
|
||||
|
||||
meta.replaceChildren();
|
||||
|
||||
// The clip title matters most for finding footage; show it big when we have one.
|
||||
const heading =
|
||||
item.title || (item.titleError && (item.provider ?? "").toLowerCase().includes("youtube"))
|
||||
? item.title
|
||||
? `${item.title}${item.titleAuthor ? ` — ${item.titleAuthor}` : ""}`
|
||||
: "Video unavailable (removed or private)"
|
||||
: "";
|
||||
if (heading) {
|
||||
meta.append(el("div", "vk-media-viewer-title", heading));
|
||||
}
|
||||
|
||||
const values = metaValues(item);
|
||||
for (const [key, label] of META_FIELDS) {
|
||||
if (!values[key]) continue;
|
||||
|
||||
Reference in New Issue
Block a user