Update youtube_client.py

This commit is contained in:
Broque Thomas 2026-01-04 15:02:41 -08:00
parent 58f7fdb005
commit 381e43c76b

View file

@ -530,7 +530,15 @@ class YouTubeClient:
)
# Add thumbnail for frontend (surgical addition)
track_result.thumbnail = entry.get('thumbnail')
# In fast mode (extract_flat), 'thumbnail' might be missing, but 'thumbnails' list exists
thumbnail = entry.get('thumbnail')
if not thumbnail and entry.get('thumbnails'):
# Pick the last thumbnail (usually highest quality)
thumbs = entry.get('thumbnails')
if isinstance(thumbs, list) and thumbs:
thumbnail = thumbs[-1].get('url')
track_result.thumbnail = thumbnail
return track_result
@ -556,7 +564,7 @@ class YouTubeClient:
ydl_opts = {
'quiet': True,
'no_warnings': True,
'extract_flat': False,
'extract_flat': True, # Fast mode: Don't fetch formats (massive speedup)
'default_search': 'ytsearch',
# Bot detection bypass (same as download options)
'extractor_args': {