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