diff --git a/src/example/main.cpp b/src/example/main.cpp index 555098a0..3fa1f5c2 100644 --- a/src/example/main.cpp +++ b/src/example/main.cpp @@ -8,7 +8,7 @@ int main() { const auto ytm = YTMusic(); - const auto results = ytm.search("y2ECgOhoDGs"); + const auto results = ytm.search("Systemabsturz"); std::cout << "Found " << results.size() << " results." << std::endl; @@ -55,6 +55,12 @@ int main() { if (playlist.lyrics) { ytm.get_lyrics(*playlist.lyrics); } + } else if (!arg.artists.empty()) { + for (const meta::Artist &artist : arg.artists) { + if (artist.id) { + ytm.get_artist(*artist.id); + } + } } } else { std::cout << "non exaustive visitor" << std::endl; diff --git a/src/ytmusic.cpp b/src/ytmusic.cpp index 0f33953c..d27029f6 100644 --- a/src/ytmusic.cpp +++ b/src/ytmusic.cpp @@ -205,6 +205,9 @@ playlist::Track extract_playlist_track(py::handle track) { } artist::Artist::Song::Album extract_song_album(py::handle album) { + if (album["id"].is_none()) { + return {}; + } return { album["name"].cast(), album["id"].cast()