Link Copy

링크 복사

2022-09-18 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

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