mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-07 12:07:07 +03:00
Made sponsor submission work on POST.
This commit is contained in:
7
index.js
7
index.js
@@ -131,7 +131,10 @@ function getIP(req) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//add the post function
|
//add the post function
|
||||||
app.get('/api/postVideoSponsorTimes', async function (req, res) {
|
app.get('/api/postVideoSponsorTimes', submitSponsorTimes);
|
||||||
|
app.post('/api/postVideoSponsorTimes', submitSponsorTimes);
|
||||||
|
|
||||||
|
async function submitSponsorTimes(req, res) {
|
||||||
let videoID = req.query.videoID;
|
let videoID = req.query.videoID;
|
||||||
let startTime = req.query.startTime;
|
let startTime = req.query.startTime;
|
||||||
let endTime = req.query.endTime;
|
let endTime = req.query.endTime;
|
||||||
@@ -278,7 +281,7 @@ app.get('/api/postVideoSponsorTimes', async function (req, res) {
|
|||||||
|
|
||||||
res.send(500);
|
res.send(500);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
//voting endpoint
|
//voting endpoint
|
||||||
app.get('/api/voteOnSponsorTime', voteOnSponsorTime);
|
app.get('/api/voteOnSponsorTime', voteOnSponsorTime);
|
||||||
|
|||||||
Reference in New Issue
Block a user