Skip to content

Commit 461b713

Browse files
committed
Update
1 parent a98fa33 commit 461b713

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

improve-adult-experience.user.js

Lines changed: 21 additions & 14 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.55
5+
// @version 0.56
66
// @downloadURL https://userscripts.codonaft.com/improve-adult-experience.user.js
77
// @grant GM_addStyle
88
// ==/UserScript==
@@ -35,8 +35,17 @@ const UNWANTED = '__unwanted';
3535
const HIDE = '__hide';
3636
const INITIALIZED = '__initialized';
3737

38-
let unmuted = false;
3938
let pageIsHidden = true;
39+
let unmuted = false;
40+
let initializedVideo = false;
41+
let playbackInitiated = false;
42+
let playbackStarted = false;
43+
const resetVideo = _ => {
44+
console.log('reset video');
45+
initializedVideo = false;
46+
playbackInitiated = false;
47+
playbackStarted = false;
48+
};
4049

4150
const loc = window.location;
4251

@@ -207,9 +216,6 @@ const init = (args = {}) => {
207216
`);
208217

209218
let searchInputInitialized = false;
210-
let initializedVideo = false;
211-
let playbackInitiated = false;
212-
let playbackStarted = false;
213219

214220
const findPlayButton = video => {
215221
const selector = !video.paused && pauseSelector ? pauseSelector : playSelector;
@@ -312,9 +318,7 @@ const init = (args = {}) => {
312318
if (newHref !== lastHref) {
313319
console.log('new page', newHref);
314320
lastHref = newHref;
315-
initializedVideo = false;
316-
playbackInitiated = false;
317-
playbackStarted = false;
321+
resetVideo();
318322
}
319323

320324
if (videoPage && !playSelector && !fullscreenSelector) {
@@ -329,7 +333,7 @@ const init = (args = {}) => {
329333
} else if (body.querySelector(KT_PLAYER_SELECTOR)) {
330334
console.log('detected kt player');
331335
playSelector = 'a.fp-play';
332-
fullscreenSelector = 'a.fp-screen';
336+
fullscreenSelector = 'a.fp-fullscreen';
333337
}
334338
}
335339

@@ -1153,7 +1157,7 @@ const sites = {
11531157
searchFilter: query => [`search/${encodeURIComponent(query)}/${ending}`, {}],
11541158
playSelector: 'a.fp-play',
11551159
fullscreenSelector: 'a.fp-screen',
1156-
thumbnailSelector: 'div.thumb-item, span.video-item',
1160+
thumbnailSelector: 'div.thumb-item, div.video-item, span.video-item',
11571161
qualitySelector: 'span.quality',
11581162
durationSelector: 'div.durations, span.video-item-duration',
11591163
isUnwantedQuality: text => (parseFloat(text.split('p')[0]) || 0) < MIN_VIDEO_HEIGHT,
@@ -1165,7 +1169,13 @@ const sites = {
11651169
if (!validLink(node)) return;
11661170

11671171
const href = node.href;
1168-
if (href.includes('/video/')) return; // TODO: refresh page if part of playlist
1172+
if (href.includes('/video/')) {
1173+
node.addEventListener('click', _ => {
1174+
if (!event.isTrusted) return;
1175+
resetVideo();
1176+
}, true);
1177+
return;
1178+
}
11691179
if (href.includes('/models/') && href.length === origin.length + '/models/a/'.length) return;
11701180
if ([`/${ending}`, '/channels/', '/tags/'].find(i => href.endsWith(i))) return;
11711181
if (node.closest('div.sort')) return;
@@ -1460,9 +1470,6 @@ const sites = {
14601470
'whoreshub.com': _ => {
14611471
init({
14621472
thumbnailSelector: 'div.thumb',
1463-
playSelector: 'div.fp-ui',
1464-
pauseSelector: 'a.fp-play',
1465-
fullscreenSelector: 'a.fp-screen',
14661473
qualitySelector: 'span.is-hd',
14671474
durationSelector: 'span.duration',
14681475
isUnwantedQuality: text => !['HD', '4K'].includes(text),

0 commit comments

Comments
 (0)