We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8672e4 commit a378225Copy full SHA for a378225
2 files changed
lib/core/utils/youtube_thumbnail_utils.dart
@@ -39,6 +39,24 @@ class YoutubeThumbnailUtils {
39
(url.contains('googleusercontent.com') && !url.contains('ytimg.com'));
40
}
41
42
+ static bool isLikelyLowQualityArtwork(String? raw) {
43
+ final url = _normalizeUrl(raw).toLowerCase();
44
+ if (url.isEmpty) return true;
45
+
46
+ final looksLikeVideoThumb =
47
+ url.contains('ytimg.com/vi/') || url.contains('ytimg.com/vi_webp/');
48
+ if (looksLikeVideoThumb) return true;
49
50
+ if (RegExp(
51
+ r'w(?:60|88|100|120|180|240)-h(?:60|88|100|120|180|240)',
52
+ ).hasMatch(url)) {
53
+ return true;
54
+ }
55
+ if (RegExp(r'=s(?:60|88|100|120|180|240)\b').hasMatch(url)) return true;
56
57
+ return false;
58
59
60
static double preferredArtworkScale({
61
String? songId,
62
String? imageUrl,
0 commit comments