Sv443 пре 3 година
родитељ
комит
e798a686e4
5 измењених фајлова са 44 додато и 667 уклоњено
  1. 2 2
      .env.template
  2. 1 1
      LICENSE.txt
  3. 25 11
      README.md
  4. 16 652
      package-lock.json
  5. 0 1
      package.json

+ 2 - 2
.env.template

@@ -1,2 +1,2 @@
-HTTP_PORT=1234
-GENIUS_ACCESS_TOKEN=abcdef # Gotten from POST https://api.genius.com/oauth/token
+HTTP_PORT=8074
+GENIUS_ACCESS_TOKEN=abcdef # Gotten from POST https://api.genius.com/oauth/token or from creating a client on https://genius.com/api-clients

+ 1 - 1
LICENSE → LICENSE.txt

@@ -1,6 +1,6 @@
 MIT License
 MIT License
 
 
-Copyright (c) 2022 Sven Fehler
+Copyright (c) 2022 Sven Fehler (Sv443)
 
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 of this software and associated documentation files (the "Software"), to deal

+ 25 - 11
README.md

@@ -1,9 +1,17 @@
 # geniURL
 # geniURL
-Simple "REST proxy" for searching for lyrics on genius.com
+Simple JSON "REST proxy" to search for lyrics metadata on [genius](https://genius.com/).  
+Obtaining actual lyrics sadly isn't possible.
 
 
 
 
 <br><br>
 <br><br>
 
 
+## Base URL:
+I host a public instance on this URL:
+```
+https://api.sv443.net/geniurl/
+```
+
+<br>
 
 
 ## Routes:
 ## Routes:
 All routes support gzip and deflate compression.  
 All routes support gzip and deflate compression.  
@@ -13,8 +21,12 @@ All routes support gzip and deflate compression.
 > ### GET `/search?q=search_text`
 > ### GET `/search?q=search_text`
 > This endpoint gives you the top 10 results for a search query specified by `search_text`  
 > This endpoint gives you the top 10 results for a search query specified by `search_text`  
 > The returned data contains various data like the lyrics website URL, song and thumbnail metadata and more (see below).  
 > The returned data contains various data like the lyrics website URL, song and thumbnail metadata and more (see below).  
->   
-> The `search_text` should contain both song and artist name(s) if possible (order doesn't matter, separate with a whitespace)
+> 
+> <br>
+> 
+> **Parameters:**  
+> `?q=search%20query`  
+> This parameter should contain both song and artist name(s) if possible (order doesn't matter, separate with a whitespace).  
 > Sometimes the song name alone might be enough but the results may vary.  
 > Sometimes the song name alone might be enough but the results may vary.  
 > If the search query contains special characters, they need to be [percent/URL-encoded.](https://en.wikipedia.org/wiki/Percent-encoding)  
 > If the search query contains special characters, they need to be [percent/URL-encoded.](https://en.wikipedia.org/wiki/Percent-encoding)  
 > 
 > 
@@ -66,16 +78,19 @@ All routes support gzip and deflate compression.
 > </details>
 > </details>
 > <br>
 > <br>
 
 
-<br><br>
+<br>
 
 
-> ### GET `/lyrics?q=search_text`
-> Use this endpoint to get the lyrics of a specified song and additionally all properties from the top result of the `/search` endpoint.  
->   
-> The `search_text` should contain both song and artist name(s) if possible (order doesn't matter, separate with a whitespace)
+> ### GET `/search/top`
+> This endpoint is the same as `/search`, but it only gives the top result.  
+> Use this if you are only interested in the top result and want to reduce traffic.  
+> 
+> <br>
+> 
+> **Parameters:**  
+> `?q=search%20query`  
+> This parameter should contain both song and artist name(s) if possible (order doesn't matter, separate with a whitespace).  
 > Sometimes the song name alone might be enough but the results may vary.  
 > Sometimes the song name alone might be enough but the results may vary.  
 > If the search query contains special characters, they need to be [percent/URL-encoded.](https://en.wikipedia.org/wiki/Percent-encoding)  
 > If the search query contains special characters, they need to be [percent/URL-encoded.](https://en.wikipedia.org/wiki/Percent-encoding)  
->   
-> This feature is powered by [this awesome scraper.](https://github.com/farshed/genius-lyrics-api)
 > 
 > 
 > <br>
 > <br>
 > <details><summary><b>Successful response (click to view)</b></summary>
 > <details><summary><b>Successful response (click to view)</b></summary>
@@ -83,7 +98,6 @@ All routes support gzip and deflate compression.
 > ```json
 > ```json
 > {
 > {
 >     "error": false,
 >     "error": false,
->     "lyrics": "[Verse 1]\nAyy ayy ayy\nYou know who it is ayy\n",
 >     "url": "https://genius.com/Artist-1-song-name-lyrics",
 >     "url": "https://genius.com/Artist-1-song-name-lyrics",
 >     "path": "/Artist-1-song-name-lyrics",
 >     "path": "/Artist-1-song-name-lyrics",
 >     "meta": {
 >     "meta": {

Разлика између датотеке није приказан због своје велике величине
+ 16 - 652
package-lock.json


+ 0 - 1
package.json

@@ -31,7 +31,6 @@
     "compression": "^1.7.4",
     "compression": "^1.7.4",
     "cors": "^2.8.5",
     "cors": "^2.8.5",
     "express": "^4.17.3",
     "express": "^4.17.3",
-    "genius-lyrics-api": "^3.2.0",
     "helmet": "^5.0.2",
     "helmet": "^5.0.2",
     "kleur": "^4.1.4",
     "kleur": "^4.1.4",
     "rate-limiter-flexible": "^2.3.6",
     "rate-limiter-flexible": "^2.3.6",

Неке датотеке нису приказане због велике количине промена