Skip to content

Commit d0ca2aa

Browse files
committed
Update
1 parent 052175c commit d0ca2aa

1 file changed

Lines changed: 25 additions & 18 deletions

File tree

improve-adult-experience.user.js

Lines changed: 25 additions & 18 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.57
5+
// @version 0.58
66
// @downloadURL https://userscripts.codonaft.com/improve-adult-experience.user.js
77
// @grant GM_addStyle
88
// ==/UserScript==
@@ -1340,7 +1340,8 @@ const sites = {
13401340

13411341
const params = url.searchParams;
13421342

1343-
if (p.includes('/search') && !params.has('d')) {
1343+
if (p.includes('/search')) {
1344+
if (params.has('d')) return;
13441345
Object.entries(searchFilterParams).forEach(([key, value]) => params.set(key, value));
13451346
updateUrl(node, url);
13461347
} else if (p !== '/' && !p.includes('/top-rated')) {
@@ -1495,18 +1496,21 @@ const sites = {
14951496

14961497
'xhamster.com': _ => {
14971498
// TODO: <iframe src="https://xhamster.com/embed/xhHw7V9" scrolling="no" allowfullscreen="" width="640" height="480" frameborder="0"></iframe><p></p>
1498-
const best = 'hd/full-length/best';
1499+
const best = '/hd/full-length/best';
1500+
const quality = `${MIN_VIDEO_HEIGHT}p`;
1501+
const searchFilterParams = {
1502+
quality,
1503+
'min-duration': 30,
1504+
'length': 'full'
1505+
};
14991506
init({
15001507
searchInputSelector: 'input[name="q"][type="text"]',
1501-
searchFilter: query => [`search/${encodeURIComponent(query)}`, {
1502-
quality: `${MIN_VIDEO_HEIGHT}p`,
1503-
'min-duration': 30,
1504-
'length': 'full'
1505-
}],
1508+
searchFilter: query => [`search/${encodeURIComponent(query)}`, {}],
1509+
searchFilterParams,
15061510
thumbnailSelector: 'div.video-thumb, div.thumb-list__item',
15071511
durationSelector: 'div[data-role="video-duration"]',
15081512
isVideoUrl: href => href.includes('/videos/'),
1509-
hideSelector: 'div[data-block="moments"], div[data-role="cookies-modal"]',
1513+
hideSelector: 'a[href^="/ff/out?"], div[data-block="moments"], div[data-role="cookies-modal"]',
15101514
onNodeChange: node => {
15111515
if ((node.matches('span') && node.textContent.includes('Watch more')) || node.matches('div[class*="skeleton"]')) {
15121516
node.closest('div')?.classList?.add(HIDE);
@@ -1515,17 +1519,20 @@ const sites = {
15151519

15161520
if (!validLink(node)) return;
15171521

1518-
const url = new URL(node.href);
1522+
const url = new URL(node.href.replace(/\/hd$/, '/'));
15191523
const params = url.searchParams;
15201524
const p = url.pathname;
1521-
if (p.startsWith('/search/')) {
1522-
if (params.get('length') !== 'full') {
1523-
params.set('quality', `${MIN_VIDEO_HEIGHT}p`);
1524-
params.set('length', 'full');
1525-
updateUrl(node, url);
1526-
}
1527-
} else if (p === '/' || ['/categories/', '/channels/'].find(i => p.startsWith(i))) {
1528-
updateUrl(node, `${node.href.replace(/\/hd$/, '/')}/${best}/monthly?quality=${MIN_VIDEO_HEIGHT}p`);
1525+
if (p.startsWith('/search/') && params.get('length') !== 'full') {
1526+
Object.entries(searchFilterParams).forEach(([key, value]) => params.set(key, value));
1527+
updateUrl(node, url);
1528+
} else if (p === '/' || (['/categories/', '/channels/'].find(i => p.startsWith(i)) && !p.includes(best))) {
1529+
url.pathname += `${best}/monthly`;
1530+
params.set('quality', quality);
1531+
updateUrl(node, url);
1532+
} else if (parts(p).length > 1 && ['/creators/', '/pornstars/'].find(i => p.startsWith(i)) && !['/all/', best].find(i => p.includes(i))) {
1533+
url.pathname += best;
1534+
params.set('quality', quality);
1535+
updateUrl(node, url);
15291536
}
15301537
},
15311538
});

0 commit comments

Comments
 (0)