rob's song page hecking died
This commit is contained in:
parent
c2c0d093d7
commit
82b7dfa7a7
6 changed files with 17 additions and 4 deletions
|
@ -7,13 +7,18 @@ module.exports = async (app, req, res) => {
|
||||||
if (req.offline) return res.send(info)
|
if (req.offline) return res.send(info)
|
||||||
|
|
||||||
let songID = req.params.song
|
let songID = req.params.song
|
||||||
|
let testError = false
|
||||||
|
|
||||||
request.post('http://boomlings.com/database/testSong.php?songID=' + songID, req.gdParams(), function(err, resp, body) {
|
request.post('http://boomlings.com/database/testSong.php?songID=' + songID, req.gdParams(), function(err, resp, body) {
|
||||||
if (err || !body || body == '-1' || body.startsWith("<")) return res.send(info)
|
if (err || !body || body == '-1' || body.startsWith("<")) return res.send(info)
|
||||||
|
else if (!body.includes("<br>")) testError = true
|
||||||
|
|
||||||
req.gdRequest('getGJSongInfo', {songID: songID}, function(err2, resp, songAllowed) {
|
req.gdRequest('getGJSongInfo', {songID: songID}, function(err2, resp, songAllowed) {
|
||||||
if (err2 || !songAllowed || songAllowed < 0 || body.startsWith("<")) return res.send(info)
|
if (err2 || !songAllowed || songAllowed < 0 || body.startsWith("<")) return res.send(info)
|
||||||
|
|
||||||
|
info.song.allowed = songAllowed.length > 15
|
||||||
|
if (testError) return res.send(info)
|
||||||
|
|
||||||
let artistInfo = body.split(/<\/?br>/)
|
let artistInfo = body.split(/<\/?br>/)
|
||||||
info.artist.name = artistInfo[0].split(": ")[1]
|
info.artist.name = artistInfo[0].split(": ")[1]
|
||||||
info.exists = info.artist.name.length > 0
|
info.exists = info.artist.name.length > 0
|
||||||
|
@ -21,7 +26,6 @@ module.exports = async (app, req, res) => {
|
||||||
info.artist.whitelisted = artistInfo[1].split("is NOT").length == 1
|
info.artist.whitelisted = artistInfo[1].split("is NOT").length == 1
|
||||||
info.song.name = artistInfo[4].split(": ")[1]
|
info.song.name = artistInfo[4].split(": ")[1]
|
||||||
info.song.externalUse = artistInfo[5].split("API NOT").length == 1
|
info.song.externalUse = artistInfo[5].split("API NOT").length == 1
|
||||||
info.song.allowed = songAllowed.length > 15
|
|
||||||
|
|
||||||
delete info.error
|
delete info.error
|
||||||
res.send(info)
|
res.send(info)
|
||||||
|
|
BIN
assets/gdps/aurora_icon.png
Normal file
BIN
assets/gdps/aurora_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 201 KiB |
BIN
assets/gdps/aurora_logo.png
Normal file
BIN
assets/gdps/aurora_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 53 KiB |
|
@ -747,7 +747,7 @@
|
||||||
<br>
|
<br>
|
||||||
<p class="reveal" onclick="$('#response-analyze').slideToggle(100)"><b>Response (8)</b></p>
|
<p class="reveal" onclick="$('#response-analyze').slideToggle(100)"><b>Response (8)</b></p>
|
||||||
<div class="subdiv" id="response-analyze">
|
<div class="subdiv" id="response-analyze">
|
||||||
<p>error: Appears if the GD servers rejected the request or not</p>
|
<p>error: Appears if the GD servers rejected the request or not. <code>song.allowed</code> may still work even with an error</p>
|
||||||
<p>exists: If the provided song exists on Newgrounds</p>
|
<p>exists: If the provided song exists on Newgrounds</p>
|
||||||
<p>artist.name: The name of the artist</p>
|
<p>artist.name: The name of the artist</p>
|
||||||
<p>artist.scouted: If the artist was scouted by a Newgrounds member</p>
|
<p>artist.scouted: If the artist was scouted by a Newgrounds member</p>
|
||||||
|
|
|
@ -343,6 +343,7 @@ $('#checkSong').click(function() {
|
||||||
fetch(`../api/song/[[SONGID]]`).then(res => res.json()).then(info => {
|
fetch(`../api/song/[[SONGID]]`).then(res => res.json()).then(info => {
|
||||||
$('#songLoading').hide()
|
$('#songLoading').hide()
|
||||||
$(info.song.allowed ? '#songAllowed' : '#songNotAllowed').show().addClass('songStatus')
|
$(info.song.allowed ? '#songAllowed' : '#songNotAllowed').show().addClass('songStatus')
|
||||||
|
if (info.error) return
|
||||||
if (!info.artist.scouted) {
|
if (!info.artist.scouted) {
|
||||||
$('#scout').attr('src', '../assets/x.png')
|
$('#scout').attr('src', '../assets/x.png')
|
||||||
$('#scout').attr('title', $('#scout').attr('title').replace('is ', 'is NOT '))
|
$('#scout').attr('title', $('#scout').attr('title').replace('is ', 'is NOT '))
|
||||||
|
|
12
servers.json
12
servers.json
|
@ -7,8 +7,7 @@
|
||||||
"id": "",
|
"id": "",
|
||||||
"endpoint": "http://boomlings.com/database/",
|
"endpoint": "http://boomlings.com/database/",
|
||||||
"timestampSuffix": " ago",
|
"timestampSuffix": " ago",
|
||||||
"demonList": "https://pointercrate.com/",
|
"demonList": "https://pointercrate.com/"
|
||||||
"downloadsDisabled": true
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -126,6 +125,15 @@
|
||||||
"endpoint": "http://gdps.mathieuar.fr/supreme1/"
|
"endpoint": "http://gdps.mathieuar.fr/supreme1/"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": "Aurora Dash",
|
||||||
|
"link": "http://aurorgdpsgd.7m.pl",
|
||||||
|
"author": "Yayi Kawaii",
|
||||||
|
"authorLink": "https://www.youtube.com/channel/UCBH8Y_3SAYB-f-k7zFXLvtA",
|
||||||
|
"id": "aurora",
|
||||||
|
"endpoint": "http://aurorgdpsgd.7m.pl/database/"
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "GD Multiverse",
|
"name": "GD Multiverse",
|
||||||
"link": "https://discord.gg/rJtAky72xE",
|
"link": "https://discord.gg/rJtAky72xE",
|
||||||
|
|
Loading…
Reference in a new issue