rob's song page hecking died

This commit is contained in:
GDColon 2021-02-04 22:52:09 -05:00
parent c2c0d093d7
commit 82b7dfa7a7
6 changed files with 17 additions and 4 deletions

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

BIN
assets/gdps/aurora_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View file

@ -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>

View file

@ -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 '))

View file

@ -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",