pervert-monkey 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +62 -0
- package/dist/core/pervertmonkey.core.es.d.ts +391 -0
- package/dist/core/pervertmonkey.core.es.js +8497 -0
- package/dist/core/pervertmonkey.core.es.js.map +1 -0
- package/dist/core/pervertmonkey.core.umd.js +8500 -0
- package/dist/core/pervertmonkey.core.umd.js.map +1 -0
- package/dist/userscripts/3hentai.user.js +1176 -0
- package/dist/userscripts/camgirlfinder.user.js +68 -0
- package/dist/userscripts/camwhores.user.js +1602 -0
- package/dist/userscripts/e-hentai.user.js +1212 -0
- package/dist/userscripts/ebalka.user.js +1231 -0
- package/dist/userscripts/eporner.user.js +1265 -0
- package/dist/userscripts/erome.user.js +1245 -0
- package/dist/userscripts/eroprofile.user.js +1194 -0
- package/dist/userscripts/javhdporn.user.js +1178 -0
- package/dist/userscripts/missav.user.js +1182 -0
- package/dist/userscripts/motherless.user.js +1380 -0
- package/dist/userscripts/namethatporn.user.js +1218 -0
- package/dist/userscripts/nhentai.user.js +1262 -0
- package/dist/userscripts/pornhub.user.js +1199 -0
- package/dist/userscripts/spankbang.user.js +1239 -0
- package/dist/userscripts/xhamster.user.js +1374 -0
- package/dist/userscripts/xvideos.user.js +1254 -0
- package/package.json +54 -0
- package/src/core/data-control/data-filter.ts +143 -0
- package/src/core/data-control/data-manager.ts +144 -0
- package/src/core/data-control/index.ts +2 -0
- package/src/core/infinite-scroll/index.ts +143 -0
- package/src/core/jabroni-config/default-scheme.ts +97 -0
- package/src/core/jabroni-config/default-store.ts +9 -0
- package/src/core/pagination-parsing/index.ts +55 -0
- package/src/core/pagination-parsing/pagination-strategies/PaginationStrategy.ts +44 -0
- package/src/core/pagination-parsing/pagination-strategies/PaginationStrategyDataParams.ts +66 -0
- package/src/core/pagination-parsing/pagination-strategies/PaginationStrategyPathnameParams.ts +77 -0
- package/src/core/pagination-parsing/pagination-strategies/PaginationStrategySearchParams.ts +56 -0
- package/src/core/pagination-parsing/pagination-strategies/index.ts +4 -0
- package/src/core/pagination-parsing/pagination-utils/index.ts +84 -0
- package/src/core/rules/index.ts +385 -0
- package/src/index.ts +42 -0
- package/src/types/index.ts +7 -0
- package/src/userscripts/ascii-logos.js +468 -0
- package/src/userscripts/index.ts +1 -0
- package/src/userscripts/meta.json +11 -0
- package/src/userscripts/scripts/3hentai.ts +20 -0
- package/src/userscripts/scripts/camgirlfinder.ts +68 -0
- package/src/userscripts/scripts/camwhores.ts +382 -0
- package/src/userscripts/scripts/e-hentai.ts +68 -0
- package/src/userscripts/scripts/ebalka.ts +58 -0
- package/src/userscripts/scripts/eporner.ts +90 -0
- package/src/userscripts/scripts/erome.ts +105 -0
- package/src/userscripts/scripts/eroprofile.ts +38 -0
- package/src/userscripts/scripts/javhdporn.ts +24 -0
- package/src/userscripts/scripts/missav.ts +28 -0
- package/src/userscripts/scripts/motherless.ts +222 -0
- package/src/userscripts/scripts/namethatporn.ts +68 -0
- package/src/userscripts/scripts/nhentai.ts +135 -0
- package/src/userscripts/scripts/pornhub.ts +53 -0
- package/src/userscripts/scripts/spankbang.ts +61 -0
- package/src/userscripts/scripts/thisvid.ts +716 -0
- package/src/userscripts/scripts/xhamster.ts +179 -0
- package/src/userscripts/scripts/xvideos.ts +83 -0
- package/src/utils/arrays/index.ts +15 -0
- package/src/utils/async/index.ts +3 -0
- package/src/utils/dom/dom-observers.ts +76 -0
- package/src/utils/dom/index.ts +156 -0
- package/src/utils/events/index.ts +2 -0
- package/src/utils/events/on-pointer-over-and-leave.ts +35 -0
- package/src/utils/events/tick.ts +27 -0
- package/src/utils/fetch/index.ts +37 -0
- package/src/utils/math/index.ts +3 -0
- package/src/utils/objects/index.ts +9 -0
- package/src/utils/objects/memoize.ts +25 -0
- package/src/utils/observers/index.ts +44 -0
- package/src/utils/observers/lazy-image-loader.ts +27 -0
- package/src/utils/parsers/index.ts +30 -0
- package/src/utils/parsers/time-parser.ts +28 -0
- package/src/utils/strings/index.ts +10 -0
- package/src/utils/strings/regexes.ts +35 -0
- package/src/vite-env.d.ts +4 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { MonkeyUserScript } from 'vite-plugin-monkey';
|
|
2
|
+
import { RulesGlobal } from '../../core/rules';
|
|
3
|
+
|
|
4
|
+
export const meta: MonkeyUserScript = {
|
|
5
|
+
name: '3Hentai PervertMonkey',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
description: 'Infinite scroll [optional], Filter by Title',
|
|
8
|
+
match: 'https://*.3hentai.net/*',
|
|
9
|
+
icon: 'https://www.google.com/s2/favicons?sz=64&domain=3hentai.net',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const rules = new RulesGlobal({
|
|
13
|
+
containerSelectorLast: '.listing-container',
|
|
14
|
+
thumbsSelector: '.doujin-col',
|
|
15
|
+
titleSelector: '.title',
|
|
16
|
+
getThumbImgDataStrategy: 'auto',
|
|
17
|
+
gropeStrategy: 'all-in-all',
|
|
18
|
+
customDataSelectorFns: ['filterInclude', 'filterExclude'],
|
|
19
|
+
schemeOptions: ['Text Filter', 'Badge', 'Advanced'],
|
|
20
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { MonkeyUserScript } from 'vite-plugin-monkey';
|
|
2
|
+
|
|
3
|
+
export const meta: MonkeyUserScript = {
|
|
4
|
+
name: 'CamGirlFinder PervertMonkey',
|
|
5
|
+
version: '1.6.0',
|
|
6
|
+
description:
|
|
7
|
+
'Adds model links for CamWhores, webcamrecordings, recu.me, camvideos, privat-zapisi',
|
|
8
|
+
match: ['https://camgirlfinder.net/*'],
|
|
9
|
+
grant: 'none',
|
|
10
|
+
icon: 'https://www.google.com/s2/favicons?sz=64&domain=camgirlfinder.net',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
interface Website {
|
|
14
|
+
name: string;
|
|
15
|
+
url: (u: string) => string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const websites: Website[] = [
|
|
19
|
+
{ name: 'camwhores.tv', url: (u) => `https://camwhores.tv/search/${u}/` },
|
|
20
|
+
{
|
|
21
|
+
name: 'webcamrecordings.com',
|
|
22
|
+
url: (u) => `https://www.webcamrecordings.com/modelSearch/${u}/page/1/`,
|
|
23
|
+
},
|
|
24
|
+
{ name: 'camvideos.me', url: (u) => `https://camvideos.me/search/${u}` },
|
|
25
|
+
{ name: 'recu.me', url: (u) => `https://recu.me/performer/${u}` },
|
|
26
|
+
{
|
|
27
|
+
name: 'privat-zapisi.info',
|
|
28
|
+
url: (u) => `https://www.privat-zapisi.info/search/${u}/`,
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
function createLinks(name: string) {
|
|
33
|
+
return websites
|
|
34
|
+
.map(
|
|
35
|
+
(w) => `
|
|
36
|
+
<a rel="nofollow" href="${w.url(name)}">
|
|
37
|
+
<img class="platform-icon" title="${w.name}" src="https://www.google.com/s2/favicons?sz=64&domain=${w.name}"></a>`,
|
|
38
|
+
)
|
|
39
|
+
.join(' ');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function addRedirectButton() {
|
|
43
|
+
if (!document.body.querySelector<HTMLElement>('.model-name')?.innerText.trim()) return;
|
|
44
|
+
|
|
45
|
+
document.querySelectorAll('.result:not(.fucked)').forEach((e) => {
|
|
46
|
+
const name = e.querySelector<HTMLElement>('.model-name')?.innerText.trim() as string;
|
|
47
|
+
if (name?.length === 0) return;
|
|
48
|
+
(e.querySelector('p:last-child') as HTMLElement).innerHTML += createLinks(name);
|
|
49
|
+
e.classList.add('fucked');
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let timeout: ReturnType<typeof setTimeout>;
|
|
54
|
+
|
|
55
|
+
const observer = new MutationObserver((mutations) => {
|
|
56
|
+
mutations.forEach(() => {
|
|
57
|
+
clearTimeout(timeout);
|
|
58
|
+
timeout = setTimeout(addRedirectButton, 300);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
observer.observe(document.body, {
|
|
63
|
+
attributes: true,
|
|
64
|
+
childList: true,
|
|
65
|
+
subtree: true,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
addRedirectButton();
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { LSKDB } from 'lskdb';
|
|
2
|
+
import type { MonkeyUserScript } from 'vite-plugin-monkey';
|
|
3
|
+
import { GM_addStyle, unsafeWindow } from '$';
|
|
4
|
+
import { InfiniteScroller } from '../../core/infinite-scroll';
|
|
5
|
+
import { getPaginationStrategy } from '../../core/pagination-parsing';
|
|
6
|
+
import { RulesGlobal } from '../../core/rules';
|
|
7
|
+
import { wait } from '../../utils/async';
|
|
8
|
+
import {
|
|
9
|
+
downloader,
|
|
10
|
+
parseHtml,
|
|
11
|
+
querySelectorLastNumber,
|
|
12
|
+
querySelectorText,
|
|
13
|
+
} from '../../utils/dom';
|
|
14
|
+
import { onPointerOverAndLeave, Tick } from '../../utils/events';
|
|
15
|
+
import { fetchHtml } from '../../utils/fetch';
|
|
16
|
+
import { circularShift } from '../../utils/math';
|
|
17
|
+
import { objectToFormData } from '../../utils/objects';
|
|
18
|
+
|
|
19
|
+
export const meta: MonkeyUserScript = {
|
|
20
|
+
name: 'CamWhores PervertMonkey',
|
|
21
|
+
version: '3.0.3',
|
|
22
|
+
description:
|
|
23
|
+
'Infinite scroll [optional]. Filter by Title, Duration and Private/Public. Mass friend request button. Download button',
|
|
24
|
+
match: ['https://*.camwhores.*/*', 'https://*.camwhores.tv'],
|
|
25
|
+
exclude: 'https://*.camwhores.tv/*mode=async*',
|
|
26
|
+
icon: 'https://www.google.com/s2/favicons?sz=64&domain=3hentai.net',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const $ = (unsafeWindow as any).$;
|
|
30
|
+
|
|
31
|
+
GM_addStyle(`
|
|
32
|
+
.item.private .thumb, .item .thumb.private { opacity: 1 !important; }
|
|
33
|
+
.haveNoAccess { background: linear-gradient(to bottom, #b50000 0%, #2c2c2c 100%) red !important; }
|
|
34
|
+
.haveAccess { background: linear-gradient(to bottom, #4e9299 0%, #2c2c2c 100%) green !important; }
|
|
35
|
+
.friend-button { background: radial-gradient(#5ccbf4, #e1ccb1) !important; }
|
|
36
|
+
`);
|
|
37
|
+
|
|
38
|
+
const IS_MEMBER_PAGE = /^(\/members\/\d+\/|\/my\/)$/.test(location.pathname);
|
|
39
|
+
const IS_MESSAGES = /^\/my\/messages\//.test(location.pathname);
|
|
40
|
+
const IS_COMMUNITY_LIST = /\/members\/$/.test(location.pathname);
|
|
41
|
+
const IS_VIDEO_PAGE = /^(\/videos)?\/\d+\//.test(location.pathname);
|
|
42
|
+
const IS_LOGGED_IN = document.cookie.includes('kt_member');
|
|
43
|
+
|
|
44
|
+
const rules = new RulesGlobal({
|
|
45
|
+
containerSelector:
|
|
46
|
+
'[id*="playlist"]:has(> .item .title),[id*="videos"]:has(> .item .title),form:has(>.item .title)',
|
|
47
|
+
paginationStrategyOptions: {
|
|
48
|
+
paginationSelector: '.pagination:not([id *= member])',
|
|
49
|
+
overwritePaginationLast: IS_MEMBER_PAGE ? () => 1 : (x) => (x === 9 ? 9999 : x),
|
|
50
|
+
},
|
|
51
|
+
getThumbImgDataAttrSelector: 'data-original',
|
|
52
|
+
getThumbImgDataStrategy: 'auto',
|
|
53
|
+
thumbsSelector:
|
|
54
|
+
'.list-videos .item, .playlist .item, .list-playlists > div > .item, .item:has(.title)',
|
|
55
|
+
gropeStrategy: 'all-in-all',
|
|
56
|
+
getThumbDataStrategy: 'auto-select',
|
|
57
|
+
customThumbDataSelectors: {
|
|
58
|
+
private: { type: 'boolean', selector: '[class*=private]' },
|
|
59
|
+
},
|
|
60
|
+
customDataSelectorFns: [
|
|
61
|
+
'filterInclude',
|
|
62
|
+
'filterExclude',
|
|
63
|
+
'filterDuration',
|
|
64
|
+
{
|
|
65
|
+
filterPrivate: (e, state) => (state.filterPrivate && e.private) as boolean,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
filterPublic: (e, state) => (state.filterPublic && !e.private) as boolean,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
schemeOptions: [
|
|
72
|
+
'Text Filter',
|
|
73
|
+
'Duration Filter',
|
|
74
|
+
'Privacy Filter',
|
|
75
|
+
'Badge',
|
|
76
|
+
{
|
|
77
|
+
title: 'Advanced',
|
|
78
|
+
content: [
|
|
79
|
+
{
|
|
80
|
+
autoRequestAccess: false,
|
|
81
|
+
label: 'auto send friend request on check access',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
animatePreview,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
function animatePreview(container: HTMLElement) {
|
|
90
|
+
const tick = new Tick(500);
|
|
91
|
+
|
|
92
|
+
function killjquery(n = 10) {
|
|
93
|
+
if (n > 0) {
|
|
94
|
+
n--;
|
|
95
|
+
$('img[data-cnt]').off();
|
|
96
|
+
setTimeout(() => killjquery(n), 250);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
killjquery();
|
|
101
|
+
|
|
102
|
+
function rotateImg(src: string, count: number) {
|
|
103
|
+
return src.replace(/(\d)(?=\.jpg$)/, (_, n) => `${circularShift(parseInt(n), count)}`);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
onPointerOverAndLeave(
|
|
107
|
+
container,
|
|
108
|
+
(target) =>
|
|
109
|
+
target.tagName === 'IMG' &&
|
|
110
|
+
target.classList.contains('thumb') &&
|
|
111
|
+
!!target.getAttribute('src') &&
|
|
112
|
+
!/data:image|avatar/.test(target.getAttribute('src') as string),
|
|
113
|
+
(_target) => {
|
|
114
|
+
const target = _target as HTMLImageElement;
|
|
115
|
+
const origin = target.src;
|
|
116
|
+
const count = parseInt(target.getAttribute('data-cnt') as string) || 5;
|
|
117
|
+
tick.start(
|
|
118
|
+
() => {
|
|
119
|
+
target.src = rotateImg(target.src, count);
|
|
120
|
+
},
|
|
121
|
+
() => {
|
|
122
|
+
target.src = origin;
|
|
123
|
+
},
|
|
124
|
+
);
|
|
125
|
+
return {
|
|
126
|
+
leaveTarget: target.closest('.item') as HTMLElement,
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
() => tick.stop(),
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
//====================================================================================================
|
|
134
|
+
|
|
135
|
+
const createDownloadButton = () =>
|
|
136
|
+
downloader({
|
|
137
|
+
append: '.tabs-menu > ul',
|
|
138
|
+
after: '',
|
|
139
|
+
button:
|
|
140
|
+
'<li><a href="#tab_comments" class="toggle-button" style="text-decoration: none;">download 📼</a></li>',
|
|
141
|
+
cbBefore: () => $('.fp-ui').click(),
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
//====================================================================================================
|
|
145
|
+
|
|
146
|
+
const DEFAULT_FRIEND_REQUEST_FORMDATA = objectToFormData({
|
|
147
|
+
message: '',
|
|
148
|
+
action: 'add_to_friends_complete',
|
|
149
|
+
function: 'get_block',
|
|
150
|
+
block_id: 'member_profile_view_view_profile',
|
|
151
|
+
format: 'json',
|
|
152
|
+
mode: 'async',
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
const lskdb = new LSKDB();
|
|
156
|
+
|
|
157
|
+
async function friendRequest(id: string) {
|
|
158
|
+
const url = Number.isInteger(id) ? `${location.origin}/members/${id}/` : id;
|
|
159
|
+
await fetch(url, { body: DEFAULT_FRIEND_REQUEST_FORMDATA, method: 'post' });
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function getMemberLinks(e: HTMLElement) {
|
|
163
|
+
return Array.from(
|
|
164
|
+
e?.querySelectorAll<HTMLAnchorElement>('.item > a') || [],
|
|
165
|
+
(l) => l.href,
|
|
166
|
+
).filter((l) => /\/members\/\d+\/$/.test(l));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
async function getMemberFriends(id: number | string) {
|
|
170
|
+
const url = new URL(
|
|
171
|
+
IS_COMMUNITY_LIST ? '/members/' : `/members/${id}/friends/`,
|
|
172
|
+
location.origin,
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
const doc = (await fetchHtml(url.href)) as unknown as Document;
|
|
176
|
+
|
|
177
|
+
const paginationStrategy = getPaginationStrategy({
|
|
178
|
+
doc,
|
|
179
|
+
url,
|
|
180
|
+
overwritePaginationLast: (x) => (x === 9 ? 999 : x),
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
const gen = InfiniteScroller.generatorForPaginationStrategy(paginationStrategy);
|
|
184
|
+
|
|
185
|
+
for (const url in gen) {
|
|
186
|
+
const doc = await fetchHtml(url);
|
|
187
|
+
getMemberLinks(doc).forEach((a) => {
|
|
188
|
+
const id = a.match(/\d+/)?.[0] as string;
|
|
189
|
+
lskdb.setKey(id);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
await processFriendship();
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
let processFriendshipStarted = false;
|
|
197
|
+
async function processFriendship(batchSize = 1, interval = 5000) {
|
|
198
|
+
if (lskdb.isLocked()) return;
|
|
199
|
+
const friendlist = lskdb.getKeys(batchSize);
|
|
200
|
+
if (friendlist?.length < 1) return;
|
|
201
|
+
if (!processFriendshipStarted) {
|
|
202
|
+
processFriendshipStarted = true;
|
|
203
|
+
console.log('processFriendshipStarted');
|
|
204
|
+
}
|
|
205
|
+
lskdb.lock(true);
|
|
206
|
+
const urls = friendlist.map((id) => `${location.origin}/members/${id}/`);
|
|
207
|
+
for (const url of urls) {
|
|
208
|
+
await wait(interval);
|
|
209
|
+
await friendRequest(url);
|
|
210
|
+
}
|
|
211
|
+
lskdb.lock(false);
|
|
212
|
+
await processFriendship();
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function createPrivateVideoFriendButton() {
|
|
216
|
+
if (!document.querySelector('.no-player')) return;
|
|
217
|
+
const member = document.querySelector<HTMLAnchorElement>('.no-player a')?.href as string;
|
|
218
|
+
const button = parseHtml(
|
|
219
|
+
'<button class="friend-button"><span>Friend Request</span></button>',
|
|
220
|
+
);
|
|
221
|
+
document.querySelector('.no-player .message')?.append(button);
|
|
222
|
+
button.addEventListener('click', () => friendRequest(member), { once: true });
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function createFriendButton() {
|
|
226
|
+
const button = parseHtml(
|
|
227
|
+
'<a href="#friend_everyone" class="button friend-button"><span>Friend Everyone</span></a>',
|
|
228
|
+
);
|
|
229
|
+
document.querySelector('.main-container-user > .headline, .headline')?.append(button);
|
|
230
|
+
const memberid = location.pathname.match(/\d+/)?.[0] as string;
|
|
231
|
+
button.addEventListener(
|
|
232
|
+
'click',
|
|
233
|
+
() => {
|
|
234
|
+
button.style.background = 'radial-gradient(#ff6114, #5babc4)';
|
|
235
|
+
button.innerText = 'processing requests';
|
|
236
|
+
getMemberFriends(memberid).then(() => {
|
|
237
|
+
button.style.background = 'radial-gradient(blue, lightgreen)';
|
|
238
|
+
button.innerText = 'friend requests sent';
|
|
239
|
+
});
|
|
240
|
+
},
|
|
241
|
+
{ once: true },
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
//====================================================================================================
|
|
246
|
+
|
|
247
|
+
async function requestAccess() {
|
|
248
|
+
checkPrivateVidsAccess();
|
|
249
|
+
setTimeout(processFriendship, 5000);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
async function checkPrivateVidsAccess() {
|
|
253
|
+
const checkAccess = async (item: HTMLElement) => {
|
|
254
|
+
const videoURL = (item.firstElementChild as HTMLAnchorElement).href as string;
|
|
255
|
+
const doc = await fetchHtml(videoURL);
|
|
256
|
+
|
|
257
|
+
if (!doc.querySelector('.player')) return;
|
|
258
|
+
|
|
259
|
+
const haveAccess = !doc.querySelector('.no-player');
|
|
260
|
+
|
|
261
|
+
if (!haveAccess && rules.store.state.autoRequestAccess) {
|
|
262
|
+
const anchor = doc.querySelector<HTMLAnchorElement>('.message a');
|
|
263
|
+
const uid = anchor?.href.match(/\d+/)?.at(-1) as string;
|
|
264
|
+
lskdb.setKey(uid);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
item.classList.add(haveAccess ? 'haveAccess' : 'haveNoAccess');
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
const thumbs = document.querySelectorAll<HTMLElement>(
|
|
271
|
+
'.item.private:not(.haveAccess,.haveNoAccess)',
|
|
272
|
+
);
|
|
273
|
+
|
|
274
|
+
for (const thumb of thumbs) {
|
|
275
|
+
await checkAccess(thumb);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
//====================================================================================================
|
|
280
|
+
|
|
281
|
+
function getUserInfo(e: HTMLElement) {
|
|
282
|
+
const uploadedCount = querySelectorLastNumber('#list_videos_uploaded_videos strong', e);
|
|
283
|
+
const friendsCount = querySelectorLastNumber('#list_members_friends .headline', e);
|
|
284
|
+
return { uploadedCount, friendsCount };
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
async function acceptFriendRequest(id: number | string) {
|
|
288
|
+
const url = new URL(`/my/messages/${id}/`, location.origin);
|
|
289
|
+
const memberUrl = new URL(`/members/${id}/`, location.origin);
|
|
290
|
+
await fetch(url, {
|
|
291
|
+
headers: {
|
|
292
|
+
Accept: '*/*',
|
|
293
|
+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
|
294
|
+
},
|
|
295
|
+
body: `action=confirm_add_to_friends&message_from_user_id=${id}&function=get_block&block_id=list_messages_my_conversation_messages&confirm=Confirm&format=json&mode=async`,
|
|
296
|
+
method: 'POST',
|
|
297
|
+
});
|
|
298
|
+
await fetchHtml(memberUrl).then((doc) =>
|
|
299
|
+
console.log('userInfo', memberUrl.href, getUserInfo(doc)),
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
async function clearMessages() {
|
|
304
|
+
const pages = InfiniteScroller.generatorForPaginationStrategy(
|
|
305
|
+
getPaginationStrategy({
|
|
306
|
+
overwritePaginationLast: (x) => (x === 9 ? 999 : x),
|
|
307
|
+
}),
|
|
308
|
+
);
|
|
309
|
+
|
|
310
|
+
for await (const p of pages) {
|
|
311
|
+
const doc = await fetchHtml(p.url);
|
|
312
|
+
|
|
313
|
+
const messages = Array.from(
|
|
314
|
+
doc.querySelectorAll<HTMLAnchorElement>(
|
|
315
|
+
'#list_members_my_conversations_items .item > a',
|
|
316
|
+
) || [],
|
|
317
|
+
).map((a) => a.href);
|
|
318
|
+
|
|
319
|
+
for (const m of messages) {
|
|
320
|
+
await checkMessageHistory(m);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
async function deleteMessage(url: string, id: string) {
|
|
325
|
+
const deleteURL = `${url}?mode=async&format=json&function=get_block&block_id=list_messages_my_conversation_messages&action=delete_conversation&conversation_user_id=${id}`;
|
|
326
|
+
await fetch(deleteURL);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
async function getConversation(url: string) {
|
|
330
|
+
const doc = await fetchHtml(url);
|
|
331
|
+
const hasFriendRequest = !!doc.querySelector('input[value=confirm_add_to_friends]');
|
|
332
|
+
const originalText = querySelectorText(doc, '.original-text');
|
|
333
|
+
const id = url.match(/\d+/)?.[0] as string;
|
|
334
|
+
const messages = querySelectorText(doc, '.list-messages');
|
|
335
|
+
return {
|
|
336
|
+
id,
|
|
337
|
+
hasFriendRequest,
|
|
338
|
+
originalText,
|
|
339
|
+
messages,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
async function checkMessageHistory(url: string) {
|
|
344
|
+
const { originalText, hasFriendRequest, id, messages } = await getConversation(url);
|
|
345
|
+
if (!(originalText || hasFriendRequest)) {
|
|
346
|
+
await deleteMessage(url, id);
|
|
347
|
+
} else {
|
|
348
|
+
console.log({ originalText, url, messages });
|
|
349
|
+
if (hasFriendRequest) {
|
|
350
|
+
await acceptFriendRequest(id);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
//====================================================================================================
|
|
357
|
+
|
|
358
|
+
const FRIEND_REQUEST_INTERVAL = 5000;
|
|
359
|
+
|
|
360
|
+
if (IS_LOGGED_IN) {
|
|
361
|
+
setTimeout(processFriendship, FRIEND_REQUEST_INTERVAL);
|
|
362
|
+
if (IS_MEMBER_PAGE || IS_COMMUNITY_LIST) {
|
|
363
|
+
createFriendButton();
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
if (IS_VIDEO_PAGE) {
|
|
368
|
+
createDownloadButton();
|
|
369
|
+
createPrivateVideoFriendButton();
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if (IS_MESSAGES) {
|
|
373
|
+
const button = parseHtml('<button>clear messages</button>');
|
|
374
|
+
document.querySelector('.headline')?.append(button);
|
|
375
|
+
button.addEventListener('click', clearMessages);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
rules.store.eventSubject.subscribe((event) => {
|
|
379
|
+
if (event.includes('check access')) {
|
|
380
|
+
requestAccess();
|
|
381
|
+
}
|
|
382
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { MonkeyUserScript } from 'vite-plugin-monkey';
|
|
2
|
+
import { RulesGlobal } from '../../core/rules';
|
|
3
|
+
import { fetchHtml } from '../../utils/fetch';
|
|
4
|
+
|
|
5
|
+
export const meta: MonkeyUserScript = {
|
|
6
|
+
name: 'E-Hentai PervertMonkey',
|
|
7
|
+
version: '1.0.0',
|
|
8
|
+
description: 'Infinite scroll [optional], Filter by Title',
|
|
9
|
+
match: ['https://*.e-hentai.org/*'],
|
|
10
|
+
icon: 'https://www.google.com/s2/favicons?sz=64&domain=e-hentai.org',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const rules = new RulesGlobal({
|
|
14
|
+
thumbsSelector: '.gl1t',
|
|
15
|
+
titleSelector: '.glname',
|
|
16
|
+
containerSelectorLast: '.itg.gld',
|
|
17
|
+
getThumbImgDataAttrSelector: 'data-lazy-load',
|
|
18
|
+
getThumbImgDataStrategy: 'auto',
|
|
19
|
+
paginationStrategyOptions: createPaginationStrategyOptions(),
|
|
20
|
+
customDataSelectorFns: ['filterInclude', 'filterExclude'],
|
|
21
|
+
schemeOptions: ['Text Filter', 'Badge', 'Advanced'],
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
function createPaginationStrategyOptions(): RulesGlobal['paginationStrategyOptions'] {
|
|
25
|
+
let nextLink: string;
|
|
26
|
+
|
|
27
|
+
function getPaginationUrlGenerator() {
|
|
28
|
+
function getNextLink(doc: Document | HTMLElement = document) {
|
|
29
|
+
return [...doc.querySelectorAll<HTMLAnchorElement>('a#dnext[href]')].pop()
|
|
30
|
+
?.href as string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const paginationUrlGenerator = async (_: number) => {
|
|
34
|
+
if (!nextLink) {
|
|
35
|
+
nextLink = getNextLink();
|
|
36
|
+
return nextLink;
|
|
37
|
+
}
|
|
38
|
+
// need cache or reuse infinite scroller request
|
|
39
|
+
const doc = await fetchHtml(nextLink);
|
|
40
|
+
nextLink = getNextLink(doc);
|
|
41
|
+
return nextLink;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return paginationUrlGenerator;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
paginationSelector: '.searchnav + div + .searchnav',
|
|
49
|
+
overwritePaginationLast: () => 9999999,
|
|
50
|
+
getPaginationUrlGenerator,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function setThumbnailMode() {
|
|
55
|
+
const IS_SEARCH_PAGE =
|
|
56
|
+
/f_search/.test(location.search) || /^\/tag\//.test(location.pathname);
|
|
57
|
+
if (!IS_SEARCH_PAGE) return;
|
|
58
|
+
|
|
59
|
+
const selectInputT = document.querySelector('option[value=t]') as HTMLOptGroupElement;
|
|
60
|
+
if (selectInputT) {
|
|
61
|
+
const select = selectInputT.parentElement as HTMLOptionElement;
|
|
62
|
+
if (select.value === 't') return;
|
|
63
|
+
select.value = 't';
|
|
64
|
+
select.dispatchEvent(new Event('change'));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
setThumbnailMode();
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { MonkeyUserScript } from 'vite-plugin-monkey';
|
|
2
|
+
import { RulesGlobal } from '../../core/rules';
|
|
3
|
+
import { exterminateVideo, parseHtml } from '../../utils/dom';
|
|
4
|
+
import { onPointerOverAndLeave } from '../../utils/events';
|
|
5
|
+
|
|
6
|
+
export const meta: MonkeyUserScript = {
|
|
7
|
+
name: 'Ebalka PervertMonkey',
|
|
8
|
+
version: '3.0.0',
|
|
9
|
+
description: 'Infinite scroll [optional], Filter by Title and Duration',
|
|
10
|
+
match: [
|
|
11
|
+
'https://a.ebalka.love/*',
|
|
12
|
+
'https://b.ebalka.zip/*',
|
|
13
|
+
'https://*ebalka.*.*/*',
|
|
14
|
+
'https://*.ebalk*.*/*',
|
|
15
|
+
'https://*.fuckingbear*.*/*',
|
|
16
|
+
],
|
|
17
|
+
icon: 'https://www.google.com/s2/favicons?sz=64&domain=ebalka.nl',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const rules = new RulesGlobal({
|
|
21
|
+
containerSelectorLast: '.content__video',
|
|
22
|
+
paginationStrategyOptions: {
|
|
23
|
+
paginationSelector: '.pagination:not([id *= member])',
|
|
24
|
+
},
|
|
25
|
+
thumbsSelector: '.card_video',
|
|
26
|
+
titleSelector: '.card__title',
|
|
27
|
+
durationSelector: '.card__spot > span:last-child',
|
|
28
|
+
animatePreview,
|
|
29
|
+
schemeOptions: ['Text Filter', 'Badge', 'Duration Filter', 'Advanced'],
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
function animatePreview(container: HTMLElement) {
|
|
33
|
+
function animateThumb(thumb: HTMLElement) {
|
|
34
|
+
const el = thumb.querySelector('.card__thumb_video') as HTMLElement;
|
|
35
|
+
el.classList.toggle('video-on');
|
|
36
|
+
const src = el.querySelector('.card__image')?.getAttribute('data-preview') as string;
|
|
37
|
+
|
|
38
|
+
const videoElem =
|
|
39
|
+
parseHtml(`<video style="position: absolute; left: 0px; top: 0px; visibility: visible; margin-top: -1px;"
|
|
40
|
+
autoplay="" loop="" playsinline="true" webkit-playsinline="true" src="${src}"></video>`) as HTMLVideoElement;
|
|
41
|
+
el.appendChild(videoElem);
|
|
42
|
+
|
|
43
|
+
return () => {
|
|
44
|
+
el.classList.toggle('video-on');
|
|
45
|
+
exterminateVideo(videoElem);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
onPointerOverAndLeave(
|
|
50
|
+
container,
|
|
51
|
+
(target) => target.tagName === 'IMG',
|
|
52
|
+
(target) => {
|
|
53
|
+
const thumb = target.closest('.card') as HTMLElement;
|
|
54
|
+
const onOverCallback = animateThumb(thumb);
|
|
55
|
+
return { leaveTarget: thumb, onOverCallback };
|
|
56
|
+
},
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { MonkeyUserScript } from 'vite-plugin-monkey';
|
|
2
|
+
import { unsafeWindow } from '$';
|
|
3
|
+
import { RulesGlobal } from '../../core/rules';
|
|
4
|
+
import { onPointerOverAndLeave } from '../../utils/events';
|
|
5
|
+
|
|
6
|
+
export const meta: MonkeyUserScript = {
|
|
7
|
+
name: 'Eporner PervertMonkey',
|
|
8
|
+
version: '2.0.1',
|
|
9
|
+
description: 'Infinite scroll [optional], Filter by Title, Duration and HD',
|
|
10
|
+
match: ['https://*.eporner.com/*', 'https://*.eporner.*/*'],
|
|
11
|
+
icon: 'https://www.google.com/s2/favicons?sz=64&domain=eporner.com',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const show_video_prev = (unsafeWindow as any).show_video_prev;
|
|
15
|
+
|
|
16
|
+
const rules = new RulesGlobal({
|
|
17
|
+
paginationStrategyOptions: {
|
|
18
|
+
paginationSelector: '.numlist2',
|
|
19
|
+
},
|
|
20
|
+
customThumbDataSelectors: {
|
|
21
|
+
quality: { type: 'number', selector: '[title="Quality"]' },
|
|
22
|
+
},
|
|
23
|
+
containerSelectorLast: '#vidresults',
|
|
24
|
+
thumbsSelector: 'div[id^=vf][data-id]',
|
|
25
|
+
uploaderSelector: '[title="Uploader"]',
|
|
26
|
+
titleSelector: 'a',
|
|
27
|
+
durationSelector: '[title="Duration"]',
|
|
28
|
+
getThumbImgDataStrategy: 'auto',
|
|
29
|
+
getThumbImgDataAttrDelete: 'auto',
|
|
30
|
+
customDataSelectorFns: [
|
|
31
|
+
'filterInclude',
|
|
32
|
+
'filterExclude',
|
|
33
|
+
'filterDuration',
|
|
34
|
+
{
|
|
35
|
+
quality360: (el, state) => !!state.quality360 && el.quality !== 360,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
quality480: (el, state) => !!state.quality480 && el.quality !== 480,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
quality720: (el, state) => !!state.quality720 && el.quality !== 720,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
quality1080: (el, state) => !!state.quality1080 && el.quality !== 1080,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
quality4k: (el, state) => !!state.quality4k && el.quality !== 4,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
schemeOptions: [
|
|
51
|
+
'Text Filter',
|
|
52
|
+
'Badge',
|
|
53
|
+
'Duration Filter',
|
|
54
|
+
{
|
|
55
|
+
title: 'Quality Filter ',
|
|
56
|
+
content: [
|
|
57
|
+
{
|
|
58
|
+
quality360: false,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
quality480: false,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
quality720: false,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
quality1080: false,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
quality4k: false,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
'Advanced',
|
|
75
|
+
],
|
|
76
|
+
animatePreview,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
function animatePreview(doc: HTMLElement) {
|
|
80
|
+
onPointerOverAndLeave(
|
|
81
|
+
doc,
|
|
82
|
+
(e) => e instanceof HTMLImageElement,
|
|
83
|
+
(e) => {
|
|
84
|
+
const target = e as HTMLImageElement;
|
|
85
|
+
const thumb = target.closest('[data-id]');
|
|
86
|
+
const id = thumb?.getAttribute('data-id');
|
|
87
|
+
show_video_prev(id);
|
|
88
|
+
},
|
|
89
|
+
);
|
|
90
|
+
}
|