Link Copy for Jdownloader

링크 복사

Pada tanggal 23 September 2022. Lihat %(latest_version_link).

  1. // ==UserScript==
  2. // @name Link Copy for Jdownloader
  3. // @version 1.01
  4. // @description 링크 복사
  5. // @author DandyClubs
  6. // @include /naughtyblog\.org/
  7. // @include /maxjav\.com/
  8. // @include /(8kcosplay\.com|blogjav\.net|thotsgirls\.com)/
  9. // @include /top-modelz\.org/
  10. // @include /wetholefans\.com/
  11. // @include /pornchil\.com\/.*/
  12. // @include /pornrips\.cc/
  13. // @include /javpink\.com/
  14. // @include /siteripbb\.org/
  15. // @include /javfree\.me/
  16. // @include /pornobunny\.org/
  17. // @include /adult-porno\.org/
  18. // @include /pornrip\.cc/
  19. // @include /fhdporn\.video/
  20. // @include /asianscan\.biz/
  21. // @include /sharepornlink\.com\/.*/
  22. // @include /javarchive\.com/
  23. // @include /0xxx\.ws/
  24. // @include /hpjav\.tv/
  25. // @include /kbjme\.com\/\d+/
  26. // @include /av18plus\.com/
  27. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js
  28. // @require https://greasyfork.org/scripts/451572-rootdomain/code/RootDomain.js?version=1095109
  29. // @require https://greasyfork.org/scripts/451573-copy-link-common-library/code/Copy%20Link%20Common%20Library.js?version=1095463
  30. // @require https://greasyfork.org/scripts/451574-key-press/code/Key%20Press.js?version=1095111
  31. // @grant GM_addStyle
  32. // @grant GM_setValue
  33. // @grant GM_getValue
  34. // @grant GM_deleteValue
  35. // @grant GM_listValues
  36. // @grant GM_setClipboard
  37. // @grant window.close
  38. // @grant GM_xmlhttpRequest
  39. // @run-at document-body
  40. // @noframes
  41. // @license MIT
  42. // @namespace https://greasyfork.org/users/15621
  43. // ==/UserScript==
  44.  
  45.  
  46. (function() { var css = document.createElement('link'); css.href = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css'; css.rel = 'stylesheet'; css.type = 'text/css'; document.getElementsByTagName('head')[0].appendChild(css); })();
  47.  
  48. GM_addStyle (`
  49. @import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@600&family=Noto+Sans+KR:wght@600&family=Noto+Sans:wght@600&display=swap');
  50.  
  51. .CloseIcon, .CopyIcon, .Minus, .GetTitle {
  52. text-align: center;
  53. cursor: pointer;
  54. color: dodgerblue !important;
  55. background-color:transparent !important;
  56. font-style: initial !important;
  57. }
  58. .IconSet {
  59. word-spacing: .5rem;
  60. white-space : nowrap;
  61. background-color:transparent !important;
  62. }
  63.  
  64. .CopyNotice {
  65. font-family: 'Nanum Gothic', 'M PLUS Rounded 1c', 'Noto Sans', sans-serif !important;
  66. margin-left: auto;
  67. margin-right: auto;
  68. border-radius: 4px;
  69. color: white !important;
  70. background: rgba(255, 110, 0, 0.75) !important;
  71. padding: .25em 1em;
  72. white-space: pre;
  73. text-shadow: initial !important;
  74. text-align: left;
  75. line-height: 1.25em;
  76. font-weight: initial !important;
  77. font-style: initial !important;
  78. display: -webkit-box;
  79. -webkit-line-clamp: 15;
  80. -webkit-box-orient: vertical;
  81. overflow: hidden;
  82. text-overflow: ellipsis;
  83. -webkit-transition: height 0.3s ease-in-out;
  84. -o-transition: height 0.3s ease-in-out;
  85. transition: height 0.3s ease-in-out;
  86.  
  87. }
  88. .CopyNotice:not(.active) {
  89. display: none;
  90. }
  91. .CenterBox {
  92. right: 50%;
  93. left: auto;
  94. top: 1px;
  95. margin: 0 auto;
  96. max-width: max-content;
  97. position: fixed !important;
  98. word-spacing: .5rem;
  99. padding: .25em;
  100. font-style: initial !important;
  101. text-align: center;
  102. color: dodgerblue !important;
  103. background-color:transparent !important;
  104. }
  105. .ToTop {
  106. font-style: initial !important;
  107. text-align: center;
  108. cursor: pointer;
  109. padding: .25em !important;
  110. border-radius: .25em !important;
  111. -webkit-box-sizing: border-box !important;
  112. box-sizing: border-box !important;
  113. background-color: rgba(255,255,255,0.5) !important;
  114. }
  115. .State {
  116. display: inline-block;
  117. font-weight: bold;
  118. text-align: right;
  119. vertical-align: middle;
  120. font-family: 'Noto Sans', sans-serif !important;
  121. background-color:transparent !important;
  122. font-style: italic !important;
  123. width: 5ch;
  124. }
  125.  
  126. .CopyButton, .ClearButton {
  127. font-style: initial !important;
  128. background-color:transparent !important;
  129. word-spacing: .5rem;
  130. cursor: pointer;
  131. }
  132. `);
  133.  
  134. var CopyLinks = []
  135. var AllCopyLinks = []
  136. var TmpLinksDB = []
  137. var CopyLinksBackup, MakeIconTimer
  138. const PageURL = window.location !== window.parent.location ? document.referrer : document.location.href;
  139. const RootDomain = extractRootDomain(PageURL)
  140. //console.log('RootDomain: ', RootDomain)
  141.  
  142. var RootDomainDB = JSON.parse(GM_getValue(RootDomain, "[]"))
  143.  
  144. //console.log(RootDomainDB)
  145.  
  146. var GetState, searchDB
  147. GetState = RootDomainDB
  148. //console.log(GetState)
  149.  
  150. var MakerCfg = false
  151. var CfgReleaseDate = false
  152. var Maker = '', ReleaseDate = ''
  153.  
  154. var GetDPI, DefaultFontSize
  155. var Target, DownloadArea, CopyTitle, CopyOffSetArea, InfoArea, Resolution = '', TitleLast = '', Series ='', Title, ID = '', TitleID, CopyTitleTmp, InfoTitleTmp, CoverImage, MatchWebRegExp, Gallery
  156. var UrlTitle = ''
  157. const SkipFilter = new RegExp('keep2share\.cc\/pr\/|demosaic|upgrade|javascript|SKIP|pixhost\.to\/gallery\/|imgchili\.net\/show|#$|^\/|^(?=.*' + window.location.origin + ')(?!.*\\?site).*$', 'i')
  158. //console.log(SkipFilter)
  159.  
  160. const SkipClassNames = ['adead_link', 'autohyperlink', 'social-icon']
  161. const JapaneseChar = /[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]/g
  162. const SearchID = /([a-zA-Z]{2,11}-?\d{2,6}[a-zA-Z]?|\d{2,4}[a-zA-Z]{2,7}-?\d{3,6}[a-zA-Z]?|[a-zA-Z]{1,2}-?\d{2}-?\d{2}|[a-zA-Z]{2,7}-?[a-zA-Z]{1,2}\d{2})(.*)/
  163. const SearchFC2ID = /(^FC2.+\d{6})(.*)/
  164. const SearchIDRegExp = /^(\[\s?)?(?=([a-zA-Z]{2,11}-?\d{2,6}[a-zA-Z]?|\d{2,4}[a-zA-Z]{2,7}-?\d{3,6}[a-zA-Z]?|[a-zA-Z]{1,2}-?\d{2}-?\d{2}|[a-zA-Z]{2,7}-?[a-zA-Z]{1,2}\d{2}))(?!(C_\d+|file\d+))(.*)$/
  165. const K2SRegExp = /(.*k2s\.cc\/file\/)(.*\/?)/
  166.  
  167. async function Start() {
  168. GetDPI = window.devicePixelRatio
  169. DefaultFontSize = getDefaultFontSize()
  170. //console.log('GetDPI: ', GetDPI, 'DefaultFontSize: ', DefaultFontSize)
  171.  
  172. document.querySelector("body").insertAdjacentHTML('afterbegin', '<div class="CenterBox" style="display: none"></>')
  173. document.querySelector("div.CenterBox").insertAdjacentHTML('beforeend', '<i class="ToTop fa-solid fa-circle-chevron-up"></>')
  174. document.querySelector("div.CenterBox").insertAdjacentHTML('beforeend', '&nbsp;<i class="ClearButton far fa-minus-square"></>')
  175. document.querySelector("div.CenterBox").insertAdjacentHTML('beforeend', '&nbsp;<i class="CopyButton fas fa-paste"></>')
  176. document.querySelector("div.CenterBox").insertAdjacentHTML('beforeend', '<i class="State"></>')
  177. document.querySelector(".ToTop").onclick = () => window.scrollTo({ top: 0, behavior: 'smooth' })
  178. console.log('Link Copy Start!')
  179. let CneterBoxFontSize = Number(((1/(GetDPI/1.5))*(16/DefaultFontSize)).toFixed(2)) + 'rem'
  180. let CenterBoxZIndex = getMaxZIndex() + 1
  181. let StateFontSize = Number(((1/(GetDPI/1.5))*0.65*(16/DefaultFontSize)).toFixed(2)) + 'rem'
  182. let StateLineHeight = Number(((1/(GetDPI/1.5))*(16/DefaultFontSize)).toFixed(2)) + 'rem'
  183.  
  184. document.querySelector('.CenterBox').style.cssText = `font-size: ${CneterBoxFontSize}; z-index: ${CenterBoxZIndex}; display: block;`
  185. document.querySelector('.State').style.cssText = `font-size: ${StateFontSize}; line-height: ${StateLineHeight}`
  186. document.querySelector('.State').textContent = ' ' + GetState.length
  187.  
  188. if(/naughtyblog\.org\/.+/.test(PageURL)){
  189. CopyOffSetArea = document.querySelector('.post-title.entry-title')
  190. CopyTitle = CopyOffSetArea.innerText
  191.  
  192. DownloadArea = document.querySelectorAll('div#download, div#downloadhidden')
  193. CoverImage = document.querySelector('div.post-content-single p a') ? document.querySelector('div.post-content-single p a').href : ''
  194. let MatchCast, InfoAreaCast, Title, Cast, SearchCast, SearchTitle, SearchWeb, FirstMatchCast, FirstMatchWeb, InfoCast, SearchWebPoint, SearchCastPoint, Released, ReleasedEn, Episode
  195. //CopyTitle에서 MatchWeb 찾기
  196. let MatchWebPoint = CopyTitle.search(/\s-\s/)
  197. console.log('MatchWebPoint: ' + MatchWebPoint)
  198. let MatchWeb = MatchWebPoint !== -1 ? CopyTitle.substr(0, MatchWebPoint).replace(/\s/g, '') : CopyTitle
  199. MatchWebRegExp = new RegExp(MatchWeb.replaceAll("'", ""), 'i')
  200. console.log('MatchWeb: ' + MatchWeb)
  201.  
  202. InfoArea = document.querySelector('div.post-content-single').innerText.replace(/(?:(?:\r\n|\r|\n)\s*){2}/gm, '\n').replace(/^(\s?(UPDATED|EARLY LEAK)\s?)/gim,'').split(/\n/)
  203. InfoArea = InfoArea.filter(function(e){return e})
  204. InfoArea = InfoArea.filter((element) => !/^(http|Size|Download|Watch online|Spare links)/i.test(element));
  205. console.log('InfoArea: ', InfoArea)
  206. InfoAreaCast = document.querySelector('div.post-content-single p strong').innerText.replace(/(?:(?:\r\n|\r|\n)\s*){2}/gm, '\n').replace(/^(\s?(UPDATED|EARLY LEAK)\s?)/gim,'').split(/\n/)
  207. InfoAreaCast = InfoAreaCast.filter(function(e){return e})
  208. console.log(InfoAreaCast)
  209.  
  210. if(CopyTitle.match(/Updates/i)){
  211. CoverImage = ''
  212. MutilSubTitle(MatchWeb, MatchWebPoint, InfoAreaCast, DownloadArea)
  213. }
  214. else if(!CopyTitle.match(/Updates/i) && InfoAreaCast.length > 1 ){
  215. console.log('Mutil SubTitle....')
  216. MutilSubTitle(MatchWeb, MatchWebPoint, InfoAreaCast, DownloadArea)
  217. }
  218.  
  219. else if(!CopyTitle.match(/SITERIP|OnlyFans|Collection/i)){
  220. //CopyTitle에서 배우명 찾기
  221. MatchCast = MatchWebPoint !== -1 ? CopyTitle.substr(MatchWebPoint + 3).split(/&|\s|,|:/) : CopyTitle.match(/.+/)
  222. MatchCast = MatchCast ? MatchCast.filter(function(e){return e}) : []
  223. MatchCast = MatchCast ? MatchCast.filter((entry) => isNaN(entry)) : []//숫자 및 단일글자 제거
  224. MatchCast = MatchCast ? MatchCast.filter((entry) => entry.length > 1) : []//숫자 및 단일글자 제거
  225. console.log('MatchCast: ' + MatchCast)
  226. let MatchTitle = MatchWebPoint !== -1 ? CopyTitle.substr(MatchWebPoint+3) : CopyTitle
  227. console.log('MatchTitle: ' + MatchTitle)
  228. for (let i = 0; i < InfoArea.length; i++) {
  229. if(!Cast){
  230. Cast = InfoArea[i].match(/Cast\s?:/) ? InfoArea[i].match(/Cast\s?:(.+)/).pop() : ''
  231. console.log('Cast: ', Cast)
  232. }
  233. //배우명 작품타이틀 찾기
  234. if(!FirstMatchCast && InfoArea[i].match(/-/g) && !Cast){
  235. //배우명 찾기
  236. SearchCastPoint = InfoArea[i].search(/\s-\s/)
  237. console.log('SearchCastPoint: ' + SearchCastPoint)
  238. SearchCast = SearchCastPoint !== -1 ? InfoArea[i].substr(0, SearchCastPoint).split(/\&|\s|,/) : new Array(InfoArea[i])
  239. SearchCast = SearchCast ? SearchCast.filter(function(e){return e}) : ''//빈 배열값 제거
  240. SearchCast = SearchCast ? SearchCast.filter((entry) => isNaN(entry)) : ''//숫자 제거
  241. SearchCast = SearchCast ? SearchCast.filter((entry) => entry.length > 1) : ''//단일글자 제거
  242. console.log('SearchCast: ' + SearchCast)
  243. MatchCast = MatchCast ? MatchCast.find((val) => {
  244. console.log('SearchingCast: ' + val)
  245. return SearchCast.includes(val)
  246. })
  247. :''
  248. console.log('MatchCast: ' + MatchCast)
  249. //배우명 없는 경우 작품 타이틀로 찾기
  250. if(!MatchCast && !SearchTitle){
  251. SearchTitle = SearchCastPoint !== -1 ? InfoArea[i].substr(SearchCastPoint + 3) : InfoArea[i]
  252. SearchTitle = InfoArea[i].toLowerCase().includes(SearchTitle.toLowerCase()) ? InfoArea[i] : ''
  253. console.log('SearchTitle: ' + SearchTitle)
  254. }
  255. FirstMatchCast = MatchCast ? MatchCast : ''
  256. SearchTitle = SearchTitle ? SearchTitle : ''
  257. InfoCast = MatchCast && !InfoCast ? InfoArea[i] : ''
  258. console.log('FirstMatchCast: ' + FirstMatchCast)
  259. console.log('InfoCast: ' + InfoCast)
  260. }
  261. //MatchWeb 찾기
  262. if(!InfoArea[i].match(/^http/) && !FirstMatchWeb){
  263. SearchWebPoint = InfoArea[i].match(/(.+)(\.\d+\.\d+.\d+\.)(.+)/) ? InfoArea[i].match(/(.+)(\.\d+\.\d+.\d+\.)(.+)/)
  264. : InfoArea[i].match(/(.+)(\.\d{4}\.)(.+)/) ? InfoArea[i].match(/(.+)(\.\d{4}\.)(.+)/) : ''
  265. console.log('SearchWebPoint:', InfoArea[i], InfoArea[i].match(/(.+)(\.\d+\.\d+.\d+\.)(.+)/), InfoArea[i].match(/(.+)(\.\d{4}\.)(.+)/))
  266. if(SearchWebPoint){
  267. SearchWeb = SearchWebPoint[1] && MatchWeb.toLowerCase().match(SearchWebPoint[1].toLowerCase()) ? MatchWeb
  268. : (MatchWeb.replace(/\!|'/g, '').toLowerCase()).match(SearchWebPoint[1].toLowerCase()) ? MatchWeb
  269. : (MatchWeb.replace(/-|\s|\./g, '').toLowerCase()).match(SearchWebPoint[1].toLowerCase()) ? SearchWebPoint[1]
  270. : (MatchWeb.toLowerCase()).match(SearchWebPoint[1].replace(/-|\s/g, '').toLowerCase()) ? SearchWebPoint[1]
  271. : MatchWeb + '(' + SearchWebPoint[1] + ')'
  272. console.log('SearchWeb: ' + SearchWeb)
  273. FirstMatchWeb = SearchWeb ? SearchWeb
  274. : ''
  275. console.log('FirstMatchWeb 1st: ' + FirstMatchWeb)
  276. }
  277. else{
  278. FirstMatchWeb = CopyTitle === InfoArea[i] ? MatchWeb
  279. : InfoArea[i].match(MatchWeb) ? InfoArea[i].match(MatchWeb) : ''
  280. var EpisodeTmp = InfoArea[i].match(/^(?!.*S\d+)(?=.*E\d{2,5}).*$/) ? '.' + InfoArea[i].match(/E\d{2,5}/) : ''
  281. InfoCast = InfoCast && EpisodeTmp && InfoCast.match(/^(?!.*S\d+)(?=.*E\d{2,5}).*$/) ? InfoCast.replace(/-?\s?E\d{2,5}$/, '').trim() : InfoCast
  282. console.log('FirstMatchWeb 2nd: ', FirstMatchWeb, '\nEpisode: ', Episode)
  283. }
  284. }
  285. if(!Released){
  286. Released = InfoArea[i].match(/(.+)(\.\d+\.\d+.\d+\.)(.+)/) ? InfoArea[i].match(/(\.\d+\.\d+.\d+\.)/).pop() : ''
  287. console.log('Released: ', Released)
  288. }
  289. if(!Episode){
  290. Episode = InfoArea[i].match(/^(?!.*S\d+)(?=.*E\d{2,5}).*$/) ? '.' + InfoArea[i].match(/E\d{2,5}/)
  291. : EpisodeTmp ? EpisodeTmp
  292. : ''
  293. }
  294.  
  295. if(!ReleasedEn){
  296. ReleasedEn = InfoArea[i].match(/Released:(.+)/i) ? InfoArea[i].match(/Released:(.+)/i).pop() : ''
  297. console.log('ReleasedEn: ', ReleasedEn)
  298. ReleasedEn = ReleasedEn ? '.' + ReleasedEn.trim().replace(/,/g, '').replace(/\s/g, '.') + '.' : ''
  299. ReleasedEn = ReleasedEn && ReleasedEn.split('.')[1].match(/^[a-zA-Z]/) ? ReleasedEn.replace(ReleasedEn.split('.')[1], getNumericMonth(ReleasedEn.split('.')[1])) : ''
  300. }
  301.  
  302. if(FirstMatchCast && FirstMatchWeb && Released){
  303. CopyTitle = Released && InfoCast ? FirstMatchWeb + Episode + Released + InfoCast
  304. : Released && !InfoCast && MatchTitle ? FirstMatchWeb + Episode + Released + MatchTitle
  305. : FirstMatchWeb + Episode + Released + InfoCast
  306. console.log('All Match: ' + CopyTitle)
  307. break
  308. }
  309. else if(FirstMatchCast && FirstMatchWeb && ReleasedEn){
  310. CopyTitle = InfoCast ? FirstMatchWeb + Episode + ReleasedEn + InfoCast
  311. : !InfoCast && FirstMatchCast ? FirstMatchWeb + Episode + ReleasedEn + FirstMatchCast
  312. : FirstMatchWeb + Episode + ReleasedEn + (InfoCast ? InfoCast : FirstMatchCast)
  313. console.log('Some Match: ' + CopyTitle)
  314. }
  315. else if(!FirstMatchCast && !FirstMatchWeb && Released){
  316. if(CopyTitle === InfoArea[i]){
  317. console.log('Same Title: ' + CopyTitle, InfoArea[i])
  318. }
  319. }
  320. else if(MatchCast == MatchTitle && FirstMatchWeb && Released){
  321. InfoCast = InfoCast ? InfoCast : Cast ? '(' + Cast.trim() + ')' : ''
  322. CopyTitle = FirstMatchWeb + Episode + Released + InfoCast
  323. console.log('MatchCast == MatchTitle: ' + CopyTitle)
  324. }
  325. else if(!FirstMatchCast && MatchWeb && FirstMatchWeb && Released && MatchCast){
  326. CopyTitle = MatchWeb + "(" + FirstMatchWeb + ")" + Episode + Released + MatchCast.join(' ')
  327. console.log('MatchWeb VS FirstMatchWeb: ' + CopyTitle, InfoArea[i])
  328. }
  329. else if(i == InfoArea.length -1){
  330. console.log( MatchWeb, SearchWeb, Released, ReleasedEn, FirstMatchCast, Episode, InfoCast )
  331. InfoCast = InfoCast ? InfoCast : Cast ? '(' + Cast.trim() + ')' : ''
  332. console.log('InfoCast: ', InfoCast)
  333. Released = Released ? Released : ReleasedEn ? ReleasedEn : ''
  334. CopyTitle = MatchWeb && Released && SearchWebPoint && InfoCast ? MatchWeb + '(' + SearchWebPoint[1] + ')' + Episode + Released + InfoCast
  335. : MatchWeb && Released && InfoCast ? MatchWeb + Episode + Released + InfoCast
  336. : MatchWeb && Released && FirstMatchCast ? MatchWeb + Episode + Released + FirstMatchCast
  337. : SearchWeb && !Released && SearchWebPoint && SearchWeb&& InfoCast ? SearchWeb + SearchWebPoint[2] + Episode + InfoCast
  338. : MatchWeb && Episode && MatchTitle && InfoCast ? MatchWeb + Episode + MatchTitle + InfoCast
  339. : MatchWeb && SearchTitle && !InfoCast && Released ? MatchWeb + Episode + Released + SearchTitle
  340. : MatchWeb && MatchTitle && !InfoCast && Released ? MatchWeb + Episode + Released + MatchTitle
  341. : MatchWeb && Released && InfoCast ? MatchWeb + Episode + Released + InfoCast
  342. : SearchWeb && InfoCast ? SearchWeb + Episode + InfoCast
  343. : CopyTitle + InfoCast
  344. console.log('End : ', CopyTitle)
  345. }
  346. }
  347.  
  348. CopyTitle = CopyTitle.replace(/(S\d+):(E\d+)/i, '$1$2')
  349. CopyTitle = byteLengthOf(CopyTitle, 250)
  350. CopyTitle = FilenameConvert(CopyTitle) + Resolution
  351.  
  352. console.log('CopyTitle: ' + CopyTitle)
  353. let LinkDB = []
  354. for (let i = 0; i < DownloadArea.length; i++) {
  355. let Links = MatchRegex(DownloadArea[i], new RegExp('1080p', 'i'), 'href')
  356. console.log('1080p: ', Links)
  357. if(Links?.length > 0){
  358. LinkDB.push(...Links)
  359. }
  360. else if(!Links?.length){
  361. Links = MatchRegex(DownloadArea[i], new RegExp('2160p', 'i'), 'href')
  362. console.log('2160p: ', Links)
  363. if(Links?.length > 0){
  364. LinkDB.push(...Links)
  365. }
  366. else if(!Links?.length){
  367. Links = MatchRegex(DownloadArea[i], new RegExp('720p', 'i'), 'href')
  368. console.log('720p: ', Links)
  369. if(Links?.length > 0){
  370. LinkDB.push(...Links)
  371. }
  372. else if(!Links?.length){
  373. Links = MatchRegex(DownloadArea[i], new RegExp(MatchWeb + '|' + MatchCast, 'i'), 'href')
  374. console.log('Links: ', Links)
  375. LinkDB.push(...Links)
  376. }
  377. }
  378. }
  379. }
  380. LinkDB = LinkDB?.length > 0 ? LinkDB.map((entry) => entry.outerHTML) : ''
  381. console.log('LinkDB: ', LinkDB)
  382. let container = document.createElement("div")
  383.  
  384. LinkDB.forEach((el, i) => {
  385. const fragment = document.createRange().createContextualFragment(el);
  386. console.log(fragment.children[0]);
  387. container.appendChild(fragment.children[0]);
  388. })
  389. container.classList.add("DownloadArea")
  390. document.body.appendChild(container);
  391. DownloadArea = document.querySelectorAll('div.DownloadArea')
  392. console.log('DownloadArea: ', DownloadArea)
  393. }
  394. if(!document.querySelector('.GetTitle')){
  395. document.querySelector("div#main-content.main-content-single div div.post-content-single p strong").insertAdjacentHTML('afterend', '&nbsp;&nbsp;<i class="GetTitle fas fa-paste"></>')
  396. }
  397. document.querySelector('.GetTitle').addEventListener("click", async function(event){
  398. event.preventDefault()
  399. event.target.style.setProperty('color', 'Orange', 'important')
  400. updateClipboard(CopyTitle)
  401. })
  402. }
  403.  
  404. else if(/maxjav.com\/\d+/.test(PageURL) && window.top === window.self){
  405. CopyOffSetArea = document.querySelector('div#content > div > .title')
  406. CopyTitle = CopyOffSetArea.innerText
  407. CopyTitle = CopyTitle.match(/\[?.*Subtitle\]?(.+)/) ? CopyTitle.match(/\[.+Subtitle\](.+)/).pop() : CopyTitle
  408. CopyTitle = CopyTitle.replace(/amp;/g, '').replace(/(\s)?\/(\s)?/g, '/').replace(/(-|–)\sHD/, '').replace(/amp;|\(\s?ブルーレイ版\s?\)|\(ブルーレイディスク版\)|:/g, '').trim()
  409. console.log(CopyTitle)
  410. if(!CopyTitle.match(/^Collection/)){
  411. InfoArea = document.querySelector('div#content > div > .entry > p').innerText.replace(/(?:(?:\r\n|\r|\n)\s*){2}/gm, '\n').split(/\n\n|\n/)
  412. InfoArea = InfoArea.filter(function(e){return e})//빈 배열값 제거
  413. console.log(InfoArea)
  414. //Series = InfoArea.find(InfoSearch => InfoSearch.match(/シリーズ:?.*/)) ? InfoArea.find(InfoSearch => InfoSearch.match(/シリーズ:?.*/)).replace(/シリーズ:?/, '').trim() : ''
  415. for (let i = 0; i < InfoArea.length; i++) {
  416. if(!Title){
  417. console.log(CopyTitle.match(SearchID))
  418. CopyTitleTmp = CopyTitle.match(SearchIDRegExp) ? CopyTitle.match(SearchID).pop().trim() : ''
  419. InfoTitleTmp = InfoArea[i].match(SearchIDRegExp) ? InfoArea[i].match(SearchID).pop().trim() : ''
  420. console.log('CopyTitleTmp: ', CopyTitleTmp, '\nInfoTitleTmp: ', InfoTitleTmp)
  421. //CopyTitleTmp.match(/[\u3040-\u309f\u30a0-\u30ff]/g) 일본어 히라가나 카타가나 찾기
  422. if(CopyTitleTmp && InfoTitleTmp){
  423. Title = CopyTitleTmp.toLowerCase() === InfoTitleTmp.toLowerCase() ? CopyTitleTmp
  424. : (CopyTitleTmp.match(JapaneseChar) || []).length >= (InfoArea[i].match(JapaneseChar) || []).length ? CopyTitleTmp
  425. : (CopyTitleTmp.match(JapaneseChar) || []).length < (InfoArea[i].match(JapaneseChar) || []).length ? InfoTitleTmp
  426. : CopyTitleTmp
  427. Title = Title.trim() + ' '
  428. console.log('Title 1st: ' + Title)
  429. }
  430. else{
  431. Title = CopyTitleTmp && (CopyTitle.match(JapaneseChar) || []).length >= (InfoArea[i].match(JapaneseChar) || []).length ? CopyTitleTmp
  432. : InfoTitleTmp && InfoTitleTmp.match(JapaneseChar) && (CopyTitle.match(JapaneseChar) || []).length <= (InfoArea[i].match(JapaneseChar) || []).length ? InfoTitleTmp
  433. : (CopyTitle.match(JapaneseChar) || []).length < (InfoArea[i].match(JapaneseChar) || []).length ? InfoArea[i]
  434. : CopyTitle.match(JapaneseChar) ? CopyTitle
  435. : InfoArea[i].match(JapaneseChar) ? InfoArea[i]
  436. : CopyTitle
  437.  
  438. Title = Title.trim() + ' '
  439. Title = mbConvertKana(Title, 'rans')
  440. console.log('Title 2nd: ' + Title)
  441. }
  442. }
  443. if(!ID){
  444. console.log(CopyTitle.match(SearchID), InfoArea[i].match(SearchID))
  445. let TitleID = CopyTitle.match(SearchIDRegExp) ? CopyTitle.match(SearchID)[1] : CopyTitle.match(SearchFC2ID) ? CopyTitle.match(SearchFC2ID)[1] : ''
  446. let InfoID = InfoArea[i].match(SearchIDRegExp) ? InfoArea[i].match(SearchID)[1] : InfoArea[i].match(SearchFC2ID) ? InfoArea[i].match(SearchFC2ID)[1] : ''
  447. if(TitleID && InfoID && TitleID.replace(/-/g, '').trim().toLowerCase() === InfoID.replace(/-/g, '').trim().toLowerCase()){
  448. ID = TitleID.match(/-/g) && InfoID.match(/-/g) ? TitleID
  449. : TitleID.match(/-/g) ? TitleID
  450. : InfoID.match(/-/g) ? InfoID.match(/-/g)
  451. : TitleID
  452. }
  453. else{
  454. ID = TitleID ? TitleID : InfoID
  455. }
  456. console.log('ID: ' + ID)
  457. if(ID){
  458. ID = ID.trim() + ' '
  459. }
  460. }
  461. if(CfgReleaseDate && !ReleaseDate && InfoArea[i].match(/Release Date:/)){
  462. ReleaseDate = InfoArea[i].match(/Release Date:(.+)/)[1].replace(/\//g, '-').trim()
  463. }
  464. if(MakerCfg && !Maker && InfoArea[i].match(/(Maker|Studio)\s?:(.+)/)){
  465. Maker = InfoArea[i].match(/(Maker|Studio)\s?:(.+)/)[2].replace(/(\s)?\/(\s)?/g, '/').trim()
  466. }
  467. if(Title && ID && ReleaseDate){
  468. break
  469. }
  470. }
  471. Maker = Maker ? '[' + Maker + '] ' : ''
  472. ReleaseDate = ReleaseDate ? '(' + ReleaseDate + ') ' : ''
  473.  
  474. Title = Maker + ID + ReleaseDate + Title
  475.  
  476. if(byteLengthOfCheck(Title) > 250){
  477.  
  478. let TitleLast = getLastText(Title)
  479.  
  480. if(typeof TitleLast == 'undefined' || !TitleLast || TitleLast.length === 0 || TitleLast === "" || !/[^\s]/.test(TitleLast) || /^\s*$/.test(TitleLast) || TitleLast.replace(/\s/g,"") === ""){
  481. CopyTitle = byteLengthOf(Title, 250).trim()
  482. }
  483. else{
  484. Title = Title.split(TitleLast)[0].trim()
  485. Title = byteLengthOf(Title, 250 - byteLengthOfCheck(TitleLast))
  486. console.log('Title: ', Title, TitleLast)
  487. CopyTitle = (Title + TitleLast).trim()
  488. }
  489. }
  490. else CopyTitle = Title.trim()
  491.  
  492. console.log('Last Title: ' + CopyTitle)
  493.  
  494. }
  495. //CopyTitle = CopyOffSetArea.textContent.replace(/\s–\s(UltraHD|Full|HD|SD)/, '').trim()
  496. DownloadArea = document.querySelectorAll('div#content > div > div.entry p')
  497. CoverImage = DownloadArea[0].querySelector('p img') ? DownloadArea[0].querySelector('p img').src : ''
  498. }
  499.  
  500. else if(/javpink\.com\/\?p/.test(PageURL)){
  501. CopyOffSetArea = document.querySelector('.item > .title')
  502. Title = CopyOffSetArea.textContent.trim()
  503. DownloadArea = document.querySelectorAll('.item > .content')
  504. CoverImage = DownloadArea[0].querySelector('p img') ? DownloadArea[0].querySelector('p img').src : ''
  505.  
  506. for (let i = 0; i < DownloadArea.length; i++) {
  507. InfoArea = DownloadArea[i].innerText.replace(/(?:(?:\r\n|\r|\n)\s*){2}/gm, '\n').split(/\n\n|\n/)
  508. }
  509. InfoArea = InfoArea.filter(function(e){return e})//빈 배열값 제거
  510. console.log(InfoArea)
  511. Series = InfoArea.find(InfoSearch => InfoSearch.match(/シリーズ:?.*/)) ? InfoArea.find(InfoSearch => InfoSearch.match(/シリーズ:?.*/)).replace(/シリーズ:?/, '').trim() : ''
  512.  
  513. Title = mbConvertKana(Title, 'rans')
  514. if(byteLengthOfCheck(Title) > 250){
  515. let TitleLast = getLastText(Title)
  516.  
  517. if(typeof TitleLast == 'undefined' || !TitleLast || TitleLast.length === 0 || TitleLast === "" || !/[^\s]/.test(TitleLast) || /^\s*$/.test(TitleLast) || TitleLast.replace(/\s/g,"") === ""){
  518. CopyTitle = byteLengthOf(Title, 250).trim()
  519. }
  520. else{
  521. Title = Title.split(TitleLast)[0].trim()
  522. Title = byteLengthOf(Title, 250 - (byteLengthOfCheck(TitleLast)))
  523. console.log('Title: ', Title, TitleLast)
  524. CopyTitle = (Title + TitleLast).trim()
  525. }
  526. }
  527. else CopyTitle = Title.trim()
  528. }
  529.  
  530. else if(/top-modelz.org\/.+html/.test(PageURL)){
  531. CopyOffSetArea = document.querySelector('.news-detalis h2')
  532. Title = CopyOffSetArea.textContent.trim()
  533. DownloadArea = document.querySelectorAll('div#content div#l-content div#dle-content div.news-block div.newspad')
  534. CoverImage = DownloadArea[0].querySelector('p img') ? DownloadArea[0].querySelector('p img').src : ''
  535. for (let i = 0; i < DownloadArea.length; i++) {
  536. InfoArea = DownloadArea[i].innerText.replace(/(?:(?:\r\n|\r|\n)\s*){2}/gm, '\n').split(/\n\n|\n/)
  537. }
  538. InfoArea = InfoArea.filter(function(e){return e})//빈 배열값 제거
  539. console.log(InfoArea)
  540. let Released
  541. for (let i = 0; i < InfoArea.length; i++) {
  542. if(!Released){
  543. Released = InfoArea[i].match(/\d+-\d+-\d+/) ? InfoArea[i].match(/\d+-\d+-\d+/) + ' ' : ''
  544. }
  545. if(Released){
  546. break
  547. }
  548. }
  549. CopyTitle = Released ? Released + Title : Title
  550. CopyTitle = CopyTitle
  551. CopyTitle = byteLengthOf(CopyTitle, 250)
  552. }
  553.  
  554. else if(/(8kcosplay\.com|blogjav\.net|javfree\.me)\/\d+/.test(PageURL)){
  555. CopyOffSetArea = document.querySelector('.entry-title')
  556. if(/javfree\.me/.test(PageURL)){
  557. DownloadArea = document.querySelectorAll('.entry-content')
  558.  
  559. //CoverImage = DownloadArea[0].querySelector('p img') ? DownloadArea[0].querySelector('p img').src : ''
  560. }
  561. else{
  562. DownloadArea = document.querySelectorAll('.entry-content > p')
  563. CoverImage = DownloadArea[0].querySelector('p img') ? DownloadArea[0].querySelector('p img').src : ''
  564. }
  565.  
  566. Title = CopyOffSetArea.textContent.replace(/\[([a-zA-Z]{2,11}-?\d{2,6}[a-zA-Z]?|\d{2,4}[a-zA-Z]{2,7}-?\d{3,6}[a-zA-Z]?|[a-zA-Z]{1,2}-?\d{2}-?\d{2}|[a-zA-Z]{2,7}-?[a-zA-Z]{1,2}\d{2})\]/, '$1')
  567. ID = Title.match(SearchFC2ID) ? Title.match(SearchFC2ID)[1] : ''
  568. console.log('ID: ', ID)
  569. Title = Title.replace(ID, '').trim()
  570. Title = Title.split(/\s/).filter(function(e){return e})
  571. console.log('Title: ', Title)
  572. if(Title[0].match(/UNCENSORED/)){
  573. Title.shift()
  574. Title = Title.join(' ')
  575. }
  576. else{
  577. Title = Title.join(' ')
  578. }
  579. for (let i = 0; i < DownloadArea.length; i++) {
  580. InfoArea = DownloadArea[i].innerText.replace(/(?:(?:\r\n|\r|\n)\s*){2}/gm, '\n').split(/\n\n|\n/)
  581. }
  582.  
  583. InfoArea = InfoArea.filter(function(e){return e})//빈 배열값 제거
  584. console.log('InfoArea: ', InfoArea)
  585. Series = InfoArea.find(InfoSearch => InfoSearch.match(/シリーズ:?.*/)) ? InfoArea.find(InfoSearch => InfoSearch.match(/シリーズ:?.*/)).replace(/シリーズ:?/, '').trim() : ''
  586. console.log('Series: ', Series)
  587. Title = mbConvertKana(Title, 'rans')
  588. console.log(Title, ID)
  589. if(byteLengthOfCheck(Title) > 250 - byteLengthOfCheck(ID)){
  590. let TitleLast = getLastText(Title)
  591. if(typeof TitleLast == 'undefined' || !TitleLast || TitleLast.length === 0 || TitleLast === "" || !/[^\s]/.test(TitleLast) || /^\s*$/.test(TitleLast) || TitleLast.replace(/\s/g,"") === ""){
  592. CopyTitle = ID + byteLengthOf(Title, 250 - byteLengthOfCheck(ID)).trim()
  593. }
  594. else{
  595. Title = Title.split(TitleLast)[0].trim()
  596. Title = byteLengthOf(Title, 250 - (byteLengthOfCheck(ID) + byteLengthOfCheck(TitleLast)))
  597. CopyTitle = (ID + Title + TitleLast).trim()
  598. if(byteLengthOfCheck(CopyTitle) > 250){
  599. console.log('CopyTitle length: ', byteLengthOfCheck(CopyTitle))
  600. }
  601. }
  602. }
  603. else CopyTitle = ID + Title.trim()
  604. console.log('CopyTitle: ', CopyTitle)
  605. }
  606.  
  607. else if(/wetholefans.com\/.+/.test(PageURL)){
  608. CopyOffSetArea = document.querySelector('.post-title #news-title h1')
  609. console.log(parseFloat(window.getComputedStyle(CopyOffSetArea).fontSize))
  610. //console.log('CopyOffSetArea: ' + CopyOffSetArea)
  611. Resolution = !Resolution && CopyOffSetArea && CopyOffSetArea.innerText.match(/[0-9]{3,4}p/) ? ' ' + CopyOffSetArea.innerText.match(/[0-9]{3,4}p/)[0] : ''
  612. console.log(Resolution)
  613. CopyTitle = CopyOffSetArea.innerText.replace(/\((UltraHD|Full|HD|SD).+/, '').replace(/\s+/g, ' ').trim()
  614. CopyTitle = capitalize(CopyTitle)
  615. DownloadArea = CopyOffSetArea.closest('.story').querySelectorAll('.quote')
  616. let SearchLinks
  617. DownloadArea.forEach((LinkEntry) => {
  618. SearchLinks = LinkEntry.querySelectorAll('a')
  619. })
  620. console.log(SearchLinks)
  621. for (let i = 0; i < SearchLinks.length; i++) {
  622. if(!ReleaseDate){
  623. ReleaseDate = SearchLinks[i].textContent.match(/(.+)(\.\d+\.\d+.\d+\.)(.+)/) ? SearchLinks[i].textContent.match(/(\.\d+\.\d+.\d+\.)/).pop() : ''
  624. }
  625. else{
  626. break
  627. }
  628. }
  629. let MatchWebPoint = CopyTitle.search(/\s-\s/)
  630. let MatchWeb = MatchWebPoint !== -1 ? CopyTitle.substr(0, MatchWebPoint).replace(/\s/g, '') : CopyTitle
  631. CopyTitle = ReleaseDate ? MatchWeb + ReleaseDate + CopyTitle.substr(MatchWebPoint+3) : CopyTitle
  632. console.log(CopyTitle)
  633. CopyTitle = CopyTitle.replace(/\*/g, '*').replace(/\?/g, '?')
  634. CopyTitle = byteLengthOf(CopyTitle, 250)
  635.  
  636. }
  637.  
  638. else{
  639. if(/(pornchil\.com\/)(?!$).*$/.test(PageURL)){
  640. CopyOffSetArea = document.querySelector('.inside-article > .entry-content').querySelector('strong > span')
  641. DownloadArea = document.querySelectorAll('.inside-article > div.entry-content')
  642. console.log(CopyOffSetArea)
  643. }
  644. else if(/javarchive\.com\/\d{4,6}/.test(PageURL)){
  645. CopyOffSetArea = document.querySelector('div.news > div.first_des') || document.querySelector('.menudd > h1')
  646. DownloadArea = document.querySelectorAll('.link_archive_innew')
  647. CoverImage = document.querySelector('div.category_news_phai_chinh > div.news > div.fisrst_sc img:not([src^="data"])') ? document.querySelector('div.category_news_phai_chinh > div.news > div.fisrst_sc img').getAttribute('src') : document.querySelector('div.category_news_phai_chinh > div.news > div.fisrst_sc img').getAttribute('data-src')
  648. //console.log(CopyOffSetArea, DownloadArea, CoverImage)
  649. }
  650. else if(/kbjme\.com\/\d+/.test(PageURL)){
  651. CopyOffSetArea = document.querySelector('.article_container h1')
  652. DownloadArea = document.querySelectorAll('div.article_container div.context div#post_content')
  653. console.log(DownloadArea)
  654. document.querySelector('.article_container a').href = '#'
  655. document.querySelector('.article_container a').removeAttribute('target')
  656. }
  657. else if(/hpjav.tv\/(ja\/)?\d+/.test(PageURL)){
  658. CopyOffSetArea = document.querySelector('section div ol li.active')
  659. CoverImage = document.querySelector('#JKDiv_0') ? GetBackGroundUrl(document.querySelector('#JKDiv_0')) : ''
  660. let AddElementArea = document.querySelector('div#down_server')
  661. let observer = new MutationObserver(function(mutations) {
  662. if (document.querySelector('ul.pricing-table')) {
  663. DownloadArea = document.querySelectorAll('ul.pricing-table')
  664. console.log('DownloadArea: ', DownloadArea)
  665. if(DownloadArea){
  666. observer.disconnect()
  667. window.scrollTo({ top: 0, behavior: 'auto' })
  668. DownloadArea.forEach((LinkEntry) => {
  669. LinkEntry.querySelectorAll('a').forEach((aEntry) => {
  670. if( RootDomain !== (extractRootDomain(aEntry.href))){
  671. aEntry.classList.remove("dbtn")
  672. aEntry.removeAttribute('type')
  673. aEntry.textContent = aEntry.href
  674. aEntry.insertAdjacentHTML('beforebegin', '<img src=https://www.google.com/s2/favicons?domain=' + extractRootDomain(aEntry.href) +' ></>')
  675. }
  676. })
  677. })
  678. keyvent.down('ctrl alt a')
  679. }
  680. }
  681. })
  682. observer.observe(AddElementArea, { attributes: true, childList: true, subtree: true });
  683. await sleep(1000)
  684. document.querySelector('#download_div.btn.btn-info').click()
  685. }
  686. else if(/0xxx\.ws\/articles\/\d+/.test(PageURL)){
  687. CopyOffSetArea = document.querySelector('div.container table#detail-table tbody tr td.taj:not(.levo)')
  688. DownloadArea = document.querySelectorAll('div.container table#detail-table tbody tr td.dlinks.taj')
  689. console.log(DownloadArea)
  690. window.addEventListener('scroll', scrollToTop)
  691. }
  692. else if(/pornrips\.cc\/.+/.test(PageURL)){
  693. CopyOffSetArea = document.querySelector('div#dle-content article div.head h1.title')
  694. DownloadArea = document.querySelectorAll('div#dle-content article div.story_cont .screenshots, div#dle-content article div.story_cont div.links')
  695. console.log(DownloadArea)
  696. }
  697. else if(/(thotsgirls\.com)\/.+/.test(PageURL)){
  698. CopyOffSetArea = document.querySelector('.entry-title')
  699. DownloadArea = document.querySelectorAll('div.entry-content')
  700. console.log(DownloadArea)
  701. }
  702. else if(/fhdporn\.video\/.+/.test(PageURL)){
  703. CopyOffSetArea = document.querySelector('h1.post-title')
  704. DownloadArea = document.querySelectorAll('div.post-content')
  705. console.log(DownloadArea)
  706. }
  707. else if(/av18plus\.com/.test(PageURL)){
  708. CopyOffSetArea = document.querySelector('article.post > h1#post-title')
  709. DownloadArea = CopyOffSetArea ? CopyOffSetArea.closest('article').querySelectorAll('p') : ''
  710. console.log(DownloadArea)
  711. }
  712. else if(/siteripbb\.org\/.+/.test(PageURL)){
  713. CopyOffSetArea = document.querySelector('.entry-title')
  714. DownloadArea = document.querySelectorAll('div.entry-content')
  715. console.log(DownloadArea)
  716. }
  717. else if(/asianscan\.biz\/.*\.html/.test(PageURL)){
  718. CopyOffSetArea = document.querySelector('div div.content div#dle-content div.mainf3')
  719. DownloadArea = document.querySelectorAll('div.content div#dle-content div.sscn div.quote')
  720. console.log(DownloadArea)
  721. }
  722. else if(/adult-porno\.org\/.+/.test(PageURL)){
  723. CopyOffSetArea = document.querySelector('div.full-in h1')
  724. DownloadArea = document.querySelectorAll('div.quote')
  725. console.log(DownloadArea)
  726. Resolution = !Resolution && CopyOffSetArea && CopyOffSetArea.innerText.match(/[0-9]{3,4}p/) ? ' ' + CopyOffSetArea.innerText.match(/[0-9]{3,4}p/)[0] : ''
  727. }
  728. else if(/(sharepornlink\.com\/)(?!($|page))(.*)$/.test(PageURL)){
  729. CopyOffSetArea = document.querySelector('.main-title.title')
  730. DownloadArea = document.querySelectorAll('div.text p')
  731. console.log(DownloadArea)
  732. Resolution = !Resolution && CopyOffSetArea && CopyOffSetArea.innerText.match(/[0-9]{3,4}p/) ? ' ' + CopyOffSetArea.innerText.match(/[0-9]{3,4}p/)[0] : ''
  733. }
  734. else if(/pornobunny\.org\/.+/.test(PageURL)){
  735. CopyOffSetArea = document.querySelector('.titlesf')
  736. document.querySelector('a.quote-hider-trigger').click()
  737. let AddElementArea = document.querySelector('div.sstory')
  738. let observer = new MutationObserver(function(mutations) {
  739. mutations.forEach(function(mutation) {
  740. for (var i = 0; i < mutation.addedNodes.length; i++) {
  741. if (mutation.addedNodes[i].nodeType === Node.ELEMENT_NODE) {
  742. if (mutation.addedNodes[i].classList.contains('quote')) {
  743. DownloadArea = document.querySelectorAll('div.quote')
  744. console.log('DownloadArea: ', DownloadArea)
  745. if(DownloadArea){
  746. observer.disconnect()
  747. window.scrollTo({ top: 0, behavior: 'auto' })
  748. }
  749. }
  750. }
  751. }
  752. })
  753. });
  754. observer.observe(AddElementArea, { childList: true, subtree: true });
  755. Resolution = !Resolution && CopyOffSetArea && CopyOffSetArea.innerText.match(/[0-9]{3,4}p/) ? ' ' + CopyOffSetArea.innerText.match(/[0-9]{3,4}p/)[0] : ''
  756. }
  757. else if(/pornrip\.cc\/.+\.html/.test(PageURL)){
  758. CopyOffSetArea = document.querySelector('.title.ularge')
  759. let AddElementArea = document.querySelector('article.main-article section.post-content')
  760. let observer = new MutationObserver(function(mutations) {
  761. mutations.forEach(function(mutation) {
  762. for (var i = 0; i < mutation.addedNodes.length; i++) {
  763. console.log(mutation.addedNodes[i])
  764. if (mutation.addedNodes[i].nodeName === 'A') {
  765. DownloadArea = document.querySelectorAll('article.main-article > section.post-content > div > div.su-spoiler > div.su-spoiler-content')
  766. console.log('DownloadArea: ', DownloadArea)
  767. if(DownloadArea){
  768. observer.disconnect()
  769. window.scrollTo({ top: 0, behavior: 'auto' })
  770. document.querySelectorAll('a').forEach((aEntry) => {
  771. if(/\?site.+$/.test(aEntry.href)){
  772. aEntry.setAttribute('href', aEntry.href.replace(/\?site.+$/, ''))
  773. }
  774. })
  775. break
  776. }
  777. }
  778. }
  779. })
  780. });
  781. observer.observe(AddElementArea, { childList: true, subtree: true })
  782. Resolution = !Resolution && CopyOffSetArea && CopyOffSetArea.innerText.match(/[0-9]{3,4}p/) ? ' ' + CopyOffSetArea.innerText.match(/[0-9]{3,4}p/)[0] : ''
  783. }
  784. if(CopyOffSetArea){
  785. //console.log('InnerText: ', getDirectInnerText(CopyOffSetArea))
  786. CopyTitle = getDirectInnerText(CopyOffSetArea).replace('–', '-').replace(/\s+/g, ' ').replace(/\[(UltraHD|FullHD|HD).+\].*/, '').replace(/^Japanese porn -|6000Kbps FHD/, '').trim()
  787. CopyTitle = CopyTitle.match(/(–\sSiterip)\s–.+/) ? CopyTitle.match(/(.+Siterip)\s–.+/)[1] : CopyTitle
  788. CopyTitle = capitalize(CopyTitle)
  789. if(byteLengthOfCheck(CopyTitle) > 250){
  790. let TitleLast = getLastText(CopyTitle)
  791.  
  792. if(typeof TitleLast == 'undefined' || !TitleLast || TitleLast.length === 0 || TitleLast === "" || !/[^\s]/.test(TitleLast) || /^\s*$/.test(TitleLast) || TitleLast.replace(/\s/g,"") === ""){
  793. Title = byteLengthOf(CopyTitle, 250).trim()
  794. }
  795. else{
  796. Title = CopyTitle.split(TitleLast)[0].trim()
  797. Title = byteLengthOf(Title, 250 - (byteLengthOfCheck(TitleLast)))
  798. console.log('Title: ', Title, TitleLast)
  799. Title = (Title + TitleLast).trim()
  800. }
  801. CopyTitle = Title.trim()
  802. }
  803. else CopyTitle = CopyTitle.trim()
  804. }
  805. }
  806. }
  807.  
  808.  
  809. document.addEventListener("DOMContentLoaded", async function(event) {
  810. if(!document.querySelector("div.CenterBox")){
  811. await Start()
  812. }
  813.  
  814. document.addEventListener("click", async (event) => {
  815. //console.log(event.target)
  816. if(event.target.classList.contains('ClearButton')){
  817. event.preventDefault()
  818. await ClearUrls()
  819. }
  820. if(event.target.classList.contains('CopyButton')){
  821. event.preventDefault()
  822. await ClipPaste()
  823. }
  824. if(event.target.classList.contains('CopyIcon')){
  825. event.preventDefault()
  826. CopyGo()
  827. }
  828. if(event.target.classList.contains('CloseIcon')){
  829. window.close()
  830. }
  831. if(event.target.classList.contains('Minus')){
  832. event.preventDefault()
  833. event.target.style = "color: Orange !important;";
  834. RemoveDB(listToDo(DownloadArea))
  835. CheckDB(listToDo(DownloadArea))
  836. }
  837. })
  838.  
  839. if(CopyOffSetArea && !document.querySelector(".IconSet")){
  840. CopyOffSetArea.insertAdjacentHTML('afterend', '<div class="IconSet" style="top: auto; left: auto; max-width: max-content; visibility:hidden; position: absolute;"></>')
  841. document.querySelector(".IconSet").insertAdjacentHTML('beforeend', '<i class="CopyIcon far fa-clone" style ="color: dodgerblue !important; visibility:hidden;"></>')
  842. document.querySelector(".IconSet").insertAdjacentHTML('beforeend', '&nbsp;<i class="CloseIcon fa-solid fa-square-xmark" style ="color: dodgerblue !important; visibility:hidden"></>')
  843. document.querySelector(".IconSet").insertAdjacentHTML('beforeend', '&nbsp;<i class="Minus fa-solid fa-magnifying-glass-minus" style ="color: dodgerblue !important; visibility:hidden;"></>')
  844. document.body.insertAdjacentHTML('beforeend', '<div class="CopyNotice" style="visibility:hidden;"></>')
  845. document.querySelector(".IconSet").style.visibility = "hidden"
  846. if(document.hidden){
  847. document.querySelector(".CopyIcon").style.visibility = "hidden"
  848. }
  849. let IconSetZIndex = MaxZIndexFromPoint('.IconSet') + 1
  850. let IconSetFontSize = Number(((1/(GetDPI/1.5))*(16/DefaultFontSize)).toFixed(2)) + 'rem'
  851. //document.querySelector('.IconSet').style.cssText = `font-size: ${CneterBoxFontSize}; z-index: ${CenterBoxZIndex}; display: block;`
  852. Object.assign(document.querySelector('.IconSet').style, {fontSize: IconSetFontSize, zIndex: IconSetZIndex});
  853.  
  854. }
  855.  
  856. if(CopyOffSetArea){
  857. console.log('Make Icon')
  858. MakeIconTimer = setTimeout(() => MakeIcon(GetDPI), 2000)
  859. /*
  860. window.addEventListener("resize", function(e) {
  861. console.log(e.type)
  862. //GetDPI = window.devicePixelRatio
  863. //DefaultFontSize = getDefaultFontSize()
  864. //console.log('GetDPI: ', GetDPI, 'DefaultFontSize: ', DefaultFontSize)
  865. //document.querySelector('.CenterBox').style.setProperty('font-size', Number(((1/(GetDPI/1.5))*(16/DefaultFontSize)).toFixed(2)) + 'rem', 'important');
  866. //document.querySelector('.State').style.setProperty('font-size', Number(((1/(GetDPI/1.5))*0.65*(16/DefaultFontSize)).toFixed(2)) + 'rem', 'important');
  867. //document.querySelector('.State').style.setProperty('line-height', Number(((1/(GetDPI/1.5))*(16/DefaultFontSize)).toFixed(2)) + 'rem', 'important');
  868. //document.querySelector('.CenterBox').style.setProperty('z-index', getMaxZIndex() + 1)
  869. //document.querySelector(".IconSet").style.setProperty('z-index', MaxZIndexFromPoint('.IconSet') + 1)
  870. MakeIcon(GetDPI)
  871. })
  872. */
  873. }
  874.  
  875. })
  876.  
  877. document.addEventListener("visibilitychange", async function() {
  878. //console.log("window is active!" )
  879. RootDomainDB = JSON.parse(await GM_getValue(RootDomain, '[]'))
  880. GetState = RootDomainDB
  881. if(document.querySelector('.CenterBox')){
  882. document.querySelector('.State').textContent = ' ' + GetState.length
  883. document.querySelector('.ClearButton').style = "color: dodgerblue !important;";
  884. document.querySelector('.CopyButton').style = "color: dodgerblue !important;";
  885. }
  886. })
  887.  
  888. async function CopyGo() {
  889. let TitlePostion = getElementOffset(CopyOffSetArea)
  890. let TitleHeight = Math.max(TitlePostion.height, parseFloat(window.getComputedStyle(CopyOffSetArea).fontSize))
  891. let FixTop = Number((TitlePostion.top + TitlePostion.height).toFixed(2))
  892. let FixLeft = Number((TitlePostion.left + 2).toFixed(2))
  893. if(/pornchil.com/.test(PageURL)){
  894. FixLeft = getElementOffset(document.querySelector(".entry-content > h6")).left
  895. }
  896. else if(/pornrips\.cc/.test(PageURL)){
  897. FixLeft = getElementOffset(document.querySelector(".meta_date > .masha_index")).left
  898. }
  899. else if(/naughtyblog/.test(PageURL)){
  900. FixTop = getElementOffset(document.querySelector(".post-title.entry-title")).top + getElementOffset(document.querySelector(".post-title.entry-title")).height
  901. }
  902. $('.CopyNotice').css({
  903. "fontSize": Number(((1/(GetDPI/1.5))*0.6*(16/DefaultFontSize)).toFixed(2)) + 'rem',
  904. "top": FixTop + window.scrollY
  905. ,"left": FixLeft + window.scrollX
  906. , "position": "absolute",
  907. "z-index": getMaxZIndex() + 1
  908. })
  909. event.target.style = "color: Orange !important;"
  910. await CopyLink()
  911. let container = document.querySelector('.CopyNotice')
  912. container.classList.add('active')
  913. container.style.height = 'auto'
  914. var height = container.clientHeight + 'px'
  915. container.style.height = '0px'
  916. setTimeout(function () {
  917. container.style.height = height;
  918. container.style.visibility = "visible"
  919. }, 0)
  920. await sleep(3000)
  921. container.style.height = '0px'
  922. container.addEventListener('transitionend', function () {
  923. container.classList.remove('active');
  924. }, {
  925. once: true
  926. });
  927. }
  928.  
  929. function sleep(ms) {
  930. return new Promise(resolve => setTimeout(resolve, ms));
  931. }
  932.  
  933. function getLastText(Text) {
  934. let byteCheck = '', SearchCharPoint, TitleLastTmp
  935. let ArrayDB = Text.split(/\s/).filter(function(e){return e})//빈 배열값 제거
  936. let SeriesExp = new RegExp(Series + '.*')
  937. let ModelNameExp = new RegExp(/\((?!.*\().*\)/)
  938. let ModelName
  939.  
  940. //console.log(JapaneseChar.test([ArrayDB.length -1]) , ArrayDB[ArrayDB.length -1], ArrayDB[ArrayDB.length -2] + ' ' + ArrayDB[ArrayDB.length -1])
  941. if(ModelNameExp.test(Text)){
  942. console.log('Model Name: ', Text.match(ModelNameExp)[0])
  943. ModelName = Text.match(ModelNameExp) ? Text.match(ModelNameExp)[0] : ''
  944. Text = Text.replace(ModelNameExp, '').trim()
  945. console.log(Text)
  946. }
  947. if(Series && SeriesExp.test(Text)){
  948. console.log(Series, SeriesExp)
  949. //console.log(Text.match(SeriesExp))
  950. TitleLastTmp = Text.match(SeriesExp) ? Text.match(SeriesExp).pop() : ''
  951. }
  952. else if(/朝までハシゴ酒/.test(Text)){
  953. TitleLastTmp = Text.match(/朝までハシゴ酒.*/)[0]
  954. }
  955. else if(/\d+/.test(ArrayDB[ArrayDB.length -1])){
  956. console.log(ArrayDB[ArrayDB.length -1])
  957. if(/ファイル\d+/.test(ArrayDB[ArrayDB.length -1])){
  958. TitleLastTmp = ArrayDB[ArrayDB.length - 2] + ' ' + ArrayDB[ArrayDB.length - 1]
  959. console.log('1st Match:' , TitleLastTmp)
  960. }
  961. else if(JapaneseChar.test(ArrayDB[ArrayDB.length -1])){
  962. TitleLastTmp = ArrayDB[ArrayDB.length -1]
  963. console.log('2nd Match:' , TitleLastTmp)
  964. }
  965. else if(byteLengthOfCheck(ArrayDB[ArrayDB.length -1]) < 100) {
  966. TitleLastTmp = ArrayDB[ArrayDB.length - 2] + ' ' + ArrayDB[ArrayDB.length - 1]
  967. console.log('3th Match:' , TitleLastTmp)
  968. }
  969. }
  970. console.log('TitleLastTmp: ', TitleLastTmp, /\d+/.test(ArrayDB[ArrayDB.length -1]), byteLengthOfCheck(TitleLastTmp))
  971. if(typeof TitleLastTmp == 'undefined' || !TitleLastTmp || TitleLastTmp.length === 0 || TitleLastTmp === "" || !/[^\s]/.test(TitleLastTmp) || /^\s*$/.test(TitleLastTmp) || TitleLastTmp.replace(/\s/g,"") === ""){
  972. byteCheck = ''
  973. }
  974. else if(TitleLastTmp.match(/\d+/)){
  975. if(SearchChar(TitleLastTmp, '】')){
  976. SearchCharPoint = Text.lastIndexOf("【")
  977. TitleLastTmp = Text.substring(SearchCharPoint)
  978. console.log('TitleLastTmp: ', TitleLastTmp)
  979. }
  980. else if(SearchChar(TitleLastTmp, '、') && TitleLastTmp.length <= 10 ){
  981. SearchCharPoint = TitleLastTmp.lastIndexOf("、")
  982. TitleLastTmp = TitleLastTmp.substring(SearchCharPoint + 1)
  983. console.log('TitleLastTmp: ', TitleLastTmp)
  984. }
  985. byteCheck = TitleLastTmp
  986. console.log('byteCheck: ', byteCheck)
  987. let FlagPoint = getFlag(byteCheck)
  988. if (byteLengthOfCheck(byteCheck) >= 100){
  989. console.log('CheckFlag: ', byteCheck, byteLengthOfCheck(byteCheck))
  990. let byteCheckTmp = byteCheck.substring(FlagPoint[0])
  991. if(!JapaneseChar.test(byteCheckTmp)){
  992. byteCheckTmp = byteCheck.substring(FlagPoint[1])
  993. }
  994. if(byteLengthOfCheck(byteCheckTmp) > 250 - byteLengthOfCheck(ID)){
  995. byteCheckTmp = ''
  996. }
  997. byteCheck = byteCheckTmp
  998. }
  999. if(!/\d+|【.*】$/.test(byteCheck)){
  1000. byteCheck = ''
  1001. }
  1002. console.log('TitleLast: ' , byteCheck)
  1003. }
  1004. if(ModelName) {
  1005. byteCheck = byteCheck + ModelName
  1006. }
  1007. return byteCheck
  1008. }
  1009.  
  1010. async function CollectionCoverImage(CoverImage){
  1011. RootDomainDB = JSON.parse(await GM_getValue(RootDomain, '[]'))
  1012. if(CoverImage){
  1013. await UpdateDB(CoverImage, FilenameConvert(CopyTitle) + Resolution)
  1014. await GM_setValue(RootDomain, JSON.stringify(RootDomainDB))
  1015. }
  1016. GetState = RootDomainDB
  1017. document.querySelector('.State').textContent = ' ' + GetState.length
  1018. return CoverImage
  1019. }
  1020.  
  1021. async function CollectionLinks(DownloadArea){
  1022. RootDomainDB = JSON.parse(await GM_getValue(RootDomain, '[]'))
  1023. var CollectionATag = []
  1024. DownloadArea.forEach((LinkEntry) => {
  1025. LinkEntry.querySelectorAll('a').forEach((aEntry) => {
  1026. if(/\?site.+$/.test(aEntry.href)){
  1027. aEntry.setAttribute('href', aEntry.href.replace(/\?site.+$/, ''))
  1028. }
  1029. CollectionATag.push(aEntry)
  1030. })
  1031. })
  1032. //console.log('CollectionATag: ', CollectionATag )
  1033. CollectionATag = CollectionATag.filter(el => SkipClassNames.some(Skip => !el.classList.contains(Skip))) // SkipClass
  1034.  
  1035. CollectionATag = CollectionATag.filter(el => !SkipFilter.test(el.href)) // SkipFilter
  1036.  
  1037. CollectionATag = CollectionATag.filter(el => ![...el.children].some(e => e.matches('img'))) // LinkItemsChilren
  1038.  
  1039.  
  1040. if(/blogjav/.test(RootDomain)){
  1041. CollectionATag = CollectionATag.filter(el => !el.textContent.match(/\.(mp4|mkv)$/i)) // Skip mp4 mkv
  1042. }
  1043. else if(/javarchive/.test(RootDomain)){
  1044. let RemainCount = CollectionATag.filter(el => !el.textContent.match(/k2s\.cc|part\d\.rar/i)) // Skip k2s part
  1045. //console.log('RemainCount:', RemainCount?.length)
  1046. if(RemainCount?.length){
  1047. CollectionATag = CollectionATag.filter(el => !el.textContent.match(/k2s\.cc|part\d\.rar/i)) // Skip k2s part
  1048. }
  1049. else{
  1050. CollectionATag = CollectionATag.filter(el => !el.textContent.match(/k2s\.cc/i)) // Skip k2s
  1051. }
  1052. }
  1053. //console.log('CollectionATag: ', CollectionATag )
  1054. let SkipLink, SkipClass, LinkItemsChilren
  1055. for (let i = 0; i < CollectionATag.length; i++) {
  1056. Target = CollectionATag[i].href
  1057. if(/naughtyblog.org/.test(RootDomain)){
  1058. if(CollectionATag[i].textContent.match(/SD\.mp4/gi)){
  1059. continue
  1060. }
  1061. else if(!CopyTitle.match(/SITERIP|OnlyFans|Updates|Collection/)){
  1062. Resolution = CollectionATag[i].textContent.match(/[0-9]{3,4}p/) ? '.XXX.' + CollectionATag[i].textContent.match(/[0-9]{3,4}p/)[0] : ''
  1063. }
  1064. }
  1065. if(/blogjav.net/.test(RootDomain)){
  1066. if(Target.match(/\.mp4(\.html)?$/gi)){
  1067. continue
  1068. }
  1069. }
  1070. if(Target){
  1071. if(CopyTitle){
  1072. CopyTitle = FilenameConvert(CopyTitle)
  1073. //CopyLinks += Target + "#Title=" + encodeURI(CopyTitle) + Resolution + "\n"
  1074. UrlTitle = CopyTitle + Resolution
  1075. //console.log('RootDomainDB: ', RootDomainDB)
  1076. //await GM_setValue(Target, "#Title=" + encodeURI(CopyTitle) + Resolution)
  1077. }
  1078. CopyLinks += Target + "\n"
  1079.  
  1080. await UpdateDB(Target, UrlTitle)
  1081. }
  1082. }
  1083. await GM_setValue(RootDomain, JSON.stringify(RootDomainDB))
  1084. GetState = RootDomainDB
  1085. document.querySelector('.State').textContent = ' ' + GetState.length
  1086. console.log(CopyLinks)
  1087. if(CopyLinks?.length){
  1088. return CopyLinks.split("\n").filter((item, i, allItems) => { return i === allItems.indexOf(item)}).join("\n")
  1089. }
  1090. else return null
  1091. }
  1092.  
  1093.  
  1094. async function UpdateDB(Target, UrlTitle){
  1095. if(Target.match(K2SRegExp)){
  1096. Target = Target.match(K2SRegExp)[1] + Target.match(K2SRegExp)[2].slice(0, 18)
  1097. }
  1098. searchDB = RootDomainDB.find( ({ U }) => U === Target )
  1099. //console.log(RootDomainDB, searchDB)
  1100. if(searchDB){
  1101. searchDB.T = UrlTitle
  1102. }
  1103. else{
  1104. RootDomainDB.push({U : Target , T : UrlTitle})
  1105. }
  1106. //console.log(RootDomainDB)
  1107. return RootDomainDB
  1108. }
  1109.  
  1110.  
  1111. async function RemoveDB(listToDelete){
  1112. RootDomainDB = RootDomainDB.filter( item => (!listToDelete.includes(item.U)) );
  1113. await GM_setValue(RootDomain, JSON.stringify(RootDomainDB))
  1114. GetState = RootDomainDB
  1115. document.querySelector('.State').textContent = ' ' + GetState.length
  1116. }
  1117.  
  1118. async function CheckDB(listTo){
  1119. if(GetState.length > 0){
  1120. let Check = RootDomainDB.some( item => (listTo.includes(item.U)))
  1121. //console.log('CheckDB: ', RootDomainDB, listTo, Check)
  1122. if(Check){
  1123. document.querySelector('.Minus').style.visibility = "visible"
  1124. }
  1125. else{
  1126. document.querySelector('.Minus').style.visibility = "hidden"
  1127. }
  1128. }
  1129. }
  1130.  
  1131. async function CopyLink(){
  1132. var CopyNoticeData = ''
  1133. //console.log('CopyLinks: ', CopyLinks, TmpLinksDB, !CopyLinks?.length, !TmpLinksDB?.length)
  1134. if(!CopyLinks?.length && !TmpLinksDB?.length){
  1135. CopyNoticeData = FilenameConvert(CopyTitle) + "\n"
  1136. AllCopyLinks = await CollectionLinks(DownloadArea)
  1137. //console.log('AllCopyLinks: ', AllCopyLinks)
  1138. if(AllCopyLinks){
  1139. if(CoverImage){
  1140. AllCopyLinks += await CollectionCoverImage(CoverImage)
  1141. }
  1142. JDownloader(AllCopyLinks, FilenameConvert(CopyTitle) + Resolution)
  1143. //updateClipboard(AllCopyLinks)
  1144. CopyNoticeData += AllCopyLinks
  1145. document.querySelector('.CopyNotice').textContent = CopyNoticeData
  1146. }
  1147. else{
  1148. document.querySelector('.CopyNotice').textContent = 'Empty Links'
  1149. }
  1150. }
  1151. else if(TmpLinksDB?.length > 0){
  1152. //console.log('TmpLinksDB: ', TmpLinksDB)
  1153.  
  1154. for (let i = 0; i < TmpLinksDB.length; i++) {
  1155. UpdateDB(TmpLinksDB[i].U, TmpLinksDB[i].T)
  1156. CopyLinks += TmpLinksDB[i].U + '\n'
  1157. //await GM_setValue(TmpLinksDB[i].Key, TmpLinksDB[i].Value)
  1158. }
  1159. await GM_setValue(RootDomain, JSON.stringify(RootDomainDB))
  1160. GetState = RootDomainDB
  1161. //console.log(GetState)
  1162. document.querySelector('.State').textContent = ' ' + GetState.length
  1163. //console.log(TmpLinksDB)
  1164. JDownloaderDB(TmpLinksDB)
  1165. //console.log(JdownloaderData)
  1166.  
  1167. //updateClipboard(CopyLinks)
  1168. CopyNoticeData = CopyLinks
  1169. document.querySelector('.CopyNotice').textContent = CopyNoticeData
  1170. }
  1171. await CheckDB(listToDo(DownloadArea))
  1172. CopyLinks = []
  1173. AllCopyLinks = []
  1174. }
  1175.  
  1176.  
  1177. function listToDo(Area) {
  1178. let List = [], CheckList = []
  1179. let Target
  1180. try {
  1181. Area.forEach((LinkEntry) => {
  1182. LinkEntry.querySelectorAll('a').forEach((aEntry) => {
  1183. if(CheckList.indexOf(aEntry) === -1){
  1184. CheckList.push(aEntry)
  1185. }
  1186. })
  1187. })
  1188. for (let i = 0; i < CheckList.length; i++) {
  1189. let SkipLink = SkipFilter.test(CheckList[i].href)
  1190. let LinkItemsChilren = [...CheckList[i].children].filter(e => e.matches('img'))
  1191. if(SkipLink || LinkItemsChilren?.length){
  1192. continue
  1193. }
  1194. Target = CheckList[i].href.replace(/\?site.+/, '')
  1195. if(Target.match(K2SRegExp)){
  1196. Target = Target.match(K2SRegExp)[1] + Target.match(K2SRegExp)[2].slice(0, 18)
  1197. }
  1198. if(List.indexOf(Target) === -1){
  1199. List.push(Target)
  1200. }
  1201. }
  1202. if(CoverImage){
  1203. List.push(CoverImage)
  1204. }
  1205. return List
  1206. } catch (err){
  1207. console.log(err)
  1208. return List
  1209. }
  1210.  
  1211. }
  1212.  
  1213. async function MutilSubTitle(MatchWeb, MatchWebPoint, InfoAreaCast, DownloadArea) {
  1214. let AreadyAdd = [], CastName, CastNameDB = [], CastFirstTitle, CastLastTitle
  1215. for (let i = 0; i < InfoAreaCast.length; i++) {
  1216. let MatchPoint = InfoAreaCast[i].search(/\s?-\s/)
  1217. console.log('MatchPoint: ', MatchPoint)
  1218. console.log(MatchWeb, InfoAreaCast[i].substr(0, MatchPoint).replace(/\s/g, ''))
  1219. if(MatchPoint !== -1 && MatchWeb !== InfoAreaCast[i].substr(0, MatchPoint).replace(/\s/g, '')){
  1220. CastName = MatchPoint !== -1 ? InfoAreaCast[i].substr(0, MatchPoint).replace(/\s?(,|&|aka.*)\s?/gi, '&').replace(/\s{2}/g, ' ').trim().replace(/\s/g, '.') : ''
  1221. console.log('CastName: ' , CastName)
  1222. if(CastName.match(/&/)){
  1223. CastNameDB = CastName.split('&')
  1224. CastName = CastNameDB[0] + '(.+)\?' + CastNameDB.pop()
  1225. }
  1226. }
  1227. else{
  1228. CastName = ''
  1229. }
  1230. console.log('CastName: ' , CastName)
  1231. console.log(MatchPoint, InfoAreaCast[i].lastIndexOf(' - '))
  1232. CastFirstTitle = MatchPoint !== -1 ? InfoAreaCast[i].slice(MatchPoint + 1, InfoAreaCast[i].length).replace(/\s-\s.*/, '').split(' ') : []
  1233. CastFirstTitle = CastFirstTitle?.length > 0 ? CastFirstTitle.filter((entry) => isNaN(entry)) : []//숫자 및 단일글자 제거
  1234. CastFirstTitle = CastFirstTitle?.length > 0 ? CastFirstTitle.filter((entry) => entry.length > 1) : []//숫자 및 단일글자 제거
  1235. CastFirstTitle = CastFirstTitle?.length > 0 ? CastFirstTitle.shift().trim() : ''
  1236. CastLastTitle = MatchPoint !== -1 ? InfoAreaCast[i].slice(MatchPoint + 1, InfoAreaCast[i].length).replace(/\s-\s.*/, '').split(' ') : []
  1237. //CastLastTitle = MatchPoint !== -1 ? InfoAreaCast[i].slice(MatchPoint + 1, InfoAreaCast[i].lastIndexOf(' - ')).replace(/\s-\s.*/, '').split(' ') : []
  1238. CastLastTitle = CastLastTitle?.length > 0 ? CastLastTitle.filter((entry) => isNaN(entry)) : []//숫자 및 단일글자 제거
  1239. CastLastTitle = CastLastTitle?.length > 0 ? CastLastTitle.filter((entry) => entry.length > 1) : []//숫자 및 단일글자 제거
  1240. CastLastTitle = CastLastTitle?.length > 0 ? CastLastTitle.pop().trim() : ''
  1241. console.log('Cast First & Last Title: ', CastFirstTitle, CastLastTitle)
  1242. DownloadArea = document.querySelectorAll('div#download')
  1243. DownloadArea.forEach((LinkEntry) => {
  1244. let Links
  1245. if(CastName){
  1246. Links = MatchRegex(LinkEntry, new RegExp(CastName + '.*' + CastFirstTitle + '.*' + CastLastTitle, 'i'), 'href')
  1247. if(!Links?.length){
  1248. Links = MatchRegex(LinkEntry, new RegExp(CastName, 'i'), 'href')
  1249. if(!Links?.length){
  1250. console.log('Links Empty...')
  1251. return
  1252. }
  1253. }
  1254. }
  1255. else{
  1256. Links = MatchRegex(LinkEntry, new RegExp(CastFirstTitle + '.*' + CastLastTitle, 'i'), 'href')
  1257. if(!Links?.length){
  1258. Links = MatchRegex(LinkEntry, new RegExp(CastFirstTitle, 'i'), 'href')
  1259. if(!Links?.length){
  1260. console.log('Links Empty...')
  1261. return
  1262. }
  1263. }
  1264. }
  1265. Links = Links.filter( ( el ) => !AreadyAdd.includes( el )) //이미 추가된 링크 제외
  1266. // 링크가 6개 이상일때 짝수인덱스 값만 가져오기
  1267. if(Links?.length >= 6){
  1268. var filtered = Links.filter(function(element, index, array) {
  1269. return (index % 2 === 0);
  1270. });
  1271. Links = filtered
  1272. }
  1273. console.log('Links: ', Links)
  1274.  
  1275. for (let j = 0; j < Links.length; j++) {
  1276. let LinkText = Links[j].innerText.search(MatchWebRegExp) ? Links[j].innerText.substr(Links[j].innerText.search(MatchWebRegExp)) : Links[j].innerText
  1277. console.log('LinkText: ', LinkText)
  1278.  
  1279. let Released = LinkText.match(/(.+)(\.\d+\.\d+.\d+\.)(.+)/) ? LinkText.match(/(\.\d+\.\d+.\d+\.)/).pop()
  1280. : MatchWebPoint !== -1 && LinkText.match(new RegExp(MatchWeb + '\\.\\d{4}\\.')) ? LinkText.match(new RegExp(MatchWeb + '\(\\.\\d{4}\\.\)')).pop()
  1281. : ''
  1282. console.log('Released: ', Released)
  1283. let Episode = LinkText.match(/E\d{2,5}/i) ? '.' + LinkText.match(/E\d{2,5}/i) + '.' : ''
  1284. Resolution = LinkText.match(/[0-9]{3,4}p/) ? '.XXX.' + LinkText.match(/[0-9]{3,4}p/)[0] : ''
  1285. let CastTitle = InfoAreaCast[i].substr(MatchPoint + 3) && Episode ? '- ' + InfoAreaCast[i].substr(MatchPoint + 3).replace(/-\sE\d{2,5}/i, '').trim()
  1286. : InfoAreaCast[i].substr(MatchPoint + 3) && !Episode ? '- ' + InfoAreaCast[i].substr(MatchPoint + 3)
  1287. : ''
  1288. console.log('CastTitle: ', CastTitle)
  1289. let CastRegExp = LinkText.match(CastFirstTitle) && LinkText.match(CastLastTitle) ? new RegExp(MatchWeb + Episode + Released + CastName + '.*(' + CastFirstTitle + ')?(.*' + CastLastTitle + ')?', 'i') : ''
  1290. console.log('CastRegExp: ', CastRegExp)
  1291. let Cast = LinkText.match(CastRegExp)
  1292. console.log('Cast: ', Cast)
  1293. Title = CastRegExp && Cast && Cast.length > 1 && Episode ? MatchWeb + Episode + Released + Cast.pop().replace(/\./g, ' ') + CastTitle
  1294. : Episode || Released ? MatchWeb + Episode + Released + InfoAreaCast[i]
  1295. : MatchWeb + ' ' + Released + InfoAreaCast[i]
  1296. Title = Title.replace(/(S\d+):(E\d+)/i, '$1$2')
  1297. Title = FilenameConvert(Title)
  1298. //CopyLinks += Links[j].href + "\n"
  1299. let U = Links[j].href
  1300. let T = Title + Resolution
  1301. console.log(Title, Links[j])
  1302. TmpLinksDB.push({U, T})
  1303. AreadyAdd.push(Links[j])
  1304. }
  1305. if(CoverImage){
  1306. let U = CoverImage
  1307. let T = FilenameConvert(CopyTitle) + Resolution
  1308. TmpLinksDB.push({U, T})
  1309. }
  1310. })
  1311. }
  1312. }
  1313.  
  1314. async function ClearUrls(){
  1315. document.querySelector('.ClearButton').style = "color: White !important;";
  1316. //document.querySelector('.ClearButton').style.setProperty('font-size', Number(((1/(GetDPI/1.5))*(16/DefaultFontSize)).toFixed(2)) + 'rem', 'important');
  1317. await GM_deleteValue(RootDomain)
  1318. RootDomainDB = JSON.parse(await GM_getValue(RootDomain, '[]'))
  1319. GetState = RootDomainDB
  1320. //console.log(GetState)
  1321. if(document.querySelector('.Minus')){
  1322. document.querySelector('.Minus').style.visibility = "hidden"
  1323. }
  1324. document.querySelector('.State').textContent = ' ' + 0
  1325. }
  1326.  
  1327. async function ClipPaste(){
  1328. document.querySelector('.CopyButton').style = "color: White !important;";
  1329. //document.querySelector('.CopyButton').style.setProperty('font-size', Number(((1/(GetDPI/1.5))*(16/DefaultFontSize)).toFixed(2)) + 'rem', 'important');
  1330. var ClipPasteData = JSON.parse(await GM_getValue(RootDomain, '[]'))
  1331. JDownloaderDB(ClipPasteData)
  1332. //updateClipboard(ClipPasteData)
  1333. }
  1334.  
  1335.  
  1336. function MakeIcon(GetDPI) {
  1337. clearTimeout(MakeIconTimer)
  1338. if(CopyOffSetArea){
  1339. let ModArea = CopyOffSetArea
  1340. let OffSetArea
  1341. let IconSet = document.querySelector(".IconSet")
  1342. //console.log(ModArea, ModArea.nodeType)
  1343. if(/kbjme\.com/.test(RootDomain)){
  1344. OffSetArea = ModArea.closest('.article_container')
  1345. OffSetArea.style.setProperty('position', 'relative')
  1346. }
  1347. else if(/javarchive\.com/.test(RootDomain)){
  1348. OffSetArea = ModArea.closest('.category_news_phai_chinh').querySelector('.menudd')
  1349. OffSetArea.style.setProperty('position', 'relative')
  1350. }
  1351. else if(/pornchil\.com/.test(RootDomain)){
  1352. OffSetArea = ModArea.closest('.entry-content')
  1353. OffSetArea.style.setProperty('position', 'relative')
  1354. }
  1355. else if(/top-modelz\.org/.test(RootDomain)){
  1356. OffSetArea = ModArea
  1357. OffSetArea.parentElement.style.setProperty('position', 'relative')
  1358. }
  1359. else if(/pornrips\.cc/.test(RootDomain)){
  1360. OffSetArea = ModArea
  1361. OffSetArea.parentElement.style.setProperty('position', 'relative')
  1362. }
  1363. else{
  1364. OffSetArea = ModArea
  1365. OffSetArea.parentElement.style.setProperty('position', 'relative')
  1366. }
  1367. var GetViewProperty = window.document.defaultView.getComputedStyle(ModArea, null)
  1368. var GetPadding = GetViewProperty.getPropertyValue('padding') || 0
  1369. var verticalalign = GetViewProperty.getPropertyValue('vertical-align') || 'middle'
  1370. var lineheight = GetViewProperty.getPropertyValue('line-height') || '1rem'
  1371. var Top = GetViewProperty.getPropertyValue('top') || 'auto'
  1372. var DisPlay = GetViewProperty.getPropertyValue('display') || 'auto'
  1373. let IconHeight = parseFloat(window.getComputedStyle(IconSet).fontSize)
  1374. let FontHeight = parseFloat(window.getComputedStyle(OffSetArea).fontSize)
  1375. let OffSetAreaElementOffset = getRelativeOffset(OffSetArea)
  1376. let OffSetAreatNodeTextElementOffset = getNodeTextElementOffset(OffSetArea)
  1377. let IconSetElementOffset = getRelativeOffset(IconSet)
  1378. //console.log(OffSetArea.offsetParent, GetPadding)
  1379. if(/javfree|blogjav|javpink|wetholefans/.test(PageURL)){
  1380. $('.IconSet').css({
  1381. "top": OffSetAreaElementOffset.top - IconSetElementOffset.height ,
  1382. "left": OffSetAreaElementOffset.width - IconSetElementOffset.width/2
  1383. })
  1384. }
  1385. else if(/naughtyblog|pornrip\.cc/.test(PageURL)) {
  1386. $('.IconSet').css({
  1387. "top": OffSetAreaElementOffset.top,
  1388. "left": OffSetAreaElementOffset.width - IconSetElementOffset.width,
  1389. "padding": GetPadding,
  1390. })
  1391. }
  1392. else if(/pornrips\.cc/.test(PageURL)) {
  1393. let MetaView = getRelativeOffset(OffSetArea.parentElement.querySelector('.meta > .meta_views'))
  1394. $('.IconSet').css({
  1395. "top": MetaView.top - IconSetElementOffset.height,
  1396. "left": MetaView.left + IconSetElementOffset.width,
  1397. })
  1398. console.log(getRelativeOffset(MetaView))
  1399. }
  1400. else if(/javarchive/.test(PageURL)) {
  1401. $('.IconSet').css({
  1402. "top": OffSetAreaElementOffset.top + OffSetAreaElementOffset.height - IconSetElementOffset.height/2,
  1403. "left": OffSetAreaElementOffset.left + OffSetAreaElementOffset.width - IconSetElementOffset.width
  1404. })
  1405. }
  1406. else if(/kbjme\.com/.test(PageURL)) {
  1407. $('.IconSet').css({
  1408. "top": getElementOffset(IconSet).height*3/2,
  1409. "left": OffSetAreaElementOffset.right - OffSetAreaElementOffset.width + IconSetElementOffset.width
  1410. })
  1411. //})
  1412. }
  1413. else if(/maxjav\.com/.test(PageURL)) {
  1414. $('.IconSet').css({
  1415. "top": OffSetAreaElementOffset.top + IconSetElementOffset.height/2,
  1416. "left": OffSetAreaElementOffset.left + OffSetAreaElementOffset.width - IconSetElementOffset.width
  1417. })
  1418. }
  1419. else if(/0xxx\.ws\/articles\/\d+/.test(PageURL)) {
  1420. //console.log((getElementOffset(OffSetArea).top - getNodeTextElementOffset(OffSetArea).top)/2)
  1421. $('.IconSet').css({
  1422. "top": OffSetAreaElementOffset.top,
  1423. "right": IconHeight,
  1424. "padding": GetPadding,
  1425. })
  1426. }
  1427. else if(/top-modelz\.org/.test(PageURL)) {
  1428. //console.log((getElementOffset(OffSetArea).top - getNodeTextElementOffset(OffSetArea).top)/2)
  1429. $('.IconSet').css({
  1430. "top": OffSetAreaElementOffset.top,
  1431. "right": IconHeight
  1432. })
  1433. }
  1434. else if(/hpjav\.tv/.test(PageURL)) {
  1435. $('.IconSet').css({
  1436. "top": OffSetAreaElementOffset.top - Math.abs(FontHeight - IconHeight)/2,
  1437. "left": OffSetAreaElementOffset.width + IconHeight
  1438. })
  1439. }
  1440.  
  1441. else if(/8kcosplay\.com|fhdporn/.test(PageURL)){
  1442. $('.IconSet').css({
  1443. "top": OffSetAreaElementOffset.top - IconHeight,
  1444. "left": OffSetAreaElementOffset.width - IconSetElementOffset.width
  1445. })
  1446. }
  1447. else if(/av18plus\.com/.test(PageURL)){
  1448. $('.IconSet').css({
  1449. "top": OffSetAreaElementOffset.top - IconHeight,
  1450. "left": OffSetAreaElementOffset.width - IconSetElementOffset.width
  1451. })
  1452. }
  1453. else if(/pornchil\.com|asianscan/.test(PageURL)){
  1454. $('.IconSet').css({
  1455. "top": 0,
  1456. "left": OffSetAreaElementOffset.width - IconSetElementOffset.width
  1457. })
  1458. }
  1459. else {
  1460. $('.IconSet').css({
  1461. "top": OffSetAreaElementOffset.top,
  1462. "left": OffSetAreaElementOffset.width - IconSetElementOffset.width,
  1463. })
  1464. }
  1465. IconSet.style.visibility = "visible"
  1466. document.querySelector('.CopyIcon').style.visibility = "visible"
  1467. document.querySelector(".CloseIcon").style.visibility = "visible"
  1468. if(DownloadArea){
  1469. CheckDB(listToDo(DownloadArea))
  1470. }
  1471. //console.log(getElementOffset(OffSetArea), getNodeTextElementOffset(OffSetArea), getElementOffset(IconSet), getRelativeOffset(OffSetArea), getRelativeOffset(IconSet), FontHeight, IconHeight )
  1472. }
  1473. }
  1474.  
  1475.  
  1476. function JDownloader(JdownloaderData, PackageName){
  1477. //console.log(PackageName + '\n' + JdownloaderData)
  1478. if(JdownloaderData){
  1479. let data = new URLSearchParams();
  1480. data.append(`urls`, JdownloaderData);
  1481. data.append(`referer`, PageURL)
  1482. if(PackageName){
  1483. data.append(`package`, PackageName)
  1484. }
  1485. fetch('http://127.0.0.1:9666/flash/add', {
  1486. method: 'POST',
  1487. //mode: 'cors',
  1488. headers: {
  1489. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
  1490. },
  1491. body: data
  1492. })
  1493. }
  1494. }
  1495.  
  1496. function JDownloaderDB(LinksDB){
  1497. //console.log(LinksDB)
  1498. let uniqueTitle = [...new Set(LinksDB.map( x => x.T ))]
  1499. //console.log(uniqueTitle)
  1500. uniqueTitle.forEach(x => JDownloader(GetMatchLinks(x, LinksDB), x))
  1501. }
  1502.  
  1503. function GetMatchLinks(text, LinksDB){
  1504. try {
  1505. return LinksDB.filter(u => text.includes(u.T)).map(l => l.U).join('\n')
  1506. } catch(err) {
  1507. console.log(err, text, LinksDB)
  1508. }
  1509. }
  1510.  
  1511. function scrollToTop() {
  1512. window.scrollTo({ top: 0, behavior: 'auto' })
  1513. window.removeEventListener('scroll', scrollToTop)
  1514. }
  1515.  
  1516.  
  1517. function attrPromise(element, attributeName, attributeValue) {
  1518. return new Promise((resolve,reject) => {
  1519. const observerConfig = {attributes: true, childList: true, subtree: true,};
  1520. const observer = new MutationObserver((mutations) => {
  1521. mutations.forEach((mutation) => {
  1522. if (mutation.attributeName == attributeName && mutation.getAttribute(attributeName) == attributeValue ) {
  1523. observer.disconnect();
  1524. resolve(element);
  1525. }
  1526. });
  1527. });
  1528.  
  1529. observer.observe(element, observerConfig);
  1530. });
  1531. }