mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-07 03:57:06 +03:00
Disable IP ratelimiting
This commit is contained in:
@@ -178,14 +178,17 @@ module.exports = async function postSkipSegments(req, res) {
|
|||||||
|
|
||||||
let yesterday = timeSubmitted - 86400000;
|
let yesterday = timeSubmitted - 86400000;
|
||||||
|
|
||||||
//check to see if this ip has submitted too many sponsors today
|
// Disable IP ratelimiting for now
|
||||||
let rateLimitCheckRow = privateDB.prepare("SELECT COUNT(*) as count FROM sponsorTimes WHERE hashedIP = ? AND videoID = ? AND timeSubmitted > ?").get([hashedIP, videoID, yesterday]);
|
if (false) {
|
||||||
|
//check to see if this ip has submitted too many sponsors today
|
||||||
|
let rateLimitCheckRow = privateDB.prepare("SELECT COUNT(*) as count FROM sponsorTimes WHERE hashedIP = ? AND videoID = ? AND timeSubmitted > ?").get([hashedIP, videoID, yesterday]);
|
||||||
|
|
||||||
if (rateLimitCheckRow.count >= 10) {
|
if (rateLimitCheckRow.count >= 10) {
|
||||||
//too many sponsors for the same video from the same ip address
|
//too many sponsors for the same video from the same ip address
|
||||||
res.sendStatus(429);
|
res.sendStatus(429);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//check to see if the user has already submitted sponsors for this video
|
//check to see if the user has already submitted sponsors for this video
|
||||||
|
|||||||
Reference in New Issue
Block a user