AdBlock for hahasport/yopika

hahasport remove add

当前为 2015-10-29 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name AdBlock for hahasport/yopika
  3. // @description hahasport remove add
  4. // @version 0.1
  5. // @copyright 2015, Turkhero
  6. // @namespace https://greasyfork.org/tr/scripts/13440-adblock-for-hahasport-yopika
  7. // @match http://*biggestplayer.me/*
  8. // @match http://*cricfree.*/*
  9. // @match http://*crichd.in/*
  10. // @match http://*freehdsport.com/*
  11. // @match http://*hahasport.com/*
  12. // @match http://*hqstream.tv/*
  13. // @match http://*leton.tv/*
  14. // @match http://*liveall.tv/*
  15. // @match http://*u-stream.me/*
  16. // @match http://*privatestream.tv/*
  17. // @match http://*sawlive.tv/*
  18. // @match http://*yocast.tv/*
  19. // @match http://*yopika.com/*
  20. // @match http://*yotv.co/*
  21. // @require https://code.jquery.com/jquery-2.1.4.min.js
  22. // @run-at document-end
  23. // ==/UserScript==
  24.  
  25. (function(window, document) {"use strict";
  26. var player_width = 1000;
  27. var jQuery, $;
  28. $ = jQuery = window.jQuery.noConflict(true);
  29. document.addEventListener('DOMContentLoaded', DOM_ContentReady);
  30. window.addEventListener('load', pageFullyLoaded);
  31. function bigsize_player() {
  32. var iplayerframe = $('.player>iframe');
  33. var iplayersource = iplayerframe.attr('src');
  34. var iplayerframe_width = iplayerframe.attr('width');
  35. var iplayerframe_height = iplayerframe.attr('height');
  36. if (iplayerframe_width < player_width) {
  37. var irgxpw = new RegExp('width=' + iplayerframe_width, 'g');
  38. var irgxph = new RegExp('height=' + iplayerframe_height, 'g');
  39. if (iplayersource.match(irgxpw)){
  40. iplayersource = iplayersource.replace(irgxpw, 'width=' + player_width);
  41. iplayerframe.attr('width', player_width);
  42. var iplayerframe_newheight = Math.round(player_width * iplayerframe_height / iplayerframe_width);
  43. iplayerframe.attr('height', iplayerframe_newheight);
  44. iplayersource = iplayersource.replace(irgxph, 'height=' + iplayerframe_newheight);
  45. iplayerframe.attr('src', iplayersource);
  46. }else{
  47. iplayerframe.attr('width', player_width);
  48. var iplayerframe_newheight = Math.round(player_width * iplayerframe_height / iplayerframe_width);
  49. iplayerframe.attr('height', iplayerframe_newheight);
  50. }
  51. }
  52. }
  53. function DOM_ContentReady() {
  54. $('.lad').remove();
  55. $('#ads_video_before').remove();
  56. $('#ads_video_after').remove();
  57. $('head').append('<style type="text/css">' +
  58. '.player{float:none;margin:0;}' +
  59. '.turk-danger{color:red;}' +
  60. '</style>'
  61. );
  62. // Ubinet link
  63. var itext;
  64. $('td.evv_link').each(function () {
  65. itext = $(this).text();
  66. if (itext.match(/\(Unibet TV\)/g)) {
  67. $(this).append(' <span class=\'turk-danger\'>!</span>');
  68. }
  69. });
  70. }
  71. function pageFullyLoaded() {
  72. var ihost = document.location.host;
  73. if (ihost.indexOf('liveall.tv') > - 1 ||
  74. ihost.indexOf('privatestream.tv') > - 1 ||
  75. ihost.indexOf('hqstream') > - 1 ||
  76. ihost.indexOf('leton') > - 1
  77. ) {
  78. timer_ads();
  79. bigsize_player();
  80. }
  81. else if (ihost.indexOf('yocast.tv') > - 1 ||
  82. ihost.indexOf('freehdsport.com') > - 1 ||
  83. ihost.indexOf('cricfree') > - 1 ||
  84. ihost.indexOf('yotv.co') > - 1 ||
  85. ihost.indexOf('crichd') > - 1
  86. ) {
  87. floatlayer_ads();
  88. bigsize_player();
  89. }
  90. else if (ihost.indexOf('biggestplayer') > - 1) {
  91. adblock_ads();
  92. bigsize_player();
  93. }
  94. else if (ihost.indexOf('u-stream.me') > - 1) {
  95. ustreamme();
  96. bigsize_player();
  97. }
  98. else if (ihost.indexOf('sawlive.tv') > - 1) {
  99. $('#adba').remove();
  100. $('#sawdiv').remove();
  101. bigsize_player();
  102. }
  103. }
  104. function timer_ads() {
  105. $('div').each(function () {
  106. if ($(this).attr('id') == 'timer1') {
  107. $(this).remove();
  108. }
  109. else if ($(this).attr('id') == 'timer2') {
  110. $(this).remove();
  111. }
  112. else if ($(this).attr('id') == 'timer3') {
  113. $(this).remove();
  114. }
  115. else if ($(this).attr('id') == 'timer4') {
  116. $(this).remove();
  117. }
  118. else if ($(this).attr('id') == 'timer5') {
  119. $(this).remove();
  120. }
  121. else if ($(this).attr('id') == 'timer_full') {
  122. $(this).remove();
  123. }
  124. else if ($(this).attr('id') == 'title') {
  125. $(this).remove();
  126. }
  127. else if ($(this).attr('id') == 'topad') {
  128. $(this).remove();
  129. }
  130. });
  131. }
  132. function floatlayer_ads() {
  133. $('div').each(function () {
  134. if ($(this).attr('id') == 'video_ads_overdiv') {
  135. $(this).remove();
  136. }
  137. else if ($(this).attr('id') == 'floatLayer1') {
  138. $(this).remove();
  139. }
  140. else if ($(this).attr('id') == 'floatLayer2') {
  141. $(this).remove();
  142. }
  143. else if ($(this).attr('id') == 'flashcontent') {
  144. $(this).remove();
  145. }
  146. else if ($(this).attr('id') == 'video_ads_overdiv') {
  147. $(this).remove();
  148. }
  149. else{
  150. var style=$(this).attr("style");
  151. if(style.match(/background-color: rgb\(251\, 236\, 173\)/)){
  152. $(this).remove();
  153. }
  154. }
  155. });
  156. }
  157. function adblock_ads() {
  158. $('.adblock1').remove();
  159. }
  160. function ustreamme() {
  161. $('div').each(function () {
  162. if ($(this).attr('id') == 'ad') {
  163. $(this).remove();
  164. }
  165. });
  166. }
  167. }(window, document));