Sleazy Fork is available in English.

Nyaa以图搜种

通过官方图床搜索下载地址

2021/06/14時点のページです。最新版はこちら。

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name         Nyaa以图搜种
// @description  通过官方图床搜索下载地址
// @version      1.41
// @author       psrx
// @namespace    https://github.com/psrx
// @run-at       document-start
// @match        https://hentai-covers.site/*
// @grant        GM_xmlhttpRequest
// @grant	     GM_addStyle
// ==/UserScript==

//考虑到不是每个用户都有屏蔽广告的扩展帮你们解决下广告和多余元素
GM_addStyle(
  '#explore_after_top_nsfw, #listing_before_pagination_nsfw, #listing_after_pagination_nsfw>.dmm_ranking, #listing_after_pagination_nsfw{display: none;}'
)

document.addEventListener('DOMContentLoaded', () => {
  function f(a, span, urltitle) {
    a.httping = GM_xmlhttpRequest({
      method: 'GET',
      url: `https://sukebei.nyaa.si/?f=0&c=0_0&q="${urltitle}"`,
      onload: (res) => {
        let cili = new DOMParser()
          .parseFromString(res.responseText, 'text/html')
          .querySelector(
            '.container>.table-responsive>table>tbody>tr>td:nth-child(3)>a:nth-child(2)'
          )
        if (!cili) {
          a.href = `https://e-hentai.org/?f_doujinshi=1&f_manga=1&f_artistcg=1&f_gamecg=1&f_western=1&f_non-h=1&f_imageset=1&f_cosplay=1&f_asianporn=1&f_misc=1&f_search="${urltitle}"&f_apply=Apply+Filter`
          a.target = '_blank'
          span.style.color = 'rgb(230, 247, 0)'
          a.style.color = 'rgb(230, 247, 0)'
          span.textContent = '没找到,去隔壁瞅瞅?'
          return
        }
        a.href = cili.href
        span.style.color = 'rgb(57, 241, 0)'
        a.style.color = 'rgb(57, 241, 0)'
        span.textContent = '搜索完毕,请点击标题下载'
      },
    })
    setTimeout(() => {
      if (span.textContent === '正在搜索...') {
        a.httping.abort()
        f(a, span, urltitle)
      }
    }, 5000)
  }

  const setuBox = document.querySelector(
    '.content-width>#content-listing-tabs>#tabbed-content-group>.visible>.pad-content-listing'
  )

  setuBox.addEventListener('mouseover', ({ target }) => {
    if (target.localName !== 'a' || target._ok) return
    target._ok = true
    let span = target.nextElementSibling
    span.textContent = '正在搜索...'
    f(target, span, encodeURIComponent(target.textContent))
  })

  // 更新后不让复制图片了...我有分享给好友的需求所以...
  setuBox.addEventListener(
    'contextmenu',
    (e) => {
      e.stopPropagation()
    },
    true
  )
})