Skip to content

Commit

Permalink
perf(Alternative Thumbnails): Skip verify still images of live videos
Browse files Browse the repository at this point in the history
  • Loading branch information
YT-Advanced authored Jan 10, 2025
1 parent 18cd39b commit 235d83f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 235d83f

Please sign in to comment.