Advertisement
Guest User

fuck all sidebranches

a guest
Feb 17th, 2022
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.47 KB | None | 0 0
  1. // ==UserScript==
  2. // @name         New Userscript
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  try to take over the world!
  6. // @author       You
  7. // @match        https://hololive.jetri.co/
  8. // @icon         https://www.google.com/s2/favicons?domain=jetri.co
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13.     'use strict';
  14.  
  15.     // Your code here...
  16. })();// ==UserScript==
  17. // @name         Remove homosharts
  18. // @namespace    remove homosharts
  19. // @version      0.2
  20. // @description  Remove sharts in .jetri
  21. // @author       me
  22. // @match        https://hololive.jetri.co/*
  23. // @grant        none
  24. // @run-at       document-start
  25. // ==/UserScript==
  26.  
  27. (function() {
  28.     const shartList = ['花咲みやび','奏手イヅル','アルランディス','律可','アステル','岸堂天真','夕刻ロベル','影山シエン','荒咬オウガ','ホロスタ','Astel', 'Izuru',
  29.                       'Risu', 'Moona', 'Airani Iofifteen', 'Ollie', 'Anya', 'Reine', 'Kiara', 'Mori', 'Gura', 'Fauna', 'Hakos', 'Ouro', 'Mumei', 'Sana', 'Watson']
  30.     const freeChatList = ['Twitterのかわりにお知らせしたりする枠【Free Chat】', '【Free chat】サーカス客席【ホロライブ/尾丸ポルカ】', '【Free chat】Happy New Year!ししろんの射撃訓練場【ホロライブ/獅白ぼたん】', '✿  FreeeChat | Miko Ch. ✿']
  31.  
  32.     if (location.host === "hololive.jetri.co") {
  33.         window.addEventListener('DOMContentLoaded', clearnup(), false);
  34.         window.addEventListener('load', clearnup(), false);
  35.         window.addEventListener('beforeunload', clearnup(), false);
  36.  
  37.         function clearnup(){
  38.             function modifyResponse(response) {
  39.                 if (this.readyState === 4) {
  40.                     const url = response.target.responseURL;
  41.                     const original_response = response.target.responseText;
  42.  
  43.                     if (url.search("//api.holotools.app/v1/live") >= 0) {
  44.                         Object.defineProperty(this, "responseText", {writable: true});
  45.                         const modified_response = JSON.parse(original_response);
  46.                         modified_response.live = cleanupVids(modified_response.live);
  47.                         modified_response.ended = cleanupVids(modified_response.ended);
  48.                         modified_response.upcoming = cleanupVids(modified_response.upcoming);
  49.                         modified_response.live = cleanupFreechats(modified_response.live);
  50.                         modified_response.upcoming = cleanupFreechats(modified_response.upcoming);
  51.                         this.responseText = JSON.stringify(modified_response);
  52.                     }
  53.  
  54.                     if (url.search("//api.holotools.app/v1/videos") >= 0) {
  55.                         Object.defineProperty(this, "responseText", {writable: true});
  56.                         const modified_response = JSON.parse(original_response);
  57.                         modified_response.videos = cleanupVids(modified_response.videos);
  58.                         this.responseText = JSON.stringify(modified_response);
  59.                     }
  60.  
  61.                     if (url.search("//api.holotools.app/v1/channels") >= 0) {
  62.                         Object.defineProperty(this, "responseText", {writable: true});
  63.                         const modified_response = JSON.parse(original_response);
  64.                         modified_response.channels = cleanupChannels(modified_response.channels);
  65.                         this.responseText = JSON.stringify(modified_response);
  66.                     }
  67.                 }
  68.             }
  69.  
  70.             function cleanupVids(vids) {
  71.                 return vids.filter(v => shartList.every(shart => !v.channel.name.includes(shart)));
  72.             }
  73.  
  74.             function cleanupChannels(channels) {
  75.                 return channels.filter(c => shartList.every(shart => !c.name.includes(shart)));
  76.             }
  77.  
  78.             function cleanupFreechats(vids) {
  79.                 return vids.filter(v => freeChatList.every(freeChat => !v.title.includes(freeChat)));;
  80.             }
  81.  
  82.             function openBypass(original_function) {
  83.                 return function(method, url, async) {
  84.                     this.addEventListener("readystatechange", modifyResponse);
  85.                     return original_function.apply(this, arguments);
  86.                 };
  87.             }
  88.  
  89.             XMLHttpRequest.prototype.open = openBypass(XMLHttpRequest.prototype.open);
  90.         }
  91.     }
  92. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement