Spaces:
Configuration error
Configuration error
Download src/security/abuseProtection.js from UUUZCX/video-optimizer-bot: direct link, hf CLI and curl.
- Browser
- Download file 351 Bytes
-
https://huggingface.co/spaces/UUUZCX/video-optimizer-bot/resolve/main/src/security/abuseProtection.js
- Command line
-
hf download hf://spaces/UUUZCX/video-optimizer-bot/src/security/abuseProtection.js
-
curl -L -o abuseProtection.js https://huggingface.co/spaces/UUUZCX/video-optimizer-bot/resolve/main/src/security/abuseProtection.js
351 Bytes
| const { allowRate } = require("./rateLimit"); | |
| const { AppError } = require("../utils/errors"); | |
| function assertUserCanCreateJob(userId) { | |
| if (!allowRate(`jobs:${userId}`, 12, 60 * 60 * 1000)) { | |
| throw new AppError("Rate limit reached. Please wait before sending more videos.", "RATE_LIMITED"); | |
| } | |
| } | |
| module.exports = { assertUserCanCreateJob }; | |