Enhanced Corrupt Dailymotion Ads

Corrupts ads on Dailymotion by blocking playback

  1. // ==UserScript==
  2. // @name Enhanced Corrupt Dailymotion Ads
  3. // @namespace https://pastebin.com/tiAedV19
  4. // @version 2.0
  5. // @description Corrupts ads on Dailymotion by blocking playback
  6. // @match https://www.dailymotion.com/*
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12.  
  13. const adSources = [
  14. 'ad',
  15. 'advertisement',
  16. 'doubleclick',
  17. 'adserver',
  18. 'ads',
  19. 'tracking',
  20. 'spotxchange',
  21. 'krxd.net',
  22. 'brighttag',
  23. 'vdopia',
  24. 'dailymotion.com/ads',
  25. 'googleads',
  26. 'adtech',
  27. 'serving-sys',
  28. 'adsrvr',
  29. 'adroll',
  30. 'adnxs',
  31. 'adform',
  32. 'rubiconproject',
  33. 'appnexus',
  34. 'zencoder',
  35. 'floodlight',
  36. 'criteo',
  37. 'indexexchange',
  38. 'openx',
  39. 'smaato',
  40. 'yieldmo',
  41. 'adcolony',
  42. 'moatads',
  43. 'brightroll',
  44. 'liveintent',
  45. 'taboola',
  46. 'outbrain',
  47. 'revcontent',
  48. 'adsbygoogle',
  49. 'sovrn',
  50. 'sonobi',
  51. 'mopub',
  52. 'audiencenetwork',
  53. 'flashtalking',
  54. 'triplelift',
  55. 'fetchback',
  56. 'adbeast',
  57. 'adpushup',
  58. 'improvely',
  59. 'videonow',
  60. 'extreme-reach',
  61. 'adview',
  62. 'adserverpub',
  63. 'adsnative',
  64. 'yieldbot',
  65. 'moat',
  66. 'improvedigital',
  67. 'cysend',
  68. 'media.net',
  69. 'adswizz',
  70. 'spotx',
  71. 'gumgum',
  72. 'kontera',
  73. 'nativeads',
  74. 'adf.ly',
  75. 'shorte.st',
  76. 'adfender',
  77. 'fanboost',
  78. 'nativo',
  79. 'adlib',
  80. 'mediacom',
  81. 'admatic',
  82. 'videoplaza',
  83. 'mocean',
  84. 'adconion',
  85. 'justpremium',
  86. 'openadstream',
  87. 'admeld',
  88. 'smaato',
  89. 'adswapper',
  90. 'mediaalpha',
  91. 'brainly',
  92. 'adblade',
  93. 'tapad',
  94. 'adparlor',
  95. 'adknowledge',
  96. 'tremorvideo',
  97. 'radiumone',
  98. 'uzymedia',
  99. 'adgear',
  100. 'cpxinteractive',
  101. 'whiteshark',
  102. 'adcontrol',
  103. 'adspring',
  104. 'maxymiser',
  105. 'booster',
  106. 'customaudience',
  107. 'geniuslink',
  108. 'intango',
  109. 'igum',
  110. 'leadbolt',
  111. 'adaction',
  112. 'buysellads',
  113. 'clicksor',
  114. 'zebraads',
  115. 'advertise.com',
  116. 'ezanga',
  117. 'videojug',
  118. 'avocarrot',
  119. 'fyber',
  120. 'yandex',
  121. 'adlibitum',
  122. 'popads',
  123. 'popunder',
  124. 'atdmt',
  125. 'adpolicy',
  126. 'acxiom',
  127. 'mopub',
  128. 'criteo',
  129. 'dynamicyield',
  130. 'adpiler',
  131. 'arbitraryads',
  132. 'adtrader',
  133. 'adhero',
  134. 'digitalenvoy',
  135. 'cocoon',
  136. 'adshuffler',
  137. 'backflip',
  138. 'advangelists',
  139. 'interclick',
  140. 'adman',
  141. 'adscape',
  142. 'adattic',
  143. 'adsidian',
  144. 'adperium',
  145. 'retargeting',
  146. 'bidswitch',
  147. 'adteca',
  148. 'whaleads',
  149. 'buyat',
  150. 'adshuffle',
  151. 'inmobi',
  152. 'interscroller',
  153. 'proxio',
  154. 'adcloud',
  155. 'adserving',
  156. 'adunity',
  157. 'pof.com',
  158. 'roboads',
  159. 'in-ads',
  160. 'hypeaudience',
  161. 'yahooads',
  162. 'vungle',
  163. 'chartboost',
  164. 'unityads',
  165. 'applovin',
  166. 'adnetwork',
  167. 'innoads',
  168. 'adpure',
  169. 'adsoft',
  170. 'redefiningads',
  171. 'mmedia',
  172. 'weborama',
  173. 'newads',
  174. 'adspring',
  175. 'deputyads',
  176. 'dcollab',
  177. 'dsp',
  178. 'quantcast',
  179. 'adfuse',
  180. 'epom',
  181. 'adext',
  182. 'rsi',
  183. 'thetradedesk',
  184. 'buzzcity',
  185. 'criteo',
  186. 'districtm',
  187. 'plista',
  188. 'veeboo',
  189. 'adopt',
  190. 'admitad',
  191. 'kargo',
  192. 'squeezy',
  193. 'clearcode',
  194. 'adupay',
  195. 'spinme',
  196. 'yuga',
  197. 'inetwork',
  198. 'adwallet',
  199. 'myads',
  200. 'adfunnel',
  201. 'unitedads',
  202. 'adwarrior',
  203. 'metaad',
  204. 'intelligentads',
  205. 'mediacore',
  206. 'driftrock',
  207. '360ads',
  208. 'adclick',
  209. 'splashad',
  210. 'adbrokers',
  211. 'reachlocal',
  212. 'adiq',
  213. 'adzero',
  214. 'adspresso',
  215. 'netseer',
  216. 'btrll',
  217. 'conviva',
  218. 'bitrate',
  219. 'adtraction',
  220. 'adstring',
  221. 'adviewmedia',
  222. 'interceptd',
  223. 'avora',
  224. 'mindspark',
  225. 'aolads',
  226. 'adnow',
  227. 'adverty',
  228. 'adcloudmedia',
  229. 'adoption',
  230. 'inspireads',
  231. 'broadstreetads',
  232. 'exponential',
  233. 'crossmedia',
  234. 'triplelift',
  235. 'lotame',
  236. 'nexage',
  237. 'clickable',
  238. 'dove',
  239. 'inviqa',
  240. 'adspark',
  241. 'addefend',
  242. 'fastclick',
  243. 'adnet',
  244. 'adexchanger',
  245. 'metricads',
  246. 'simpleads',
  247. 'upliftads',
  248. 'advolcano',
  249. 'spotx',
  250. 'twitch',
  251. 'preroll',
  252. ];
  253.  
  254. const isAdSource = (src) => {
  255. return adSources.some(ad => src.includes(ad));
  256. };
  257.  
  258. const corruptAds = () => {
  259. const originalPlay = HTMLMediaElement.prototype.play;
  260.  
  261. HTMLMediaElement.prototype.play = function() {
  262. if (isAdSource(this.src)) {
  263. return Promise.reject(new Error('Ad playback failed due to connection issues.'));
  264. }
  265. return originalPlay.call(this);
  266. };
  267. };
  268.  
  269. const suppressConsoleWarnings = () => {
  270. const originalError = console.error;
  271. console.error = function(...args) {
  272. if (args[0] && typeof args[0] === 'string' && args[0].includes('Reading cookie in cross-site context')) {
  273. return;
  274. }
  275. originalError.apply(console, args);
  276. };
  277. };
  278.  
  279. window.addEventListener('load', () => {
  280. suppressConsoleWarnings();
  281. corruptAds();
  282.  
  283. const observer = new MutationObserver(() => {
  284. corruptAds();
  285. });
  286. observer.observe(document.body, { childList: true, subtree: true });
  287. });
  288. })();