Open Frederick888 opened 3 years ago
Hopefully there's a property on the track itself that indicates if it is playable or not 🤔
@Rigellute There are at the moment 2 properties:
is_playable
: true
when it's playable; omitted when it's not. Not sure whether false
is ever used.is_local
: If it's a local file.So ideally we need 2 configs/CLI arguments for each of them. I guess local files can still be played when using official app as playback device, but in the case of spotifyd
both unplayable and local songs should be filtered out.
FYI the API response of the example playlist is:
{
"href": "https://api.spotify.com/v1/playlists/<playlist_id>/tracks?offset=0&limit=100&market=from_token&additional_types=track%2Cepisode",
"items": [
{
"added_at": "2019-03-07T10:37:57Z",
"added_by": {
"external_urls": {
"spotify": "https://open.spotify.com/user/<user_id>"
},
"href": "https://api.spotify.com/v1/users/<user_id>",
"id": "<user_id>",
"type": "user",
"uri": "spotify:user:<user_id>"
},
"is_local": true,
"primary_color": null,
"track": {
"album": {
"album_type": null,
"artists": [],
"available_markets": [],
"external_urls": {},
"href": null,
"id": null,
"images": [],
"name": "ZIGAEXPERIENTIA",
"release_date": null,
"release_date_precision": null,
"type": "album",
"uri": null
},
"artists": [
{
"external_urls": {},
"href": null,
"id": null,
"name": "supercell",
"type": "artist",
"uri": null
}
],
"available_markets": [],
"disc_number": 0,
"duration_ms": 424000,
"explicit": false,
"external_ids": {},
"external_urls": {},
"href": null,
"id": null,
"is_local": true,
"name": "銀色飛行船",
"popularity": 0,
"preview_url": null,
"track_number": 0,
"type": "track",
"uri": "spotify:local:supercell:ZIGAEXPERIENTIA:%E9%8A%80%E8%89%B2%E9%A3%9B%E8%A1%8C%E8%88%B9:424"
},
"video_thumbnail": {
"url": null
}
},
{
"added_at": "2019-03-07T10:37:57Z",
"added_by": {
"external_urls": {
"spotify": "https://open.spotify.com/user/<user_id>"
},
"href": "https://api.spotify.com/v1/users/<user_id>",
"id": "<user_id>",
"type": "user",
"uri": "spotify:user:<user_id>"
},
"is_local": true,
"primary_color": null,
"track": {
"album": {
"album_type": null,
"artists": [],
"available_markets": [],
"external_urls": {},
"href": null,
"id": null,
"images": [],
"name": "銀色飛行船",
"release_date": null,
"release_date_precision": null,
"type": "album",
"uri": null
},
"artists": [
{
"external_urls": {},
"href": null,
"id": null,
"name": "supercell",
"type": "artist",
"uri": null
}
],
"available_markets": [],
"disc_number": 0,
"duration_ms": 143000,
"explicit": false,
"external_ids": {},
"external_urls": {},
"href": null,
"id": null,
"is_local": true,
"name": "劇場版アニメ映画 「ねらわれた学園」 特報用BGM",
"popularity": 0,
"preview_url": null,
"track_number": 0,
"type": "track",
"uri": "spotify:local:supercell:%E9%8A%80%E8%89%B2%E9%A3%9B%E8%A1%8C%E8%88%B9:%E5%8A%87%E5%A0%B4%E7%89%88%E3%82%A2%E3%83%8B%E3%83%A1%E6%98%A0%E7%94%BB+%E3%80%8C%E3%81%AD%E3%82%89%E3%82%8F%E3%82%8C%E3%81%9F%E5%AD%A6%E5%9C%92%E3%80%8D+%E7%89%B9%E5%A0%B1%E7%94%A8BGM:143"
},
"video_thumbnail": {
"url": null
}
},
{
"added_at": "2019-03-07T10:37:57Z",
"added_by": {
"external_urls": {
"spotify": "https://open.spotify.com/user/<user_id>"
},
"href": "https://api.spotify.com/v1/users/<user_id>",
"id": "<user_id>",
"type": "user",
"uri": "spotify:user:<user_id>"
},
"is_local": true,
"primary_color": null,
"track": {
"album": {
"album_type": null,
"artists": [],
"available_markets": [],
"external_urls": {},
"href": null,
"id": null,
"images": [],
"name": "One more time, One more chance ''Byōsoku 5 Centimeter'' Special Edition",
"release_date": null,
"release_date_precision": null,
"type": "album",
"uri": null
},
"artists": [
{
"external_urls": {},
"href": null,
"id": null,
"name": "Yamazaki Masayoshi",
"type": "artist",
"uri": null
}
],
"available_markets": [],
"disc_number": 0,
"duration_ms": 141000,
"explicit": false,
"external_ids": {},
"external_urls": {},
"href": null,
"id": null,
"is_local": true,
"name": "Yuki no Eki ~One more time, One more chance~ (from ''Byōsoku 5 Centimeter'' Original Soundtrack)",
"popularity": 0,
"preview_url": null,
"track_number": 0,
"type": "track",
"uri": "spotify:local:Yamazaki+Masayoshi:One+more+time%2C+One+more+chance+%27%27By%C5%8Dsoku+5+Centimeter%27%27+Special+Edition:Yuki+no+Eki+%EF%BD%9EOne+more+time%2C+One+more+chance%EF%BD%9E+%28from+%27%27By%C5%8Dsoku+5+Centimeter%27%27+Original+Soundtrack%29:141"
},
"video_thumbnail": {
"url": null
}
},
{
"added_at": "2019-08-19T12:15:56Z",
"added_by": {
"external_urls": {
"spotify": "https://open.spotify.com/user/<user_id>"
},
"href": "https://api.spotify.com/v1/users/<user_id>",
"id": "<user_id>",
"type": "user",
"uri": "spotify:user:<user_id>"
},
"is_local": false,
"primary_color": null,
"sharing_info": {
"share_id": "-85igrYUSoaEXc694HFG_g",
"share_url": "https://open.spotify.com/track/5R73heiC9M9u94jsNrS2BF?si=-85igrYUSoaEXc694HFG_g",
"uri": "spotify:track:5R73heiC9M9u94jsNrS2BF"
},
"track": {
"album": {
"album_type": "album",
"artists": [
{
"external_urls": {
"spotify": "https://open.spotify.com/artist/3D73KNJRMbV45N59E8IN0F"
},
"href": "https://api.spotify.com/v1/artists/3D73KNJRMbV45N59E8IN0F",
"id": "3D73KNJRMbV45N59E8IN0F",
"name": "Mika Nakashima",
"type": "artist",
"uri": "spotify:artist:3D73KNJRMbV45N59E8IN0F"
}
],
"external_urls": {
"spotify": "https://open.spotify.com/album/1d75Jg7kVu2v5bNneBd0j9"
},
"href": "https://api.spotify.com/v1/albums/1d75Jg7kVu2v5bNneBd0j9",
"id": "1d75Jg7kVu2v5bNneBd0j9",
"images": [
{
"height": 640,
"url": "https://i.scdn.co/image/ab67616d0000b2737964fb772e16a4d2c5ed5794",
"width": 640
},
{
"height": 300,
"url": "https://i.scdn.co/image/ab67616d00001e027964fb772e16a4d2c5ed5794",
"width": 300
},
{
"height": 64,
"url": "https://i.scdn.co/image/ab67616d000048517964fb772e16a4d2c5ed5794",
"width": 64
}
],
"name": "LOVE",
"release_date": "2003-11-06",
"release_date_precision": "day",
"total_tracks": 13,
"type": "album",
"uri": "spotify:album:1d75Jg7kVu2v5bNneBd0j9"
},
"artists": [
{
"external_urls": {
"spotify": "https://open.spotify.com/artist/3D73KNJRMbV45N59E8IN0F"
},
"href": "https://api.spotify.com/v1/artists/3D73KNJRMbV45N59E8IN0F",
"id": "3D73KNJRMbV45N59E8IN0F",
"name": "Mika Nakashima",
"type": "artist",
"uri": "spotify:artist:3D73KNJRMbV45N59E8IN0F"
}
],
"disc_number": 1,
"duration_ms": 341973,
"episode": false,
"explicit": false,
"external_ids": {
"isrc": "JPN300301301"
},
"external_urls": {
"spotify": "https://open.spotify.com/track/5R73heiC9M9u94jsNrS2BF"
},
"href": "https://api.spotify.com/v1/tracks/5R73heiC9M9u94jsNrS2BF",
"id": "5R73heiC9M9u94jsNrS2BF",
"is_local": false,
"is_playable": true,
"name": "雪の華",
"popularity": 50,
"preview_url": "https://p.scdn.co/mp3-preview/a4847a0f3f5e2d3a77fdd19d82a0549a0d9f1ee1?cid=d8a5ed958d274c2e8ee717e6a4b0971d",
"track": true,
"track_number": 4,
"type": "track",
"uri": "spotify:track:5R73heiC9M9u94jsNrS2BF"
},
"video_thumbnail": {
"url": null
}
},
{
"added_at": "2019-08-19T12:16:54Z",
"added_by": {
"external_urls": {
"spotify": "https://open.spotify.com/user/<user_id>"
},
"href": "https://api.spotify.com/v1/users/<user_id>",
"id": "<user_id>",
"type": "user",
"uri": "spotify:user:<user_id>"
},
"is_local": false,
"primary_color": null,
"sharing_info": {
"share_id": "RaXTddZBTWOwmRhpULQhvg",
"share_url": "https://open.spotify.com/track/2gmZpgSxuqhwGaMipiLLLn?si=RaXTddZBTWOwmRhpULQhvg",
"uri": "spotify:track:2gmZpgSxuqhwGaMipiLLLn"
},
"track": {
"album": {
"album_type": "single",
"artists": [
{
"external_urls": {
"spotify": "https://open.spotify.com/artist/4Mc3zbnQx4wRb0tYg7A8sG"
},
"href": "https://api.spotify.com/v1/artists/4Mc3zbnQx4wRb0tYg7A8sG",
"id": "4Mc3zbnQx4wRb0tYg7A8sG",
"name": "supercell",
"type": "artist",
"uri": "spotify:artist:4Mc3zbnQx4wRb0tYg7A8sG"
}
],
"external_urls": {
"spotify": "https://open.spotify.com/album/28PjOT4OMA2lMdL6Dpr7Py"
},
"href": "https://api.spotify.com/v1/albums/28PjOT4OMA2lMdL6Dpr7Py",
"id": "28PjOT4OMA2lMdL6Dpr7Py",
"images": [
{
"height": 640,
"url": "https://i.scdn.co/image/ab67616d0000b273609a43d143128bea2dc1b7cd",
"width": 640
},
{
"height": 300,
"url": "https://i.scdn.co/image/ab67616d00001e02609a43d143128bea2dc1b7cd",
"width": 300
},
{
"height": 64,
"url": "https://i.scdn.co/image/ab67616d00004851609a43d143128bea2dc1b7cd",
"width": 64
}
],
"name": "銀色飛行船",
"release_date": "2012-12-19",
"release_date_precision": "day",
"total_tracks": 5,
"type": "album",
"uri": "spotify:album:28PjOT4OMA2lMdL6Dpr7Py"
},
"artists": [
{
"external_urls": {
"spotify": "https://open.spotify.com/artist/4Mc3zbnQx4wRb0tYg7A8sG"
},
"href": "https://api.spotify.com/v1/artists/4Mc3zbnQx4wRb0tYg7A8sG",
"id": "4Mc3zbnQx4wRb0tYg7A8sG",
"name": "supercell",
"type": "artist",
"uri": "spotify:artist:4Mc3zbnQx4wRb0tYg7A8sG"
}
],
"disc_number": 1,
"duration_ms": 425453,
"episode": false,
"explicit": false,
"external_ids": {
"isrc": "JPSR01203941"
},
"external_urls": {
"spotify": "https://open.spotify.com/track/2gmZpgSxuqhwGaMipiLLLn"
},
"href": "https://api.spotify.com/v1/tracks/2gmZpgSxuqhwGaMipiLLLn",
"id": "2gmZpgSxuqhwGaMipiLLLn",
"is_local": false,
"is_playable": true,
"name": "銀色飛行船",
"popularity": 9,
"preview_url": "https://p.scdn.co/mp3-preview/4d1164490bbf78cc9cb272d0e64ba9bddabc8109?cid=d8a5ed958d274c2e8ee717e6a4b0971d",
"track": true,
"track_number": 1,
"type": "track",
"uri": "spotify:track:2gmZpgSxuqhwGaMipiLLLn"
},
"video_thumbnail": {
"url": null
}
}
],
"limit": 100,
"next": null,
"offset": 0,
"previous": null,
"total": 5
}
As mentioned in https://github.com/ramsayleung/rspotify/issues/190, we currently do not get this is_playable
information in a reliable way from rspotify
. I filed an upstream issue there and will try to help them debug the issue.
Getting the "is_playable" flag would probably make this easily fixable too. https://github.com/Rigellute/spotify-tui/issues/766
Is your feature request related to a problem? Please describe. Some songs in my playlists are unplayable. It causes errors when client tries to play such songs.
Describe the solution you'd like Implementing a 'Hide Unplayable Songs' option like the official Spotify app.
For example, in one of my playlists the first 3 songs are unplayable.
In
spt
if I choose any of them the playback just stops:Originally reported at Spotifyd/spotifyd#794