`search`: playlistId always returns None on albums
Closed this issue · 1 comments
When using the search function to search for albums, ytmusicapi returns the playlistId value as None.
This occurs for all albums under the "Albums" category, weirdly albums in the "Top result" category are exempt from this.
Aside playlist ID-s, they're also missing durations.
I am using a computer running Windows 11 version 23H2.
I am using the newest version of ytmusicapi, which is at the time of writing 1.8.0.
Issue persists on both authenticated and unauthenticated instances.
Here is a snippet of the JSON returned after running ytmusic.search('radiohead album')
to illustrate my issue:
[
{
"category": "Top result",
"resultType": "album",
"videoId": null,
"videoType": null,
"title": "In Rainbows",
"artists": [
{
"name": "Radiohead",
"id": "UCr_iyUANcn9OX_yy9piYoLw"
}
],
"browseId": "MPREb_R6C9lU4QEg2",
"playlistId": "OLAK5uy_m59x-hBFsC789l1_qWwFXwH3gjntwy_CA",
"thumbnails": [
{
"url": "https://lh3.googleusercontent.com/BAl1FqoDaFrpWSSrr95Yjii4fJSeitdRcVt7f-uOVrhxQfmo5ActMNysFErQfI-CiOZR4GH2fePoVQtd=w60-h60-l90-rj",
"width": 60,
"height": 60
},
{
"url": "https://lh3.googleusercontent.com/BAl1FqoDaFrpWSSrr95Yjii4fJSeitdRcVt7f-uOVrhxQfmo5ActMNysFErQfI-CiOZR4GH2fePoVQtd=w120-h120-l90-rj",
"width": 120,
"height": 120
},
{
"url": "https://lh3.googleusercontent.com/BAl1FqoDaFrpWSSrr95Yjii4fJSeitdRcVt7f-uOVrhxQfmo5ActMNysFErQfI-CiOZR4GH2fePoVQtd=w226-h226-l90-rj",
"width": 226,
"height": 226
},
{
"url": "https://lh3.googleusercontent.com/BAl1FqoDaFrpWSSrr95Yjii4fJSeitdRcVt7f-uOVrhxQfmo5ActMNysFErQfI-CiOZR4GH2fePoVQtd=w544-h544-l90-rj",
"width": 544,
"height": 544
}
]
},
{
"category": "Albums",
"resultType": "album",
"title": "Kid A",
"type": "Album",
"duration": null,
"year": "2000",
"artists": [
{
"name": "Radiohead",
"id": "UCr_iyUANcn9OX_yy9piYoLw"
}
],
"browseId": "MPREb_ob5cslgCNc0",
"isExplicit": false,
"playlistId": null,
"thumbnails": [
{
"url": "https://lh3.googleusercontent.com/yJLXG7QJySOUp57Nff9te1cqhRqvz9BHusWk8c9ek08m-DRv5TJhCqW0HV2tAk5K2ErChBlHEUeFfGt_6A=w60-h60-l90-rj",
"width": 60,
"height": 60
},
{
"url": "https://lh3.googleusercontent.com/yJLXG7QJySOUp57Nff9te1cqhRqvz9BHusWk8c9ek08m-DRv5TJhCqW0HV2tAk5K2ErChBlHEUeFfGt_6A=w120-h120-l90-rj",
"width": 120,
"height": 120
},
{
"url": "https://lh3.googleusercontent.com/yJLXG7QJySOUp57Nff9te1cqhRqvz9BHusWk8c9ek08m-DRv5TJhCqW0HV2tAk5K2ErChBlHEUeFfGt_6A=w226-h226-l90-rj",
"width": 226,
"height": 226
},
{
"url": "https://lh3.googleusercontent.com/yJLXG7QJySOUp57Nff9te1cqhRqvz9BHusWk8c9ek08m-DRv5TJhCqW0HV2tAk5K2ErChBlHEUeFfGt_6A=w544-h544-l90-rj",
"width": 544,
"height": 544
}
]
},
...
Good catch, it's actually available
The reason it works for top results is that the parsing is different there. As you can tell from the UI the return format is totally different