mihaiolteanu / vuiet

The music player and explorer for Emacs
https://mihaiolteanu.me/vuiet
GNU General Public License v3.0
278 stars 15 forks source link

Error while trying to get lyrics #66

Closed jjnilton closed 2 years ago

jjnilton commented 2 years ago

I'm getting this error on most songs when trying to get the lyrics with vuiet-playing-track-lyrics:

[error] request--callback: peculiar error: 404 error in process sentinel: apply: Wrong number of arguments: (0 . 0), 8 error in process sentinel: Wrong number of arguments: (0 . 0), 8 [error] request--callback: peculiar error: 400 [error] request-default-error-callback: http://ws.audioscrobbler.com/2.0/ error Error running timer ‘vuiet--scrobble-track’: (wrong-type-argument stringp t)

I'm using emacs 27.1 on Debian 11.

mihaiolteanu commented 2 years ago

That's from failing to scrobble to last.fm, for some reason and not for trying to get the lyrics.\ Enable debugging with enable-debug-on-error and repost the output of the error, when that happens again.

In the worst case, just disable scrobbling for now until we can fix it,

(setf vuiet-scrobble-enabled nil)

Does this happen all the time or just randomly?

jjnilton commented 2 years ago

Coincidentally the first part of that output was appearing when I tried to get the lyrics for a track. Sometimes nothing happens. I also got this with enable-debug-on-error:

Debugger entered--Lisp error: (error "Unimplemented attribute type: pseudo-class")
  signal(error ("Unimplemented attribute type: pseudo-class"))
  error("Unimplemented attribute type: %s" pseudo-class)
  esxml--node-matches-modifier-p((div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div ((class . "alert alert-danger") (role . "alert")) "\n                Access denied.\n            ") "\n") pseudo-class ((name . "nth-child") (args (number . 2))))
  #f(compiled-function (attribute) #<bytecode 0x158032905d19>)((pseudo-class (name . "nth-child") (args (number . 2))))
  cl-every(#f(compiled-function (attribute) #<bytecode 0x158032905d19>) ((tag . div) (pseudo-class (name . "nth-child") (args (number . 2)))))
  #f(compiled-function (node) #<bytecode 0x158032905d2d>)((div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div ((class . "alert alert-danger") (role . "alert")) "\n                Access denied.\n            ") "\n"))
  #f(compiled-function (node) #<bytecode 0x1580328f5ea5>)((div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div ((class . "alert alert-danger") (role . "alert")) "\n                Access denied.\n            ") "\n"))
  esxml-visit-nodes(#f(compiled-function (node) #<bytecode 0x1580328f5ea5>) (div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div ((class . "alert alert-danger") (role . "alert")) "\n                Access denied.\n            ") "\n"))
  esxml-find-nodes(#f(compiled-function (node) #<bytecode 0x158032905d2d>) (div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div ((class . "alert alert-danger") (role . "alert")) "\n                Access denied.\n            ") "\n"))
  #f(compiled-function (node) #<bytecode 0x158032905a5d>)((div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div ((class . "alert alert-danger") (role . "alert")) "\n                Access denied.\n            ") "\n"))
  mapcan(#f(compiled-function (node) #<bytecode 0x158032905a5d>) ("\n  " (div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div ((class . "alert alert-danger") (role . "alert")) "\n                Access denied.\n            ") "\n") "\n"))
  cl-mapcan(#f(compiled-function (node) #<bytecode 0x158032905a5d>) ("\n  " (div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div ((class . "alert alert-danger") (role . "alert")) "\n                Access denied.\n            ") "\n") "\n"))
  esxml-find-descendants(#f(compiled-function (node) #<bytecode 0x158032905d2d>) (div ((class . "row")) "\n  " (div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div ((class . "alert alert-danger") (role . "alert")) "\n                Access denied.\n            ") "\n") "\n"))
  esxml--find-nodes((div ((class . "row")) "\n  " (div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div ((class . "alert alert-danger") (role . "alert")) "\n                Access denied.\n            ") "\n") "\n") ((combinator . descendant)) ((tag . div) (pseudo-class (name . "nth-child") (args (number . 2)))))
  #f(compiled-function (node) #<bytecode 0x158032905dcd>)((div ((class . "row")) "\n  " (div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div ((class . "alert alert-danger") (role . "alert")) "\n                Access denied.\n            ") "\n") "\n"))
  mapcan(#f(compiled-function (node) #<bytecode 0x158032905dcd>) ((div ((class . "row")) "\n  " (div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div ((class . "alert alert-danger") (role . "alert")) "\n                Access denied.\n            ") "\n") "\n")))
  cl-mapcan(#f(compiled-function (node) #<bytecode 0x158032905dcd>) ((div ((class . "row")) "\n  " (div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div ((class . "alert alert-danger") (role . "alert")) "\n                Access denied.\n            ") "\n") "\n")))
  esxml--query((((tag . div) (class . "container") (class . "main-page")) ((combinator . descendant)) ((tag . div) (class . "row")) ((combinator . descendant)) ((tag . div) (pseudo-class (name . "nth-child") (args (number . 2)))) ((combinator . descendant)) ((tag . div) (pseudo-class (name . "nth-of-type") (args (number . 5))))) (html ((lang . "en")) (head nil (meta ((charset . "utf-8"))) (meta ((http-equiv . "X-UA-Compatible") (content . "IE=edge"))) (meta ((name . "viewport") (content . "width=device-width, initial-scale=1"))) (meta ((name . "robots") (content . "noindex,nofollow"))) (title nil "AZLyrics - request for access") (link ((rel . "stylesheet") (href . "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/cs...") (integrity . "sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4...") (crossorigin . "anonymous"))) (link ((rel . "stylesheet") (href . "https://code.jquery.com/ui/1.12.1/themes/base/jque..."))) (link ((rel . "stylesheet") (href . "/bsaz.css"))) (comment nil " HTML5 shim and Respond.js for IE8 support of HTML...") (comment nil "[if lt IE 9]>\n      <script src=\"https://oss.maxcd...") (script ((src . "https://www.google.com/recaptcha/api.js") (defer . "defer"))) (script ((src . "https://code.jquery.com/jquery-1.12.4.min.js") (integrity . "sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ...") (crossorigin . "anonymous"))) (script ((src . "https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"))) (script ((src . "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js...") (integrity . "sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCW...") (crossorigin . "anonymous"))) (script ((type . "text/javascript")) "\n    <!-- \n      if (top.location != self.location...")) (body nil "\n\n  " (nav ((class . "navbar navbar-default navbar-static-top text-cente...")) (div ((class . "container text-center")) "\n    " (div ((class . "navbar-header") (style . "float:none; display:inline-block;")) "\n      " (a (... ...) (img ...)) "\n    ") "\n  ") (comment nil " /.container ") "\n  ") (comment nil " top ban ") (comment nil "  <div class=\"lboard-wrap\">\n  <div class=\"containe...") (comment nil " main ") (div ((class . "container main-page")) "\n  " (div ((class . "row")) "\n  " (div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div (... ...) "\n                Access denied.\n            ") "\n") "\n") "\n\n             ") "\n    \n    " (comment nil " container main-page ") "\n\n" (comment nil " bot ban ") "\n  " (comment nil "<div class=\"lboard-wrap\">\n  <div class=\"container\"...") "\n\n" (comment nil " footer ") "\n     " (comment nil "<nav class=\"navbar navbar-footer\">\n          <div ...") "\n     " (div ((class . "footer-wrap")) "\n          " (div ((class . "container")) "\n          " (small nil "\n             " (script (...) "\n                curdate=new Date();\n             ...")) "\n          ") "\n     ") "\n  ")))
  esxml-query-all("div.container.main-page div.row div:nth-child(2) d..." (html ((lang . "en")) (head nil (meta ((charset . "utf-8"))) (meta ((http-equiv . "X-UA-Compatible") (content . "IE=edge"))) (meta ((name . "viewport") (content . "width=device-width, initial-scale=1"))) (meta ((name . "robots") (content . "noindex,nofollow"))) (title nil "AZLyrics - request for access") (link ((rel . "stylesheet") (href . "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/cs...") (integrity . "sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4...") (crossorigin . "anonymous"))) (link ((rel . "stylesheet") (href . "https://code.jquery.com/ui/1.12.1/themes/base/jque..."))) (link ((rel . "stylesheet") (href . "/bsaz.css"))) (comment nil " HTML5 shim and Respond.js for IE8 support of HTML...") (comment nil "[if lt IE 9]>\n      <script src=\"https://oss.maxcd...") (script ((src . "https://www.google.com/recaptcha/api.js") (defer . "defer"))) (script ((src . "https://code.jquery.com/jquery-1.12.4.min.js") (integrity . "sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ...") (crossorigin . "anonymous"))) (script ((src . "https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"))) (script ((src . "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js...") (integrity . "sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCW...") (crossorigin . "anonymous"))) (script ((type . "text/javascript")) "\n    <!-- \n      if (top.location != self.location...")) (body nil "\n\n  " (nav ((class . "navbar navbar-default navbar-static-top text-cente...")) (div ((class . "container text-center")) "\n    " (div ((class . "navbar-header") (style . "float:none; display:inline-block;")) "\n      " (a (... ...) (img ...)) "\n    ") "\n  ") (comment nil " /.container ") "\n  ") (comment nil " top ban ") (comment nil "  <div class=\"lboard-wrap\">\n  <div class=\"containe...") (comment nil " main ") (div ((class . "container main-page")) "\n  " (div ((class . "row")) "\n  " (div ((class . "col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-m...")) "\n            " (div (... ...) "\n                Access denied.\n            ") "\n") "\n") "\n\n             ") "\n    \n    " (comment nil " container main-page ") "\n\n" (comment nil " bot ban ") "\n  " (comment nil "<div class=\"lboard-wrap\">\n  <div class=\"container\"...") "\n\n" (comment nil " footer ") "\n     " (comment nil "<nav class=\"navbar navbar-footer\">\n          <div ...") "\n     " (div ((class . "footer-wrap")) "\n          " (div ((class . "container")) "\n          " (small nil "\n             " (script (...) "\n                curdate=new Date();\n             ...")) "\n          ") "\n     ") "\n  ")))
  versuri--parse(#s(versuri--website :name "azlyrics" :template "https://www.azlyrics.com/lyrics/${artist}/${song}...." :separator "" :query "div.container.main-page div.row div:nth-child(2) d...") "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <met...")
  #f(compiled-function (resp) #<bytecode 0x1580323956a5>)("<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <met...")
  #f(compiled-function (&rest rest) #<bytecode 0x1580323957d9>)(:data "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <met..." :symbol-status success :error-thrown nil :response #s(request-response :status-code 200 :history (#s(request-response :status-code nil :history nil :data nil :error-thrown nil :symbol-status nil :url "https://www.azlyrics.com/lyrics/FooFighters/Genera..." :done-p nil :settings nil :-buffer #<killed buffer> :-raw-header "HTTP/1.1 302 Moved Temporarily\nServer: nginx\nDate:..." :-timer nil :-backend curl)) :data "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <met..." :error-thrown nil :symbol-status success :url "https://b.azlyrics.com/?u=/lyrics/FooFighters/Gene..." :done-p nil :settings (:parser buffer-string :sync nil :success #f(compiled-function (&rest rest) #<bytecode 0x1580323957d9>) :error #f(compiled-function () #<bytecode 0x1580323957f1>) :status-code ((403 lambda nil (funcall callback nil))) :url "https://www.azlyrics.com/lyrics/FooFighters/Genera..." :response #8 :encoding utf-8) :-buffer #<killed buffer> :-raw-header "HTTP/1.1 200 OK\nServer: nginx\nDate: Mon, 31 Jan 20..." :-timer nil :-backend curl))
  apply(#f(compiled-function (&rest rest) #<bytecode 0x1580323957d9>) (:data "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <met..." :symbol-status success :error-thrown nil :response #s(request-response :status-code 200 :history (#s(request-response :status-code nil :history nil :data nil :error-thrown nil :symbol-status nil :url "https://www.azlyrics.com/lyrics/FooFighters/Genera..." :done-p nil :settings nil :-buffer #<killed buffer> :-raw-header "HTTP/1.1 302 Moved Temporarily\nServer: nginx\nDate:..." :-timer nil :-backend curl)) :data "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <met..." :error-thrown nil :symbol-status success :url "https://b.azlyrics.com/?u=/lyrics/FooFighters/Gene..." :done-p nil :settings (:parser buffer-string :sync nil :success #f(compiled-function (&rest rest) #<bytecode 0x1580323957d9>) :error #f(compiled-function () #<bytecode 0x1580323957f1>) :status-code ((403 lambda nil (funcall callback nil))) :url "https://www.azlyrics.com/lyrics/FooFighters/Genera..." :response #10 :encoding utf-8) :-buffer #<killed buffer> :-raw-header "HTTP/1.1 200 OK\nServer: nginx\nDate: Mon, 31 Jan 20..." :-timer nil :-backend curl)))
  request--callback(#<killed buffer> :parser buffer-string :sync nil :success #f(compiled-function (&rest rest) #<bytecode 0x1580323957d9>) :error #f(compiled-function () #<bytecode 0x1580323957f1>) :status-code ((403 lambda nil (funcall callback nil))) :url "https://www.azlyrics.com/lyrics/FooFighters/Genera..." :response #s(request-response :status-code 200 :history (#s(request-response :status-code nil :history nil :data nil :error-thrown nil :symbol-status nil :url "https://www.azlyrics.com/lyrics/FooFighters/Genera..." :done-p nil :settings nil :-buffer #<killed buffer> :-raw-header "HTTP/1.1 302 Moved Temporarily\nServer: nginx\nDate:..." :-timer nil :-backend curl)) :data "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <met..." :error-thrown nil :symbol-status success :url "https://b.azlyrics.com/?u=/lyrics/FooFighters/Gene..." :done-p nil :settings (:parser buffer-string :sync nil :success #f(compiled-function (&rest rest) #<bytecode 0x1580323957d9>) :error #f(compiled-function () #<bytecode 0x1580323957f1>) :status-code ((403 lambda nil (funcall callback nil))) :url "https://www.azlyrics.com/lyrics/FooFighters/Genera..." :response #15 :encoding utf-8) :-buffer #<killed buffer> :-raw-header "HTTP/1.1 200 OK\nServer: nginx\nDate: Mon, 31 Jan 20..." :-timer nil :-backend curl) :encoding utf-8)
  apply(request--callback #<killed buffer> (:parser buffer-string :sync nil :success #f(compiled-function (&rest rest) #<bytecode 0x1580323957d9>) :error #f(compiled-function () #<bytecode 0x1580323957f1>) :status-code ((403 lambda nil (funcall callback nil))) :url "https://www.azlyrics.com/lyrics/FooFighters/Genera..." :response #s(request-response :status-code 200 :history (#s(request-response :status-code nil :history nil :data nil :error-thrown nil :symbol-status nil :url "https://www.azlyrics.com/lyrics/FooFighters/Genera..." :done-p nil :settings nil :-buffer #<killed buffer> :-raw-header "HTTP/1.1 302 Moved Temporarily\nServer: nginx\nDate:..." :-timer nil :-backend curl)) :data "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <met..." :error-thrown nil :symbol-status success :url "https://b.azlyrics.com/?u=/lyrics/FooFighters/Gene..." :done-p nil :settings #3 :-buffer #<killed buffer> :-raw-header "HTTP/1.1 200 OK\nServer: nginx\nDate: Mon, 31 Jan 20..." :-timer nil :-backend curl) :encoding utf-8))
  request--curl-callback("https://www.azlyrics.com/lyrics/FooFighters/Genera..." #<process request curl> "finished\n")
  apply(request--curl-callback ("https://www.azlyrics.com/lyrics/FooFighters/Genera..." #<process request curl> "finished\n"))
  #f(compiled-function (&rest args2) #<bytecode 0x1580323958e9>)(#<process request curl> "finished\n")

But this happens shortly after I play a track, it seems:

[error] request--callback: peculiar error: 400
[error] request-default-error-callback: http://ws.audioscrobbler.com/2.0/ error
Error running timer ‘vuiet--scrobble-track’: (wrong-type-argument stringp t)

And here with enable-debug-on-error enabled:

Debugger entered--Lisp error: (wrong-type-argument stringp t)
  format-message(t)
  apply(format-message t)
  error(t)
  (progn (error it))
  (if it (progn (error it)))
  (let ((it (s-present-p (elquery-text (cl-first (elquery-$ "error" raw-response)))))) (if it (progn (error it))))
  (let ((raw-response (elquery-read-string response))) (let ((it (s-present-p (elquery-text (cl-first (elquery-$ "error" raw-response)))))) (if it (progn (error it)))) (let ((parsed-response (mapcar #'(lambda (query-str) (reverse ...)) query-strings))) (if (cl-some #'(lambda (e) (= (length e) 1)) parsed-response) (-flatten parsed-response) (if (= (length query-strings) 2) (-zip-with #'list (cl-first parsed-response) (car (cdr parsed-response))) (apply #'-zip parsed-response)))))
  lastfm--parse-response("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<lfm status..." ("lfm"))
  lastfm-track-scrobble("Foo Fighters" "Generator" "1643668415")
  vuiet--scrobble-track(#s(vuiet-track :artist "Foo Fighters" :name "Generator" :duration "3:48"))
  apply(vuiet--scrobble-track #s(vuiet-track :artist "Foo Fighters" :name "Generator" :duration "3:48"))
  timer-event-handler([t 25080 25535 460819 nil vuiet--scrobble-track (#s(vuiet-track :artist "Foo Fighters" :name "Generator" :duration "3:48")) nil 462000])
  read-from-minibuffer("M-x " "^" (keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) keymap (36 . ivy-magic-read-file-env) (3 keymap (19 . ivy-rotate-sort) (1 . ivy-toggle-ignore) (15 . ivy-occur)) (33554464 . ivy-restrict-to-matches) (15 . hydra-ivy/body) (22 . ivy-scroll-up-command) (prior . ivy-scroll-down-command) (next . ivy-scroll-up-command) (7 . minibuffer-keyboard-quit) (right . ivy-forward-char) (32 . self-insert-command) (18 . ivy-reverse-i-search) (remap keymap (describe-mode . ivy-help) (kill-ring-save . ivy-kill-ring-save) (kill-whole-line . ivy-kill-whole-line) (kill-line . ivy-kill-line) (scroll-down-command . ivy-scroll-down-command) (scroll-up-command . ivy-scroll-up-command) (end-of-buffer . ivy-end-of-buffer) (beginning-of-buffer . ivy-beginning-of-buffer) (kill-word . ivy-kill-word) (forward-char . ivy-forward-char) (delete-char . ivy-delete-char) (backward-kill-word . ivy-backward-kill-word) (backward-delete-char-untabify . ivy-backward-delete-char) (delete-backward-char . ivy-backward-delete-char) (previous-line . ivy-previous-line) (next-line . ivy-next-line)) (9 . ivy-partial-or-done) (10 . ivy-alt-done) (27 keymap (1 . ivy-read-action) (15 . ivy-dispatching-call) (111 . ivy-dispatching-done) (25 . ivy-insert-current-full) (105 . ivy-insert-current) (106 . ivy-yank-word) (114 . ivy-toggle-regexp-quote) (97 . ivy-toggle-marks) (16 . ivy-previous-line-and-call) (14 . ivy-next-line-and-call) (118 . ivy-scroll-down-command) (112 . ivy-previous-history-element) (110 . ivy-next-history-element) (10 . ivy-immediate-done) (13 . ivy-call)) (mouse-3 . ivy-mouse-dispatching-done) (mouse-1 . ivy-mouse-done) (down-mouse-1 . ignore) (13 . ivy-done)) nil counsel-M-x-history)
  ivy-read("M-x " ("vuiet-play-track-search" "toggle-debug-on-error" "smudge-select-device" "customize-face" "mlw-mode-line-buf-id-sel-win-mode" "mc/mark-next-like-this-word" "customize-variable" "package-install" "eval-buffer" "mc/mark-pop" "syntree-insert" "customize-group" "minimap-mode" "git-gutter-mode" "whitespace-mode" "lsp" "mc/mark-next-word-like-this" "phpactor-generate-accessors" "web-mode" "smudge-track-search" "lsp-ui-mode" "customize-themes" "cua-mode" "vuiet-play-album" "package-list-packages" "eglot" "rgrep" "flyspell-mode" "sublimity-mode" "multiple-cursors-mode" "display-line-numbers-mode" "vuiet-playing-track-lyrics" "counsel-fzf" "mc/edit-lines" "esup" "helm-find" "company-mode" "tool-bar-mode" "git-gutter+-mode" "magit" "indent-region" "list-packages" "eval-expression" "org-indent-mode" "transpose-frame" "eval-and-replace" "vuiet-album-info" "customize-apropos" "electric-indent-mode" "org-mode" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)

Another thing I noticed is that vuiet-album-info and vuiet-album-info-search aren't available when I first start Emacs, but they show up after a search for a track or artist.

Thanks!

mihaiolteanu commented 2 years ago

You get an error from last.fm itself, while the code indeed handles it wrongly (that's a bug). But the most important thing for now is why or what error do you get. I believe that you can check that in your Messages buffer, on this line,

lastfm--parse-response("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<lfm status..." ("lfm"))

As of now there is only the ... for the actual status. I believe you might be able to click on that and let emacs expand that line. It might be useful for us.

You can also manually try to scrobble the track, maybe you get the same error and it would be easier to debug,

(lastfm-track-scrobble "Foo Fighters" "Generator" "1643668415")

It works in my case,

Feb01-082248

jjnilton commented 2 years ago

The error in that line is:

lastfm--parse-response("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<lfm status=\"failed\">\n  <error code=\"13\">Invalid method signature supplied</error>\n</lfm>\n" ("lfm"))

I get the same error when trying to scrobble manually:

  format-message(t)
  apply(format-message t)
  error(t)
  (progn (error it))
  (if it (progn (error it)))
  (let ((it (s-present-p (elquery-text (cl-first (elquery-$ "error" raw-response)))))) (if it (progn (error it))))
  (let ((raw-response (elquery-read-string response))) (let ((it (s-present-p (elquery-text (cl-first (elquery-$ "error" raw-response)))))) (if it (progn (error it)))) (let ((parsed-response (mapcar #'(lambda (query-str) (reverse ...)) query-strings))) (if (cl-some #'(lambda (e) (= (length e) 1)) parsed-response) (-flatten parsed-response) (if (= (length query-strings) 2) (-zip-with #'list (cl-first parsed-response) (car (cdr parsed-response))) (apply #'-zip parsed-response)))))
  lastfm--parse-response("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<lfm status=\"failed\">\n  <error code=\"13\">Invalid method signature supplied</error>\n</lfm>\n" ("lfm"))
  lastfm-track-scrobble("Foo Fighters" "Generator" "1643668415")
  eval((lastfm-track-scrobble "Foo Fighters" "Generator" "1643668415") t)
  eval-expression((lastfm-track-scrobble "Foo Fighters" "Generator" "1643668415") nil nil 127)
  funcall-interactively(eval-expression (lastfm-track-scrobble "Foo Fighters" "Generator" "1643668415") nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

Unrelated, but I also get this error when I first try to play a track:

 signal(error ("Failed to connect to mpv"))
  error("Failed to connect to mpv")
  mpv-start("--no-video" "--idle=yes" "--keep-open=yes")
  vuiet--play(#f(compiled-function (op value) #<bytecode 0x1555b2019ae5>))
  vuiet-play((("Pink Floyd" "Time")))
  #f(compiled-function (selection) #<bytecode 0x1555b2085e69>)(("Pink Floyd      Time               " ("Pink Floyd" "Time")))
  ivy-call()
  ivy-read("Play song: " (("BTS             My Time            " ("BTS" "My Time")) ("MGMT            Time to Pretend    " ("MGMT" "Time to Pretend")) ("Muse            Time Is Running Out" ("Muse" "Time Is Running Out")) ("Pink Floyd      Time               " ("Pink Floyd" "Time")) ("Lana Del Rey    Doin' Time         " ("Lana Del Rey" "Doin' Time")) ("Daft Punk       One More Time      " ("Daft Punk" "One More Time")) ("Paramore        HarD TiMEs         " ("Paramore" "HarD TiMEs")) ("Playboi Carti   Long Time - Intro  " ("Playboi Carti" "Long Time - Intro")) ("Foo Fighters    Times Like These   " ("Foo Fighters" "Times Like These")) ("Cyndi Lauper    Time After Time    " ("Cyndi Lauper" "Time After Time"))) :action #f(compiled-function (selection) #<bytecode 0x1555b2085e69>))
  vuiet--ivy-play-song((("BTS" "My Time") ("MGMT" "Time to Pretend") ("Muse" "Time Is Running Out") ("Pink Floyd" "Time") ("Lana Del Rey" "Doin' Time") ("Daft Punk" "One More Time") ("Paramore" "HarD TiMEs") ("Playboi Carti" "Long Time - Intro") ("Foo Fighters" "Times Like These") ("Cyndi Lauper" "Time After Time")))
  vuiet-play-track-search("time")
  funcall-interactively(vuiet-play-track-search "time")
  call-interactively(vuiet-play-track-search record nil)
  command-execute(vuiet-play-track-search record)
  counsel-M-x-action("vuiet-play-track-search")
  ivy-call()
  ivy-read("M-x " ("toggle-debug-on-error" "global-smudge-remote-mode" "smudge-controller-toggle-play" "customize-variable" "mlw-mode-line-buf-id-sel-win-mode" "smudge-track-search" "mc/mark-next-like-this-word" "package-install" "eval-buffer" "mc/mark-pop" "syntree-insert" "customize-group" "minimap-mode" "git-gutter-mode" "whitespace-mode" "lsp" "mc/mark-next-word-like-this" "phpactor-generate-accessors" "web-mode" "lsp-ui-mode" "customize-face" "customize-themes" "cua-mode" "vuiet-play-album" "package-list-packages" "eglot" "rgrep" "flyspell-mode" "sublimity-mode" "multiple-cursors-mode" "display-line-numbers-mode" "smudge-controller-next-track" "counsel-fzf" "mc/edit-lines" "esup" "helm-find" "company-mode" "tool-bar-mode" "git-gutter+-mode" "magit" "indent-region" "list-packages" "eval-expression" "org-indent-mode" "transpose-frame" "eval-and-replace" "customize-apropos" "electric-indent-mode" "smudge-select-device" "org-mode" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)

Thanks.

mihaiolteanu commented 2 years ago

lastfm--parse-response("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<lfm status=\"failed\">\n <error code=\"13\">Invalid method signature supplied\n\n" ("lfm"))

Just to be sure, you are using vuiet successfully otherwise and you did follow the install steps successfully, right? https://github.com/mihaiolteanu/lastfm.el#install

Another thing I noticed is that vuiet-album-info and vuiet-album-info-search aren't available when I first start Emacs, but they show up after a search for a track or artist.

Yes, most of the functionality is autoloaded, meaning they will only be available if you actually use vuiet. It's a way of not loading everything at start-up and using resources that you don't actually need. It's a feature offered by emacs.

jjnilton commented 2 years ago

Just to be sure, you are using vuiet successfully otherwise and you did follow the install steps successfully, right? https://github.com/mihaiolteanu/lastfm.el#install

Yes, it works fine - I can search for songs, play, get the lyrics, etc.

I think did this part in reverse order, though:

Grant access to Last.fm, make sure Lastm.fm displays the "Application Authenticated" message and then answer yes to Emacs. At this point, the SK is added to your lastfmrc file and all the services are now working. Save the file and use it for all eternity, never having to repeat this process ever again.

I think I answered 'yes' to Emacs and then confirmed in the browser.

Yes, most of the functionality is autoloaded, meaning they will only be available if you actually use vuiet. It's a way of not loading everything at start-up and using resources that you don't actually need. It's a feature offered by emacs.

Is that why the vuiet-album-info-search command isn't available before I search a track or artist?

mihaiolteanu commented 2 years ago

Check that you have the /home/<username>/.config/.lastfmrc file, then, and confirm you have the following fields in it,

(CONFIG :API-KEY "your-api" 
        :SHARED-SECRET "your-shared-secret" 
        :USERNAME "your-username" 
        :SK "your-sk")

Just make sure you don't post any of its contents here, though.

Yes, you can check the implementation. All the (interactive) functions that have an ;;;;autoload on top of them are not available when you first start emacs. All the others are. Calling any one of them leads emacs to load the autoloaded ones, too.

https://www.gnu.org/software/emacs/manual/html_node/elisp/Autoloading.html

jjnilton commented 2 years ago

Check that you have the /home//.config/.lastfmrc file, then, and confirm you have the following fields in it,

Yes, I have the ~/.config/.lastfmrc file with key, secret and username.

Yes, you can check the implementation. All the (interactive) functions that have an ;;;;autoload on top of them are not available when you first start emacs. All the others are. Calling any one of them leads emacs to load the autoloaded ones, too.

Got it, thanks for the explanation!

mihaiolteanu commented 2 years ago

You can also try adding a tag for your track, for example.

;; Evaluate this first; no tags yet
(lastfm-track-get-tags "anathema" "one last goodbye")
=> ("") 

;; Add a personal tag to this song
(lastfm-track-add-tags "anathema" "one last goodbye" "favorite")

;; Re-evaluate and expect the added tag
(lastfm-track-get-tags "anathema" "one last goodbye")
=> ("Favorite")

The add-tag method is also similar to the love-track method, in that you need modify access rights to last.fm, so to speak, for the call to be successful.

If this add-tag call also returns an error, I would go on and repeat the last.fm install process. Maybe also ask for a new lastfm API, in the extreme case.

jjnilton commented 2 years ago

Thanks for your help. I tried this:

(lastfm-track-get-tags "anathema" "one last goodbye")

And still got this:

Debugger entered--Lisp error: (wrong-type-argument stringp t)
  format-message(t)
  apply(format-message t)
  error(t)
  (progn (error it))
  (if it (progn (error it)))
  (let ((it (s-present-p (elquery-text (cl-first (elquery-$ "error" raw-response)))))) (if it (progn (error it))))
  (let ((raw-response (elquery-read-string response))) (let ((it (s-present-p (elquery-text (cl-first (elquery-$ "error" raw-response)))))) (if it (progn (error it)))) (let ((parsed-response (mapcar #'(lambda (query-str) (reverse ...)) query-strings))) (if (cl-some #'(lambda (e) (= (length e) 1)) parsed-response) (-flatten parsed-response) (if (= (length query-strings) 2) (-zip-with #'list (cl-first parsed-response) (car (cdr parsed-response))) (apply #'-zip parsed-response)))))
  lastfm--parse-response("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<lfm status=\"failed\">\n  <error code=\"13\">Invalid method signature supplied</error>\n</lfm>\n" ("name"))
  lastfm-track-get-tags("anathema" "one last goodbye")
  eval((lastfm-track-get-tags "anathema" "one last goodbye") t)
  eval-expression((lastfm-track-get-tags "anathema" "one last goodbye") nil nil 127)
  funcall-interactively(eval-expression (lastfm-track-get-tags "anathema" "one last goodbye") nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

So I asked for a new API key and configured it again, this time confirming in the Last.fm page before answer 'yes' to the prompt in emacs, and it seems to be solved. So I guess the issue was the API key.

Thanks again for all the help and explanations.