SHARE
TWEET

HBOGO sync

mrhotdog33 Mar 26th, 2020 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. async function setTime(newTime) {
  2.     const getV = () => document.getElementsByTagName('video')[0];
  3.  
  4.     const sleep = time => new Promise(resolve => setTimeout(resolve, time));
  5.  
  6.     let v = getV();
  7.     while (v.duration < 1000) {
  8.         console.log('Detected ad, skipping');
  9.         v.currentTime = v.duration;
  10.         await sleep(1000);
  11.         await v.play();
  12.         await sleep(2000);
  13.         v = getV();
  14.     }
  15.  
  16.     await v.pause();
  17.     v.currentTime = newTime;
  18.     await v.play();
  19.     await v.pause();
  20.  
  21.     console.log('Ready!');
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top