Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spotify not working #299

Closed
solidnumber2 opened this issue Jul 19, 2018 · 43 comments
Closed

Spotify not working #299

solidnumber2 opened this issue Jul 19, 2018 · 43 comments

Comments

@solidnumber2
Copy link

solidnumber2 commented Jul 19, 2018

I noticed that the Spotify source for Snip was really buggy, but somehow in the middle of using it, Snip had stopped working entirely, only saying "No Track Playing" or "Spotify is not currently running". I tried running the source code in Visual Studios, but noticed this in the output:

C:\Users\User\Desktop\Snip-6.9.5\Snip\Players\Spotify.cs(534,129,534,144): error CS0103: The name 'ApplicationKeys' does not exist in the current context

Followed by an error saying "The name 'ApplicationKeys' does not exist in the current context"

Did you maybe forget to put the file back when you pushed to GitHub? Still not sure how it was working before without that file, but I hadn't changed any settings in Spotify or Snip while using it and I noticed it went from showing the song playing to saying "No Track Playing". I haven't gone into depth with your project here so I don't understand these errors entirely, let alone their dependencies.

@eav86
Copy link

eav86 commented Jul 19, 2018

Same here. Snip has stopped working with catching Song from spotify. While i havent change a thing. It still works with VLC. But not Spotify. i Running it under Windows

@MeikelLP
Copy link

Probably Spotify has changed a thing. Spotify does this often and has no public api which causes inconsitence.

@florenzius
Copy link

Please fix that! I can't get it working...

@Vindexus
Copy link

I'm running into this issue as well.

@markspolakovs
Copy link
Contributor

markspolakovs commented Jul 19, 2018

THIS IS ONLY FOR DEVELOPERS who want to work on Snip!

If you're having the "No Track Playing" or "Spotify is not currently running" problem, this is not the issue for you!

ApplicationKeys is intentionally ignored:

Snip/.gitignore

Line 116 in dfda32e

ApplicationKeys.cs

This is because it contains DLRudie's private Spotify API key. If you want to add your own, first register an app in Spotify's dashboard, then use the Client Credentials flow to get the key you need (TL;DR get your client ID and secret, concatenate them with a colon (client_id:client_secret), base64 encode that, then post it like so: curl -X "POST" -H "Authorization: Basic YOUR_BASE64_HERE" -d grant_type=client_credentials https://accounts.spotify.com/api/token and get the access_token from the result). Then, create ApplicationKeys.cs yourself like so:

namespace Winter {
  internal sealed class ApplicationKeys {
    internal const string Spotify = "YOUR_KEY_HERE";
  }
}

(i hope)

@MeikelLP
Copy link

Why isn't this configurable?

@Vierdz
Copy link

Vierdz commented Jul 19, 2018

I've had this problem on and off in the past, usually it resolves itself somehow but now it's flat out not working.

@markspolakovs
Copy link
Contributor

@Vierdz if you're talking about "No Track Playing" or "Spotify is not currently running", that's not what we're discussing here, comment in any of the other issues about that, I guarantee adding a Spotify key won't resolve it

@Vierdz
Copy link

Vierdz commented Jul 19, 2018

Thanks!

@florenzius
Copy link

@markspolakovs The first post is also about the error and his guess why it appears. So I have no idea when this will be fixed.. In fact it's keeping me away from streaming and it's annoying

@markspolakovs
Copy link
Contributor

markspolakovs commented Jul 20, 2018

@florenzius (and everyone else, for reference): when DLRudie builds the Snip that you download (in the 7z file) on his computer, he includes his key, so the problem isn't there. It's only when he pushes the code to GitHub that he removes it, to prevent abuse. The lack of ApplicationKeys.cs is 100% not the cause of the errors if you download the 7z file, it's only an issue if you build it from source yourself.

@solidnumber2
Copy link
Author

Thank you @markspolakovs for the detailed explanation of how the ApplicationKeys.cs file functions and how I can even create my own for testing! How could I forget to check the .gitignore?! Guess it's been a while.

Seeing the number of people responding with the same problem at the same time seems to indicate that there may have been a Spotify update that the Snip tool was not ready for, now that I know the "missing file" wasn't the issue.

@GenesisFR
Copy link
Contributor

GenesisFR commented Jul 20, 2018

Here's my ApplicationKeys.cs by the way, it'll save you a quick search on stackoverflow:

using System;
using System.Text;

namespace Winter
{
    public static class ApplicationKeys
    {
        public static string clientid = "";
        public static string clientsecret = "";
        public static string Spotify = Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Format("{0}:{1}", clientid, clientsecret)));
    }
}

@markspolakovs Did you get Snip or any other way to get track information to work? I get "Invalid OAuth token" every time.

@solidnumber2
Copy link
Author

solidnumber2 commented Jul 20, 2018

Oh no...I think Spotify may have changed too drastically for a quick fix to Snip: "Remote control of Spotify’s desktop app has been deprecated in favour of full track playback in the browser." -New Updates to Spotify Play Button, Spotify AB, July 19th

It's such a side comment, too; especially for something that could mess with a bunch of programs/tools that read similar information from the desktop app.

@hakmeister
Copy link

When I get home I’m going to try to revert the Spotify update. I don’t know if this is fixable anytime soon.

@markspolakovs
Copy link
Contributor

I suppose it could be ported to use https://developer.spotify.com/documentation/web-api/reference/player/... would require users to sign in, which would be a pain in the ass but not impossible

@dlrudie
Copy link
Owner

dlrudie commented Jul 21, 2018

Ugh.

@dlrudie
Copy link
Owner

dlrudie commented Jul 21, 2018

I'll figure this out one way or another.

@dlrudie
Copy link
Owner

dlrudie commented Jul 21, 2018

So I have a plan. Those of you that have your compile environments set up I'll be pushing something tonight hopefully.

@hakmeister
Copy link

hakmeister commented Jul 21, 2018 via email

@dlrudie
Copy link
Owner

dlrudie commented Jul 21, 2018

No. Spotify disabled their local API endpoint for controlling the desktop app.

@dlrudie
Copy link
Owner

dlrudie commented Jul 21, 2018

I had to go the hacky route and open the process to read memory. I found a static address in memory that contains the track ID so I can use that. HOWEVER, this address will HIGHLY LIKELY change with each new version of Spotify. I'll need to implement a function in the future to automatically figure out the memory address.

@dlrudie dlrudie changed the title Spotify not working - ApplicationKeys.cs is missing from source code Spotify not working Jul 21, 2018
@markspolakovs
Copy link
Contributor

@dlrudie there exists this web API endpoint: https://developer.spotify.com/documentation/web-api/reference/player/get-the-users-currently-playing-track/ - it seems to be the "official" way of doing this. However, it requires the user to sign in with their Spotify account, which would require opening their OAuth flow in a WebView, This seems like the best way of doing this in the long term, but it would require rewriting much of the Spotify code.

@dlrudie
Copy link
Owner

dlrudie commented Jul 21, 2018

I've already rewrote the majority of the Spotify code tonight. What I have going works great. But only once it's out there will I know if it works for everyone or not. It should be the most reliable solution yet.

@MeikelLP
Copy link

MeikelLP commented Jul 21, 2018

Too bad I just started implementing https://github.com/JohnnyCrazy/SpotifyAPI-NET/ into the app so it is more future proofed ._.
Guess I stop that :D

Edit
I did it anyway lol

@roachadam
Copy link

roachadam commented Jul 24, 2018

Easiest solution here is to just read the artist/song from the spotify title window and do away with the api. @dlrudie

@MeikelLP
Copy link

@roachadam Yes this is the easiest way. But at this point we cannot assure that spotify never changes this behaviour. For a fast workaround solution this may be possible. On the long term we need to access an official API.

@ClutchKey
Copy link

ClutchKey commented Jul 24, 2018

So when I downloaded Snip, it doesn't have like a n application button. I downloaded it during 6.9.1, and it had that button. I don't know what to do after downloading it now. @dlrudie

@MeikelLP
Copy link

@ClutchKey be sure to check your tray popup. Windows might hide it behind other tray icons. If not please verify that the process is running via task manager

@ClutchKey
Copy link

Wait @MeikelLP how exactly do I do that?

@MeikelLP
Copy link

like this: tray
It may hide there and you do not directly see it.

@ClutchKey
Copy link

@MeikelLP Ok well it pops up, but it still says 6.9.1 for me

@GenesisFR
Copy link
Contributor

Well if it says 6.9.1 then you obviously don't have the latest version.

image

@ClutchKey
Copy link

@GenesisFR I realize that thank you. But when I downloaded it, it's not showing an application for me to use it...

@GenesisFR
Copy link
Contributor

GenesisFR commented Jul 24, 2018

What you mean is it's not showing in the task bar, that's because Snip sits in the system tray.

If it's not there after running Snip, then check in your task manager if you can find Snip.exe.

image

If it's not there, then you have another problem.

@ClutchKey
Copy link

No @GenesisFR I downloaded everything that came with the 6.10.1. My PROBLEM is that I don't see an application to run it. It's all the scripts and stuff, but there is no app to use it. It's still showing the old version of 6.9.1 for me. I see it in the task manager, but again, it says it is still running 6.9.1.

@MeikelLP
Copy link

Did you download Snip-v6.10.1.zip or Source code (zip) ? Sounds like you downloaded the source code not the application.

@GenesisFR
Copy link
Contributor

If there's no executable inside Snip-v6.10.1.zip, you can blame your antivirus.

@ClutchKey
Copy link

@MeikelLP Where would I find the snip 6.10.1 zip? I may have downloaded the source code zip by mistake

@MeikelLP
Copy link

Be sure to download it from here called Snip-v6.10.1.zip (or newer)

@ClutchKey
Copy link

Thank you @MeikelLP !!!!! Much Appreciated

@tsuNammi
Copy link

tsuNammi commented Aug 3, 2018

I had this problem, updated to 6.10.2 - then it worked.

After a week now, suddenly it stops working. It can work from beginning of the stream, then suddenly, the Snip.txt file is empty - doesn't help if i close/reopen Spotify and/or Snip. Anyone still having issues?

@MeikelLP
Copy link

MeikelLP commented Aug 3, 2018

@tsuNammi see #315

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests