docs: add comments for genius behavior

This commit is contained in:
Pavel Korytov 2021-08-14 11:38:23 +03:00
parent 12175e6965
commit ce7858a602
3 changed files with 6 additions and 1 deletions

View file

@ -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=.

View file

@ -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

View file

@ -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