ニジカ投稿局 https://tv.nizika.tv
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

10 lines
474 B

  1. import Bluebird from "bluebird";
  2. import { PeerTubeServer } from "@peertube/peertube-server-commands";
  3. module.exports = async function sendViews(options) {
  4. const { url, videoId, viewers } = options;
  5. const server = new PeerTubeServer({ url });
  6. await Bluebird.map(viewers, (viewer) => {
  7. return server.views.simulateView({ id: videoId, xForwardedFor: viewer.xForwardedFor }).catch((err) => console.error("Cannot simulate viewer", err));
  8. }, { concurrency: 500 });
  9. };