0

I'm trying to get lyrics from specific songs by using the package "genius" in R. I have used the functions from the package:

kendrick <- gen_song_url("Kendrick Lamar","Humble")
genius_url(kendrick, info = "all")

From "kendrick" I get the url for the lyric on genius webpage. But when I use the function genius_url I get this error message:

Error in stream$next_ident() : Expected ident, got <EOF at 2>

Which I do not understand. Has anyone had the same problem?

camille
  • 16,432
  • 18
  • 38
  • 60
anders
  • 29
  • 3

1 Answers1

0

A issue has been raised, here https://github.com/JosiahParry/genius/issues/62

If you need the lyrics you can use the rvest package

library(rvest)
library(dplyr)

kendrick %>% read_html() %>% 
  html_nodes('.Lyrics__Container-sc-1ynbvzw-6') %>% 
  html_text()

[1] "[Intro]Nobody pray for meIt been that day for meWay (Yeah, yeah)[Verse 1]Ayy, I remember syrup sandwiches and crime allowancesFinesse a nigga with some counterfeits, but now I'm countin’ thisParmesan where my accountant lives, in fact I'm downin' thisD’USSÉ with my boo bae tastes like Kool-Aid for the analystsGirl, I can buy your ass the world with my paystubOoh, that pussy good, won't you sit it on my taste blood
Nad Pat
  • 3,129
  • 3
  • 10
  • 20