Programma-peredach.com Time Zone Changer

Automatic selection of a TV guide for your time zone, instead of the default selection based on geolocation

  1. // ==UserScript==
  2. // @name Programma-peredach.com Time Zone Changer
  3. // @namespace https://violentmonkey.github.io/
  4. // @version 1.4
  5. // @description Automatic selection of a TV guide for your time zone, instead of the default selection based on geolocation
  6. // @author Streampunk
  7. // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIwAAACMCAMAAACZHrEMAAADAFBMVEUAov/////+9/f+4eH+7e3+5ub+3d3+8/MAAAAAAAAAAAAIAAAAAAAAAAAARAAIAAAACgCxpyzwDHcAAJgAAAA6AEUAXABvAEQAdwBsAG4AbwBkAGEAcwB0AFwAdgBnAF8AdQBkAGkAZQBiAF8AbABlAHUAXwA0ADEAMABwAC4AbgAAAGcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIcAAACY73Sp0ABsd7EAmO8AAAER5AAAdiwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADOfIgviADYB64AznuY71x49gBcd7EAmO+uL4h5GAd7d7F2quDOe9hTyAAYB4cAzvvOfIh72AAUAM4AAACHU8gAAAcgAAAAmO8AAADwhAD9AJh3tUOC3J/vmAEHAJgAAACxeJsAAHcAAAAAzgCuL6AABwcBAAAAAAAAABUAAgAoAAB2LBIoKhgAIHbyAIf////O+2h72ACwAM4AmO+w4WPg5XcAd7AAAAAAAAAAAAA0AAAAmPApyGrwNHbEAJh2KcgAAAAAAAAAAADAAACcrLQAGAcAAAAAAACY8AwAQAAAAAAAAACY7/gAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAIBAQABB7UAAAC1JpAATAegAhoHri8AAAAAAgAAAAC1NtzWAAAAAWJLR0QB/wIt3gAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAhpJREFUeNrtmtG2hCAIRcE0//+P70trTbdRxIS0Wee8NZFuyUlAiSAIgiAIgiAIgt4i1qpgWWovqKxGYcJ3N0HTnotnlK4BTKWjIZYeGFJMmokw/C6YzQkmKsY95pgOGM2kmQrDjdaSI0xr5PuYY2xheC5MEBuLrjCNsQ86ptfNokVaCeZ6LzvDbNKkMXUMDS7LK8FERSBoCxPrJraOUX206pNmARieCZNrNtmWRbe21Gx4BZgwEyZUjIxZlCFA2SisBMNzYEJx0lizaCO1otVKMGElGHMWdUBdmDTLwPBiMJeFaX8Qhlq5Jk2EySvB8DaUYg/CUDvdA0y5rPQozO7umJ6Sxltg8uMwydsxXZWnd8CECTDR2TF9BcI3wIQpMNnXMZ11XGcYCIKgn1XpsxkPndbmf7+Ury6PfD3bskssFny+kaUr7VaYdjfCCkbcZFHuYBnCnFJbFUw9CrGA+SQHGhjBxgSGO2CSOwzrYcpzzRMmbSdVYIRvTx9MbZgdaSmZw9BSMPEuTHCAobsw5AnD68K0P3lrwoyvTYABzPN/7X0lGPaEoZ+FiQ+t2lQJgURSHUwcgDnO6p6f2GtHCrIEk66lWFLDRFYEwY1AciAGbp0GtYbpKkDeH41B3qTK4o5bm6p5qbMsD1pxIP8DnDTNC51tjTeQ+8rPilS+2llqTofY2r2SjqULq2zrBTTqAhAEQRAEQRAEQUR/ZWsXAuh2QsoAAAAASUVORK5CYII=
  8. // @match https://programma-peredach.com/*
  9. // @run-at document-start
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. // Set your time zone number here by selecting it from the time zone table */
  15. var timezone_number = 1;
  16.  
  17. /* Time zone table
  18. # Timezone city_id querySelector
  19. 1 UTC+0 96 #tab-utc > div:nth-child(1) > a:nth-child(1)
  20. 2 UTC+1 95 #tab-utc > div:nth-child(1) > a:nth-child(3)
  21. 3 МСК-1 / UTC+2 13 #tab-utc > div:nth-child(1) > a:nth-child(5)
  22. 4 МСК+0 / UTC+3 14 #tab-utc > div:nth-child(1) > a:nth-child(7)
  23. 5 МСК+1 / UTC+4 15 #tab-utc > div:nth-child(1) > a:nth-child(9)
  24. 6 МСК+2 / UTC+5 16 #tab-utc > div:nth-child(1) > a:nth-child(11)
  25. 7 МСК+3 / UTC+6 17 #tab-utc > div:nth-child(1) > a:nth-child(13)
  26. 8 МСК+4 / UTC+7 18 #tab-utc > div:nth-child(1) > a:nth-child(15)
  27. 9 МСК+5 / UTC+8 19 #tab-utc > div:nth-child(1) > a:nth-child(17)
  28. 10 МСК+6 / UTC+9 20 #tab-utc > div:nth-child(1) > a:nth-child(19)
  29. 11 МСК+7 / UTC+10 21 #tab-utc > div:nth-child(1) > a:nth-child(21)
  30. 12 МСК+8 / UTC+11 22 #tab-utc > div:nth-child(1) > a:nth-child(23)
  31. 13 МСК+9 / UTC+12 23 #tab-utc > div:nth-child(1) > a:nth-child(25)
  32. 14 UTC-1 111 #tab-utc > div:nth-child(2) > a:nth-child(1)
  33. 15 UTC-2 112 #tab-utc > div:nth-child(2) > a:nth-child(3)
  34. 16 UTC-3 113 #tab-utc > div:nth-child(2) > a:nth-child(5)
  35. 17 UTC-4 114 #tab-utc > div:nth-child(2) > a:nth-child(7)
  36. 18 UTC-5 115 #tab-utc > div:nth-child(2) > a:nth-child(9)
  37. 19 UTC-6 116 #tab-utc > div:nth-child(2) > a:nth-child(11)
  38. 20 UTC-7 117 #tab-utc > div:nth-child(2) > a:nth-child(13)
  39. 21 UTC-8 118 #tab-utc > div:nth-child(2) > a:nth-child(15)
  40. 22 UTC-9 119 #tab-utc > div:nth-child(2) > a:nth-child(17)
  41. 23 UTC-10 120 #tab-utc > div:nth-child(2) > a:nth-child(19)
  42. 24 UTC-11 121 #tab-utc > div:nth-child(2) > a:nth-child(21)
  43. 25 UTC-12 122 #tab-utc > div:nth-child(2) > a:nth-child(23) */
  44.  
  45. // If you wish, you can set your geolocation here by selecting it from the row below */
  46. let cou = '%3F';
  47. /*
  48. US
  49. EU
  50. GB
  51. DE
  52. FR
  53. NL
  54. PL
  55. SE
  56. RU
  57. %3F = ?
  58. */
  59.  
  60. // Set the value of custom settings as activated, so that the script works properly
  61. var user_settings = 'activated';
  62.  
  63. // Set your time zone on the page
  64. if (timezone_number == 1) {
  65. var city_id = '96';
  66. } else if (timezone_number == 2) {
  67. var city_id = '95';
  68. } else if (timezone_number == 3) {
  69. var city_id = '13';
  70. } else if (timezone_number == 4) {
  71. var city_id = '14';
  72. } else if (timezone_number == 5) {
  73. var city_id = '15';
  74. } else if (timezone_number == 6) {
  75. var city_id = '16';
  76. } else if (timezone_number == 7) {
  77. var city_id = '17';
  78. } else if (timezone_number == 8) {
  79. var city_id = '18';
  80. } else if (timezone_number == 9) {
  81. var city_id = '19';
  82. } else if (timezone_number == 10) {
  83. var city_id = '20';
  84. } else if (timezone_number == 11) {
  85. var city_id = '21';
  86. } else if (timezone_number == 12) {
  87. var city_id = '22';
  88. } else if (timezone_number == 13) {
  89. var city_id = '23';
  90. } else if (timezone_number == 14) {
  91. var city_id = '111';
  92. } else if (timezone_number == 15) {
  93. var city_id = '112';
  94. } else if (timezone_number == 16) {
  95. var city_id = '113';
  96. } else if (timezone_number == 17) {
  97. var city_id = '114';
  98. } else if (timezone_number == 18) {
  99. var city_id = '115';
  100. } else if (timezone_number == 19) {
  101. var city_id = '116';
  102. } else if (timezone_number == 20) {
  103. var city_id = '117';
  104. } else if (timezone_number == 21) {
  105. var city_id = '118';
  106. } else if (timezone_number == 22) {
  107. var city_id = '119';
  108. } else if (timezone_number == 23) {
  109. var city_id = '120';
  110. } else if (timezone_number == 24) {
  111. var city_id = '121';
  112. } else if (timezone_number == 25) {
  113. var city_id = '122';
  114. }
  115.  
  116. // A Function to Set a Cookie
  117. function setCookie(cName, cValue) {
  118. const domain = "domain=programma-peredach.com";
  119. document.cookie = cName + "=" + cValue + ";" + domain + ";";
  120. }
  121.  
  122. // A Function to Get a Cookie
  123. function getCookie(cName) {
  124. let Name = cName + "=";
  125. let ca = document.cookie.split(';');
  126. for(let i = 0; i < ca.length; i++) {
  127. let c = ca[i];
  128. while (c.charAt(0) == ' ') {
  129. c = c.substring(1);
  130. }
  131. if (c.indexOf(Name) == 0) {
  132. return c.substring(Name.length, c.length);
  133. }
  134. }
  135. return "";
  136. }
  137.  
  138. // A Function that Checks if a Cookie is set
  139. function checkCookie() {
  140. let user = getCookie("user_settings");
  141. if (user != "") {
  142. // Remember to open the console (Press F12)
  143. console.error("Сookies with custom user settings are set!");
  144. } else {
  145. // Apply setCookie
  146. setCookie('city_id', city_id);
  147. setCookie('cou', cou);
  148. setCookie('user_settings', user_settings);
  149. location.reload();
  150. }
  151. }
  152.  
  153. // Check if Сookies are set and if not, set a Сookie with custom user settings
  154. checkCookie();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址