forked from Chat_things/NeuroDock
Added legal disclaimers about scraping.. mostly to make sure i dont get into too mutch trouble about things
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
# Genius API
|
||||
|
||||
## Important notes
|
||||
### Legal note
|
||||
For legal reasons, this tool is for educational purposes only. And Scraping is not allowed by the Genius API Terms of Service. And I do not encourage the use of Scraping websites for any data, and that API endpoints should always be used instead.
|
||||
### Legal Notice
|
||||
|
||||
This tool is provided for educational and experimental purposes only.
|
||||
|
||||
Please be aware that the Genius API Terms of Service **prohibit** web scraping of their website. This project contains code that performs scraping to retrieve song lyrics directly from Genius.com, which may violate those terms.
|
||||
|
||||
Since Genius does not provide official API endpoints for lyrics due to copyright restrictions, this tool includes scraping functionality as a workaround. However, scraping may result in legal or technical consequences such as IP bans, rate limiting, or other restrictions imposed by Genius.
|
||||
|
||||
**Use this tool responsibly and at your own risk.** The author does not encourage or endorse violating any third-party terms of service or applicable laws and disclaims any liability arising from misuse.
|
||||
|
||||
Whenever possible, prefer using official API endpoints and respect copyright laws.
|
||||
|
||||
## API key required
|
||||
This tool requires a Genius API key to work since it fetches song metadata from the Genius API.
|
||||
|
||||
@@ -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