HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: sstavross on 2016-11-04 12:16:19

Title: Spotify for foobar (foo_input_spotify) New!
Post by: sstavross on 2016-11-04 12:16:19
Hi!

Searching in internet to find a plugin for playing my spotify list (premium account) on my beloved foorbar, I came across this webpage

http://cpancake.me/spotify-on-foobar2000.html (http://cpancake.me/spotify-on-foobar2000.html)

The guy has taken an old spotify not working plugin and has made a new one that works very well! You start foobar2000 and go to File > Add Location (or press Ctrl-U). This will bring up the "Add Location" menu, then you take a spotify URI from the official client, like "spotify:track:5IRkM1WyCMDXPnabEeqz5i" or "spotify:user:communistpancake:playlist:2jYKvcXFolpUexOaOX3r7h" and this add the track(s) to your playlist!! the search track is working too!

You have to add manually each playlist from your spotify official client. If you add an new song  in the spotify official client you have to "reload" the playlist in the  "Add Location" menu of foobar. Actually the spotify playlist address is not changing , it remains the same.

I was just wondering if I can make it easier to do this procedure, via a script or something. Does anyone have any idea or inspiration of how to do this?

Thank you in advance!
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: euamotubaina on 2017-01-06 00:30:40
it works flawlessly! thanks

I took the liberty to ask the dev about the possibility of fetching the album/track artwork as well.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: sstavross on 2017-01-18 14:08:45
Hi!!
You are welcome!
Did he reply to you?
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Zao on 2017-01-22 08:59:09
The last time I used libspotify, it couldn't decode multiple tracks at the same time and was very thread-unsafe. Has that been addressed with this component or is it a ticking bomb?
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: foosion on 2017-01-22 20:46:16
Given that libspotify was last updated in 2013 the situation probably hasn't changed much. It can still only decode one track at a time. At least the plugin includes safeguards to handle this.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: kode54 on 2017-01-23 00:29:03
I doubt it will ever decode multiple tracks at once. That would be equivalent to Spotify allowing a single account to stream from multiple clients simultaneously, each with different tracks. Nope, not going to happen. Well, unless you want to get one of those Family accounts and use up all of your family quota with a single player.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Typhoon859 on 2017-01-24 14:43:39
Anyone know if by default, playing a URI code from Spotify gives you 320 KB/s quality?  Cause technically, by default, in every version of Spotify, even as a Premium user you always have to toggle that option.  If this isn't a known fact, perhaps the only way is by comparing the waveform from each source and comparing it.

Also, it would be incredible if the following additional things were also possible to do.  I sent Andrew Rogers this request on the page this was posted:
"Any chance of making the track numbers 1-(whatever is the total number of all the songs) when adding a playlist URI?  This would allow you to order it by name/artists if necessary and then reorder it back to how it originally was.  It would give it a more authentic look as well I would imagine.  That would be awesome, though this is really incredible already!  Thank you!  A lot you can actually do with this, apart from convenience of mixing different sources and being able to utilize Foobar's DSP.

Also, it would be amazing if upon going to the playlist tab in Foobar where you placed a playlist URI from Spotify, it auto-updates/reloads the playlist automatically to add any possibly new songs which were added.  That way, you can pretty much literally open Foobar to listen to your Starred list (for example) on shuffle and not have to worry about opening Spotify, re-copying, and re-adding the playlist location into the Foobar playlist every time manually.  If it was smart enough to compare and only add the new files, that would be even more awesome, not having to replace the old ones (saving time and possibly not screwing up your order) and adding the new tracks with track numbers x+1 (x being the highest number currently in the playlist)."
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: foosion on 2017-01-24 20:50:19
Given that Spotify has announced to shut down libspotify in 2017 (https://developer.spotify.com/technologies/libspotify/#download) any work spent on the foo_input_spotify plugin is probably in vain. Nevertheless I have tinkered with it a bit. After several hours of intense refactoring and bug fixing the login handling still leaves a lot to be desired UX wise. Under the hoods it had become rather easy to add album art support though. There is no proper release yet but you can find a link to the latest build on my GitHub repo (https://github.com/stengerh/foo_input_spotify).
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Typhoon859 on 2017-01-25 00:21:12
Given that Spotify has announced to shut down libspotify in 2017 (https://developer.spotify.com/technologies/libspotify/#download) any work spent on the foo_input_spotify plugin is probably in vain. Nevertheless I have tinkered with it a bit. After several hours of intense refactoring and bug fixing the login handling still leaves a lot to be desired UX wise. Under the hoods it had become rather easy to add album art support though. There is no proper release yet but you can find a link to the latest build on my GitHub repo (https://github.com/stengerh/foo_input_spotify).

Wait, so you're Andrew Rogers, or you picked up where he left off?

In any case, so once they terminate it, this won't work anymore at all?  Would they have something to take its place and would it therefore still be possible to develop some alternative?

My main concern now has actually become the first thing I mentioned.  I just tried comparing Foobar with Spotify, and the songs in Foobar (to varying degrees) are significantly quieter.  Obviously the quieter relatively always sounds worse so it's hard to tell if it's playing at a lower bitrate or not, but the fact that there's any difference at all is concerning.  The option in Spotify to play all tracks back at the same volume isn't enabled on Spotify, Foobar is on full volume, and my DSP chain is as simple as it can get, to otherwise match the output from Spotify.  Is there any way within libspotify that this could be affected?
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: foosion on 2017-01-25 07:17:05
Wait, so you're Andrew Rogers, or you picked up where he left off?
No, I'm not Andrew Rogers and never have been. ;)

In any case, so once they terminate it, this won't work anymore at all?
That is to be expected.

Would they have something to take its place and would it therefore still be possible to develop some alternative?
They have APIs for web and mobile applications but nothing for desktop applications which could take the place of libspotify.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: MaCs on 2017-01-25 08:50:36
fb2k crashes when I add a Spotify track. From the crash report:

Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 058AC7C0h
Access violation, operation: read, address: 00000000h
Last win32 error: 3

Call path:
threaded_process thread=>playlist_loader::g_process_path=>index_tracks_helper=>hintable=>input_entry::g_open_for_info_read

Code bytes (058AC7C0h):
058AC780h:  8B 4E 04 E8 58 C4 F5 FF 8B 0E E9 51 C4 F5 FF CC
058AC790h:  6A FF 68 9B CB 8F 05 64 A1 00 00 00 00 50 64 89
058AC7A0h:  25 00 00 00 00 83 EC 08 55 56 8B 74 24 20 57 C7
058AC7B0h:  06 24 FF 91 05 C7 44 24 1C 04 00 00 00 8B 4E 04
058AC7C0h:  8B 01 8B 90 70 01 00 00 FF D2 33 FF 39 7E 04 74
058AC7D0h:  10 8B 4E 04 89 7E 04 8B 01 8B 90 74 01 00 00 FF
058AC7E0h:  D2 8B 86 C0 01 00 00 3B C7 74 09 50 E8 84 F4 02
058AC7F0h:  00 83 C4 04 E8 27 BC FB FF E8 22 F9 F4 FF C6 44
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: foosion on 2017-01-25 20:41:02
That excerpt from the crash report is not that useful to me. However I am guessing the crash location is within libspotify because I could provoke at crash was well and the code bytes look the same.
[codebox]
Crash location:
Module: libspotify
Offset: DC7C0h
[/codebox]
Do you have a second copy of foobar2000 running which also has foo_input_spotify installed? Libspotify needs a cache directory. The plugin uses the a directory within the Windows user profile as per the recommendation in the Libspotify SDK. It always uses the same directory, no matter where foobar2000 is installed or where the foobar2000 configuration directory is. This means any two installations of foobar2000 will use the same cache directory, no matter whether they are normal or portable installations.

Apparently Libspotify does not fail gracefully, i.e. by returning an error code, when the cache directory is already in use by another instance.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: MaCs on 2017-01-25 21:48:25
No, there was no other copy of foobar2000 running. However I used previously another version of foo_input_spotify. Maybe it corrupted the cache or something like this. Do you know what is the cache directory? I could try to delete it and see what happens.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: foosion on 2017-01-25 22:22:43
The cache directory is at "%USERPROFILE%\AppData\Local\foo_input_spotify". If you paste this into the address field in Windows Explorer and press Return it will expand %USERPROFILE% to something like C:\Users\username-goes-here.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: MaCs on 2017-01-26 00:51:57
Funny, that directory doesn't exist.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Typhoon859 on 2017-01-26 02:42:40
In any case, so once they terminate it, this won't work anymore at all?
That is to be expected.

Would they have something to take its place and would it therefore still be possible to develop some alternative?
They have APIs for web and mobile applications but nothing for desktop applications which could take the place of libspotify.

This is quite unfortunate...  This awesome discovery is so short-lived...  You think there's any chance Spotify will ever be able to be played through Foobar again (since they only have API's for app and web platforms)?  Maybe somehow through the web API?

Btw, I tried the version you tinkered with and I still didn't see any album art (if it was supposed to do that).
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Typhoon859 on 2017-01-28 01:47:51
I have since I think definitively been able to determine that the songs (at least most) DO NOT actually play in high quality (320 KB/s).  They are of significantly lower fidelity, when volume managed, to their directly from Spotify counterparts - quite noticeably actually.  Any ideas on if there a way of internally changing the source of the stream that's played back within the libspotify API?  If there's any one thing that's most important, at least in the meantime while there's still a chance to use it, it would be that.  Thanks!
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: mudlord on 2017-01-28 10:54:33
That excerpt from the crash report is not that useful to me. However I am guessing the crash location is within libspotify because I could provoke at crash was well and the code bytes look the same.
[codebox]
Crash location:
Module: libspotify
Offset: DC7C0h
[/codebox]
Do you have a second copy of foobar2000 running which also has foo_input_spotify installed? Libspotify needs a cache directory. The plugin uses the a directory within the Windows user profile as per the recommendation in the Libspotify SDK. It always uses the same directory, no matter where foobar2000 is installed or where the foobar2000 configuration directory is. This means any two installations of foobar2000 will use the same cache directory, no matter whether they are normal or portable installations.

Apparently Libspotify does not fail gracefully, i.e. by returning an error code, when the cache directory is already in use by another instance.

Hang on, isnt libspotify still protected with Themida? Or have they upgraded the Spotify DRM to VMProtect 3/Denuvo or something?
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: foosion on 2017-01-28 14:52:38
Btw, I tried the version you tinkered with and I still didn't see any album art (if it was supposed to do that).
It is supposed to work. Later today or tomorrow I will add more logging to my code.

Hang on, isnt libspotify still protected with Themida? Or have they upgraded the Spotify DRM to VMProtect 3/Denuvo or something?
It is Themida. I found out when I started foobar2000 with foo_input_spotify after investigating some unrelated problem with the SysInternals Process Monitor. It displayed a message box, something about my computer being tainted by monitoring software. It crashed after I had clicked OK.

When another instance is already using the cache directory it crashes without displaying a message box.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Typhoon859 on 2017-01-28 21:56:12
It is supposed to work. Later today or tomorrow I will add more logging to my code.

I would imagine so XD.  I'm sure it installed and installed correctly though because when I did it without the libspotify.dll in the directory, it would fail to load songs entirely (obviously).  The previous install was through a ZIP which had the accompanying dll inside of it.  But yeah, so, not sure why it isn't.

With regards to the bitrate, I'm guessing you don't know? XD
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: foosion on 2017-01-29 08:00:16
I have updated the build process since my initial version so it now provides an fb2k-component file (a renamed ZIP file) containing the DLLs for the plugin and libspotify. I'm a little surprised about you saying it didn't load songs when you only grabbed the DLL. Foobar2000 should have complained about not being able to load the plugin when starting.

The libspotify library does not report the actual bitrate. There is a function to set the preferred bitrate for streaming (96, 160 or 320 kbps), but the plugin does not use this function. The library also has a volume normalization function, again the plugin does not use this. If the libspotify documentation describes a default value for either of these settings I haven't found it yet.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Typhoon859 on 2017-01-29 08:50:42
I have updated the build process since my initial version so it now provides an fb2k-component file (a renamed ZIP file) containing the DLLs for the plugin and libspotify. I'm a little surprised about you saying it didn't load songs when you only grabbed the DLL. Foobar2000 should have complained about not being able to load the plugin when starting.

The libspotify library does not report the actual bitrate. There is a function to set the preferred bitrate for streaming (96, 160 or 320 kbps), but the plugin does not use this function. The library also has a volume normalization function, again the plugin does not use this. If the libspotify documentation describes a default value for either of these settings I haven't found it yet.

Hmm, so you're saying it should've worked just by loading the fb2k-component file...  Hmm, well, so then I'll just try uninstalling and removing everything and then installing it.  Maybe it actually didn't load properly then even though it was working.

If you mention there is a function to set the preferred bitrate, can't it more or less be easily set in the plug-in?  I have no idea what I'm talking about (well, as far as how the plug-in works) so maybe not XD.  I imagine if it were, you would've already done it XD
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: foosion on 2017-01-29 21:16:08
I have added log output to the code which loads album art from Spotify. I should have mentioned before that the supported image types depend on the Spotify link type. The following table summarizes the currently supported image types:

Link typeArtist imageAlbum image
Artist linkyesno
Album linkyesyes
Track linkyesyes
Playlist linknoyes (playlist image, if available)
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Typhoon859 on 2017-01-30 05:38:53
I have added log output to the code which loads album art from Spotify. I should have mentioned before that the supported image types depend on the Spotify link type. The following table summarizes the currently supported image types:

Link typeArtist imageAlbum image
Artist linkyesno
Album linkyesyes
Track linkyesyes
Playlist linknoyes (playlist image, if available)

Hmm..  Don't know what to tell you.

I removed every trace of the component and libspotify DLL I previously had, restarted, and then installed yours.  I then newly imported every of the above variations and tried to switch through every option the album preview had in terms of what it displays.  Nothing seemed to work.  Obviously can't tell you why or otherwise any more than that.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: foosion on 2017-01-30 06:56:17
Have you looked at the foobar2000 console window (View > Console)?
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Typhoon859 on 2017-01-30 07:25:51
Have you looked at the foobar2000 console window (View > Console)?
Code: [Select]
Components loaded in: 0:00.465544
Configuration read in: 0:00.011697
User Interface initialized in: 0:00.218112
Graphic Equalizer: initialized (SSE support: 3)
Startup time : 0:00.850884
Seekbar: taking GDI path.
Seekbar: Frontend initialized.
Opening track for playback: "spotify:user:typhoon859:playlist:3E7ldN455B6scANl4LpCUW" / index: 3
spotify log: 07:26:46.565 E [c:/Users/spotify-buildagent/BuildAgent/work/1e0ce8a77adfb2dc/client/core/network/proxy_resolver_win32.cpp:215] WinHttpGetProxyForUrl failed
spotify log: 07:26:46.582 I [ap:1752] Connecting to AP ap.gslb.spotify.com:4070
spotify log: 07:26:46.620 I [ap:1226] Connected to AP: 193.235.203.36:4070
spotify log: 07:26:46.625 I [offline-mgr:2084] Storage has been cleaned
Wave cache: generic IO exception (Access denied) for "spotify:user:typhoon859:playlist:3E7ldN455B6scANl4LpCUW" / index: 3
spotify log: 07:26:47.037 E [ap:4172] ChannelError(0, 1, link-tracks)
spotify log: 07:26:47.056 E [ap:4172] ChannelError(5, 0, playlist)
spotify log: 07:26:47.336 E [ap:4172] ChannelError(0, 1, link-tracks)
spotify log: 07:26:47.593 E [ap:4172] ChannelError(0, 1, link-tracks)
spotify log: 07:26:47.847 E [ap:4172] ChannelError(0, 1, link-tracks)
spotify log: 07:26:51.083 E [ap:4172] ChannelError(38, 1, playlist)
spotify log: 07:26:51.083 E [ap:4172] ChannelError(39, 1, playlist)
spotify log: 07:26:58.628 I [c:/Users/spotify-buildagent/BuildAgent/work/1e0ce8a77adfb2dc/client/core/protocol/file_streamer_simple.cpp:769] Request for file 38551ae9469347089f35fa61b835dbdded9a3c74 complete (code: 0)
spotify log: 07:27:29.973 E [ap:4172] ChannelError(2, 1, playlist)
spotify log: 07:27:29.973 E [ap:4172] ChannelError(3, 1, playlist)
spotify log: 07:27:30.109 E [ap:4172] ChannelError(1, 0, playlist)
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: foosion on 2017-01-30 19:31:55
Just to be sure, but do you have an album art viewer or a playlist view with album art support in your layout?
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Typhoon859 on 2017-01-31 08:34:04
Just to be sure, but do you have an album art viewer or a playlist view with album art support in your layout?
I mean, I recognize the specificity of your question, but I can only imagine the answer is yes since I can see album art displayed from local files XD

Here's a post of where I posted screenshots of my UI, in case you missed it: https://hydrogenaud.io/index.php/topic,113538.msg934687.html#msg934687
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: foosion on 2017-01-31 19:13:13
Well, there is obviously an album art viewer in that screenshot. The reason I was asking is because there was no indication in your console output that anything  tried to load album art for a Spotify URI. Something like this:
Code: [Select]
Opening track for loading album art from Spotify: spotify:album:3gN3L3XdCnZv4F784sq2C5
Creating album art extractor for Spotify album link
Initializing album art extractor for Spotify link
Loading cover image from Spotify
The two most likely reasons for this would be (a) not having an album art viewer and (b) using a version of the plugin which has no logging. Since I just grabbed the current build from my GitHub repo and it produced the above output, I guess you might be the victim of your browser or a proxy caching an old version. Adding a visible build number to the plugin is still on my to-do list.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Typhoon859 on 2017-01-31 20:06:52
Well, there is obviously an album art viewer in that screenshot. The reason I was asking is because there was no indication in your console output that anything  tried to load album art for a Spotify URI. Something like this:
Code: [Select]
Opening track for loading album art from Spotify: spotify:album:3gN3L3XdCnZv4F784sq2C5
Creating album art extractor for Spotify album link
Initializing album art extractor for Spotify link
Loading cover image from Spotify
The two most likely reasons for this would be (a) not having an album art viewer and (b) using a version of the plugin which has no logging. Since I just grabbed the current build from my GitHub repo and it produced the above output, I guess you might be the victim of your browser or a proxy caching an old version. Adding a visible build number to the plugin is still on my to-do list.
Perhaps I'm missing something here again, but couldn't I just update whatever components if they're out of date, or this isn't the problem? XD
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: foosion on 2017-01-31 20:45:54
I had assumed you had already downloaded foo_input_spotify from here (https://github.com/stengerh/foo_input_spotify) (the .fb2k-component file).
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Typhoon859 on 2017-02-01 00:23:14
I had assumed you had already downloaded foo_input_spotify from here (https://github.com/stengerh/foo_input_spotify) (the .fb2k-component file).
Yes, indeed.  I was talking about other components.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: MaCs on 2017-02-20 03:02:32
The local appdata folder is not created correctly when username has accented characters. For example it creates:

     C:\Users\Utilis�\AppData\Local\foo_input_spotify

while it should be:

          C:\Users\Utilisé\AppData\Local\foo_input_spotify
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Dexter_prog on 2017-08-23 00:10:30
I think I'm missing something, but how do I actually use this? I installed it and can't find anything related to spotify in foobar (not in settings, not anywhere)
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Rozzo on 2017-08-23 10:13:19
Go to Preferences/File/Add Location/

and write something like:      spotify:album:401DhjeJg1yVIfBN2A55JY

where 401DhjeJg1yVIfBN2A55JY is the album code. To get the album codes I open Spotify Web Player. You need a premium account.

It works fine.

Ys
Rozzo
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: Dexter_prog on 2017-08-23 21:56:55
Go to Preferences/File/Add Location/

and write something like:      spotify:album:401DhjeJg1yVIfBN2A55JY

where 401DhjeJg1yVIfBN2A55JY is the album code. To get the album codes I open Spotify Web Player. You need a premium account.

It works fine.

Ys
Rozzo
so there's no way for it to just load all of the artists/albums I've saved to spotify?
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: suffhort on 2017-10-24 18:08:34
@Dexter_prog

afaik, Spotify's playlist size is limited to 10,000 songs.  You can get the URI's Rozzo mentions from any Spotify single song, single artist, or single playlist atm at:

"..." button | "share" | "copy Spotify URI".

FYI:

You can't get Spotify URI's or URLS for that matter (because they don't generate them unfortunately) for any COLLECTION of artists or playlist FOLDERS.  Hate it, hate it, hate it, HATE IT!  So if your artists / albums have less than 10,000 total songs you actually want to listen to or discover, then you're fine because you can throw it all on one playlist and grab the URI for that and throw it in foobar2k.  Otherwise you'll have to create individual playlists with <10k songs each (which I also hate and haven't completed because it's so tedious to do in the Spotify app). 

If you want to get a list of all your artists or albums, the only way I've figured out how is to use the web player and scroll all the way to the bottom until they are all loaded and use the dev tools to copy out the html, and then manually delete all the unneeded infos with regexes.  Hate it, hate it, HATE IT, HATE IT!  I've personally started but not finished splitting all my artist's music up into various playlists by genre, desktop vs mobile, and alphabetically just to accommodate Spotify's bad 10k limit decision.  Creating large playlists in Spotify is annoyingly slow and I've yet to find a 3rd party app that can do anything I find useful with playlists besides the one that removes duplicates.  If you can handle adding each new artist you like as you are listening, great, but I feel when listening at work or even at home, you can't practically distract yourself each time a new artist you like appears and add all their music to "<genre> - A to Ag" playlist, for example, without a lot of multitasking discipline and patience.  I'd pay twice as much each month for Spotify just to remove the 10k cap.  Or, if they automated the process of grabbing all artist's songs and put them in 3k-ish or less playlist folder sets by genre, alphabet, and/or other filters and allowed playlist folder URI's, life would be a golden dream.  Or further, if the foo_input_spotify author could figure out a way to do that and alleviate corporate controlled devs the task of doing something rebellious though sensible, life would be a unicorn's subconscious, even better!

It would be nice to know if any Spotify api that is still working allows access to playlist folders.  Then the author could add support to feed foo_input_spotify the Spotify web player URL for the artist's page and/or a playlist folder and get a full Foobar2k playlist of them all, though with playlist folders, you'd still be limited to 10k songs for each playlist.  Of course, one wouldn't want to update their plugin with such a heavy feature unless they knew api support for it would continue for the long term.

Also, if you are ok with discovering new artists and can stand listening through the Spotify app itself, you can create fairly small playlists that stick to a genre or stuff you like and then make a "playlist radio".  That's probably the most practical way I've discovered to date to fine tune listening variety and/or get the most musical-variety bang for your playlist-creation-effort buck, but, again, requires using the Spotify app because I'd guess there's no way to update a foobar2k playlist in real time every time a song changes and again update if the song is a thumbs down.  That said, even playlist radio tends to repeat songs too frequently for my tastes.

Btw, ultra-props to the plugin author as foo_input_spotify (and foo_youtube) have fully resurrected my interest in Foobar2k.  If  Milkdrop worked on wine/osx (please do not suggest projectM as shader stuff isn't fully working)....

ben
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: accxx on 2018-11-02 12:22:35
I had assumed you had already downloaded foo_input_spotify from here (https://github.com/stengerh/foo_input_spotify) (the .fb2k-component file).
Hi! The link on the main page does not work anymore, can you upload it somewhere else?
I can't get playlist working unfortunately and i'm suspecting this might be the issue (i found the 0.6 version). I can add single songs but nothing else.
foo_input_spotify-v006.zip
this is the one i've downloaded, from 2016

here's the console output

Components loaded in: 0:05.357681
Configuration read in: 0:00.001960
User Interface initialized in: 0:00.048038
Startup time : 0:05.511828
Opening track for playback: "spotify:user:oklart:playlist:4N0RAhA6yHvvZWnq5WXtDD"
spotify log: 11:56:40.837 E [c:/Users/spotify-buildagent/BuildAgent/work/1e0ce8a77adfb2dc/client/core/network/proxy_resolver_win32.cpp:215] WinHttpGetProxyForUrl failed
spotify log: 11:56:40.841 I [user_cache:135] UserCache::initiateGetUsers() will query for 1 users
spotify log: 11:56:40.841 I [offline-mgr:2084] Storage has been cleaned
spotify log: 11:56:41.120 I [ap:1752] Connecting to AP ap.gslb.spotify.com:4070
spotify log: 11:56:41.383 I [ap:1226] Connected to AP: 104.199.65.162:4070
spotify log: 11:56:41.832 I [offline-mgr:2032] 0 files are locked. 0 images are locked
spotify log: 11:56:41.832 I [offline-mgr:2058] 0 files unlocked. 0 images unlocked
Unable to open item for playback (empty (or failed to load?) playlist):
"spotify:user:oklart:playlist:4N0RAhA6yHvvZWnq5WXtDD"
Opening track for playback: "spotify:track:1MzFmVDSl7Vm00f3Hw4Xfx"
spotify log: 12:19:20.762 I [c:/Users/spotify-buildagent/BuildAgent/work/1e0ce8a77adfb2dc/client/core/protocol/file_streamer_simple.cpp:769] Request for file 9ccc516ec919e10c4bf3c640b40e3d15ee798188 complete (code: 0)
spotify log: 12:19:20.946 I [c:/Users/spotify-buildagent/BuildAgent/work/1e0ce8a77adfb2dc/client/core/protocol/file_streamer_simple.cpp:769] Request for file 9ccc516ec919e10c4bf3c640b40e3d15ee798188 complete (code: 0)
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: euamotubaina on 2020-02-08 15:12:23
trying to load an spotify URI directly by "add location" is now giving an object not found error:

Unable to open item for playback (Object not found):

but if I try to load an m-tags file pointing to a spotify uri everything works as before.

maybe spotify has changed something?


nevermind, I had tinkered with the full file buffering...
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: paulb39 on 2020-06-09 23:45:15
I am not sure if anyone is watching this thread, but I have the same issue as accxx.
Albums and tracks work fine, I get that same error for playlists.

I downloaded the fork and compiled from source to make sure I had latest code, but same issue.

If it was in c# I could debug it, but reading c++ is like reading chinese to me, idk what the issue could be. This plugin would be super useful if playlists worked.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: peersoft on 2020-06-11 10:30:42
Hi, I would be interested in continued development of this component, too, or at least fixing this bug. I can't even compile anything for now :-(.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: paulb39 on 2020-06-12 14:00:05
Hi, I would be interested in continued development of this component, too, or at least fixing this bug. I can't even compile anything for now :-(.

Make sure you are pulling the fork: https://github.com/stengerh/foo_input_spotify

I used VS2017 - when I opened it up it told me the needed components to install - and then it upgraded it to compile to windows 10, not 8, and it compiled fine for me.

I believe the issue is libspotify hasn't been supported since 2017, you can't even download it anymore. So the plugin needs to be updated to use the web api, there's probably a c++ wrapper for it.



Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: marc2k3 on 2020-06-12 14:38:45
Surely it would be easier to export your playlist as a list of track ids which the component can still play - assuming it's possible!! Same end result but you might need some external tool/help getting there?? Must be easier than updating the component.

Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: paulb39 on 2020-07-05 18:23:43
Surely it would be easier to export your playlist as a list of track ids which the component can still play - assuming it's possible!! Same end result but you might need some external tool/help getting there?? Must be easier than updating the component.

You are right - finally got around to writing the app - just a small app that takes a spotify playlist and outputs a m3u file with the tracks so that the plugin can play them.

https://github.com/paulb39/SpotifyToFoobar/releases/
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: wcs13 on 2020-09-22 00:24:17
Hi guys. My wife has a Spotify premium subscription, and I'm very interested in playing Spotify tracks through foobar, because on foobar I can do DSP stuff on the audio before outputting it.
@paulb39 , your app looks great, but how to use it ? Is there a manual or an example somewhere ?
Besides, where can I find the latest version of the foobar component ? Is it still working ? Is there a more recent component now ?

Anybody feel free to chime in. Thanks in advance !
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: korth on 2020-09-22 16:13:29
[...]
@paulb39 , Is there a manual or an example somewhere ?
[...]
Anybody feel free to chime in. Thanks in advance !
paulb39 provided a readme
https://github.com/paulb39/SpotifyToFoobar/blob/master/README.md
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: wcs13 on 2020-09-23 01:26:06
Great! Didn't see it. Thanks @korth .
And as for foo_input_spotify, is this still the last version? https://github.com/FauxFaux/foo_input_spotify/wiki
It hasn't been updated since 2016. Is it still working? Or is there another component?
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: paulb39 on 2020-09-24 19:19:10
Great! Didn't see it. Thanks @korth .
And as for foo_input_spotify, is this still the last version? https://github.com/FauxFaux/foo_input_spotify/wiki
It hasn't been updated since 2016. Is it still working? Or is there another component?

Hey @wcs13 that is the latest version, its old and doesn't work with playlists, which is why I made the small app. I been using the plugin daily, it works fine for songs
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: wcs13 on 2020-09-25 17:32:55
That's amazing. Thanks, both of you.
Just one thing : is there a way NOT to get this message (attached pic) on each foobar startup ? It may become a bit boring over time.
I hope somebody can pick up on this old project so it doesn't end up dying. Spotify is still a thing, lol, and playing it through foobar with DSPs and such is great !

@paulb39 , so far I have added one individual test song via Ctrl-U ( https://open.spotify.com/track/3IN6NrMAkbpzOB93b6gj8s ).
It's been added to my playlist view, but with no tag info (no artist, no title), and I can't even add such info manually ("One file couldn't be updated. Access denied.")
Plus trying to play it results in a playback error ("Unsupported file format").
I wish I could enter some Spotify login info somewhere, but foobar isn't asking for it...
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: paulb39 on 2020-09-25 18:04:19
Oh, I guess those builds are debug builds. I don't get that message because I built the plugin from source. I uploaded the release binaries under https://github.com/paulb39/SpotifyToFoobar/releases

Idk how the plugin gets your spotify login, but I have the spotify app installed and I am logged into that, I do know you will get an access denied message if you don't have spotify premium.

You don't need to add songs via Ctrl+U, use my app and it'll make you a .m3u file that you can just import into foobar.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: wcs13 on 2020-09-25 20:21:18
Indeed ! Using your release binaries it works much better, lol. No more errors on startup.
I don't have the Spotify App, I'm using a web browser (I can of course install the app if needed). Will try with my wife's premium login as soon as she gets home.
I am definitely going to use your app for playlists, but for individual songs I guess I need to use Ctrl+U.
I'll report any issues.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: TheQwertiest on 2020-09-25 21:04:01
A little teaser: I'm developing a plugin that can handle playlists as well =)
No Spotify Connect integration though (it's just not possible via available API).
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: wcs13 on 2020-09-25 23:01:43
That is definitely a teaser and some great news ! Thanks !
Any ETA or expected name so I can find it and try it when it's available ? ;)
Oh, and nevermind about Spotify Connect, we don't use it anyway.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: wcs13 on 2020-09-26 14:17:19
Hey @paulb39 , here's an update in case you or somebody understands it :

I have installed the Spotify app, and connected with the Premium login credentials.
I have successfully used your app to generate a m3u playlist, which I have drag'n'dropped into foobar's Playlist View.
It works : the songs are there, with the relevant info downloaded from Spotify (artist, title, album, track number, etc.).

However, I still can't play them. The error is still the same, for example :
Code: [Select]
Unable to open item for playback (Object not found):
"spotify:track:74EvryuRQteh7iK4OOyKYv"

The Spotify component is installed (see attached pic). I downloaded it from here : https://github.com/paulb39/SpotifyToFoobar/releases
Also, foobar keeps endlessly asking me for the Spotify login and password. Like, everytime I single click on a Spotify track (see attached pic). It's like the login info is never stored anywhere, it's really annoying.
One last thing : foobar becomes incredibly unresponsive/laggy (CPU hog probably).

For the record I have foobar 1.5.1, which isn't the latest version but should be more than enough for such an old component, right ?
Here's what the Console is showing :

Code: [Select]
spotify log: 13:29:10.338 I [ap:1752] Connecting to AP ap.gslb.spotify.com:4070
spotify log: 13:29:13.396 I [ap:1226] Connected to AP: 35.190.242.230:4070
Opening track for loading album art from Spotify: spotify:track:74EvryuRQteh7iK4OOyKYv
Creating album art extractor for Spotify track link
Initializing album art extractor for Spotify link
Opening track for loading album art from Spotify: spotify:track:74EvryuRQteh7iK4OOyKYv
Creating album art extractor for Spotify track link
Initializing album art extractor for Spotify link
Loading cover image from Spotify
Unsupported image type for Spotify album or track link
spotify log: 13:29:16.775 E [ap:4172] ChannelError(0, 0, get-image)
Opening track for loading album art from Spotify: spotify:track:74EvryuRQteh7iK4OOyKYv
Creating album art extractor for Spotify track link
Initializing album art extractor for Spotify link
Loading cover image from Spotify
Autobackup: Backed up 387 items to autobackup.20200926-152916.zip
Opening track for loading album art from Spotify: spotify:track:74EvryuRQteh7iK4OOyKYv
Creating album art extractor for Spotify track link
Opening track for loading album art from Spotify: spotify:track:74EvryuRQteh7iK4OOyKYv
Initializing album art extractor for Spotify link
Creating album art extractor for Spotify track link
Initializing album art extractor for Spotify link
Loading cover image from Spotify
Unsupported image type for Spotify album or track link
Opening track for loading album art from Spotify: spotify:track:28TT4jY3AzNVSf5NYfVtDx
Creating album art extractor for Spotify track link
Initializing album art extractor for Spotify link
Opening track for loading album art from Spotify: spotify:track:28TT4jY3AzNVSf5NYfVtDx
Creating album art extractor for Spotify track link
Initializing album art extractor for Spotify link
Loading cover image from Spotify
Unsupported image type for Spotify album or track link
spotify log: 13:29:26.927 E [ap:4172] ChannelError(0, 0, get-image)
Opening track for playback: "spotify:track:28TT4jY3AzNVSf5NYfVtDx"
Unable to open item for playback (Object not found):
"spotify:track:28TT4jY3AzNVSf5NYfVtDx"
Minibar scanning spotify:track:28TT4jY3AzNVSf5NYfVtDx
Track couldn't be analyzed
Opening track for loading album art from Spotify: spotify:track:28TT4jY3AzNVSf5NYfVtDx
Creating album art extractor for Spotify track link
Initializing album art extractor for Spotify link
Loading cover image from Spotify

Then some time later :

Code: [Select]
spotify log: 13:34:06.839 E [ap:3915] Connection error:  112
spotify log: 13:34:51.029 I [ap:1752] Connecting to AP ap.gslb.spotify.com:4070
spotify log: 13:34:51.042 I [ap:1226] Connected to AP: 35.190.243.145:4070
spotify log: 13:34:51.159 E [ap:1694] AP Socket Error: Connection closed by peer (10053)
spotify log: 13:34:51.159 E [ap:3915] Connection error:  112
spotify log: 13:35:58.720 I [ap:1752] Connecting to AP ap.gslb.spotify.com:80
spotify log: 13:35:58.741 I [ap:1226] Connected to AP: 35.190.242.40:80
spotify log: 13:35:58.817 E [ap:1694] AP Socket Error: Connection closed by peer (10053)
spotify log: 13:35:58.817 E [ap:3915] Connection error:  112
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: paulb39 on 2020-09-26 17:31:35
Hmm, that is very odd. I can play that song no problem:

Code: [Select]
Opening track for loading album art from Spotify: spotify:track:28TT4jY3AzNVSf5NYfVtDx
Creating album art extractor for Spotify track link
Initializing album art extractor for Spotify link
Loading cover image from Spotify
spotify log: 16:28:09.712 E [ap:4172] ChannelError(0, 0, get-image)
spotify log: 16:28:10.312 I [c:/Users/spotify-buildagent/BuildAgent/work/1e0ce8a77adfb2dc/client/core/protocol/file_streamer_simple.cpp:769] Request for file 0e9a8c5412e64816cadb1382e115635834baeff7 complete (code: 0)
spotify log: 16:28:10.762 I [c:/Users/spotify-buildagent/BuildAgent/work/1e0ce8a77adfb2dc/client/core/protocol/file_streamer_simple.cpp:769] Request for file 0e9a8c5412e64816cadb1382e115635834baeff7 complete (code: 0)
spotify log: 16:28:27.672 I [c:/Users/spotify-buildagent/BuildAgent/work/1e0ce8a77adfb2dc/client/core/protocol/file_streamer_simple.cpp:769] Request for file 0e9a8c5412e64816cadb1382e115635834baeff7 complete (code: 0)

Do you get the same results using the plugin builds listed here (v5 and v6)?: https://github.com/FauxFaux/foo_input_spotify/wiki

I am using foobar 1.5.4
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: TheQwertiest on 2020-09-26 19:41:19
Any ETA or expected name so I can find it and try it when it's available ? ;)
No ETA, but I will post it here on HA once it's ready for the release =)
(there are only two thing left to implement: GUI for authentication and proper error handling)
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: wcs13 on 2020-09-27 00:57:04
Do you get the same results using the plugin builds listed here (v5 and v6)?: https://github.com/FauxFaux/foo_input_spotify/wiki
Yes, I have uninstalled the previous one and installed this one : https://b.goeswhere.com/foo_input_spotify-v006.zip (BTW in foobar all versions still appear as 0.0.4 among the components)
Two things have changed (one bad and one good) :
- It's a debug build, so I get that annoying message on each startup
- It doesn't ask endlessly for Spotify login info, only once (because now I have the "remember the info" checkbox on the dialog, which I didn't have previously - see my previous screen cap)

Those two things aside, nothing has changed : I can import playlists, it connects well with Spotify... but I still can't play anything : same "object not found" error, and same console (here's an excerpt) :

Code: [Select]
Opening track for playback: "spotify:track:7tySfDFfBiCjraLdoy6In5"
Unable to open item for playback (Object not found):
"spotify:track:7tySfDFfBiCjraLdoy6In5"
Minibar scanning spotify:track:7tySfDFfBiCjraLdoy6In5
Opening track for playback: "spotify:track:0cO3nUJorGtqyk3vE4nJGa"
Unable to open item for playback (Object not found):
"spotify:track:0cO3nUJorGtqyk3vE4nJGa"

Reverting to this version ( https://github.com/paulb39/SpotifyToFoobar/files/4880156/SpotifyToFoobarV2.zip ) doesn't change anything, except that I don't have the debug message anymore.

As for this version ( https://ci.appveyor.com/api/projects/stengerh/foo-input-spotify/artifacts/Release/foo_input_spotify.fb2k-component ) I can't access it : {"message":"Artifact not found or access denied."} . Probably because I don't have an AppVeyor account.

@TheQwertiest , fingers crossed ! Your component couldn't come at a better time for me, lol. I'll be happy to test its first release. Not being able to access Spotify through foobar is so frustrating !
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: rykiff on 2020-11-07 03:49:27
Hey wcs13, I have a working version of foo_input_spotify from years ago that self-reports as v. 007 without any debug tags. I wish I had kept better notes on where I obtained this version from (unsure if it was stengerh, fauxfaux, or cpancake) but it has worked seamlessly throughout the years. I've uploaded it to this post as an fb2k file, but let me know if it suits your needs.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: iuriuriur61 on 2021-11-13 01:50:27
Album art is not displayed. Is it no longer available?
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: paulb39 on 2022-05-18 00:54:54
Jut FYI to anyone who finds this thread, Spotify shut down LibSpotify yesterday, so this plugin will no longer work. There's no alternative to the library, so looks like we won't be able to play songs via Foobar anymore.
Title: Re: Spotify for foobar (foo_input_spotify) New!
Post by: SPIKEYPUP on 2022-05-22 05:17:01
Jut FYI to anyone who finds this thread, Spotify shut down LibSpotify yesterday, so this plugin will no longer work. There's no alternative to the library, so looks like we won't be able to play songs via Foobar anymore.

Well, now life just got even worse.  :/  Thanks for letting us know, I was wondering what was wrong.  Is it just Libspotify, or the whole API going south?  I guess I'll look it up, thanks again.
-Spikeypup