「Youku」- 视频下载

  CREATED BY JENKINSBOT

Youku | 自动发送弹幕

function sleep(ms) {
  return new Promise(resolve => setTimeout(resolve, ms));
}

async function doSomeStuff() {
  // do some stuff ...
  for (;;) {
    $x("//div[@id='barrage-controller']//input")[0].value = 123123
    $x("//div[@id='barrage-controller']//button[contains(text(), '发送')]").click()
  
    // take a break ...
    console.log('Taking a break...');
    await sleep(2000);
    console.log('Two seconds later, showing sleep in a loop...');
  }
}

doSomeStuff();