style youtube cards
This commit is contained in:
parent
61e822bf6f
commit
58f7fdb005
2 changed files with 1500 additions and 1473 deletions
|
|
@ -513,7 +513,7 @@ class YouTubeClient:
|
||||||
video_id = entry.get('id', '')
|
video_id = entry.get('id', '')
|
||||||
filename = f"{video_id}||{title}" # Store video_id and title for later download
|
filename = f"{video_id}||{title}" # Store video_id and title for later download
|
||||||
|
|
||||||
return TrackResult(
|
track_result = TrackResult(
|
||||||
username="youtube", # YouTube doesn't have users - use constant
|
username="youtube", # YouTube doesn't have users - use constant
|
||||||
filename=filename,
|
filename=filename,
|
||||||
size=file_size,
|
size=file_size,
|
||||||
|
|
@ -528,6 +528,11 @@ class YouTubeClient:
|
||||||
album=None, # YouTube videos don't have album info (will be added from Spotify)
|
album=None, # YouTube videos don't have album info (will be added from Spotify)
|
||||||
track_number=None
|
track_number=None
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Add thumbnail for frontend (surgical addition)
|
||||||
|
track_result.thumbnail = entry.get('thumbnail')
|
||||||
|
|
||||||
|
return track_result
|
||||||
|
|
||||||
async def search(self, query: str, timeout: int = None, progress_callback=None) -> tuple[List[TrackResult], List[AlbumResult]]:
|
async def search(self, query: str, timeout: int = None, progress_callback=None) -> tuple[List[TrackResult], List[AlbumResult]]:
|
||||||
"""
|
"""
|
||||||
|
|
@ -564,8 +569,8 @@ class YouTubeClient:
|
||||||
}
|
}
|
||||||
|
|
||||||
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
||||||
# Search YouTube (max 10 results)
|
# Search YouTube (max 50 results)
|
||||||
search_results = ydl.extract_info(f"ytsearch10:{query}", download=False)
|
search_results = ydl.extract_info(f"ytsearch50:{query}", download=False)
|
||||||
|
|
||||||
if not search_results or 'entries' not in search_results:
|
if not search_results or 'entries' not in search_results:
|
||||||
return []
|
return []
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue