Skip to content

Commit 08cee71

Browse files
committed
Update
1 parent 6bae91b commit 08cee71

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

improve-adult-experience.user.js

Lines changed: 17 additions & 4 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, remove spammy elements. Usually affects every media player it can find, designed to be used on 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, youporn.com, рус-порно.tv
44
// @icon https://external-content.duckduckgo.com/ip3/pornhub.com.ico
5-
// @version 0.62
5+
// @version 0.63
66
// @downloadURL https://userscripts.codonaft.com/improve-adult-experience.user.js
77
// @grant GM_addStyle
88
// ==/UserScript==
@@ -210,6 +210,7 @@ const init = (args = {}) => {
210210
isVideoUrl,
211211
hideSelector,
212212
nodeChangeSelector,
213+
onStartPlayback,
213214
onNodeChange,
214215
} = { ...defaultArgs, ...args };
215216

@@ -237,6 +238,7 @@ const init = (args = {}) => {
237238
const strategies = [
238239
_ => button?.click(),
239240
_ => simulateMouse(document, video),
241+
_ => video.play?.(),
240242
];
241243

242244
let attempt = 0;
@@ -466,6 +468,7 @@ const init = (args = {}) => {
466468
console.log('playback is started')
467469
playbackStarted = true;
468470
focus(video);
471+
onStartPlayback(video);
469472
}, { once: true });
470473

471474
video.addEventListener('stalled', _ => {
@@ -1253,6 +1256,13 @@ const sites = {
12531256
durationSelector: 'span[data-testid="video-item-length"], div[data-testid="video-item-length"]',
12541257
isVideoUrl: href => href.includes('/video/'),
12551258
hideSelector: 'div[x-data="gifPage"], section.timeline, div.positions-wrapper',
1259+
onStartPlayback: video => {
1260+
body.querySelector('button.vjs-control[title="Unmute"]')?.click();
1261+
// FIXME
1262+
//if ([...body.querySelectorAll('div#video_container, .play_cover.loading')].find(i => i.style?.display === 'block')) return;
1263+
//console.log('fixing invisible player');
1264+
//simulateMouse(document, video);
1265+
},
12561266
onNodeChange: node => {
12571267
if (!validLink(node)) return;
12581268

@@ -1499,6 +1509,7 @@ const sites = {
14991509

15001510
'xhamster.com': _ => {
15011511
// TODO: <iframe src="https://xhamster.com/embed/xhHw7V9" scrolling="no" allowfullscreen="" width="640" height="480" frameborder="0"></iframe><p></p>
1512+
const qualityKey = 'quality';
15021513
const hd = '/hd/';
15031514
const best = `${hd}full-length/best`;
15041515
const quality = `${MIN_VIDEO_HEIGHT}p`;
@@ -1526,20 +1537,22 @@ const sites = {
15261537
const url = new URL(node.href.replace(/\/hd$/, '/'));
15271538
const params = url.searchParams;
15281539
const p = url.pathname;
1540+
if (params.has(qualityKey)) return;
1541+
15291542
if (p.startsWith('/search/') && params.get('length') !== 'full') {
15301543
applySearchFilter(searchFilterParams, url);
15311544
updateUrl(node, url);
15321545
} else if (p === '/' || (['/categories/', '/channels/'].find(i => p.startsWith(i)) && !p.includes(best))) {
15331546
url.pathname += `${best}/monthly`;
1534-
params.set('quality', quality);
1547+
params.set(qualityKey, quality);
15351548
updateUrl(node, url);
15361549
} else if (parts(p).length > 1 && p.startsWith('/creators/') && !['/all/', '/awards', '/contest/', '/videos/', hd].find(i => p.includes(i))) {
15371550
url.pathname += hd;
1538-
params.set('quality', quality);
1551+
params.set(qualityKey, quality);
15391552
updateUrl(node, url);
15401553
} else if (parts(p).length > 1 && p.startsWith('/pornstars/') && !['/all/', best].find(i => p.includes(i))) {
15411554
url.pathname += best;
1542-
params.set('quality', quality);
1555+
params.set(qualityKey, quality);
15431556
updateUrl(node, url);
15441557
}
15451558
},

0 commit comments

Comments
 (0)