From 235d83fb7316a3e7e3add15feaa1758e2540bf69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ho=C3=A0ng=20Gia=20B=E1=BA=A3o?= <70064328+YT-Advanced@users.noreply.github.com> Date: Sat, 11 Jan 2025 00:21:45 +0700 Subject: [PATCH] perf(Alternative Thumbnails): Skip verify still images of live videos --- .../alternativethumbnails/AlternativeThumbnailsPatch.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/alternativethumbnails/AlternativeThumbnailsPatch.java b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/alternativethumbnails/AlternativeThumbnailsPatch.java index aa97508533..6f7b3a9b02 100644 --- a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/alternativethumbnails/AlternativeThumbnailsPatch.java +++ b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/alternativethumbnails/AlternativeThumbnailsPatch.java @@ -293,16 +293,17 @@ public static String overrideImageURL(String originalUrl) { return originalUrl; } + final boolean shouldUseStillImages = option.useStillImages && !originalUrl.contains("live"); String sanitizedReplacementUrl; final boolean includeTracking; if (option.useDeArrow && canUseDeArrowAPI()) { includeTracking = false; // Do not include view tracking parameters with API call. - final String fallbackUrl = option.useStillImages + final String fallbackUrl = shouldUseStillImages ? buildYoutubeVideoStillURL(decodedUrl, qualityToUse) : decodedUrl.sanitizedUrl; sanitizedReplacementUrl = buildDeArrowThumbnailURL(decodedUrl.videoId, fallbackUrl); - } else if (option.useStillImages) { + } else if (shouldUseStillImages) { includeTracking = true; // Include view tracking parameters if present. sanitizedReplacementUrl = buildYoutubeVideoStillURL(decodedUrl, qualityToUse); } else {