Add endpoint to submit unlisted videos

A temporary measure which will be removed next month

https://support.google.com/youtube/answer/9230970
This commit is contained in:
Ajay Ramachandran
2021-06-23 19:19:30 -04:00
parent 746dc4f81d
commit 42da1b6c23
3 changed files with 46 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ import {rateLimitMiddleware} from './middleware/requestRateLimit';
import dumpDatabase, {redirectLink} from './routes/dumpDatabase';
import {endpoint as getSegmentInfo} from './routes/getSegmentInfo';
import {postClearCache} from './routes/postClearCache';
import { addUnlistedVideo } from './routes/addUnlistedVideo';
export function createServer(callback: () => void) {
// Create a service (the app object is just a callback).
@@ -140,6 +141,8 @@ function setupRoutes(app: Express) {
//clear cache as VIP
app.post('/api/clearCache', postClearCache)
app.post('/api/unlistedVideo', addUnlistedVideo)
if (config.postgres) {
app.get('/database', (req, res) => dumpDatabase(req, res, true));
app.get('/database.json', (req, res) => dumpDatabase(req, res, false));