For the first time ever, Andy and Dan are LIVE and in the same room. Joined by our friend, Jen Majura, we talk Songs, Women in Music and of course the recent changes in Jens's career.
Jen Majura Live from the Ibanez showroom - Guitar Stories 75
//IMAGE 404";
};
imgChecker.src = hqThumb;
}
function processThumbnail(thumb) {
let parentLink = thumb.closest('a');
if (!parentLink || !parentLink.href || !parentLink.href.includes('.html')) return;
let postUrl = parentLink.href;
if (videoCache[postUrl]) {
applyThumb(thumb, videoCache[postUrl]);
return;
}
if (thumb.dataset.fetching === "true") return;
thumb.dataset.fetching = "true";
fetch(postUrl)
.then(response => response.text())
.then(html => {
// We are dropping the DOMParser and using a brute-force Regex on the raw HTML.
// This catches iframes, lazy-loaded data-src attributes, and shortcodes.
let ytMatch = html.match(/(?:youtube(?:-nocookie)?\.com\/(?:embed\/|v\/|watch\?v=|shorts\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})/);
if (ytMatch && ytMatch[1]) {
let videoId = ytMatch[1];
videoCache[postUrl] = videoId;
applyThumb(thumb, videoId);
} else {
thumb.dataset.novideo = "true";
// Visually mark that the script scraped the post but found NO video ID
thumb.innerHTML = "NO YT ID FOUND";
}
})
.catch(err => {
thumb.innerHTML = "FETCH FAILED";
});
}
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
let target = mutation.target;
let currentBg = target.style.backgroundImage || "";
// AGGRESSIVE OVERRIDE: If the image is NOT a YouTube image, and it's supposed to have a video, attack it.
if (!currentBg.includes("ytimg.com") && target.dataset.novideo !== "true") {
processThumbnail(target);
}
}
});
});
function attachGuards() {
document.querySelectorAll('.snippet-thumbnail').forEach(thumb => {
if (!thumb.dataset.guarded) {
observer.observe(thumb, { attributes: true, attributeFilter: ['style'] });
thumb.dataset.guarded = "true";
let currentBg = thumb.style.backgroundImage || "";
if (!currentBg.includes("ytimg.com")) {
processThumbnail(thumb);
}
}
});
}
attachGuards();
setInterval(attachGuards, 1500);
});
//]]>