Init commit

This commit is contained in:
ShreejitPanchal
2026-05-19 19:56:02 +08:00
commit 6601501eff
4047 changed files with 2185372 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import Bluebird from 'bluebird'
import { PeerTubeServer } from '@peertube/peertube-server-commands'
module.exports = async function sendViews (options: {
url: string
videoId: number
viewers: { xForwardedFor: string }[]
}) {
const { url, videoId, viewers } = options
const server = new PeerTubeServer({ url })
await Bluebird.map(viewers, viewer => {
return server.views.simulateView({ id: videoId, xForwardedFor: viewer.xForwardedFor })
.catch(err => console.error('Cannot simulate viewer', err))
}, { concurrency: 500 })
}