Swyter Tweaks for Played.to

Gets rid of all the hurdles and directly plays the video in an immersive player.

  1. // ==UserScript==
  2. // @name Swyter Tweaks for Played.to
  3. // @description Gets rid of all the hurdles and directly plays the video in an immersive player.
  4. // @match http://played.to/*
  5. // @grant none
  6. // @version 2013.11.28
  7. // @author Swyter
  8. // @namespace https://greasyfork.org/users/4813
  9. // ==/UserScript==
  10.  
  11. if ( btn_download = document.querySelector("#btn_download") )
  12. {
  13. // Click the accept button if exists
  14. console.log("-> Skipping the countdown.")
  15. btn_download.disabled=false;
  16. btn_download.click();
  17. }
  18. else
  19. {
  20. // Remove all the timeouts, which launch banners and all sorts of ugly monsters (http://stackoverflow.com/a/8345837/674685)
  21. var highestTimeoutId = setTimeout(";");
  22. for (var i = 0 ; i < highestTimeoutId ; i++) {
  23. clearTimeout(i);
  24. }
  25.  
  26.  
  27. // Just remove the annoyances, enable the built-in lightbox and enjoy the view
  28. var ads = document.querySelectorAll(
  29. "div[style*='block !important;'], #overlayPPU, #OnPlayerBanner, #OnPlayerClose, center>div+script[type='text/javascript']"
  30. );
  31. Array.prototype.forEach.call(ads,function(node) {
  32. node.parentNode.removeChild(node);
  33. });
  34. document.getElementById("lightsOff").click();
  35. }