forked from neurodock/NeuroDock
Added legal disclaimers about scraping.. mostly to make sure i dont get into too mutch trouble about things
This commit is contained in:
@@ -19,6 +19,20 @@ import java.util.stream.Collectors;
|
||||
|
||||
import static me.zacharias.chat.core.Core.writeLog;
|
||||
|
||||
/**
|
||||
* This class is an Ollama tool that fetches the lyrics of a song by its ID from the Genius API.
|
||||
* It extends the GeniusEndpointTool to utilize the GeniusTools instance for API calls and caching.
|
||||
* <p>
|
||||
* <h1>Legal Notice</h1>
|
||||
* <p>
|
||||
* I (the developer) do NOT own the rights to the lyrics fetched by this tool, nor do I endorse scraping lyrics from Genius.com,
|
||||
* which may violate their Terms of Service.
|
||||
* </p>
|
||||
* <p>
|
||||
* I disclaim any responsibility or liability for how this tool is used.
|
||||
* Use this tool at your own risk, and please respect all applicable copyright laws and third-party terms.
|
||||
* </p>
|
||||
*/
|
||||
@GeniusEndpoint
|
||||
public class GetLyrics extends GeniusEndpointTool {
|
||||
public GetLyrics(GeniusTools geniusTools) {
|
||||
@@ -56,6 +70,8 @@ public class GetLyrics extends GeniusEndpointTool {
|
||||
|
||||
String lyrics_path = obj.getJSONObject("response").getJSONObject("song").getString("url");
|
||||
try {
|
||||
// WARNING: This request scrapes the lyrics from the Genius website.
|
||||
// Which is against their Terms of Service. Use responsibly
|
||||
Document doc = Jsoup.connect(lyrics_path)
|
||||
.userAgent("insomnia/11.1.0") // TODO: replace with somthing else then insomnia! since we in no way support what ever Insomnia's User-Agent says we do
|
||||
.header("host", "genius.com")
|
||||
|
||||
Reference in New Issue
Block a user