danielfm / smudge

Control the Spotify app from within Emacs.
https://asciinema.org/a/218654
GNU General Public License v3.0
313 stars 47 forks source link

HTTP 403 and Void Function Errors After Installing in Doom #78

Closed vaidyafamily closed 10 months ago

vaidyafamily commented 3 years ago

I followed the instructions on this website and installed smudge. The relevant portion of my config reads

(setq smudge-oauth2-client-secret "********")
(setq smudge-oauth2-client-id "********")
(map! :map smudge-mode-map "M-p" #'smudge-command-map)

I'm using Doom Emacs, so in my packages.el I also have

(package! smudge)
(package! simple-httpd)

I setup the spotify app in the spotify developer dashboard as instructed. I have also downloaded the spotify app from the AUR, and spotifyd (and enabled it). I have run these at the same time and separately. Without the official spotify client active, or spotifyd activated through systemctl, I get a "No Active Device Error". If I open up the official spotify client and begin playing a song, Emacs detects what song is playing, but if I try to play a different song I get an HTTP 403 error. Same thing happens if I have both the official client and spotifyd running. If I only have spotifyd activated through systemctl I get a "No Active Device" error. I'm not sure how to make this work so that I can play songs from directly within Emacs.

I made sure to install and enable simple-httpd from within Emacs, as the github site mentions using it. These errors persisted.

Also, upon running smudge-controller-player-status I get a Error running timer ‘smudge-controller-player-status’: (void-function smudge-connect-player-status) message. This particular error only began happening upon updating Doom Emacs yesterday, before that smudge-controller-player-status gave no errors (the prior update to Doom Emacs was 6 weeks ago.)

Help would be appreciated.

vaidyafamily commented 3 years ago

Tried this in vanilla Emacs, but I'm getting the same issue:

(scroll-bar-mode -1)           
(tool-bar-mode -1)             
(set-fringe-mode 10)           
(menu-bar-mode -1)             
(load-theme 'wombat)

(require 'package)

(setq package-archives '(("melpa" . "https://melpa.org/packages/")
             ("org" . "https://orgmode/elpa/")
             ("elpa" . "https://elpa.gnu.org/packages/")))

(package-initialize)
(unless package-archive-contents
  (package-refresh-contents))

(unless (package-installed-p 'use-package)
  (package-install 'use-package))

(require 'use-package)
(setq use-package-always-ensure t)

(use-package smudge)
(use-package simple-httpd)

(setq smudge-oauth2-client-secret "*****")
(setq smudge-oauth2-client-id "*****")

From here I entered global-smudge-remote-mode and tried smudge-controller-toggle-play with the Spotify client playing and got the same 403 error.

b1ackshadow commented 3 years ago

Facing the same issue. The error message is not helpful :(

matheusfillipe commented 3 years ago

Same error on doom-emacs. Got error: (error http 403

takedawilliam commented 3 years ago

I also experience the same problem

Upon debugging, I found that the error occur at this line

Reason: The function smudge-connect-player-status doesn't exist in smudge-controller.el but it does exist in smudge-connect.el

danielfm commented 3 years ago

This 403 error doesn't happen in my setup. If anyone has any suggestion on how to fix this, I'm willing to test the change and release a new version.

My config is like this:

(use-package smudge
  :ensure t
  :config (progn
            (setq smudge-oauth2-client-secret "xxx")
            (setq smudge-oauth2-client-id "xxx")
            (define-key smudge-mode-map (kbd "M-p") 'smudge-command-map)
            (global-smudge-remote-mode)))
danielfm commented 3 years ago

One thing you might try is deleting the .emacs.d/.cache/smudge directory and run the auth flow again. If your token is old, it might not have some of the newly added scopes this plugin needs.

matheusfillipe commented 3 years ago

Are you guys with the 403 error sure that you have a spotify premium account? I have just realized that I didn't after having this same type of problem on another spottily controller app with similar functionality.

danielfm commented 10 months ago

I'm using Doom and have no 403 errors while using smudge, so I'm closing this.