feat: add YouTube search to !play and fix NA URL fallback

Non-URL input (e.g. !play classical music) searches YouTube for 10
results and picks one randomly. Also fixes --flat-playlist returning
"NA" as the URL for single videos by falling back to the original
input URL.
This commit is contained in:
user
2026-02-21 23:52:01 +01:00
parent 6b7d733650
commit e4e1e219f0
4 changed files with 67 additions and 5 deletions

View File

@@ -1566,6 +1566,7 @@ and voice transmission.
```
!play <url|playlist> Play audio or add to queue (playlists expanded)
!play <query> Search YouTube, play a random result
!stop Stop playback, clear queue
!skip Skip current track
!queue Show queue
@@ -1576,6 +1577,8 @@ and voice transmission.
```
- Queue holds up to 50 tracks
- Non-URL input is treated as a YouTube search; 10 results are fetched
and one is picked randomly
- Playlists are expanded into individual tracks; excess tracks are
truncated at the queue limit
- Volume changes ramp smoothly over ~200ms (no abrupt jumps)