您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Infinite scroll. Lazy loading. Filter by duration and title. Reveal all related galleries to video at desktop. Galleries url rewritten and redirected to video/image section if available.
当前为
// ==UserScript== // @name Motherless.com Improved // @namespace http://tampermonkey.net/ // @author smartacephale // @license MIT // @version 1.2 // @description Infinite scroll. Lazy loading. Filter by duration and title. Reveal all related galleries to video at desktop. Galleries url rewritten and redirected to video/image section if available. // @match https://motherless.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=motherless.com // @grant unsafeWindow // @grant GM_addStyle // @run-at document-end // @require https://unpkg.com/[email protected]/dist/vue.global.prod.js // ==/UserScript== const LOGO = ` ⡿⣹⡝⣯⡝⣯⡝⣯⠽⣭⢻⣭⢻⣭⢻⣭⢻⡭⢯⡽⡭⢏⡳⣍⡛⡜⡍⢎⡱⢊⠖⡱⢊⡖⣱⢊⠶⡱⢎⠶⣩⣿⢣⠝⣺⢿⣹⣷⣿⣿⣿⣿⢠⢃⠦⡑⢢⠜⣐⠢ ⣟⡧⣟⢮⡽⣖⣻⢼⡻⣜⣳⢎⡷⣎⠷⣎⠷⣙⢧⡚⣥⢋⠶⣡⠞⣱⡘⣣⠱⣋⠼⡱⣉⠶⣡⡛⡼⣱⢫⡝⣶⣯⣏⢞⡥⢫⣝⣯⣟⣾⣿⣽⢂⠣⣌⡑⢣⡘⠤⣃ ⣞⡷⣭⢟⡾⣹⢮⢷⣹⢧⣛⠮⣕⢎⡳⢬⠳⣍⠶⣙⢦⢋⡞⣥⢚⡥⣚⠴⣙⢦⠳⣥⢣⣛⡴⣯⢵⣣⢷⣹⣿⡷⣽⣎⣿⣧⢿⣯⣿⡿⣾⠏⢆⡓⢤⡉⢖⡨⡑⢆ ⣷⡽⣺⣝⠾⣭⣛⣮⢷⣫⡽⣛⡼⣫⡝⣧⢻⣬⢳⢭⡲⣍⠶⣡⠏⡶⣹⡞⣵⢮⣟⡶⣯⣛⣾⡽⣷⡹⢎⣿⣿⣽⣷⣿⢿⣼⣻⣿⣿⢿⠏⡜⢢⢍⡒⠜⡢⡑⡜⢂ ⡵⣹⠳⣞⣻⢧⠿⣜⣧⢯⣷⣯⢷⣳⣽⣚⠷⣎⡟⣮⢳⣎⢷⣣⣛⡴⢣⡜⣩⠝⣚⠿⡹⢭⢏⡿⣶⡹⡭⣿⣯⣿⣿⠿⣛⠻⢿⣿⣿⣿⡘⣌⢣⠒⣌⢣⠱⡑⣌⠣ ⢫⡵⣛⡼⢣⡟⣯⢻⡼⢳⢮⡛⢿⢳⣟⡾⣯⢷⣹⣎⠷⣎⢧⡳⣍⡞⢧⡛⣖⢫⡜⢶⡱⣍⢮⡜⣡⢍⡱⣛⢭⡱⢦⡳⢬⣙⠶⣘⡛⢷⡘⢤⠣⢍⢆⢣⢣⠱⣌⠲ ⣟⡴⣣⡝⢧⡝⢮⣛⡜⣣⢎⡽⣌⠧⣎⡹⢫⠿⣳⣯⣟⡾⣧⢷⣺⡜⣧⡽⣬⢳⠜⣣⠚⣌⠱⡌⡱⢊⠥⣉⠞⡹⢿⡝⢦⣽⢢⠅⣏⠻⡜⢢⡙⡌⢎⢆⢣⠓⠤⠓ ⣯⣝⡳⣎⣗⡚⢧⡳⣜⡱⣎⠶⣭⢞⡶⠽⠧⠟⡶⢭⣻⡽⣯⣟⣳⣟⡷⢫⡱⣃⠞⡤⢋⠤⡓⢬⡑⣎⠶⣱⢮⡱⣣⣞⡧⣛⣬⣳⡌⢣⢍⠢⡑⢌⠢⠌⡂⠜⢠⠃ ⡷⣎⢷⡹⣎⢿⣹⠷⣜⡱⣭⢟⡎⡞⡴⣉⠎⡵⡘⢦⢡⠹⣑⡛⢬⡳⣜⢣⠳⣥⢋⠶⣉⢖⣩⢒⡹⢌⠯⡝⢶⡿⣣⣗⡷⡽⣞⣳⣭⣳⠌⢆⡑⢢⠘⡄⠱⡈⢄⠂ ⡿⣜⢧⡻⣜⢧⡻⣝⣮⢷⡘⢯⡜⡱⢜⢢⡙⠴⣉⢆⢣⡙⣤⠛⢦⣛⡬⢏⡷⢪⡝⢮⡱⢎⢆⠧⣘⠬⡒⣍⢲⡙⢷⣸⢞⡷⣯⡟⣯⢳⡿⢂⠜⡠⢃⠌⡱⠐⡌⢂ ⣷⡹⣎⢷⡹⢎⣽⣋⢯⡹⣜⢣⡜⡱⢊⠦⡙⢦⡑⢎⠦⡱⢆⡛⢦⣛⡼⣫⢞⣧⣛⢮⡵⣋⠞⣬⢱⡊⡵⡘⢦⡙⠦⣍⢚⡼⣱⢏⡟⣫⢆⠱⡨⢐⠡⢊⠔⡡⠘⡄ ⣳⢧⢻⡼⣳⡭⢶⡹⢮⡕⣎⠧⢎⡵⣉⠖⡩⢆⡹⢌⠶⣙⢬⡙⣦⢣⡟⣵⢯⣶⣛⡞⡶⣭⣛⡴⢣⠳⣥⠛⡴⣩⢓⢬⢚⡜⢣⢏⠼⣡⢎⡱⢢⢍⢢⠁⢎⠰⡁⠆ ⡿⣜⣣⣽⢗⡻⢳⣹⢣⢞⡬⢳⣩⠒⣥⢚⡱⢊⡴⢋⡼⣘⢦⢻⡴⣻⣼⢯⡿⣾⡽⣹⡗⣧⢯⣜⢯⡳⣬⣛⡴⢣⢏⡞⡜⣬⢃⢎⠳⣌⢮⡱⢃⡎⢦⡙⢦⠑⡌⣂ ⣾⡰⢧⣟⢮⢵⣫⢖⡏⣞⡜⣣⢖⡹⢤⠳⣘⢇⡞⡱⢎⡵⣋⢷⣹⢳⣞⣻⢽⣳⣟⣷⣻⡽⣞⡽⣎⢷⡳⣎⢷⢫⡞⡼⡱⢆⡫⣌⠳⡜⢦⡝⢣⠞⣢⡙⢆⢣⠒⡌ ⣗⣯⡷⣹⢮⡳⣎⢷⡹⣎⡼⡱⢎⡵⣊⠷⣩⠞⡼⣱⢫⢶⡹⣎⢷⣫⢾⣭⢿⣳⣟⣾⣳⢿⡽⣯⡽⣣⢟⡼⣋⡧⣝⠶⣙⢮⡑⣎⢳⡙⣦⠍⣇⢫⠴⣙⠬⡒⢩⡐ ⣿⢾⣟⡯⢷⣝⡮⢷⣹⢶⣙⢧⡻⣴⢋⡞⣥⢻⡜⣧⣛⣮⢷⣫⢷⣫⣟⡾⣯⢷⣞⡷⣿⣟⣿⣣⢟⡽⣎⢷⡹⢎⣧⢛⡜⡦⡝⣬⢣⡝⢦⢋⡔⢣⠚⡄⠓⡌⢅⠂ ⣿⣻⡼⡽⣏⡾⣝⡿⣜⣧⢻⣎⡷⣭⡻⣜⣳⣏⣾⣳⡽⣞⣯⣳⢯⢶⣯⣽⣯⣟⣾⣻⣿⡽⣶⣛⢮⢳⡎⢷⣩⢏⠶⣩⢞⣱⡙⡦⢏⡼⣋⠖⣌⠣⢍⠢⡑⢌⣂⠣ ⣷⣳⡽⣽⣫⣽⣻⣼⣻⣼⣻⢞⡷⣯⡽⣯⢷⣞⡷⣯⢿⣽⣞⡷⣯⣟⣾⣽⣾⣻⣾⣿⢯⣟⢶⡹⣎⣗⢺⢣⡞⡼⣩⣓⢮⢲⣍⡳⢏⡞⣥⢋⠤⢋⠬⡱⡘⠔⠢⡅ ⣷⣻⢞⣷⣛⡾⣵⣳⣟⡾⣽⢯⣟⣷⣻⣽⣻⢾⣽⣟⣿⣻⣾⣿⣟⣾⣿⣽⣷⣿⣻⣯⣟⢮⡳⣝⠶⣪⢭⣓⢮⠵⡳⡜⣮⠳⣜⡝⣮⡝⡦⢽⣅⢋⢆⠱⣈⢎⡱⢄ ⣷⢯⣟⡾⣽⣻⢷⣻⢾⡽⣯⣟⣾⣳⢟⡾⣽⣻⢾⡽⣞⡿⣽⣿⣿⣿⣾⣿⣯⣿⣿⣳⢏⡷⣝⢮⣛⣥⢳⣎⣏⢾⡱⣛⡴⡻⣜⡞⣵⢺⢩⠃⢏⡸⢌⢒⡡⢂⠖⣈ ⣯⣟⡾⣽⣳⢯⡿⣽⢯⣟⣷⢻⣞⣭⢿⣹⠶⣏⡿⣽⢯⣟⡿⣿⣿⣿⣿⣿⣿⣿⢷⣯⣛⢾⡹⣎⠷⣎⢷⡺⣜⢧⣛⣥⢻⡵⣣⢟⡼⣋⠦⡙⠰⢂⠎⠢⠔⡡⢊⠄ ⡿⣽⣻⢷⣯⠿⣽⣳⣟⡾⣞⠿⣼⢎⡷⣭⢻⡞⣽⣳⣟⡾⣿⣿⣿⣿⣽⡷⢾⣽⣻⢶⣫⣗⣻⣜⡻⣜⢧⡻⣜⢧⡻⣜⡳⣞⡵⣫⢞⣥⣶⣷⣿⣶⣿⣿⣿⣿⣿⣿`.trim(); //==================================================================================================== unsafeWindow.Vue = Vue; const { ref, watch, reactive, createApp } = Vue; class VueApp { template = ` <div class="fixed bottom-0 right-0 z-9999 rounded px-2 py-0.5 bg-zinc-800 max-w-full" v-if="state.uiEnabled"> <div class="flex items-center cursor-pointer py-1 px-2 m-1" @click="state.hidden = !state.hidden"> <span v-text="state.hidden ? '☒' : '⛶'" class="text-right w-full text-xl text-zinc-300"></span> </div> <template v-if="!state.hidden"> <div class="flex items-center bg-zinc-900 py-1 px-2 m-1 font-mono"> <input type="checkbox" id="exclude" v-model="state.filterNegative" class="mr-2 size-auto"> <label for="exclude" class="text-zinc-300 font-mono">exclude</label> <input type="text" v-model="state.filterNegativeTags" placeholder="tag1, tag2,.." class="w-full h-8 text-white px-3 py-2 focus:outline-none bg-zinc-700 mx-2 rounded-sm"> </div> <div class="flex items-center bg-zinc-900 py-1 px-2 m-1 font-mono"> <input type="checkbox" id="include" v-model="state.filterPositive" class="mr-2 size-auto"> <label for="include" class="text-zinc-300 font-mono">include</label> <input type="text" v-model="state.filterPositiveTags" placeholder="tag1, tag2,.." class="w-full h-8 text-white px-3 py-2 focus:outline-none bg-zinc-700 mx-2 rounded-sm size-auto"> </div> <div class="flex items-center bg-zinc-900 py-1 px-2 m-1 font-mono"> <span v-if="stateLocale.pagIndexLast > 1" class="text-zinc-300 ml-auto"> {{ stateLocale.pagIndexCur }}/{{ stateLocale.pagIndexLast }} </span> </div> <div class="flex items-center bg-zinc-900 py-1 px-2 m-1 font-mono"> <input type="checkbox" id="duration" v-model="state.filterDuration" class="mr-2 size-auto"> <label for="duration" class="text-zinc-300 font-mono">duration</label> <label for="durationFrom" class="text-zinc-300 mx-2 font-mono">from</label> <input type="number" step="10" min="0" max="72000" id="durationFrom" v-model.number="state.filterDurationFrom" class="w-24 h-8 bg-gray-700 text-zinc-300 rounded px-3 py-2 focus:outline-none"> <label for="durationTo" class="text-zinc-300 mx-2 font-mono">to</label> <input type="number" step="10" min="0" max="72000" id="durationTo" v-model.number="state.filterDurationTo" class="w-24 h-8 bg-gray-700 text-zinc-300 rounded px-3 py-2 focus:outline-none"> </div> </template> </div> `; constructor(state, stateLocale) { const root = parseDOM('<div id="tapermonkey-app" style="position: relative; z-index: 999999;"></div>'); document.body.appendChild(root); this.vue = createApp({ setup: () => ({ state, stateLocale }), template: this.template }).mount("#tapermonkey-app"); GM_addStyle(`#tapermonkey-app *,#tapermonkey-app :before,#tapermonkey-app :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}#tapermonkey-app :before,#tapermonkey-app :after{--tw-content: ""}#tapermonkey-app html,#tapermonkey-app :host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}#tapermonkey-app body{margin:0;line-height:inherit}#tapermonkey-app hr{height:0;color:inherit;border-top-width:1px}#tapermonkey-app abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}#tapermonkey-app h1,#tapermonkey-app h2,#tapermonkey-app h3,#tapermonkey-app h4,#tapermonkey-app h5,#tapermonkey-app h6{font-size:inherit;font-weight:inherit}#tapermonkey-app a{color:inherit;text-decoration:inherit}#tapermonkey-app b,#tapermonkey-app strong{font-weight:bolder}#tapermonkey-app code,#tapermonkey-app kbd,#tapermonkey-app samp,#tapermonkey-app pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}#tapermonkey-app small{font-size:80%}#tapermonkey-app sub,#tapermonkey-app sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}#tapermonkey-app sub{bottom:-.25em}#tapermonkey-app sup{top:-.5em}#tapermonkey-app table{text-indent:0;border-color:inherit;border-collapse:collapse}#tapermonkey-app button,#tapermonkey-app input,#tapermonkey-app optgroup,#tapermonkey-app select,#tapermonkey-app textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}#tapermonkey-app button,#tapermonkey-app select{text-transform:none}#tapermonkey-app button,#tapermonkey-app input:where([type=button]),#tapermonkey-app input:where([type=reset]),#tapermonkey-app input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}#tapermonkey-app :-moz-focusring{outline:auto}#tapermonkey-app :-moz-ui-invalid{box-shadow:none}#tapermonkey-app progress{vertical-align:baseline}#tapermonkey-app ::-webkit-inner-spin-button,#tapermonkey-app ::-webkit-outer-spin-button{height:auto}#tapermonkey-app [type=search]{-webkit-appearance:textfield;outline-offset:-2px}#tapermonkey-app ::-webkit-search-decoration{-webkit-appearance:none}#tapermonkey-app ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}#tapermonkey-app summary{display:list-item}#tapermonkey-app blockquote,#tapermonkey-app dl,#tapermonkey-app dd,#tapermonkey-app h1,#tapermonkey-app h2,#tapermonkey-app h3,#tapermonkey-app h4,#tapermonkey-app h5,#tapermonkey-app h6,#tapermonkey-app hr,#tapermonkey-app figure,#tapermonkey-app p,#tapermonkey-app pre{margin:0}#tapermonkey-app fieldset{margin:0;padding:0}#tapermonkey-app legend{padding:0}#tapermonkey-app ol,#tapermonkey-app ul,#tapermonkey-app menu{list-style:none;margin:0;padding:0}#tapermonkey-app dialog{padding:0}#tapermonkey-app textarea{resize:vertical}#tapermonkey-app input::-moz-placeholder,#tapermonkey-app textarea::-moz-placeholder{opacity:1;color:#9ca3af}#tapermonkey-app input::placeholder,#tapermonkey-app textarea::placeholder{opacity:1;color:#9ca3af}#tapermonkey-app button,#tapermonkey-app [role=button]{cursor:pointer}#tapermonkey-app :disabled{cursor:default}#tapermonkey-app img,#tapermonkey-app svg,#tapermonkey-app video,#tapermonkey-app canvas,#tapermonkey-app audio,#tapermonkey-app iframe,#tapermonkey-app embed,#tapermonkey-app object{display:block;vertical-align:middle}#tapermonkey-app img,#tapermonkey-app video{max-width:100%;height:auto}#tapermonkey-app [hidden]{display:none}#tapermonkey-app *,#tapermonkey-app :before,#tapermonkey-app :after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }#tapermonkey-app ::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }#tapermonkey-app .fixed{position:fixed}#tapermonkey-app .bottom-0{bottom:0}#tapermonkey-app .right-0{right:0}#tapermonkey-app .m-1{margin:.25rem}#tapermonkey-app .mx-2{margin-left:.5rem;margin-right:.5rem}#tapermonkey-app .ml-auto{margin-left:auto}#tapermonkey-app .mr-2{margin-right:.5rem}#tapermonkey-app .flex{display:flex}#tapermonkey-app .hidden{display:none}#tapermonkey-app .size-auto{width:auto;height:auto}#tapermonkey-app .h-8{height:2rem}#tapermonkey-app .w-24{width:6rem}#tapermonkey-app .w-full{width:100%}#tapermonkey-app .cursor-pointer{cursor:pointer}#tapermonkey-app .resize{resize:both}#tapermonkey-app .flex-wrap{flex-wrap:wrap}#tapermonkey-app .items-center{align-items:center}#tapermonkey-app .rounded{border-radius:.25rem}#tapermonkey-app .rounded-sm{border-radius:.125rem}#tapermonkey-app .border{border-width:1px}#tapermonkey-app .bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}#tapermonkey-app .bg-zinc-700{--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity))}#tapermonkey-app .bg-zinc-800{--tw-bg-opacity: 1;background-color:rgb(39 39 42 / var(--tw-bg-opacity))}#tapermonkey-app .bg-zinc-900{--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity))}#tapermonkey-app .px-2{padding-left:.5rem;padding-right:.5rem}#tapermonkey-app .px-3{padding-left:.75rem;padding-right:.75rem}#tapermonkey-app .py-0{padding-top:0;padding-bottom:0}#tapermonkey-app .py-0\.5{padding-top:.125rem;padding-bottom:.125rem}#tapermonkey-app .py-1{padding-top:.25rem;padding-bottom:.25rem}#tapermonkey-app .py-2{padding-top:.5rem;padding-bottom:.5rem}#tapermonkey-app .text-right{text-align:right}#tapermonkey-app .font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}#tapermonkey-app .text-xl{font-size:1.25rem;line-height:1.75rem}#tapermonkey-app .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#tapermonkey-app .text-zinc-300{--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}`); } } //==================================================================================================== const SCROLL_RESET_DELAY = 500; //==================================================================================================== function $(x, e = document.body) { return e.querySelector(x); } function parseDOM(html) { const parsed = new DOMParser().parseFromString(html, 'text/html').body; return parsed.children.length > 1 ? parsed : parsed.firstElementChild; } const MOBILE_UA = 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36'; function fetchCustomUA(url, ua = MOBILE_UA) { const headers = new Headers({ "User-Agent": ua }); return fetch(url, { headers }); } function fetchHtml(url) { return fetch(url).then((r) => r.text()).then((h) => parseDOM(h)); } function fetchMobHtml(url) { return fetchCustomUA(url).then((r) => r.text()).then((h) => parseDOM(h)); } function timeToSeconds(t) { return (t.match(/\d+/gm) || ['0']) .reverse() .map((s, i) => parseInt(s) * 60 ** i) .reduce((a, b) => a + b) || 0; } function stringToTags(s) { return s.split(",").map(s => s.trim().toLowerCase()).filter(_ => _); } function parseIntegerOr(n, or) { return Number.isInteger(parseInt(n)) ? parseInt(n) : or; } //==================================================================================================== class Observer { constructor(callback) { this.callback = callback; this.observer = new IntersectionObserver(this.handleIntersection.bind(this)); } observe(target) { this.observer.observe(target); } throttle(target, throttleTime) { this.observer.unobserve(target); setTimeout(() => this.observer.observe(target), throttleTime); } handleIntersection(entries) { for (const entry of entries) { if (entry.isIntersecting) { this.callback(entry.target); } } } static observeWhile(target, callback, throttleTime) { const observer_ = new Observer(async (target) => { const condition = await callback(); if (condition) observer_.throttle(target, throttleTime); }); observer_.observe(target); return observer_; } } //==================================================================================================== class MOTHERLESS_RULES { PAGINATION_TAG = '.pagination_link'; CONTAINER_TAG = '.content-inner'; THUMB_TAG = '.thumb-container'; GALLERIES_TAG = '.media-related-galleries'; GALLERY_TAG = '.gallery-container'; GALLERY_MOB_TAG = '.ml-gallery-thumb'; GROUP_TAG = '.group-minibio'; constructor() { this.PAGINATION = $(this.PAGINATION_TAG); this.PAGINATION_LAST = parseInt(this.PAGINATION?.lastElementChild.previousElementSibling.innerText); this.CONTAINER = $(this.CONTAINER_TAG); } THUMB_DATA(thumb) { const url = thumb.firstElementChild.getAttribute('data-codename'); const title = (thumb.querySelector('.title')?.innerText || "").toLowerCase(); const uploader = (thumb.querySelector('.uploader')?.innerText || "").toLowerCase(); const duration = timeToSeconds(thumb.querySelector('.size')?.innerText || "0"); return { url, title, uploader, duration } } URL_DATA() { const { origin, pathname, search, href } = window.location; const url = new URL(href); const offset = parseInt(url.searchParams.get('page')) || 1; const iteratable_url = (n) => { url.searchParams.set('page', n); return url.href; } return { offset, iteratable_url } } } const RULES = new MOTHERLESS_RULES(); //==================================================================================================== function fixThumbs() { let c = 0; for (const thumb of document.querySelectorAll('.img-container')) { const toRemove = thumb.querySelectorAll('div[style]'); for (let i = 0; i < toRemove.length-1; i++) { if (toRemove[i].style.zIndex) { toRemove[i].remove(); c++; console.log('remove', c); } } } } //==================================================================================================== function resetjs() { // restart preview listener const script = Array.from(document.scripts).filter(s => s.src.includes('index_full'))[0]; unsafeWindow.$("a, div, span, ul, li, p, button").off(); unsafeWindow.$.getScript(script.src); fixThumbs(); } //==================================================================================================== class PaginationPageManager { constructor() { handleLoadedHTML(document.body, RULES.CONTAINER); stateLocale.pagIndexLast = RULES.PAGINATION_LAST; RULES.PAGINATION.style.opacity = 0; this.paginationGenerator = this.createNextPageGenerator(); this.paginationObserver = Observer.observeWhile(RULES.PAGINATION, this.generatorConsume, SCROLL_RESET_DELAY); } generatorConsume = async () => { const { value: { url, offset } = {}, done, } = this.paginationGenerator.next(); if (!done) { console.log(url); const nextPageHTML = await fetchHtml(url); const prevScrollPos = document.documentElement.scrollTop; handleLoadedHTML(nextPageHTML, RULES.CONTAINER); stateLocale.pagIndexCur = offset; window.scrollTo(0, prevScrollPos); } return !this.generatorDone; } createNextPageGenerator() { const { offset, iteratable_url } = RULES.URL_DATA(); stateLocale.pagIndexCur = offset; function* nextPageGenerator() { for (let c = offset + 1; c <= RULES.PAGINATION_LAST; c++) { const url = iteratable_url(c); yield { url, offset: c }; } } return nextPageGenerator(); } } //==================================================================================================== function fixGalleriesURLs() { const galleries = Array.from(document.querySelectorAll(('.gallery-container .info span:first-child'))); galleries.forEach(s => { const videosCount = parseInt(s.innerText); const header = videosCount > 0 ? '/GV' : '/GI'; const href = s.parentElement.parentElement.href.replace(/\/G/, () => header); s.parentElement.parentElement.href = href; s.parentElement.parentElement.parentElement.previousElementSibling.href = href; }); } //==================================================================================================== function displayAll() { $(RULES.GROUP_TAG).attr('style', 'display: block !important'); $(RULES.GALLERY_TAG).attr('style', 'display: block !important'); } function copyAttributes(target, source) { for (const attr of source.attributes) { target.setAttribute(attr.nodeName, attr.nodeValue); } } function replaceElementTag(e, tagName) { const newTagElement = document.createElement(tagName); copyAttributes(newTagElement, e); newTagElement.innerHTML = e.innerHTML; e.parentNode.replaceChild(newTagElement, e); } function mobileGalleryToDesktop(e) { e.firstElementChild.nextElementSibling.nextElementSibling.remove(); e.firstElementChild.appendChild(e.firstElementChild.nextElementSibling); e.className = 'thumb-container gallery-container'; e.firstElementChild.className = 'desktop-thumb image medium'; e.firstElementChild.firstElementChild.nextElementSibling.className = 'gallery-captions'; replaceElementTag(e.firstElementChild.firstElementChild, 'a'); } async function desktopAddMobGalleries() { const galleries = $(RULES.GALLERIES_TAG); if (galleries) { const galleriesContainer = galleries.firstElementChild.nextElementSibling.firstElementChild; const galleriesCount = galleries.querySelectorAll(RULES.GALLERY_TAG).length; const mobDom = await fetchMobHtml(window.location.href); const mobGalleries = mobDom.querySelectorAll(RULES.GALLERY_MOB_TAG); for (const [i, x] of mobGalleries.entries()) { if (i > galleriesCount - 1) { mobileGalleryToDesktop(x); galleriesContainer.appendChild(x); } } displayAll(); } } //==================================================================================================== class PersistentState { key = "state_2"; constructor(state) { this.state = reactive(state); this.sync(); this.watchPersistence(); } sync() { this.trySetFromLocalStorage(); window.addEventListener('focus', this.trySetFromLocalStorage); } watchPersistence() { watch(this.state, (value) => { this.saveToLocalStorage(this.key, value); }); } saveToLocalStorage(key, value) { localStorage.setItem(key, JSON.stringify(value)); } trySetFromLocalStorage = () => { const localStorageValue = localStorage.getItem(this.key); if (localStorageValue !== null) { const prevState = JSON.parse(localStorageValue); for (const prop of Object.keys(prevState)) { this.state[prop] = prevState[prop]; } } } } //==================================================================================================== const { state } = new PersistentState({ filterDurationFrom: 0, filterDurationTo: 600, filterDuration: false, filterNegativeTags: "", filterNegative: false, filterPositiveTags: "", filterPositive: false, uiEnabled: true, }); const stateLocale = reactive({ pagIndexLast: 1, pagIndexCur: 1, }); //==================================================================================================== class LazyImgLoader { attributeName = 'lazy-loading'; constructor(callback) { this.lazyImgObserver = new Observer((target) => { callback(target, this.delazify); }); } lazify(parent, img, src) { img.setAttribute(this.attributeName, src); img.src = ''; this.lazyImgObserver.observe(parent); } delazify = (target) => { this.lazyImgObserver.observer.unobserve(target); const img = target.querySelector('.static'); img.src = img.getAttribute(this.attributeName); img.removeAttribute(this.attributeName); } } //==================================================================================================== class DomManager { constructor() { this.data = new Map(); this.lazyImgLoader = new LazyImgLoader((target, delazify) => { if (!this.isFiltered(target)) { delazify(target); } }); this.addFilterStyles(); } dataFilters = { filterDuration: new class { tag = 'filtered-duration'; createFilter = () => { return (v) => { const notInRange = v.duration < state.filterDurationFrom || v.duration > state.filterDurationTo; return [this.tag, state.filterDuration && notInRange]; } } }, filterNegative: new class { tag = 'filtered-exclude'; createFilter = () => { const tags = stringToTags(state.filterNegativeTags); return (v, k) => { const containTags = tags.some(tag => v.title.includes(tag) || v.uploader.includes(tag)); return [this.tag, state.filterNegative && containTags]; } } }, filterPositive: new class { tag = 'filtered-include'; createFilter = () => { const tags = stringToTags(state.filterPositiveTags); return (v, k) => { const containTagsNot = tags.some(tag => !v.title.includes(tag) && !v.uploader.includes(tag)); return [this.tag, state.filterPositive && containTagsNot]; } } } } addFilterStyles() { const tags = Object.keys(this.dataFilters).map(k => `.${this.dataFilters[k].tag}`).join(','); GM_addStyle(`${tags} { display: none !important; }`); } isFiltered(el) { return el.className.includes('filtered'); } filter_ = (filters, offset = 0) => { const runFilters = []; for (const f of Object.keys(filters)) { runFilters.push(this.dataFilters[f].createFilter()); } let offset_counter = 1; for (const [k, v] of this.data.entries()) { offset_counter++; if (offset_counter > offset) { for (const rf of runFilters) { const [tag, condition] = rf(v, k); v.element.classList.toggle(tag, condition); } } } } filterAll = (offset) => { const applyFilters = Object.assign({}, ...Object.keys(this.dataFilters).map(f => ({ [f]: state[f] }))); this.filter_(applyFilters, offset); } handleLoadedHTML = (nextPageHTML, container) => { const thumbs = nextPageHTML.querySelectorAll(RULES.THUMB_TAG); const data_offset = this.data.size; for (const thumb of thumbs) { const {url, title, uploader, duration} = RULES.THUMB_DATA(thumb); if (!url || this.data.has(url)) continue; this.data.set(url, { element: thumb, duration, uploader, title }); const img = thumb.querySelector('.static'); this.lazyImgLoader.lazify(thumb, img, img.src); container.appendChild(thumb); } this.filterAll(data_offset); resetjs(); } } const { filter_, handleLoadedHTML } = new DomManager(); GM_addStyle('.img-container, .desktop-thumb { min-height: 150px; }'); //==================================================================================================== (async () => { 'use strict'; console.clear(); console.log(LOGO); await desktopAddMobGalleries(); fixGalleriesURLs(); if (RULES.PAGINATION) { const manager = new PaginationPageManager(); const ui = new VueApp(state, stateLocale); watch([() => state.filterDurationFrom, () => state.filterDurationTo], (a, b) => { state.filterDurationFrom = parseIntegerOr(a[0], b[0]); state.filterDurationTo = parseIntegerOr(a[1], b[1]); if (state.filterDuration) filter_({ filterDuration: true }); }); watch(() => state.filterDuration, () => filter_({ filterDuration: true })); watch(() => state.filterNegative, () => filter_({ filterNegative: true })); watch(() => state.filterNegativeTags, () => { if (state.filterNegative) filter_({ filterNegative: true }); }, { deep: true }); watch(() => state.filterPositive, () => filter_({ filterPositive: true })); watch(() => state.filterPositiveTags, () => { if (state.filterPositive) filter_({ filterPositive: true }); }, { deep: true }); } })();