Skip to content

Commit cdf8969

Browse files
committed
Update
1 parent b8615f4 commit cdf8969

1 file changed

Lines changed: 13 additions & 36 deletions

File tree

improve-adult-experience.user.js

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @name Improve Adult Experience
33
// @description Skip intros, set better default quality/duration filters, make unwanted video previews transparent, workaround load failures, make input more consistent across the websites. Designed for a separate browser profile. Supported websites: anysex.com, beeg.com, bingato.com, drtuber.com, hqporner.com, hdzog.tube, hypnotube.com, incestporno.vip, inporn.com, manysex.com, mat6tube.com, pmvhaven.com, porn00.tv, pornhits.com, pornhub.com, porno365.best, porntrex.com, pornxp.com, redtube.com, spankbang.com, taboodude.com, tnaflix.com, tube8.com, txxx.com, veporn.com, vxxx.com, whoreshub.com, xgroovy.com, xhamster.com, xnxx.com, xvideos.com, xxxbp.tv, рус-порно.tv
44
// @icon https://external-content.duckduckgo.com/ip3/pornhub.com.ico
5-
// @version 0.53
5+
// @version 0.54
66
// @downloadURL https://userscripts.codonaft.com/improve-adult-experience.user.js
77
// @grant GM_addStyle
88
// ==/UserScript==
@@ -168,18 +168,18 @@ const subscribeOnChanges = (node, selector, f) => {
168168

169169
const defaultArgs = {
170170
css: '',
171-
videoSelector: 'video',
172-
nodeChangeSelector: 'a, div, input, li, span, video',
173171
searchFilter: '',
174172
searchFilterParams: {},
173+
videoSelector: 'video',
174+
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
175+
nodeChangeSelector: 'a, div, input, li, span, video',
175176
};
176177

177178
const init = (args = {}) => {
178179
let {
179180
css,
180181
noKeysOverride,
181182
searchInputSelector,
182-
searchFormOrSubmitButtonSelector,
183183
searchFilter,
184184
searchFilterParams,
185185
videoSelector,
@@ -343,7 +343,7 @@ const init = (args = {}) => {
343343
docs.push(document);
344344
}
345345

346-
if (!searchInputInitialized && (node.matches(searchInputSelector) || node.matches(searchFormOrSubmitButtonSelector))) {
346+
if (!searchInputInitialized && node.matches(searchInputSelector)) {
347347
console.log('initializing search input');
348348
searchInputInitialized = true;
349349
const searchInput = node.matches(searchInputSelector) ? node : body.querySelector(searchInputSelector);
@@ -352,9 +352,6 @@ const init = (args = {}) => {
352352
return true;
353353
}
354354

355-
const formOrButton = body.querySelector(searchFormOrSubmitButtonSelector);
356-
const searchForm = formOrButton?.tagName === 'FORM' ? formOrButton : (node.closest('form') || formOrButton?.closest('form'));
357-
358355
const handleSearch = event => {
359356
event.preventDefault();
360357
event.stopImmediatePropagation();
@@ -369,10 +366,7 @@ const init = (args = {}) => {
369366
}
370367
};
371368

372-
if (formOrButton?.tagName === 'BUTTON') {
373-
formOrButton.addEventListener('click', handleSearch, true);
374-
}
375-
searchForm?.addEventListener('submit', handleSearch, true);
369+
searchInput.closest('form')?.addEventListener('submit', handleSearch, true);
376370
searchInput.addEventListener('keydown', event => {
377371
if (!event.isTrusted) return;
378372
if (noKeysOverride?.includes(event.code)) return;
@@ -539,7 +533,6 @@ const p365 = _ => {
539533
init({
540534
thumbnailSelector: 'li.video_block',
541535
durationSelector: 'span.duration',
542-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
543536
isVideoUrl,
544537
hideSelector: 'div.cat_description',
545538
onNodeChange: node => {
@@ -565,9 +558,13 @@ const sites = {
565558
}
566559
</style>`;
567560
body.innerHTML = Object
568-
.keys(sites)
569-
.filter(i => i !== HOME)
570-
.map(i => `<p><a href="https://${i}">${i}</p>`)
561+
.entries(sites)
562+
.filter(([i, handler]) => i !== HOME)
563+
.map(([i, handler]) => {
564+
const protocol = handler === p365 ? 'http' : 'https';
565+
const href = `${protocol}://${i}`;
566+
return `<p><a href="${href}">${href}</p>`;
567+
})
571568
.join('');
572569
},
573570

@@ -585,7 +582,6 @@ const sites = {
585582
thumbnailSelector: 'div.item',
586583
qualitySelector: 'span.item-quality',
587584
durationSelector: 'div.duration',
588-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
589585
isUnwantedQuality: text => (parseFloat(text.split('p')[0]) || 0) < MIN_VIDEO_HEIGHT,
590586
isVideoUrl,
591587
onNodeChange: node => {
@@ -614,7 +610,6 @@ const sites = {
614610
const isVideoUrl = href => new URL(href).pathname !== '/';
615611
init({
616612
noKeysOverride: ['Space'],
617-
//playSelector: 'button.x-player__play-btn',
618613
fullscreenSelector: 'button.x-player__fullscreen-btn',
619614
thumbnailSelector: 'div.tw-relative[data-testid="unit"]',
620615
durationSelector: 'span[data-testid="unit-amount"]',
@@ -638,7 +633,6 @@ const sites = {
638633
qualitySelector: 'span.is-hd',
639634
durationSelector: 'div.duration',
640635
isUnwantedQuality: text => text !== 'HD',
641-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
642636
isVideoUrl: href => href.includes('/item/'),
643637
onNodeChange: node => {
644638
if (!validLink(node)) return;
@@ -689,7 +683,6 @@ const sites = {
689683
init({
690684
thumbnailSelector: 'section.box',
691685
durationSelector: 'span.fa-clock-o',
692-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
693686
isVideoUrl: href => href.includes('/hdporn/'),
694687
});
695688
},
@@ -712,7 +705,6 @@ const sites = {
712705
qualitySelector: 'span.quality-icon',
713706
durationSelector: 'span.time',
714707
isUnwantedQuality: text => !text.includes('HD'),
715-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
716708
isVideoUrl: href => href.includes('/video/'),
717709
hideSelector: 'div.vip',
718710
onNodeChange: node => {
@@ -807,7 +799,6 @@ const sites = {
807799
searchFilterParams,
808800
thumbnailSelector: 'div.thumb',
809801
durationSelector: 'div.thumb__duration',
810-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
811802
isVideoUrl,
812803
onNodeChange: node => {
813804
if (!validLink(node) || isVideoUrl(node.href) || node.closest('div.filters')) return;
@@ -1071,7 +1062,6 @@ const sites = {
10711062
videoSelector,
10721063
thumbnailSelector: 'div.phimage, li:has(span.info-wrapper)',
10731064
durationSelector,
1074-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
10751065
isUnwantedUrl: node => isUnwanted(new URL(node.href)),
10761066
isVideoUrl,
10771067
hideSelector: 'div.mgp_topBar, div.mgp_thumbnailsGrid, img.mgp_pornhub, div.mgp_gridMenu, ul#headerMainMenu li.photos',
@@ -1159,15 +1149,13 @@ const sites = {
11591149

11601150
init({
11611151
searchInputSelector: 'input[type="text"][placeholder="Search"], input[type="text"][name="q"]',
1162-
searchFormOrSubmitButtonSelector: 'form#search_form button[type="submit"][aria-label="search"], button[type="submit"][aria-label="search"]',
11631152
searchFilter: query => [`search/${encodeURIComponent(query)}/${ending}`, {}],
11641153
playSelector: 'a.fp-play',
11651154
fullscreenSelector: 'a.fp-screen',
11661155
thumbnailSelector: 'div.thumb-item, span.video-item',
11671156
qualitySelector: 'span.quality',
11681157
durationSelector: 'div.durations, span.video-item-duration',
11691158
isUnwantedQuality: text => (parseFloat(text.split('p')[0]) || 0) < MIN_VIDEO_HEIGHT,
1170-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
11711159
isVideoUrl: href => {
11721160
const p = new URL(href).pathname;
11731161
return p.startsWith('/video/') || (p.startsWith('/playlists/') && p.split('/').length > 3);
@@ -1198,7 +1186,6 @@ const sites = {
11981186
init({
11991187
thumbnailSelector: 'div.item_cont',
12001188
durationSelector: 'div.item_dur',
1201-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
12021189
isVideoUrl: href => href.includes('/videos/'),
12031190
});
12041191
},
@@ -1214,7 +1201,6 @@ const sites = {
12141201
playSelector: 'div.mgp_playIcon, div.mgp_bigPlay, div.mgp_playbackBtn, mgp_smallPlay',
12151202
fullscreenSelector: 'div[data-text="Enter Fullscreen"], div[data-text="Exit fullscreen"]',
12161203
durationSelector: 'div.duration',
1217-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
12181204
isVideoUrl: href => parseFloat(new URL(href).pathname.split('/')[1]) || false,
12191205
onNodeChange: node => {
12201206
if (!validLink(node) || node.closest('div.videos_sorting_container')) return;
@@ -1248,7 +1234,6 @@ const sites = {
12481234
videoSelector: 'video#main_video_player_html5_api',
12491235
thumbnailSelector: 'div[data-testid="video-item"]',
12501236
durationSelector: 'span[data-testid="video-item-length"], div[data-testid="video-item-length"]',
1251-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
12521237
isVideoUrl: href => href.includes('/video/'),
12531238
hideSelector: 'div[x-data="gifPage"], section.timeline, div.positions-wrapper',
12541239
onNodeChange: node => {
@@ -1282,7 +1267,6 @@ const sites = {
12821267
qualitySelector,
12831268
durationSelector: 'div.duration',
12841269
isUnwantedQuality: text => !['HD', '4K'].includes(text),
1285-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
12861270
isVideoUrl: href => href.includes('/video/'),
12871271
onNodeChange: node => {
12881272
if (node.matches(thumbnailSelector) && !node.querySelector('span.is-hd')) {
@@ -1314,7 +1298,6 @@ const sites = {
13141298
playSelector: 'button[aria-label="Play"]',
13151299
pauseSelector: 'button[aria-label="Pause"]',
13161300
isUnwantedQuality: text => parseFloat(text.split('p')[0]) < MIN_VIDEO_HEIGHT,
1317-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
13181301
isVideoUrl,
13191302
onNodeChange: node => {
13201303
if (node.matches(thumbnailSelector) && !node.querySelector(qualitySelector)) {
@@ -1366,7 +1349,6 @@ const sites = {
13661349
fullscreenSelector: 'div[data-text="Enter Fullscreen"], div[data-text="Exit fullscreen"]',
13671350
thumbnailSelector: 'div.video-box',
13681351
durationSelector: 'div.video-duration',
1369-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
13701352
isVideoUrl: href => href.includes('/porn-video/'),
13711353
hideSelector: 'div#cookie_consent_wrapper',
13721354
onNodeChange: node => {
@@ -1437,7 +1419,6 @@ const sites = {
14371419
fullscreenSelector: 'div.fluid_button[title="Full Screen"]',
14381420
thumbnailSelector: 'article.loop-post',
14391421
durationSelector: 'p.meta span:has(i.fa-clock)',
1440-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
14411422
hideSelector: '#onPauseAdContainer',
14421423
});
14431424
},
@@ -1481,7 +1462,6 @@ const sites = {
14811462
qualitySelector: 'span.is-hd',
14821463
durationSelector: 'span.duration',
14831464
isUnwantedQuality: text => !['HD', '4K'].includes(text),
1484-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
14851465
isVideoUrl: href => href.includes('/videos/'),
14861466
});
14871467
},
@@ -1504,15 +1484,13 @@ const sites = {
15041484
const best = 'hd/full-length/best';
15051485
init({
15061486
searchInputSelector: 'input[name="q"][type="text"]',
1507-
searchFormOrSubmitButtonSelector: 'form.search-submit-container button[type="submit"], button.search-submit[type="submit"]',
15081487
searchFilter: query => [`search/${encodeURIComponent(query)}`, {
15091488
quality: `${MIN_VIDEO_HEIGHT}p`,
15101489
'min-duration': 30,
15111490
'length': 'full'
15121491
}],
15131492
thumbnailSelector: 'div.video-thumb, div.thumb-list__item',
15141493
durationSelector: 'div[data-role="video-duration"]',
1515-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
15161494
isVideoUrl: href => href.includes('/videos/'),
15171495
hideSelector: 'div[data-block="moments"], div[data-role="cookies-modal"]',
15181496
onNodeChange: node => {
@@ -1543,7 +1521,6 @@ const sites = {
15431521
init({
15441522
thumbnailSelector: 'a[vid]',
15451523
durationSelector: 'div.durik',
1546-
isUnwantedDuration: text => timeToSeconds(text) < MIN_DURATION_MINS * 60,
15471524
isVideoUrl: href => href.endsWith('.html'),
15481525
hideSelector: 'p',
15491526
nodeChangeSelector: `${defaultArgs.nodeChangeSelector}, p`,

0 commit comments

Comments
 (0)