Auto-reload tvmucho.com streams at each timeout

This script allows you to auto-reload a tvmucho.com stream at each timeout

  1. // ==UserScript==
  2. // @name Auto-reload tvmucho.com streams at each timeout
  3. // @namespace https://github.com/GavinBrelstaff
  4. // @match https://sat.tvmucho.com/app/tvmucho/play/*
  5. // @description This script allows you to auto-reload a tvmucho.com stream at each timeout
  6. // @version 1.0
  7. // @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
  8. // @description 06/03/2023, 14:20:03
  9. // ==/UserScript==
  10.  
  11. var allCookies = document.cookie.split(';');
  12. // The "expire" attribute of every cookie is Set to "Thu, 01 Jan 1970 00:00:00 GMT"
  13. for( var i=0; i < allCookies.length; i++ )
  14. document.cookie = allCookies[i] + "=;expires=" + new Date(0).toUTCString();
  15. localStorage.clear();
  16.  
  17. window.pid = setInterval(function() // Polling
  18. {
  19. const el = document.getElementById('player');
  20.  
  21. if( el )
  22. {
  23. el.controls=true;
  24. clearInterval(window.pid);
  25. }
  26.  
  27. }, 2000); // every second
  28.  
  29.  
  30.  
  31. setInterval(function() // Polling
  32. {
  33. const el1 = document.querySelector( '#app > div.modals div.signup-main-block' );
  34. const el2 = document.querySelector( '#time_progressbar > span > div[aria-valuenow="0"]' );
  35.  
  36. if( el1 || el2)
  37. {
  38. var allCookies = document.cookie.split(';');
  39. // The "expire" attribute of every cookie is Set to "Thu, 01 Jan 1970 00:00:00 GMT"
  40. for( var i=0; i < allCookies.length; i++ )
  41. document.cookie = allCookies[i] + "=;expires=" + new Date(0).toUTCString();
  42.  
  43. localStorage.clear();
  44. //console.log('secs: ' + secs );
  45. location.href = location.href; // reload the page
  46. }
  47.  
  48. }, 1000); // every second