Skip to content

Commit

Permalink
docs: add comments for genius behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
SqrtMinusOne committed Aug 14, 2021
1 parent 12175e6 commit ce7858a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,5 @@ The album cover fetching is similar. The corresponding function is set in ~lyric
- =sync= - as above.

The first argument is =track= because in EMMS all the required information is stored in tracks, and album data is deduced from tracks. So this package just takes a sample track in the album.
* Troubleshooting
I've noticed that Genius can give pages with different DOMs to different people. If you have an empty buffer instead of lyrics, please attach the =curl-cookie-jar= file to the issue. It usually resides in =.emacs.d/request=.
3 changes: 3 additions & 0 deletions lyrics-fetcher-genius.el
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ If SYNC is non-nil, the request will be performed synchronously."
(let* ((html (with-temp-buffer
(insert data)
(libxml-parse-html-region (point-min) (point-max))))
;; Apparently, Genius can give different
;; responses to different people based on
;; cookies.
(lyrics-divs (or (dom-by-class html (rx bos "lyrics" eos))
(dom-by-class html (rx bos "Lyrics__Container" (* nonl))))))
(funcall callback
Expand Down
2 changes: 1 addition & 1 deletion lyrics-fetcher.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

;; Author: Korytov Pavel <thexcloud@gmail.com>
;; Maintainer: Korytov Pavel <thexcloud@gmail.com>
;; Version: 0.1.2
;; Version: 0.1.3
;; Package-Requires: ((emacs "27") (emms "7.5") (f "0.20.0") (request "0.3.2"))
;; Homepage: https://github.com/SqrtMinusOne/lyrics-fetcher.el

Expand Down

0 comments on commit ce7858a

Please sign in to comment.