HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: TheQwertiest on 2020-10-02 00:43:03

Title: [development suspended] Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-02 00:43:03
Spotify Integration     (https://img.shields.io/github/release/theqwertiest/foo_spotify.svg) (https://github.com/TheQwertiest/foo_spotify/blob/master/CHANGELOG.md) (https://ci.appveyor.com/api/projects/status/to3b80b0cj03bg53/branch/master?svg=true) (https://ci.appveyor.com/project/TheQwertiest/foo-spotify/branch/master)

!!! This component is no longer being developed. See #68 (https://github.com/TheQwertiest/foo_spotify/issues/68) for more info !!!

fb2k component that allows to play tracks from Spotify.

Features:
 - Albums and playlists import.
 - Artist top tracks import.
 - Album art and artist image fetching.
 - foo_acfu (https://acfu.3dyd.com) integration.

Prerequisites
 - Pentium 4 or newer processor that supports SSE2.
 - Windows 7 or later.
 - foobar2000 v1.3.17 or later.
 - Spotify Premium account.
 
Installation
 - Remove `foo_spotify_input` component if present.
 - Download the latest release (https://github.com/TheQwertiest/foo_spotify/releases/latest) (you only need `foo_spotify.fb2k-component`).
 - Install the component using the following instructions (http://wiki.hydrogenaud.io/index.php?title=Foobar2000:How_to_install_a_component).
 - Authorize the component via `Preferences`>`Tools`>`Spotify Integration`.

FAQ
>> Link (https://theqwertiest.github.io/foo_spotify/docs/faq) <<

Links
 - Download link (https://github.com/TheQwertiest/foo_spotify/releases/latest)
 - Homepage (https://theqwertiest.github.io/foo_spotify)
 - Changelog (https://github.com/TheQwertiest/foo_spotify/blob/master/CHANGELOG.md)
 - Current tasks and plans (https://github.com/TheQwertiest/foo_spotify/projects/1)
 - Nightly build (https://ci.appveyor.com/api/projects/theqwertiest/foo-spotify/artifacts/_result%2FWin32_Release%2Ffoo_spotify.fb2k-component?branch=master&pr=false&job=Configuration%3A%20Release)

Credits
 - Respective authors (https://github.com/TheQwertiest/foo_spotify/blob/master/THIRD_PARTY_NOTICES.md) of the code being used in this project.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-02 21:02:19
@wcs13 , can you try the Nightly build? It should fix your LS login issues.
Also can you open the track via a direct URL, e.g. File > AddLocation... > https://open.spotify.com/track/28yOC8MxDYj87XFZM2FMiA ?
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-03 01:19:24
Version: 1.0.1
Link: https://github.com/TheQwertiest/foo_spotify/releases/tag/v1.0.1
Changelog:
Spoiler (click to show/hide)
Title: Re: Spotify Integration (foo_spotify)
Post by: blindpainkiller on 2020-10-03 07:17:16
I've been trying out this component a little bit, with mixed results. When it works it works great, but it often won't work for me. Here are some examples of both.
I put together a little test with one track, one album and one playlist. They are as follows:
Code: [Select]
Spotify URIs:
spotify:track:0nLiqZ6A27jJri2VCalIUs
spotify:album:7p3G0OCxtlWyJcPE1FxnyB
spotify:playlist:37i9dQZF1DXagb3XZSnOQ8

Links:
https://open.spotify.com/track/0nLiqZ6A27jJri2VCalIUs?si=t8_Nb3S1T8qzD_YeasU6NA
https://open.spotify.com/album/7p3G0OCxtlWyJcPE1FxnyB?si=5FI95QXySd2CAjgDCo3XEQ
https://open.spotify.com/playlist/37i9dQZF1DXagb3XZSnOQ8?si=XX2PKL6tTeGsY_Nsf017Jw


I tested adding these with "Add location...".
The track works great, both the URI and the link.
The album works with the link but not the URI. Error text from the console when I try to play the URI:
Code: [Select]
Opening track for playback: "spotify:album:7p3G0OCxtlWyJcPE1FxnyB"
Unable to open item for playback (Object not found):
"spotify:album:7p3G0OCxtlWyJcPE1FxnyB"


The playlist won't work at all. The URI gives the same kind of message as the album URI, while the album link brings up a popup window with this text:
Code: [Select]
The following error(s) occurred during loading of the location(s):
[json.exception.type_error.302] type must be string, but is null

Hope this can be helpful.
I also have a question. What bitrate does the component stream in?
Thanks for your work so far.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-03 12:24:28
@blindpainkiller , thanks for testing and reporting those bugs!

- "Can't play URI": this is a fb2k limitation - it's not possible (or rather REALLY hard) to use an arbitrary string to load multiple tracks. It works for the track, because, well, it's a single track =)
   It should not be a big problem though, since every album/playlist/track on Spotify has a `Copy * Link` button.
- "Playlist fails with json error": yup, it's a bug. https://github.com/TheQwertiest/foo_spotify/issues/3
- "Track bit-rate": I actually didn't know that it was possible to display or change it =) https://github.com/TheQwertiest/foo_spotify/issues/4, https://github.com/TheQwertiest/foo_spotify/issues/5
Title: Re: Spotify Integration (foo_spotify)
Post by: blindpainkiller on 2020-10-03 14:00:39
@TheQwertiest, thanks for all the info and the clarifications.
Title: Re: Spotify Integration (foo_spotify)
Post by: Black_Over_Bills_Mothers on 2020-10-03 17:53:15
@TheQwertiest
Great component and a nice side-track from smp v2 development!

I've been using the nightly build and adding the Spotify link for tracks, albums and playlists works great. Thanks. Any chance of getting the artist link working too?
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-03 18:25:36
Great component and a nice side-track from smp v2 development!
I've been using the nightly build and adding the Spotify link for tracks, albums and playlists works great. Thanks.
Haha, thanks =)
I was getting a bit burned out with v2 rewrite, so I needed something light to distract myself with...

Any chance of getting the artist link working too?
Way ahead of you :P
See https://github.com/TheQwertiest/foo_spotify/projects/1 for all the planed features.
As usual no ETA for any of them, esp. since I want to switch back to SMP development once all initial bugs here are ironed out.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-03 18:29:05
@blindpainkiller , fixed the bug and exposed bitrate option in the nightly build.
Title: Re: Spotify Integration (foo_spotify)
Post by: Black_Over_Bills_Mothers on 2020-10-03 21:02:00
Middle of a long (60+tracks) Spotify playlist. This popped up but the music/list was not interrupted.

Unable to open item for playback (sp_session_player_load failed: The track cannot be played):
"spotify:track:6sHrxsewgTMPs2Di4x636C"


Title: Re: Spotify Integration (foo_spotify)
Post by: Black_Over_Bills_Mothers on 2020-10-03 21:08:59
I've found the track. It's not available even when played as a single track. I'm guessing it's an error in the playlist so probably nothing to worry about.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-03 21:09:24
@Black_Over_Bills_Mothers , this is error is reproducible on my end as well, but it's not something that I can fix: I've checked the track manually and it seems that it can't be played outside of US and CA . I will check if it's possible to get a more verbose error message though.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-03 23:52:33
Version: 1.0.2
Link: https://github.com/TheQwertiest/foo_spotify/releases/tag/v1.0.2
Changelog:
Spoiler (click to show/hide)
Title: Re: Spotify Integration (foo_spotify)
Post by: Black_Over_Bills_Mothers on 2020-10-04 08:43:47
Moved to 1.6.2b3 of foobar and 1.0.2 of this component and can't get any tracks to play. All generate the popup:

Unable to open item for playback (sp_session_player_load failed: The track cannot be played):
"spotify:track:6sHrxsewgTMPs2Di4x636C"

Title: Re: Spotify Integration (foo_spotify)
Post by: Black_Over_Bills_Mothers on 2020-10-04 08:46:26
Okay after re-boot. Strange!
Title: Re: Spotify Integration (foo_spotify)
Post by: Black_Over_Bills_Mothers on 2020-10-04 10:47:02
Would file re-linking be a solution to the unavailable tracks relating to user's country?
Title: Re: Spotify Integration (foo_spotify)
Post by: blindpainkiller on 2020-10-04 10:53:51
@TheQwertiest, thanks a lot, version 1.0.2 works great. Two things that might be good for others to know though.
Firstly, you can't convert tracks from Spotify, which I guess is a limitation/concious choice. Secondly, if you have foo_youtube installed and have youtube-dl active, Spotify URLs won't reach the Spotify component and therefore won't work.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-04 11:18:28
Would file re-linking be a solution to the unavailable tracks relating to user's country?
Only partially: track relinking only works when there is a version of track that is available in user's country.
See https://developer.spotify.com/documentation/general/guides/track-relinking-guide/ for more info.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-04 12:23:31
@TheQwertiest, thanks a lot, version 1.0.2 works great. Two things that might be good for others to know though.
Firstly, you can't convert tracks from Spotify, which I guess is a limitation/concious choice. Secondly, if you have foo_youtube installed and have youtube-dl active, Spotify URLs won't reach the Spotify component and therefore won't work.
Yes, decoding limitation is a conscious design choice. While I will not actively combat ripping of Spotify music (there are a lot of such tools available on the internet anyway), I will not go out of my way to make it easier either =)
Thanks for YT dl tip! I will add it to the FAQ.
Title: Re: Spotify Integration (foo_spotify)
Post by: blindpainkiller on 2020-10-04 14:37:26
@TheQwertiest, thanks a lot, version 1.0.2 works great. Two things that might be good for others to know though.
Firstly, you can't convert tracks from Spotify, which I guess is a limitation/concious choice. Secondly, if you have foo_youtube installed and have youtube-dl active, Spotify URLs won't reach the Spotify component and therefore won't work.
Yes, decoding limitation is a conscious design choice. While I will not actively combat ripping of Spotify music (there are a lot of such tools available on the internet anyway), I will not go out of my way to make it easier either =)
Thanks for YT dl tip! I will add it to the FAQ.
Ok, that's what I thought.
Another question. The Spotify client has a setting to normalize tracks which seems to work like ReplayGain (they had a strange compression thing earlier, but that changed some years ago). Is the info for normalization exposed in any way through the API so that it could be used in foobar?
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-04 15:45:10
@blindpainkiller, opened a corresponding issue https://github.com/TheQwertiest/foo_spotify/issues/12

And no, it can't be used in fb2k, because normalization mechanism is not exposed in Spotify streaming library.
Title: Re: Spotify Integration (foo_spotify)
Post by: blindpainkiller on 2020-10-04 20:19:37
One more enhancement suggestion, though this one is not very important (and probably not even possible to implement). In the client you can go into a "Private Session", which will not show others what you're playing and also will make what you're playing not affect your recommendations etc., which is useful sometimes.
Thanks again for the great work so far.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-04 22:07:42
One more enhancement suggestion, though this one is not very important (and probably not even possible to implement). In the client you can go into a "Private Session", which will not show others what you're playing and also will make what you're playing not affect your recommendations etc., which is useful sometimes.
Thanks again for the great work so far.
foo_spotify does not use Spotify Connect, hence nobody can see what track you are currently playing anyway =)
That said it might still affect recommendations (hard to test/verify that), hence I'll add the option: https://github.com/TheQwertiest/foo_spotify/issues/13
Title: Re: Spotify Integration (foo_spotify)
Post by: wcs13 on 2020-10-06 11:16:57
@all : FYI, both of these two advanced prefs must be set to 0, or foo_spotify won't play music no matter what you try :
- Advanced > Playback > Buffering > Read-ahead for local files
- Advanced > Playback > Buffering > Full file buffering up to
Source : https://hydrogenaud.io/index.php?topic=119973.msg988798#msg988798
Title: Re: Spotify Integration (foo_spotify)
Post by: GeSomeone on 2020-10-06 12:21:06
Thanks for sharing that here, I had the same issue. But now is works!
Title: Re: Spotify Integration (foo_spotify)
Post by: Chris Norman on 2020-10-06 21:07:43
Sorry to ask but what is the point of this extension? I need to look up the spotify uri copy it into fb2k. Why not playing it directly from the spotify client. What are the use cases?
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-06 22:53:39
To avoid confusion for anyone who've read the post above: `foo_spotify` DOES NOT require the usage of URI's. In fact, URI won't work for anything other than single tracks.
The intended usage scenario is copying tracks/albums/playlists by URL: https://theqwertiest.github.io/foo_spotify/docs/faq/#how-to-actually-play-music-from-spotify
Title: Re: Spotify Integration (foo_spotify)
Post by: Steve Forte Rio on 2020-10-08 06:37:23
@all : FYI, both of these two advanced prefs must be set to 0, or foo_spotify won't play music no matter what you try :
- Advanced > Playback > Buffering > Read-ahead for local files
- Advanced > Playback > Buffering > Full file buffering up to
Source : https://hydrogenaud.io/index.php?topic=119973.msg988798#msg988798

This helped. Thanks!

TheQwertiest, thank you for this plugin!

1. Is it theoretically possible to implement Spotify library navigation in foobar2000? Or search at least, like in Youtube Source plugin.

2. Is it possible to pass calculated gain from Spotify to foobar2000 to use normalization like in default app?

3. Current bitrate (in status bar) is not displayed. Is this a bug or limitation?
Title: Re: Spotify Integration (foo_spotify)
Post by: Steve Forte Rio on 2020-10-08 07:20:13
Sorry to ask but what is the point of this extension? I need to look up the spotify uri copy it into fb2k. Why not playing it directly from the spotify client. What are the use cases?

foobar2000 is a powerful tool. You take control of audio playback: ability to use DSPs, custom output interfaces.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-08 10:40:21
1. Is it theoretically possible to implement Spotify library navigation in foobar2000?
Yes, I've put it on the TODO list, but I don't think I will get to it any time soon.

Or search at least, like in Youtube Source plugin.
 
This is planned for the feature release after the next one.

2. Is it possible to pass calculated gain from Spotify to foobar2000 to use normalization like in default app?
No, I don't think so. There is `normalization` option (https://github.com/TheQwertiest/foo_spotify/issues/12) though.

3. Current bitrate (in status bar) is not displayed. Is this a bug or limitation?
Probably a bug, I'll look into it.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-14 19:31:29
3. Current bitrate (in status bar) is not displayed. Is this a bug or limitation?
Could not reproduce this bug: displays fine for me:

(https://i.imgur.com/a1SLnhN.png)
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-14 23:38:37
@wcs13 @GeSomeone  , FYI, I've made a workaround (in the nightly build) that allows to play Spotify tracks with buffering enabled. All tracks need to be re-imported via `Add Location...` for the workaround to work though.
Title: Re: Spotify Integration (foo_spotify)
Post by: wcs13 on 2020-10-16 20:06:23
Thank you, will try it soon :)
Title: Re: Spotify Integration (foo_spotify)
Post by: GeSomeone on 2020-10-17 11:45:16
I noticed that %APPDATA%\foobar2000\foo_spotify\ls\cache grows when playing from Spotify. It can become rather large, and doesn't become smaller when you remove Spotify tracks.
Will it be cleaned up at any time?

(a portable install doesn't use %APPDATA% but keeps everything in the install folder).
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-18 11:42:23
@GeSomeone , component uses the default setting of "libspotify automatically resizes the cache (10% of disk free space)".
I will expose the configuration though: https://github.com/TheQwertiest/foo_spotify/issues/23
Title: Re: Spotify Integration (foo_spotify)
Post by: GeSomeone on 2020-10-18 11:59:20
Thanks for the answer,
a related question however: Why is it in %APPDATA% and not in %LOCALAPPDATA%. For local it makes some sense to look at free disk space, but Roaming Profiles might have other limits than just disk space.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-18 12:11:26
Thanks for the answer,
a related question however: Why is it in %APPDATA% and not in %LOCALAPPDATA%. For local it makes some sense to look at free disk space, but Roaming Profiles might have other limits than just disk space.
Dunno, component uses the profile path that is returned by fb2k, so you'll have to ask fb2k devs =)
Title: Re: Spotify Integration (foo_spotify)
Post by: kode54 on 2020-10-19 02:01:53
Maybe none of the developers are nutty enough to use Roaming Profiles in their home environment?
Title: Re: Spotify Integration (foo_spotify)
Post by: blindpainkiller on 2020-10-19 19:55:10
I get HTTP 429 errors when trying to play any Spotify track. Tried both the latest nightly build as well as release 1.0.2. Output from the console for a test track:
Code: [Select]
Opening track for playback: "spotify:track:6rkeaQRCWZxwkjhyqgxjXi"
Unable to open item for playback (429: unknown
Additional data: HTTP/1.1 429 unknown
access-control-allow-credentials: true
access-control-allow-headers: Accept, App-Platform, Authorization, Content-Type, Origin, Retry-After, Spotify-App-Version, X-Cloud-Trace-Context, client-token
access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE, PATCH
access-control-allow-origin: *
access-control-expose-headers: Retry-After
access-control-max-age: 604800
Alt-Svc: clear
Content-Length: 80
Date: Mon, 19 Oct 2020 18:35:47 GMT
Retry-After: 3453
Server: envoy
strict-transport-security: max-age=31536000
Vary: Accept-Encoding
Via: HTTP/2 edgeproxy, 1.1 google
x-content-type-options: nosniff


):
"spotify:track:6rkeaQRCWZxwkjhyqgxjXi"
Title: Re: Spotify Integration (foo_spotify)
Post by: mwstewart01 on 2020-10-19 21:23:07
Like the previous posters issue, I am receiving the error 429 when adding songs to my library.

It was working this morning, I went out for a few hours and it's broken so I'm assuming Spotify changed something in their WebAPI.

[imghttps://imgur.com/a/7SLv0Ua[/img]

Here's the error I get when trying to play a newly added song:
"Unable to open item for playback (429: unknown
Additional data: null
):
"spotify:track:6YIHCgaDKTmyRH1yUXUKSE"."
After looking on Spotify's webAPI site it says: 429   Too Many Requests - Rate limiting has been applied.
Hope this helps you fix the issue, thank you so much for making this component!!! It saves me hours slaving away on r/riprequests
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-19 21:44:22
Welp, f*ck.
It seems that Spotify applies rate-limiting per-app and not per-user. So, as component's user base was growing, so was the amount of requests. Till eventually we reached the global (as in per-app) rate limit (which is unknown and not disclosed to the public).

I don't know how to fix it. Or even if it's possible to. I will try to search around the WWW and will try to reach to Spotify support, but it looks really unpromising.

Worst comes to worst, I'll have to abandon this component :\

PS: And it's not like there were THAT many request, it peaked at 4k request a day. Which is like ~50 requests per active user :\
Title: Re: Spotify Integration (foo_spotify)
Post by: sammoth on 2020-10-19 22:38:28
Would it be possible to have users supply their own API keys?
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-19 22:42:05
@sammoth, theoretically it's possible, but it will require a totally different authentication scheme and it will severely limit the user-base of this component.
Title: Re: Spotify Integration (foo_spotify)
Post by: GeSomeone on 2020-10-20 18:11:59
Not knowing this, I have played some tracks today, without problems. I added them to a playlist previously.
In the example below it says "Retry After 3453" seconds that is. That is almost 58 minutes, which make me think it will reset after one hour. It is suggested to wait an extra second cause it could still be counting down some milliseconds that you can't see.

It could become a problem in the long run though. The only advise from Spotify is to fetch multiple entities in one request.
 
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-20 18:45:38
Not knowing this, I have played some tracks today, without problems. I added them to a playlist previously.
That's because I'm caching the data, so nothing is actually fetched =)

In the example below it says "Retry After 3453" seconds that is. That is almost 58 minutes, which make me think it will reset after one hour. It is suggested to wait an extra second cause it could still be counting down some milliseconds that you can't see.
This value is actually in milliseconds (not seconds like usually), so it's not *that* bad =). The problem is that this still still doesn't help (I've implemented the proper handling in the latest nightly): every consequent request still returns 429 even after the required wait :\

The only advise from Spotify is to fetch multiple entities in one request.
I'm already batching all requests that are possible to batch...

It could become a problem in the long run though. The only advise from Spotify is to fetch multiple entities in one request.
It's a huge problem even in short-term, since it rendered the component effectively useless. I'm trying to find if there as any way to increase the rate-limit (apart from going commercial, since it's impossible for me), but no luck so far...
Title: Re: Spotify Integration (foo_spotify)
Post by: wcs13 on 2020-10-23 00:05:13
I would like to support this idea :

Would it be possible to have users supply their own API keys?
I understand it will make things different. But how many people want to play Spotify through foobar anyway ? Not so much, given that there was barely a working component until now. And those who really want it will surely make the effort to get a Spotify account, go to the developers page, accept the terms of service and get an API key (I guess that's the process).

I remember having a similar problem with TMDB and a script that was provided with the developer's API key. Getting my own TMDB account and a personal API key solved the issue.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-23 01:09:41
It seems that my current app key was banned (soft-ban via 429 on every request). Since the number of requests per day has fallen significantly (less than a half of requests during the first release day), but every requests still fails.
I will implement some measures to limit the amount of requests (in addition to proper 429 response handling) and then will release the component with the new app key (that is not banned).
If my measures don't help and the component still gets a `429-ban`, then I will most likely abandon it's development.
Title: Re: Spotify Integration (foo_spotify)
Post by: kode54 on 2020-10-23 01:49:09
Maybe API keys aren't designed for making a player replacement, since it seems these awful delay errors would seem to indicate that they count delay across ALL USERS of the API key, globally. Which kind of sucks.
Title: Re: Spotify Integration (foo_spotify)
Post by: wcs13 on 2020-10-23 10:59:23
If my measures don't help and the component still gets a `429-ban`, then I will most likely abandon it's development.
Please don't give up when you could at least give users the OPTION to replace your API Key with theirs...
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-23 12:03:30
@kode54 , playback is a separate API from the one that is getting 429-banned.
As I've mentioned, the current amount of daily request is MUCH smaller than it was on the first days of the component.
That could mean one or more of the following:
- Request limit are not per day, but per week or per month. The component might have exceeded that quota.
- There were a few instances when a user somehow performed more than 1k request in a day. This might have caused the throttle/429-ban.
- There was no 429 response handling implemented. This might have caused the throttle/429-ban.

But yes, rps limits are per-app and not per-user. Spotify guides have mentioned though, that it's not static. And I've seen a few popular non-commercial apps that do not require user to create a separate app key. So, I'm hoping that implementing RPS limits and 429 handling (coupled with a new app key to avoid the 429-ban) will be enough.

@wcs13 , the problem is that I will have to rewrite the authentication scheme to do that. And I currently don't have enough motivation for that.
Title: Re: Spotify Integration (foo_spotify)
Post by: GeSomeone on 2020-10-23 17:50:07
It seems that my current app key was banned (soft-ban via 429 on every request).
It seemed not permanently "banned". I could add a track this morning and another one tonight. That's all i tried today. (well I tried to add the Release Radar playlist but that seemed to be in another format and was not recognized).
Maybe this information is useful for the developer.
Title: Re: Spotify Integration (foo_spotify)
Post by: wcs13 on 2020-10-25 11:22:23
Well, I get it TheQwertiest. There's no coding without motivation. :)

In the case of my TMDB script, the dev's API Key was directly embedded in the script, so anybody could just replace it by his own in the corresponding script line. Isn't that the case of your script ?
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-26 20:05:03
Version: 1.1.0
Link: Use v1.1.1 version posted below.
Changelog:
Spoiler (click to show/hide)

Note: you need to re-login for 429 fixes to work.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-26 20:05:37
Hopefully, my workarounds will be sufficient. If not, well... Sucks =)
Title: Re: Spotify Integration (foo_spotify)
Post by: wcs13 on 2020-10-27 01:00:53
I have just tried the new version, logging out as suggested. For some reason I'm unable to log back in, with some weird error message (see attached pic).
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-27 09:46:40
@wcs13 , that's 429 error =)
It did manage to log in you though, error affected only the logged in user name fetching.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-27 10:44:50
Version: 1.1.1
Link: https://github.com/TheQwertiest/foo_spotify/releases/tag/v1.1.1
Changelog
Hotfix for v1.1.0 (see changelog above (https://hydrogenaud.io/index.php?topic=119972.msg989859#msg989859))
Spoiler (click to show/hide)
Title: Re: Spotify Integration (foo_spotify)
Post by: GeSomeone on 2020-10-27 19:02:05
Thank you for improving and trying to mitigate the 429 problem.
In most of my playlist layouts I have a panel for cover art. I noticed (by looking in the cache) that foo_spotify fetched "album" covers and/or "artist" covers, but only if required.  Would it help against the rate-limit error to use a layout that won't show cover art? (a trick to [temporarily] accomplish that, is setting the cover type, in the panel, to "disc").

And more questions about the new playback settings (thanks also).
Do I understand correctly that the cache size settings use the percentage of free space but with a maximum of the size limit?
There is now a check box for enabling volume normalization. I'm just curious to know whether it was "on", by default, in the previous version. Because the volumes seemed to reasonably match I my case.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-10-27 19:33:34
Would it help against the rate-limit error to use a layout that won't show cover art? (a trick to [temporarily] accomplish that, is setting the cover type, in the panel, to "disc").
It would've helped before, now (as of v1.1.1) it doesn't matter, since I've implemented a few optimizations to deal with that.

Do I understand correctly that the cache size settings use the percentage of free space but with a maximum of the size limit?
Yep.

There is now a check box for enabling volume normalization. I'm just curious to know whether it was "on", by default, in the previous version. Because the volumes seemed to reasonably match I my case.
Yes, it was (and is) on by default =)
Title: Re: Spotify Integration (foo_spotify)
Post by: wcs13 on 2020-10-28 01:14:32
Ah, so far so good here =)
Thank you for your efforts !
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-11-03 19:46:27
Version: 1.1.2
Link: https://github.com/TheQwertiest/foo_spotify/releases/tag/v1.1.2
Changelog:
Spoiler (click to show/hide)
Title: Re: Spotify Integration (foo_spotify)
Post by: blindpainkiller on 2020-11-04 14:01:23
One bug and a feature request.
The bug is that, in the preferences page, I can't tab between the options. The tab order skips most of the options outright, always getting back to the Playback/Authorization selector.
The feature request is that, in the Spotify clients, you can set the normalization to different "level" (described as "quiet", "normal" and "loud"). Is that setting exposed in the API?
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-11-04 14:19:59
One bug and a feature request.
The bug is that, in the preferences page, I can't tab between the options. The tab order skips most of the options outright, always getting back to the Playback/Authorization selector.
Thanks for reporting, I'll look into it.

The feature request is that, in the Spotify clients, you can set the normalization to different "level" (described as "quiet", "normal" and "loud"). Is that setting exposed in the API?
Nope, these settings are not exposed.
Title: Re: Spotify Integration (foo_spotify)
Post by: GeSomeone on 2020-11-05 19:16:53
in the preferences page, I can't tab between the options.
As addition to this, also CTL-Tab to switch from tab to tab, isn't there. (works almost everywhere else in foobar2000).

These are little things, but can come in handy for people that can't use a muse or when none is available.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-11-09 17:21:31
in the preferences page, I can't tab between the options.
As addition to this, also CTL-Tab to switch from tab to tab, isn't there. (works almost everywhere else in foobar2000).

These are little things, but can come in handy for people that can't use a muse or when none is available.
I've tested a few pages in Preferences and not a single one responded to CTRL-Tab for me (it works just as a usual Tab key press).
Title: Re: Spotify Integration (foo_spotify)
Post by: peersoft on 2020-11-10 07:46:44
Hello,

I am blind, too, and can't currently find any tab controls in the Spotify Integration treeview branch. Are there any? I've just tested with the NVDA and SuperNova screen readers. The dialog box of the Spotify component is accessible for me as far as I can tell, including announcing group boxes around logout buttons and associated text and errors as well as the bitrate slider. Are there any other controls I should see? If not, all is working OK and Tab moves focus over them. The only issue I am having with NVDA is that it does not announce the "LibSpotify" and "WebAPI" group box labels before their associated controls they should contain. The "Authentication" and "Playback" group boxes are being announced correctly together with their first child control though. An example of the component with more tabs is the foo_youtube component where the screen reader sees six tabs correctly.
Title: Re: Spotify Integration (foo_spotify)
Post by: blindpainkiller on 2020-11-10 14:56:28
Ctrl+TAB doesn't seem to work at all in the Preferences pages, no matter which component.
@peersoft, in the later versions (including the current 1.1.2), there are two tabs "Authorization" and "Playback", in earlier versions there were none.
Title: Re: Spotify Integration (foo_spotify)
Post by: peersoft on 2020-11-11 08:23:22
Hi,
sorry for that - I thought I was updated while I was not :-). Now I can reproduce this problem when Ctrl+Tab does not switch to another tab. I can see the active tab while tabbing through the dialog and I can eventually get to the Logout button and the bitrate controls only when I press the Left/Right arrow keys to switch tabs, respectively, when the focus moves to the first control. In my opinion, however, the focus should not move automatically, it should just stay on the tab control until moved out of it by pressing TAB again. The tab list should be controllable by left/right arrow keys when the focus is on the active tab name or by Ctrl+Tab to switch tabs in circular manner. When moving by Tab away from the name of the active tab I can then see no controls at all.

If you have Windows 10 you can try this behaviour we are talking about by invoking the Narrator (Win+Ctrl+Enter if the keyboard shortcut is activated, and it should be by default).
Title: Re: Spotify Integration (foo_spotify)
Post by: GeSomeone on 2020-11-11 20:26:55
I've tested a few pages in Preferences and not a single one responded to CTRL-Tab for me (it works just as a usual Tab key press).
I realize that is the case, as foobar2000 doesn't have any tabs in the preferences. If you have them, they must be from other components. In my case foo_spotify is the only one (in preferences).
But it works in properties for example (it goes to the next tab and not the next field). Also between multiple playlists or other DUI elements created with tabs, (shift-CTRL-tab goes backward, makes only sense with more than 2).
Title: Re: Spotify Integration (foo_spotify)
Post by: peersoft on 2020-11-12 08:13:56
OK, that makes sense. The only issues to solve are thus:
- reachable controls by the Tab key from the tab list
- focus not jumping to any control when you switch tabs by left/right cursor key
- now the screen reader announces "tabs" when you land on the tab list via the Tab key, this could be omitted as any screenreader can tell you which control you land onto
The foo_youtube component is an example of the component which succeeds in all those points I wrote.
Title: Re: Spotify Integration (foo_spotify)
Post by: richard3840 on 2020-11-23 16:31:02
Hello, and thanks for a great component. :-) I like having Spotify songs in foobar since there's more freedom regarding customizing the UI among other things.

I have been looking at whether it would be possible to save the information about the Spotify song in a file, like how foo_youtube stores song metadata as ".foo_youtube" files.

The foo_youtube file type is just a text file, containing the Youtube URL and metadata applied to the song. By default they are stored in the "%AppData%\Roaming\foobar2000\foo_youtube\cache" directory, but they can be moved.
foobar2000 handles it in the media library like any other song placed in a monitored folder. Like a song file that must be "decoded" by the foo_youtube component.

That's something i tried with foo_spotify, but wasn't able to. Maybe because it stores song metadata differently.
It would be great if it was possible since you would then be able to search for the song in the media library, and have it included in autoplaylists etc..
Title: Re: Spotify Integration (foo_spotify)
Post by: onijack on 2020-12-03 08:30:47
Hey, I wanted to post and echo Richard above me a bit. I've been looking for something like this (Foobar/Spotify integration) for a long time so to see it here is wonderful.

I was able to get around not being able to edit the tags on a spotify source song by using an external tag editor (foo_external_tags), but this is only a half-solution unfortunately as my foobar UI is built around songs/albums and not playlists so my album lists, category playlists and such don't recognize the spotify source stuff and don't let it appear. Still, baby steps to future solutions?
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2020-12-03 16:53:30
@peersoft , tab-ability will be fixed in the next version.

@richard3840 , @onijack , I will look into it.

@ everyone, a few months back I've landed a new job, which is much more mentally demanding than the previous one. I'm slowly getting used to it, but I still don't have much to spare to work on any of my components.

So, the development will be pretty slow (or non-existent) until I'm completely adapted, for which I apologize.
Title: Re: Spotify Integration (foo_spotify)
Post by: peersoft on 2020-12-04 07:39:54
Hi, thanks for letting us know, absolutely no problem and no hurry, I am employed too and know what you are talking about, so just do your best to adapt and I think everybody will be happy for as little as a few lines of code you can write in your spare time. Good luck!
Title: Re: Spotify Integration (foo_spotify)
Post by: richard3840 on 2020-12-04 14:44:58
What @peersoft said.
Title: Re: Spotify Integration (foo_spotify)
Post by: Smakaveli on 2020-12-08 09:12:34
The plugin is very promising and handy. Hoping for further development. But right now I'm not going to use it frequently.

Because one thing came to my eye is: I'm scrobbling to last.fm via "foo_scrobble", which usually works like a charm.

When - thanks to foo_spotify -  listening to a spotify track in foobar, I get multiple scrobbles for this track (e.g. 5 times). Is there any way to avoid this or is you theoretically able to resolve this in further releases?


Thank you,
Title: Re: Spotify Integration (foo_spotify)
Post by: peersoft on 2020-12-08 13:12:57
Hi, try entering the following title formatting string into the foo_scrobble's settings for skipping Spotify tracks:
$if($stricmp($left(%path%,13),spotify:track),NoScrobble)
Title: Re: Spotify Integration (foo_spotify)
Post by: Smakaveli on 2020-12-08 15:02:18
Hi, try entering the following title formatting string into the foo_scrobble's settings for skipping Spotify tracks:
$if($stricmp($left(%path%,13),spotify:track),NoScrobble)

You guys are amazing. Thank you, it works as it should be.
Title: Re: Spotify Integration (foo_spotify)
Post by: Smakaveli on 2020-12-09 07:06:20
Hi, try entering the following title formatting string into the foo_scrobble's settings for skipping Spotify tracks:
$if($stricmp($left(%path%,13),spotify:track),NoScrobble)

You guys are amazing. Thank you, it works as it should be.

:( Someone cheered too soon. They're back, 4 scrobbles for each listen. Seems like they didn't show up in the first place, but after a certain time.
Title: Re: Spotify Integration (foo_spotify)
Post by: peersoft on 2020-12-09 10:54:26
Hi, maybe it is on the Spotify side - foo_scrobble should not add to it anymore (you can see it in the foobar2000's log). I have an opposite experience - none of my tracks listened from yesterday through Spotify Integration appear in the Last.fm scrobbling history (I thought anything going through Spotify should have been scrobbled). Have you tried checking Spotify apps if there aren't any you don't want that could interfere (https://www.spotify.com/account/apps/)? I have the Spotify scrobble app there as well as the one to play through Last.fm and also foo_spotify for foobar2000 integration.
Title: Re: Spotify Integration (foo_spotify)
Post by: Smakaveli on 2020-12-10 09:19:55
Basically, I have more than one app which is authorized. I will leave it as it is. The amount of scrobbles never were an issue for me as long as Spotify wasn't openened up on more than one device simultaneously. Technically I WANT my spotify tracks to scrobble while listening to songs in foobar via foo_spotify. Ideally one time per song.

Besides I observed one behavior: The scrobbling count is "One" after listening in foobar to a spotify link. As it should be.

But the next time when I'm done listening to a track in - let's say - the official desktop app from Spotify the count for each track, which was listened before in foobar, will go up to 3-5 times.

All in all it seems like the plugin works correctly as long as I'm not switching the Spotify App. Than Spotify counts up the bygone scrobbles from foobar multple times!? Like it is monitoring a cache or something.
Title: Re: Spotify Integration (foo_spotify)
Post by: peersoft on 2020-12-10 20:53:32
Hi, well I understand it so that Spotify scrobbles from everywhere no matter what player you use as long as you have their Last.fm Scrobbler app authorized. (https://community.spotify.com/t5/Spotify-Answers/How-can-I-connect-Spotify-to-Last-fm/ta-p/4795301) This way, when I have this app authorized and listen in either the desktop app, Android device or whatever else, I am being scrobbled, hence I entered the title formatting string into Foobar2000's foo_scrobble to skip another scrobble and stay on one scrobble generated by Spotify itself. I don't know why it is generating more for you but will investigate on my side as well to take any action should it happen to me too.
Title: Re: Spotify Integration (foo_spotify)
Post by: Fandango on 2021-01-14 19:58:39
1. Is it theoretically possible to implement Spotify library navigation in foobar2000?
Yes, I've put it on the TODO list, but I don't think I will get to it any time soon.
Integration into the media library as a source would take care of pretty much all of the front-end stuff, like search, auto-playlists and so on. The releases of followed artists known to foo_spotify would need to be updated regularly though, maybe once per startup or every X hours.

This feature would be really awesome and put the plugin on a whole new level!
Title: Re: Spotify Integration (foo_spotify)
Post by: nullerror on 2021-01-18 11:15:08
Hi! I'm brand to new to the forums and pretty much brand new to foobar2k as a whole so excuse me if this has a simple answer or I am blatantly missing something.

This component is amazing! Works perfectly and makes it easy to import my playlists. Anyways I had a small issue which is that I can't get songs imported from Spotify to work on my phones/other devices when streaming with foo_upnp. The songs show up with the correct metadata but when I try to play them I get an object missing error. I assume this is because foo_spotify doesn't actually download the files from Spotify and instead streams them to foobar2k. Anyways I guess my question is just is there a workaround for this or am I missing something that is already built-in?

(Also feature request: some of my playlists have offline/online files in them and I get an error from the offline ones when importing a playlist. It would be cool if this component could look at the metadata for the offline song and try and match it to something in your media library just to make the process a little quicker.)
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2021-01-18 11:57:54
The songs show up with the correct metadata but when I try to play them I get an object missing error.
Can you provide the full error message (from fb2k console)?

Also feature request: some of my playlists have offline/online files in them and I get an error from the offline ones when importing a playlist. It would be cool if this component could look at the metadata for the offline song and try and match it to something in your media library just to make the process a little quicker.
An interesting idea =)
I'll add it to my TODO list (no promises or ETA though).
Title: Re: Spotify Integration (foo_spotify)
Post by: nullerror on 2021-01-18 23:24:25
Can you provide the full error message (from fb2k console)?

Sure thing!
I have attached two screenshots of my phone view. The first photo shows a playlist I imported that contains only online songs from spotify. I have not added any of my offline music. The metadata is correct (except for the album cover when on the "Now Playing" screen which just shows the default grey album cover) but when I try to play a song I get that error at the bottom of my screen and it skips through each of the tracks with the same error. The white covered part is my IP btw. The second photo is the mobile foobar2k console showing how the same error. I should also mention no errors show up on my desktop instance of foobar2k's console (which is hosting the upnp server). If you need anything else let me know!
Title: Re: Spotify Integration (foo_spotify)
Post by: elvin100 on 2021-01-19 08:45:18
This is really great!
I'm quite new to Foobar, so maybe this is a stupid question.
How do I add the spotify albums to my library, it seems they are now only in my playlist.
Title: Re: Spotify Integration (foo_spotify)
Post by: gob on 2021-02-12 04:15:08
This is great! I've been able to integrate and queue spotify links my friends send me.

I would absolutely love and would absolutely donate to see spotify radio/audio show support integrated. For example, this radio station..

Code: [Select]
https://open.spotify.com/show/0lemzSvHhYINeuKgdyqdGi
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2021-02-12 11:59:39
This is great! I've been able to integrate and queue spotify links my friends send me.

I would absolutely love and would absolutely donate to see spotify radio/audio show support integrated. For example, this radio station..

Code: [Select]
https://open.spotify.com/show/0lemzSvHhYINeuKgdyqdGi
Regretfully, show and radio support can't be implemented: https://github.com/TheQwertiest/foo_spotify/issues/45
Title: Re: Spotify Integration (foo_spotify)
Post by: blindpainkiller on 2021-02-12 18:45:58
I mentioned a long while ago that foo_youtube and this component "clashed" in that foo_youtube, when having youtube-dl enabled, sometimes would pick up the Spotify URLs even though it didn't support them. I fixed that by ticking the "process only tracks played by the component" and everything was fine... until recently when youtube-dl started supporting Spotify podcast URLs. So now, once again, when youtube-dl is enabled in foo_youtube, it will *sometimes* process the URLs meant for foo_spotify and fail, because it doesn't support music URLs, just podcast URLs. Sometimes, however, foo_spotify will pick up the URL and everything will be fine. I haven't found a way to make foo_spotify always get "priority" when processing URLs (it doesn't matter in which order I put the decoders, for example) except turning off youtube-dl completely. For those that want to use foo_youtube for listening to Spotify podcasts, it's the same problem, but reversed, because foo_spotify will tell them that it doesn't support podcast URLs.
Is there a way to make foo_spotify always take priority when processing URLs?
Title: Re: Spotify Integration (foo_spotify)
Post by: gob on 2021-02-13 03:13:00
This is great! I've been able to integrate and queue spotify links my friends send me.

I would absolutely love and would absolutely donate to see spotify radio/audio show support integrated. For example, this radio station..

Code: [Select]
https://open.spotify.com/show/0lemzSvHhYINeuKgdyqdGi
Regretfully, show and radio support can't be implemented: https://github.com/TheQwertiest/foo_spotify/issues/45

Damn. Hopefully spotify will open up the API for these one day. Unlikely i bet though. None the less, great component. Thank you. :)
Title: Re: Spotify Integration (foo_spotify)
Post by: スラッシュ on 2021-02-15 02:57:50
Thank you for this great plugin! I found that some songs are region blocked, but I suppose there is no way around this?
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2021-02-15 11:18:13
I mentioned a long while ago that foo_youtube and this component "clashed" in that foo_youtube, when having youtube-dl enabled, sometimes would pick up the Spotify URLs even though it didn't support them. I fixed that by ticking the "process only tracks played by the component" and everything was fine... until recently when youtube-dl started supporting Spotify podcast URLs. So now, once again, when youtube-dl is enabled in foo_youtube, it will *sometimes* process the URLs meant for foo_spotify and fail, because it doesn't support music URLs, just podcast URLs. Sometimes, however, foo_spotify will pick up the URL and everything will be fine. I haven't found a way to make foo_spotify always get "priority" when processing URLs (it doesn't matter in which order I put the decoders, for example) except turning off youtube-dl completely. For those that want to use foo_youtube for listening to Spotify podcasts, it's the same problem, but reversed, because foo_spotify will tell them that it doesn't support podcast URLs.
Is there a way to make foo_spotify always take priority when processing URLs?
Not sure if it's possible, but I'll add it to my todo list.

Thank you for this great plugin! I found that some songs are region blocked, but I suppose there is no way around this?
You are welcome =)
Regarding region block: nothing much that I can do, but component does have a http proxy support (which can be set in advanced settings).
Title: Re: Spotify Integration (foo_spotify)
Post by: deckardlxv on 2021-02-18 08:06:13
Since yesterday, I can not paste any music URL (track/album/playlist in Spotify) to foobar2000.
Will you confirm this situation?
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2021-02-18 09:57:23
Since yesterday, I can not paste any music URL (track/album/playlist in Spotify) to foobar2000.
Will you confirm this situation?
Yup, see here: https://github.com/TheQwertiest/foo_spotify/issues/47
Title: Re: Spotify Integration (foo_spotify)
Post by: deckardlxv on 2021-02-18 12:00:36
Since yesterday, I can not paste any music URL (track/album/playlist in Spotify) to foobar2000.
Will you confirm this situation?
Yup, see here: https://github.com/TheQwertiest/foo_spotify/issues/47

Thank you for quick response. I am waiting for the release of modified version!
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2021-02-18 18:21:33
Version: 1.1.3
Link: https://github.com/TheQwertiest/foo_spotify/releases/tag/v1.1.3
Changelog
Spoiler (click to show/hide)
Title: Re: Spotify Integration (foo_spotify)
Post by: deckardlxv on 2021-02-18 23:33:44
Version: 1.1.3
Link: https://github.com/TheQwertiest/foo_spotify/releases/tag/v1.1.3
Changelog
Spoiler (click to show/hide)

Thnak you sooooo much!! (◍ ´꒳` ◍)b
Title: SqrSoft Advanced Crossfader
Post by: frequency on 2021-02-20 18:22:04
Hi,

One of my favorite Fb2k plug-ins is the SqrSoft Advanced Crossfader. Whenever I have it enabled and use this plug-in, it takes quite a long time to start playing tracks. Can you look into this? I've attached a screenshot of my current settings for Sqr.

Thanks for this fantastic plug-in!
Title: Re: Spotify Integration (foo_spotify)
Post by: kode54 on 2021-02-21 02:56:29
SqrSoft Advanced Crossfader probably needs to buffer a significant chunk ahead, and possibly even needs to buffer across multiple files at once. The Spotify plugin is both rate limited in how fast it can decode, and instance limited to only work with a single track at once.
Title: Re: Spotify Integration (foo_spotify)
Post by: Priest_1 on 2021-02-21 07:31:31
Hi,

One of my favorite Fb2k plug-ins is the SqrSoft Advanced Crossfader. Whenever I have it enabled and use this plug-in, it takes quite a long time to start playing tracks. Can you look into this? I've attached a screenshot of my current settings for Sqr.

Thanks for this fantastic plug-in!

As Mario (plugin developer) suggest me, when i aak him same question, you must increase output buffer.
Recomended value is between 5000 up to  7000 ms.
Title: Re: Spotify Integration (foo_spotify)
Post by: Fandango on 2021-02-23 23:37:23
Does foo_spotify come with a 3rd party copy protection called Themida?

This software clearly seems to have snuck onto my system and it gets triggered when I want to start foobar2000 after I have run Sysinternal's Process Monitor once. Procmon doesn't have to be currently running for the error message to pop up, all it takes is that Procmon has run at least once. Only after I reboot the system, the error message goes away. Or when I start foobar2000 in safe mode or remove the foo_spotify component from the user-components folder.

I also can't re-install foobar2000 once Themida has been triggered. Weird.

The reason I post it in here is honestly a wild guess. Spotify has come up in connection to Themida and foo_spotify is the only link between Themida and foobar2000 here. Running Spotify after having run Process Monitor doesn't give me an error though. Even weirder.

Does your fb2k component use some Spotify binary blob? If so is it possible that that blob has secretly installed the Themida licensing "protection" software, or was it installed by the Spotify app and it only gets triggered by a binary blob in your dll? I immediately uninstalled Spotify from my system but a simple uninstall didn't help, Themida is still persistently monitoring my system if I am monitoring my system with a legit tool like Process Monitor.
Title: Re: Spotify Integration (foo_spotify)
Post by: kode54 on 2021-02-24 01:41:30
libspotify does come with Themida, yes. Blame Spotify, it's their library.
Title: Re: Spotify Integration (foo_spotify)
Post by: Fandango on 2021-02-24 05:17:38
Ah, ok. Makes sense.

Does anyone know if Themida has somehow persistently installing itself on the system? Or does it only check at startup if a tool like Procmon has left some of its traces on the stack? I suppose the later seems to be case. I hope.

libspotify seems to be deprecated since early 2015, and I guess with it the Spotify app dropped the Themida software, that's why the error only pops up when starting foobar2000+foo_spotify and not Spotify itself.

Btw, this' kinda worrying...
https://pyspotify.readthedocs.io/en/latest/ (https://pyspotify.readthedocs.io/en/latest/)
Quote
libspotify’s deprecation
Note that as of May 2015 libspotify is officially deprecated by Spotify and is no longer actively maintained.

Spotify has published newer libraries intended for Android and iOS development, as well as web APIs to access track metadata and manage playlists. Though, for making apps with Spotify playback capabilities, on any other platform than Android and iOS, there is currently no alternative to libspotify.

libspotify has been the main way of integrating with Spotify since 2009, and is today a part of numerous open source projects and commercial applications, including many receivers and even cars. There’s no guarantees, but one can hope that the large deployment of libspotify means that the library will continue to work with the Spotify service for a long time into the future.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2021-02-24 11:24:02
Does anyone know if Themida has somehow persistently installing itself on the system? Or does it only check at startup if a tool like Procmon has left some of its traces on the stack? I suppose the later seems to be case. I hope.
AFAIK it's an in-process tool.

Btw, this' kinda worrying...
There are no alternatives available on Windows anyway. If it happens, it happens. Either way, nothing much can be done about it until Spotify creates a new library for streaming.
Title: Re: Spotify Integration (foo_spotify)
Post by: regor on 2021-02-24 13:02:21
https://github.com/librespot-org/librespot
Although it only works for premium accounts
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2021-02-24 17:37:50
https://github.com/librespot-org/librespot
Although it only works for premium accounts
AFAIK, librespot is not really usable on Windows and is a huge PITA to setup. Also https://github.com/TheQwertiest/foo_spotify/issues/39
Title: Re: Spotify Integration (foo_spotify)
Post by: Priest_1 on 2021-05-19 06:18:46
Hi,

One of my favorite Fb2k plug-ins is the SqrSoft Advanced Crossfader. Whenever I have it enabled and use this plug-in, it takes quite a long time to start playing tracks. Can you look into this? I've attached a screenshot of my current settings for Sqr.

Thanks for this fantastic plug-in!

Try to set the buffer between 5000 to 7000 ms. This is what Mariano (plugin developer) suggest me for general settings for local files, but maybe it can work for Spotify too.
Title: Re: Spotify Integration (foo_spotify)
Post by: 6u6d6 on 2021-05-28 20:25:50
just started receiving this error today whenever I try to add a playlist:

The following error(s) occurred during loading of the location(s):
[json.exception.type_error.302] type must be string, but is null

I have disabled youtube source and this was all working fine last night.

I guess it is unable to read the metadata of playlists now? existing playlists still play just fine. This is frustrating.
Title: Re: Spotify Integration (foo_spotify)
Post by: 6u6d6 on 2021-05-28 20:38:13
just started receiving this error today whenever I try to add a playlist:

The following error(s) occurred during loading of the location(s):
[json.exception.type_error.302] type must be string, but is null

I have disabled youtube source and this was all working fine last night.

I guess it is unable to read the metadata of playlists now? existing playlists still play just fine. This is frustrating.

How very odd. I just added some other playlists and they work fine. does the component glitch with specific playlists, and why?
Title: Re: Spotify Integration (foo_spotify)
Post by: ShirleyMarquez on 2021-06-23 09:21:36
It stopped working tonight (6/23/2021) at about 1 AM PDT. Suddenly nothing would play; the plugin claimed I needed to log in again but logging in didn't work. The time when it happened is suspicious; it looks all too much like a scheduled shutoff.

Playing through the desktop application or open.spotify.com still works, so it's not a shutoff of my account.
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2021-06-23 20:06:41
Can't know for sure yet, but it might be caused by Spotify fully deprecating LibSpotify integration library. If that's the case, then it would be the end for this project =(
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2021-06-23 20:10:37
The issue can be tracked in the mopidy forums (mopidy has no relation to foo_spotify apart from using the same libspotify lib): https://discourse.mopidy.com/t/spotify-login-error-errortype-unable-to-contact-server-8/4979/9
Title: Re: Spotify Integration (foo_spotify)
Post by: fb2k-opus on 2021-06-24 13:21:52
Someone in the mopidy forum suggested that the cause of the problem is that the 'ap.gslb.spotify.com' address no longer is responding. The 'apresolve.spotify.com' does respond.

Adding this to the c:\Windows\System32\driver\etc\hosts did the trick for me at least:


# apresolve.spotify.com has replaced ap.gslb.spotify.com, but the libspotify has
# the FQDN hard-coded; hence this attempt to alias "ap" to one of the host listed
# from apresolve
35.190.242.176     ap.gslb.spotify.com # gew1-accesspoint-a-dfff.ap.spotify.com


I hope this is helpful in anyway.

Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2021-06-24 13:53:27
Hm... I wonder if there are any binary integrity checks in libspotify. If there are not, I might try hacking around the host in binary, so that users won't have to.
Title: Re: Spotify Integration (foo_spotify)
Post by: fb2k-opus on 2021-06-24 14:22:29
If it's possible to "patch" the binary - that would be an interesting approach. Seems however that the "hack" proposed by the other forum, has it's limitations. - It appears as if there are some other changes to the protocol.

The /etc/host hack, stopped working after a while - and any further attempts to find another address, based on the responses from the apresolve service has come up the same 410 failure code.

Could the librespot serve as an alternative to the deprecated libspotify ?
Title: Re: Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2021-06-24 14:24:03
If it's possible to "patch" the binary - that would be an interesting approach. Seems however that the "hack" proposed by the other forum, has it's limitations. - It appears as if there are some other changes to the protocol.

The /etc/host hack, stopped working after a while - and any further attempts to find another address, based on the responses from the apresolve service has come up the same 410 failure code.

Could the librespot serve as an alternative to the deprecated libspotify ?
See https://github.com/TheQwertiest/foo_spotify/issues/39
Title: Re: Spotify Integration (foo_spotify)
Post by: fb2k-opus on 2021-06-24 14:48:10
Oops, I wasn't aware it was written RUST.
Title: Re: Spotify Integration (foo_spotify)
Post by: inscythe on 2021-07-01 03:13:08
Stumbled upon a repo for C++ binding for librespot here: https://github.com/kraxarn/librespot-cpp

Thought it may interest you in case Spotify finally flipped the switch on libspotify.
Title: Re: Spotify Integration (foo_spotify)
Post by: Koshingg on 2021-07-20 18:13:13
Hi @TheQwertiest . I know this component is for Spotify premium users. Can I make a suggestion? I didn't know where to ask and I remembered about this component. Can you do something for Spotify free users? Something like this plugin for MusicBee https://getmusicbee.com/addons/plugins/306/musicbeesynctoservice/ It will allow us syncing Foobar playlists to Spotify , and from Spotify to Foobar. It will be great to be able to do this inside Foobar, and you don't need a premium account for this.
Hopefully you'll like the idea
Title: Re: Spotify Integration (foo_spotify)
Post by: frankie frank on 2021-11-03 13:51:16
Hello the Qwertiest,

thanks a lot for this add-on. I really liked it and would use it a lot.

So if you find the time to continue working on it, it would be fantastic. I'm sure, there are others who like the add-on too!

Frankie
Title: Re: Spotify Integration (foo_spotify)
Post by: mudlord on 2021-11-06 20:05:49
If it's possible to "patch" the binary - that would be an interesting approach. Seems however that the "hack" proposed by the other forum, has it's limitations. - It appears as if there are some other changes to the protocol.

Would be difficult.

Themida is designed, like Denuvo & VMProtect, to stop basic things like binary patching (as well as many other things), whether on disk or in memory. Bypassing internal integrity checks of Themida to do this is completely against the HA Terms of Service.

Its feasible. The question is whether you want to encounter Spotify Technology S.A's legal wrath. And if someone does a similar component for another streaming service (like Deezer, which has a much more permissive API, albeit all reverse engineered), there is similar legal problems for reversing private APIs.
Title: Re: Spotify Integration (foo_spotify)
Post by: fishstik on 2021-11-08 22:09:57
When - thanks to foo_spotify -  listening to a spotify track in foobar, I get multiple scrobbles for this track (e.g. 5 times)

I'm experiencing this as well. Getting double scrobbles (with different timestamps) as well as scrobbles for skipped tracks. Weird thing is that the dupes don't show up on Last.fm for a day or so. I thought it was an issue with the official (legacy) last.fm scrobbler app so I disabled that. I thought that Spotify-Last.fm-integrated scrobbling happened on Spotify's side which could explain the delay. But now I'm getting no scrobbles at all (even after waiting a day).

Can any other last.fm users share their experience with this? Should I be re-enabling the scrobblers when streaming using foo_spotify?
Title: Re: Spotify Integration (foo_spotify)
Post by: ShirleyMarquez on 2022-01-04 04:23:24
Adding new songs seems to have broken. I can play anything that's already in a playlist, but trying to add anything gives an error popup:

The following error(s) occurred during loading of the location(s):
Not Acceptable (406)

Versions: foo_spotify 1.1.3, foobar2000 1.6.7
Title: Re: Spotify Integration (foo_spotify)
Post by: ShirleyMarquez on 2022-01-07 04:35:18
It started working again. No idea why. I didn't change anything here.
Title: Re: Spotify Integration (foo_spotify)
Post by: asdfasdf64 on 2022-01-13 12:10:09
It started working again. No idea why. I didn't change anything here.

They were messing around with user-agent based filtering that weekend, I think.

Anyway, seems like the API has changed and it's broken again. Adding a playlist just results in one unplayable item with metadata that looks like this

(https://i.imgur.com/674C8i5.png)
Title: Re: Spotify Integration (foo_spotify)
Post by: cmb on 2022-04-28 11:12:17
This is really great!
I'm quite new to Foobar, so maybe this is a stupid question.
How do I add the spotify albums to my library, it seems they are now only in my playlist.

Same question here. Is this possible?
Title: Re: Spotify Integration (foo_spotify)
Post by: anamorphic on 2022-04-28 13:30:12
^ Maybe m-TAGS (https://www.foobar2000.org/components/view/foo_tags) ? I have not used this Spotify component so not sure how it works, but remote music can be added to library by saving a local m-TAGS file* - radio streams, podcasts, foo_youtube albums + music videos, etc. I cannot say for sure it works with this component as it might need support added to recognize m-TAGS paths?

* (select tracks in playlist > right-click > Tagging > Create m-TAGS file > save to a monitored library folder)

See also: Find & Play (https://hydrogenaud.io/index.php?topic=121006.0) (script for Spider Monkey Panel (https://theqwertiest.github.io/foo_spider_monkey_panel/)) + YouTube Source (https://www.foobar2000.org/components/view/foo_youtube) + m-TAGS - which together can save remote albums to library (streamed from YouTube)

Title: Re: Spotify Integration (foo_spotify)
Post by: cmb on 2022-04-28 15:19:54
^ Maybe m-TAGS (https://www.foobar2000.org/components/view/foo_tags) ? I have not used this Spotify component so not sure how it works, but remote music can be added to library by saving a local m-TAGS file* - radio streams, podcasts, foo_youtube albums + music videos, etc. I cannot say for sure it works with this component as it might need support added to recognize m-TAGS paths?

* (select tracks in playlist > right-click > Tagging > Create m-TAGS file > save to a monitored library folder)

See also: Find & Play (https://hydrogenaud.io/index.php?topic=121006.0) (script for Spider Monkey Panel (https://theqwertiest.github.io/foo_spider_monkey_panel/)) + YouTube Source (https://www.foobar2000.org/components/view/foo_youtube) + m-TAGS - which together can save remote albums to library (streamed from YouTube)


Excellent, that worked!

Note to self, if I forget (and others who might want to do the same):

Spotify: Select all "My Liked Songs" and save to a playlist.
Bring in that playlist to foobar2000.
From foobar2000 playlist, select all songs and create m-TAGS file. Add to monitored folder.
Spotify songs will have unknown Genre, so to play only the Spotify tracks, select the Unknown Genre, and music can be browsed the way it should have been from the start in Spotify.
Title: Re: Spotify Integration (foo_spotify)
Post by: DDRRE on 2022-05-16 12:25:32
Stopped working for some reason. I'm unable to log-in, getting a "Failed to login: Needs a premium account" message. Tried several times. Apps and devices work.
My account is running on a Premium Family plan.
Title: Re: Spotify Integration (foo_spotify)
Post by: GreyDragon on 2022-05-16 20:36:21
The component uses libspotify (a free library that was the main way of integrating with Spotify from ~2009-2015) to access tracks. Spotify disabled access as of today, so the component can't access Spotify any longer.  :(

"As promised last month, Spotify disabled access to libspotify on 16/05/2022. As of today, seven years after libspotify was deprecated, there is still no official replacement library available."

https://developer.spotify.com/community/news/2022/04/12/libspotify-sunset/
Title: Re: Spotify Integration (foo_spotify)
Post by: ShirleyMarquez on 2022-05-17 04:58:34
Oh well, this means it may be time to drop Spotify in favor of another streaming service. The availability of this plugin was the key advantage it had for me over the competition.
Title: Re: Spotify Integration (foo_spotify)
Post by: asdfasdf64 on 2022-05-17 13:14:33
I wonder if librespot can be dropped in as a replacement without too much rewriting
Title: Re: Spotify Integration (foo_spotify)
Post by: Wolfgan on 2022-05-17 14:03:34
I wonder if librespot can be dropped in as a replacement without too much rewriting

https://github.com/TheQwertiest/foo_spotify/issues/39 shows that there wasn't much interest to pursue that path 18 months ago, and is not a case that the project is very active in development. There are some other plugin projects in github, but almost all of them inactive for years.
Title: Re: Spotify Integration (foo_spotify)
Post by: asdfasdf64 on 2022-05-17 14:46:46
https://github.com/TheQwertiest/foo_spotify/issues/39 ...

Yeah understandably OP probably has other stuff going on these days, and of course his work is greatly appreciated - I've been using this plugin extensively every day since I first tried it out. Luckily for us he chose to leave it open so I'm just wondering what the effort would be to drop in librespot vs a total rebuild. TheQwertiest, if you end up stopping by, could you provide any info about the problems with librespot on windows?

This whole desktop player ecosystem is sort of a ghost town these days in favor of various flavors of chromium. Think if we hold on a little longer the cycle will come back around? I sure hope so.
Title: Re: Spotify Integration (foo_spotify)
Post by: Wolfgan on 2022-05-17 16:54:08
https://github.com/TheQwertiest/foo_spotify/issues/39 ...

Yeah understandably OP probably has other stuff going on these days, and of course his work is greatly appreciated - I've been using this plugin extensively every day since I first tried it out. Luckily for us he chose to leave it open so I'm just wondering what the effort would be to drop in librespot vs a total rebuild. TheQwertiest, if you end up stopping by, could you provide any info about the problems with librespot on windows?

Yes, totally thankful to TheQwertiest for creating and sharing his work. But outside him, I didn't see contributions to the project from other developers so my hopes are not high in this evolving to a working plugin again using a diff SDK/API.

This whole desktop player ecosystem is sort of a ghost town these days in favor of various flavors of chromium. Think if we hold on a little longer the cycle will come back around? I sure hope so.

100% agree. I hate to run a +500MB pgm just to listen to spotify, so anything that allows integration to an existing player or lightweight client, that will be my preference.
Title: Re: [development suspended] Spotify Integration (foo_spotify)
Post by: TheQwertiest on 2022-05-17 20:03:33
This component is no longer being developed. See #68 (https://github.com/TheQwertiest/foo_spotify/issues/68) for more info.

PS: Does not matter much to be honest, since I wouldn't be able to work on it any time soon anyway.
Title: Re: [development suspended] Spotify Integration (foo_spotify)
Post by: 6u6d6 on 2022-05-19 22:45:31
if someone else could continue development that would be great. spotify's own app is so cumbersome.
Title: Re: [development suspended] Spotify Integration (foo_spotify)
Post by: kode54 on 2022-05-20 00:46:51
Continuing development would require implementing a Spotify interface from scratch, since the API isn't documented.
Title: Re: [development suspended] Spotify Integration (foo_spotify)
Post by: 6u6d6 on 2022-05-20 06:58:19
Continuing development would require implementing a Spotify interface from scratch, since the API isn't documented.

RIP then. such a shame spotify had to disable libspotify, though inevitable I guess.
Title: Re: [development suspended] Spotify Integration (foo_spotify)
Post by: Strannik on 2022-08-01 14:38:30
Having no premium account so far I used this nice component (and Spotify) as a source of tags. Is there an easy way to grab it to playlist? Spotify has filled composers and performers lines sometime which is quite useful.