JAVLib tag助手

鼠标悬停在javLibrary图片上时显示该视频类型。

La data de 22-11-2023. Vezi ultima versiune.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        JAVLib tag助手
// @namespace   JAVLib tag助手
// @description 鼠标悬停在javLibrary图片上时显示该视频类型。

// @include     http*://www.p26y.com/*
// @include     http*://www.k25m.com/*
// @include     http*://www.javlibrary.com/*
// @include     http*://www.k25m.com/*


// @version     1.11
// @run-at      document-end
// @grant       GM_xmlhttpRequest
// @grant       GM_setClipboard
// @grant       GM_setValue
// @grant       GM_getValue
// @grant       GM_addStyle
// @grant       GM_registerMenuCommand
// ==/UserScript==

"use strict";
let videos = document.querySelector(".videos");
let video = videos
function removeBeforeFirstSpace(str) {
    return str.split(' ').slice(1).join(' ');
}

var get_eng_title = function(url, data) {
    let en_url = (url.replace("/cn/", "/en/"))
    GM_xmlhttpRequest({
            method: "GET",
            url: en_url,
            responseType: "document",
            onload: function (result) {
                let video_page = result.response;
                data.title_en = removeBeforeFirstSpace(video_page.querySelector(".post-title.text").innerText)
                GM_xmlhttpRequest({
                    method: "POST",
                    url: "https://www.mingren.life/av/general",
                    responseType: "json",
                    headers: {
                        "Content-Type": "application/json" // Set the content type to application/json
                    },
                    data: JSON.stringify([data]),
                    onload: function (result) {
                        console.log(result.response)
                    },
                })

            },
            onerror: function (e) {
                console.error(e);
                throw "search error";
            }
        });
}

var get_tags = function(element, url, seen){
    GM_xmlhttpRequest({
            method: "GET",
            url: url,
            responseType: "document",
            onload: function (result) {
                let string = "";
                let video_page = result.response;
                let genres = Array.from(video_page.querySelector("#video_genres").getElementsByClassName("genre")).map(genre => {
                    return genre.innerText
                })
                let code = video_page.querySelector("#video_id .text").innerText
                let director = video_page.querySelector("#video_director .text").innerText
                let company = video_page.querySelector("#video_maker .text").innerText
                let actors = Array.from(video_page.querySelectorAll(".cast .star")).map(star => {
                    return star.innerText
                })
                let title_jp = removeBeforeFirstSpace(video_page.querySelector(".post-title.text").innerText)
                let release_date = video_page.querySelector("#video_date .text").innerText
                let poster = video_page.querySelector("#video_jacket_img").src
                if (! seen) {
                    get_eng_title(url, {url, genres, code, director, company, actors, title_jp, release_date, poster})
                }

                element.setAttribute("data-toggle", "tooltip")
                element.setAttribute("title", string)
                element.getElementsByTagName("img")[0].setAttribute("data-toggle", "tooltip")
                element.getElementsByTagName("img")[0].setAttribute("title", genres.toString())
            },
            onerror: function (e) {
                console.error(e);
                throw "search error";
            }
        });
    const title = $(element).find("a")[0].title
    const code = title.split(" ")[0]

}


const s = $(".video")
s.each((index, video) => {
    const code = ($(video).find("a")[0].title.split(" ")[0]).replace(/-/g, '');
    $.ajax({url: `https://www.mingren.life/av/${code}`, success: (result) => {
        var url = "http://www.javlibrary.com/cn" + video.getElementsByTagName("a")[0].getAttribute('href').slice(1,);
        get_tags(video, url, result);
        if (! result) {
        } else if (result.DownloadMovies.length > 0){
            if (result.DownloadMovies[0].subtitle){
                $(video).css("background-color", "pink")
            } else {
                $(video).css("background-color", "#c6eb34")
            }
        }
        
    }})
})