diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-07-16 13:30:35 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-07-16 14:17:17 +0200 |
| commit | a9b6aa1652166eb7f871735ba6833e2bdb888e50 (patch) | |
| tree | 35f820f0af629ba62e4c5e41a28e487351581603 /youtube.go | |
| parent | 53d46753d0c4b312df9c0151089eae3891aa4add (diff) | |
| download | WRMS-a9b6aa1652166eb7f871735ba6833e2bdb888e50.tar.gz WRMS-a9b6aa1652166eb7f871735ba6833e2bdb888e50.zip | |
add more song info and preparations for advanced search
Diffstat (limited to 'youtube.go')
| -rw-r--r-- | youtube.go | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -27,8 +27,13 @@ type YoutubeDlSearchResult struct { Title string } -func (b *YoutubeBackend) Search(pattern string) []Song { - searchOption := fmt.Sprintf("ytsearch%d:%s", b.searchResults, pattern) +func (b *YoutubeBackend) Search(patterns map[string]string) []Song { + pattern := "" + for _, v := range patterns { + pattern += v + " " + } + + searchOption := fmt.Sprintf("ytsearch%d:%s", b.searchResults, pattern[:len(pattern)-1]) llog.Debug("Search youtube using: youtube-dl -j %s", searchOption) results, err := exec.Command("yt-dlp", "-j", searchOption).Output() |
