pervert-monkey 1.0.12 → 1.0.13

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.
Files changed (33) hide show
  1. package/dist/core/pervertmonkey.core.es.d.ts +3 -1
  2. package/dist/core/pervertmonkey.core.es.js +19 -1
  3. package/dist/core/pervertmonkey.core.es.js.map +1 -1
  4. package/dist/core/pervertmonkey.core.umd.js +19 -1
  5. package/dist/core/pervertmonkey.core.umd.js.map +1 -1
  6. package/dist/userscripts/3hentai.user.js +1 -1
  7. package/dist/userscripts/camgirlfinder.user.js +1 -1
  8. package/dist/userscripts/camwhores.user.js +1 -1
  9. package/dist/userscripts/e-hentai.user.js +1 -1
  10. package/dist/userscripts/ebalka.user.js +1 -1
  11. package/dist/userscripts/eporner.user.js +1 -1
  12. package/dist/userscripts/erome.user.js +1 -1
  13. package/dist/userscripts/eroprofile.user.js +1 -1
  14. package/dist/userscripts/javhdporn.user.js +1 -1
  15. package/dist/userscripts/missav.user.js +1 -1
  16. package/dist/userscripts/motherless.user.js +4 -3
  17. package/dist/userscripts/namethatporn.user.js +1 -1
  18. package/dist/userscripts/nhentai.user.js +1 -1
  19. package/dist/userscripts/obmenvsem.user.js +1 -1
  20. package/dist/userscripts/pornhub.user.js +1 -1
  21. package/dist/userscripts/spankbang.user.js +1 -1
  22. package/dist/userscripts/thisvid.user.js +1 -1
  23. package/dist/userscripts/xhamster.user.js +5 -12
  24. package/dist/userscripts/xvideos.user.js +2 -2
  25. package/package.json +1 -1
  26. package/src/core/jabroni-config/jabroni-gui-controller.ts +1 -0
  27. package/src/core/parsers/thumb-data-parser.ts +6 -1
  28. package/src/userscripts/index.ts +1 -1
  29. package/src/userscripts/scripts/eroprofile.ts +2 -2
  30. package/src/userscripts/scripts/motherless.ts +2 -1
  31. package/src/userscripts/scripts/xhamster.ts +6 -4
  32. package/src/userscripts/scripts/xvideos.ts +1 -1
  33. package/src/utils/parsers/index.ts +16 -0
@@ -11,7 +11,7 @@
11
11
  // @source github:smartacephale/sleazy-fork
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match https://*.3hentai.net/*
14
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
14
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
15
15
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
16
16
  // @grant GM_addStyle
17
17
  // @grant unsafeWindow
@@ -11,7 +11,7 @@
11
11
  // @source github:smartacephale/sleazy-fork
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match https://camgirlfinder.net/*
14
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
14
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
15
15
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
16
16
  // @grant none
17
17
  // @run-at document-idle
@@ -13,7 +13,7 @@
13
13
  // @match https://*.camwhores.tv
14
14
  // @match https://*.camwhores.*/*
15
15
  // @exclude https://*.camwhores.tv/*mode=async*
16
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
16
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
17
17
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
18
18
  // @grant GM_addStyle
19
19
  // @grant unsafeWindow
@@ -11,7 +11,7 @@
11
11
  // @source github:smartacephale/sleazy-fork
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match https://*.e-hentai.org/*
14
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
14
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
15
15
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
16
16
  // @grant GM_addStyle
17
17
  // @grant unsafeWindow
@@ -15,7 +15,7 @@
15
15
  // @match https://*ebalka.*.*/*
16
16
  // @match https://*.ebalk*.*/*
17
17
  // @match https://*.fuckingbear*.*/*
18
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
18
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
19
19
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
20
20
  // @grant GM_addStyle
21
21
  // @grant unsafeWindow
@@ -12,7 +12,7 @@
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match https://*.eporner.com/*
14
14
  // @match https://*.eporner.*/*
15
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
15
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
16
16
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
17
17
  // @grant GM_addStyle
18
18
  // @grant unsafeWindow
@@ -11,7 +11,7 @@
11
11
  // @source github:smartacephale/sleazy-fork
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match *://*.erome.com/*
14
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
14
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
15
15
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
16
16
  // @grant GM_addStyle
17
17
  // @grant unsafeWindow
@@ -11,7 +11,7 @@
11
11
  // @source github:smartacephale/sleazy-fork
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match https://*.eroprofile.com/*
14
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
14
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
15
15
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
16
16
  // @grant GM_addStyle
17
17
  // @grant unsafeWindow
@@ -12,7 +12,7 @@
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match https://*.javhdporn.net/*
14
14
  // @match https://*.javhdporn.*/*
15
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
15
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
16
16
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
17
17
  // @grant GM_addStyle
18
18
  // @grant unsafeWindow
@@ -15,7 +15,7 @@
15
15
  // @match https://*.missav.ws/*
16
16
  // @match https://*.missav.to/*
17
17
  // @match https://*.missav.live/*
18
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
18
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
19
19
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
20
20
  // @grant GM_addStyle
21
21
  // @grant unsafeWindow
@@ -11,7 +11,7 @@
11
11
  // @source github:smartacephale/sleazy-fork
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match https://motherless.com/*
14
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
14
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
15
15
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
16
16
  // @grant GM_addElement
17
17
  // @grant GM_addStyle
@@ -35,7 +35,8 @@
35
35
  selectors: {
36
36
  uploader: ".uploader",
37
37
  title: ".title",
38
- duration: ".size"
38
+ duration: ".size",
39
+ views: { selector: ".hits", type: "float" }
39
40
  }
40
41
  },
41
42
  thumbImg: { strategy: "auto" },
@@ -44,7 +45,7 @@
44
45
  },
45
46
  animatePreview,
46
47
  gropeStrategy: "all-in-all",
47
- schemeOptions: ["Text Filter", "Duration Filter", "Badge", "Advanced"]
48
+ schemeOptions: ["Text Filter", "Sort By", "Duration Filter", "Badge", "Advanced"]
48
49
  });
49
50
  function animatePreview(_) {
50
51
  const tick = new utils.Tick(500);
@@ -11,7 +11,7 @@
11
11
  // @source github:smartacephale/sleazy-fork
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match https://namethatporn.com/*
14
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
14
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
15
15
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
16
16
  // @grant GM_addStyle
17
17
  // @grant unsafeWindow
@@ -12,7 +12,7 @@
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match https://*.nhentai.net/*
14
14
  // @match https://*.nhentai.*/*
15
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
15
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
16
16
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
17
17
  // @grant GM_addStyle
18
18
  // @grant unsafeWindow
@@ -12,7 +12,7 @@
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match https://*.obmenvsem.com/*
14
14
  // @match https://*.obmenvsem.*/*
15
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
15
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
16
16
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
17
17
  // @grant GM_addElement
18
18
  // @grant GM_addStyle
@@ -12,7 +12,7 @@
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match https://*.pornhub.com/*
14
14
  // @exclude https://*.pornhub.com/embed/*
15
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
15
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
16
16
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
17
17
  // @grant GM_addStyle
18
18
  // @grant unsafeWindow
@@ -12,7 +12,7 @@
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match https://*.spankbang.com/*
14
14
  // @match https://*.spankbang.*/*
15
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
15
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
16
16
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
17
17
  // @grant GM_addStyle
18
18
  // @grant unsafeWindow
@@ -11,7 +11,7 @@
11
11
  // @source github:smartacephale/sleazy-fork
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match https://*.thisvid.com/*
14
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
14
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
15
15
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
16
16
  // @grant GM_addStyle
17
17
  // @grant unsafeWindow
@@ -13,7 +13,7 @@
13
13
  // @match https://*.xhamster.com/*
14
14
  // @match https://*.xhamster.*/*
15
15
  // @exclude https://*.xhamster.com/embed*
16
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
16
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
17
17
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
18
18
  // @grant GM_addElement
19
19
  // @grant GM_addStyle
@@ -27,13 +27,6 @@
27
27
  var _GM_addElement = (() => typeof GM_addElement != "undefined" ? GM_addElement : undefined)();
28
28
  var _unsafeWindow = (() => typeof unsafeWindow != "undefined" ? unsafeWindow : undefined)();
29
29
 
30
- function findSelfOrChild(element, selector) {
31
- if (element.matches(selector)) {
32
- return element;
33
- }
34
- return element.querySelector(selector);
35
- }
36
-
37
30
  const IS_VIDEO_PAGE = /^\/videos|moments\//.test(location.pathname);
38
31
  const IS_PLAYLIST = /^\/my\/favorites\/videos\/\w+/.test(location.pathname);
39
32
  function createThumb(data) {
@@ -143,10 +136,10 @@
143
136
  return () => utils.exterminateVideo(video);
144
137
  }
145
138
  utils.OnHover.create(document.body, ".video-thumb", (e) => {
146
- const videoSrc = findSelfOrChild(e, "[data-previewvideo]")?.getAttribute(
147
- "data-previewvideo"
148
- );
149
- return createPreviewVideoElement(videoSrc, e);
139
+ const container = e.querySelector(".thumb-image-container__image");
140
+ const videoSrc = e.querySelector("[data-previewvideo]")?.getAttribute("data-previewvideo");
141
+ console.log(container, videoSrc);
142
+ return createPreviewVideoElement(videoSrc, container);
150
143
  });
151
144
  }
152
145
  function expandMoreVideoPage() {
@@ -11,7 +11,7 @@
11
11
  // @source github:smartacephale/sleazy-fork
12
12
  // @supportURL https://github.com/smartacephale/sleazy-fork/issues
13
13
  // @match https://*.xvideos.com/*
14
- // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.12/dist/core/pervertmonkey.core.umd.js
14
+ // @require https://cdn.jsdelivr.net/npm/pervert-monkey@1.0.13/dist/core/pervertmonkey.core.umd.js
15
15
  // @require data:application/javascript,var core = window.pervertmonkey.core || pervertmonkey.core; var utils = core;
16
16
  // @grant GM_addStyle
17
17
  // @grant unsafeWindow
@@ -77,7 +77,7 @@
77
77
  utils.OnHover.create(container, "div.thumb-block[id^=video_]:not(.thumb-ad)", (target) => {
78
78
  const img = target.querySelector("img");
79
79
  const videoSrc = getVideoURL(img.src);
80
- return createPreviewElement(videoSrc, target);
80
+ return createPreviewElement(videoSrc, img);
81
81
  });
82
82
  }
83
83
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pervert-monkey",
3
3
  "description": "daddy told us not to be ashamed of our userscripts",
4
- "version": "1.0.12",
4
+ "version": "1.0.13",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "userscript",
@@ -46,6 +46,7 @@ export class JabronioGuiController {
46
46
  private readonly eventsMap = {
47
47
  'sort by duration': (direction: boolean) =>
48
48
  this.dataManager.sortBy('duration', direction),
49
+ 'sort by views': (direction: boolean) => this.dataManager.sortBy('views', direction),
49
50
  } as const;
50
51
 
51
52
  private setupStoreListeners() {
@@ -1,4 +1,5 @@
1
1
  import {
2
+ parseNumberWithLetter,
2
3
  querySelectorLast,
3
4
  querySelectorText,
4
5
  sanitizeStr,
@@ -6,7 +7,7 @@ import {
6
7
  } from '../../utils';
7
8
 
8
9
  type Primitive = string | number | boolean;
9
- type PrimitiveString = 'boolean' | 'string' | 'number' | 'duration';
10
+ type PrimitiveString = 'boolean' | 'string' | 'number' | 'float' | 'duration';
10
11
  type ThumbData = Record<string, Primitive>;
11
12
  type ThumbDataSelector = {
12
13
  name: string;
@@ -70,6 +71,10 @@ export class ThumbDataParser {
70
71
  if (type === 'duration') {
71
72
  return timeToSeconds(querySelectorText(thumb, selector));
72
73
  }
74
+ if (type === 'float') {
75
+ const value = querySelectorText(thumb, selector);
76
+ return parseNumberWithLetter(value);
77
+ }
73
78
  return Number.parseInt(querySelectorText(thumb, selector));
74
79
  }
75
80
 
@@ -1 +1 @@
1
- import './scripts/eporner'
1
+ import './scripts/motherless'
@@ -20,7 +20,7 @@ const rules = new Rules({
20
20
  selectors: {
21
21
  title: '[title]',
22
22
  duration: '.videoDur',
23
- }
23
+ },
24
24
  },
25
25
  containerSelector: '.videoGrid',
26
26
  customDataSelectorFns: ['filterInclude', 'filterExclude', 'filterDuration'],
@@ -31,7 +31,7 @@ const rules = new Rules({
31
31
  title: 'Sort By ',
32
32
  content: [
33
33
  {
34
- 'sort by duration': () => { },
34
+ 'sort by duration': () => {},
35
35
  },
36
36
  ],
37
37
  },
@@ -22,6 +22,7 @@ const rules = new Rules({
22
22
  uploader: '.uploader',
23
23
  title: '.title',
24
24
  duration: '.size',
25
+ views: { selector: '.hits', type: 'float' },
25
26
  },
26
27
  },
27
28
  thumbImg: { strategy: 'auto' },
@@ -30,7 +31,7 @@ const rules = new Rules({
30
31
  },
31
32
  animatePreview,
32
33
  gropeStrategy: 'all-in-all',
33
- schemeOptions: ['Text Filter', 'Duration Filter', 'Badge', 'Advanced'],
34
+ schemeOptions: ['Text Filter', 'Sort By', 'Duration Filter', 'Badge', 'Advanced'],
34
35
  });
35
36
 
36
37
  function animatePreview(_: HTMLElement) {
@@ -152,10 +152,12 @@ function animatePreview() {
152
152
  }
153
153
 
154
154
  OnHover.create(document.body, '.video-thumb', (e) => {
155
- const videoSrc = findSelfOrChild(e, '[data-previewvideo]')?.getAttribute(
156
- 'data-previewvideo',
157
- ) as string;
158
- return createPreviewVideoElement(videoSrc, e);
155
+ const container = e.querySelector('.thumb-image-container__image') as HTMLElement;
156
+ const videoSrc = e
157
+ .querySelector('[data-previewvideo]')
158
+ ?.getAttribute('data-previewvideo') as string;
159
+ console.log(container, videoSrc);
160
+ return createPreviewVideoElement(videoSrc, container);
159
161
  });
160
162
  }
161
163
 
@@ -70,6 +70,6 @@ function animatePreview(container: HTMLElement) {
70
70
  OnHover.create(container, 'div.thumb-block[id^=video_]:not(.thumb-ad)', (target) => {
71
71
  const img = target.querySelector('img') as HTMLImageElement;
72
72
  const videoSrc = getVideoURL(img.src);
73
- return createPreviewElement(videoSrc, target);
73
+ return createPreviewElement(videoSrc, img);
74
74
  });
75
75
  }
@@ -9,6 +9,22 @@ export function parseIntegerOr(n: string | number, or: number): number {
9
9
  return Number.isSafeInteger(num) ? num : or;
10
10
  }
11
11
 
12
+ export function parseNumberWithLetter(str: string): number {
13
+ const multipliers = { k: 1e3, m: 1e6 } as const;
14
+ const match = str.trim().match(/^([\d.]+)(\w)?$/);
15
+
16
+ if (!match) return 0;
17
+
18
+ const num = parseFloat(match[1]);
19
+ const suffix = match[2]?.toLowerCase() as keyof typeof multipliers;
20
+
21
+ if (suffix && suffix in multipliers) {
22
+ return num * multipliers[suffix];
23
+ }
24
+
25
+ return num;
26
+ }
27
+
12
28
  // "data:02;body+head:async;void:;zero:;"
13
29
  export function parseDataParams(str: string): Record<string, string> {
14
30
  const paramsStr = decodeURI(str.trim()).split(';');