Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Remove homosharts
- // @namespace remove homosharts
- // @version 0.2
- // @description Remove sharts in .jetri
- // @author 35p
- // @match https://hololive.jetri.co/*
- // @grant none
- // @run-at document-start
- // ==/UserScript==
- (function() {
- const shartList = ['花咲みやび','奏手イヅル','アルランディス','律可','アステル','岸堂天真','夕刻ロベル','影山シエン','荒咬オウガ','ホロスタ',
- 'Risu', 'Moona', 'Airani Iofifteen', 'Ollie', 'Anya', 'Reine']
- const freeChatList = ['Twitterのかわりにお知らせしたりする枠【Free Chat】', '【Free chat】サーカス客席【ホロライブ/尾丸ポルカ】', '【Free chat】Happy New Year!ししろんの射撃訓練場【ホロライブ/獅白ぼたん】', '✿ FreeeChat | Miko Ch. ✿']
- if (location.host === "hololive.jetri.co") {
- window.addEventListener('DOMContentLoaded', clearnup(), false);
- window.addEventListener('load', clearnup(), false);
- window.addEventListener('beforeunload', clearnup(), false);
- function clearnup(){
- function modifyResponse(response) {
- if (this.readyState === 4) {
- const url = response.target.responseURL;
- const original_response = response.target.responseText;
- if (url.search("//api.holotools.app/v1/live") >= 0) {
- Object.defineProperty(this, "responseText", {writable: true});
- const modified_response = JSON.parse(original_response);
- modified_response.live = cleanupVids(modified_response.live);
- modified_response.ended = cleanupVids(modified_response.ended);
- modified_response.upcoming = cleanupVids(modified_response.upcoming);
- modified_response.live = cleanupFreechats(modified_response.live);
- modified_response.upcoming = cleanupFreechats(modified_response.upcoming);
- this.responseText = JSON.stringify(modified_response);
- }
- if (url.search("//api.holotools.app/v1/videos") >= 0) {
- Object.defineProperty(this, "responseText", {writable: true});
- const modified_response = JSON.parse(original_response);
- modified_response.videos = cleanupVids(modified_response.videos);
- this.responseText = JSON.stringify(modified_response);
- }
- if (url.search("//api.holotools.app/v1/channels") >= 0) {
- Object.defineProperty(this, "responseText", {writable: true});
- const modified_response = JSON.parse(original_response);
- modified_response.channels = cleanupChannels(modified_response.channels);
- this.responseText = JSON.stringify(modified_response);
- }
- }
- }
- function cleanupVids(vids) {
- return vids.filter(v => shartList.every(shart => !v.channel.name.includes(shart)));
- }
- function cleanupChannels(channels) {
- return channels.filter(c => shartList.every(shart => !c.name.includes(shart)));
- }
- function cleanupFreechats(vids) {
- return vids.filter(v => freeChatList.every(freeChat => !v.title.includes(freeChat)));;
- }
- function openBypass(original_function) {
- return function(method, url, async) {
- this.addEventListener("readystatechange", modifyResponse);
- return original_function.apply(this, arguments);
- };
- }
- XMLHttpRequest.prototype.open = openBypass(XMLHttpRequest.prototype.open);
- }
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement