Spaces:
Paused
Paused
Download commons/validate.js from mikmc/Internet_Archive: direct link, hf CLI and curl.
- Browser
- Download file 427 Bytes
-
https://huggingface.co/spaces/mikmc/Internet_Archive/resolve/main/commons/validate.js
- Command line
-
hf download hf://spaces/mikmc/Internet_Archive/commons/validate.js
-
curl -L -o validate.js https://huggingface.co/spaces/mikmc/Internet_Archive/resolve/main/commons/validate.js
427 Bytes
| module.exports = (dependencies) => { | |
| const { env } = dependencies | |
| const validateRequest = async (args) => { | |
| if (args.id.indexOf(env.addonContentIdPrefix) !== -1) return args | |
| throw new Error('invalid id') | |
| } | |
| const validateContentType = async (args) => { | |
| if (args.type === 'movie') return args | |
| throw new Error('invalid content type') | |
| } | |
| return { | |
| validateRequest, | |
| validateContentType, | |
| } | |
| } | |