iQiyi Get Chapter Date V2

Fetches and displays the chapter dates for iqiyi manhua

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         iQiyi Get Chapter Date V2
// @namespace    https://greasyfork.org/en/users/689482-quin15
// @version      1.1.12
// @description  Fetches and displays the chapter dates for iqiyi manhua
// @author       Quin15
// @match        https://www.iqiyi.com/manhua/detai*
// @icon         https://www.google.com/s2/favicons?domain=iqiyi.com
// @grant        GM_xmlhttpRequest
// @grant        unsafeWindow
// ==/UserScript==

GM_xmlhttpRequest ({
    method:     'GET',
    url:        "https://www.iqiyi.com/manhua/catalog/" + location.pathname.split('detail_')[1].split('.')[0],
    onload:     function(responseDetails) {
        unsafeWindow.episodeList = JSON.parse(responseDetails.responseText).data.episodes;
        var checkElems = function() {if (document.querySelector('.chapter-container ol li')) {unsafeWindow.injectDates()} else {setTimeout(checkElems, 100);}};
        checkElems();
    }
});

unsafeWindow.injectDates = function() {
    var DOMEpisodeList = document.querySelectorAll('.chapter-fixhei li')
    for (var i = 0; i < DOMEpisodeList.length; i++) {
        var episodeNum = parseInt(DOMEpisodeList[i].querySelector('.itemcata-order').innerText);
        for (var e = 0; e < episodeList.length; e++) {
            if (episodeList[e].episodeOrder == episodeNum) {
                var episodeDate = (new Intl.DateTimeFormat('en-GB', {timeZone: "Asia/Hong_Kong"}).format(new Date(parseInt(episodeList[e].lastUpdateTime)))).split('/').reverse().join('-');
                if (!(DOMEpisodeList[i].querySelector('.DateElem'))) {
                    var dateElem = document.createElement('div');
                    dateElem.className = "DateElem";
                    dateElem.style = "width: 100%; color: #888; font-size: 12px; margin-top: 20px; position:absolute;";
                    dateElem.innerText = episodeDate;
                    DOMEpisodeList[i].appendChild(dateElem)
                }
            };
        };
    };
};

var comicTitle = document.querySelector('.detail-info .detail-tit h1').innerText;

var searchAP = document.createElement('div');
searchAP.className = "btn-detail detail-read J_readFromStart";
searchAP.style = "margin-left: 30px; position: absolute; cursor: pointer;"
searchAP.innerHTML = `<img src="https://www.anime-planet.com/favicon.ico" style="float: left;height: 30px;top: 8px; position: relative; margin-left: 20px"><p style="font-size: 16px">Search on AP</p>`;
document.querySelector('.detail-info').insertBefore(searchAP, document.querySelector('.detail-info').lastElementChild);
searchAP.addEventListener("click", function() {open(encodeURI("https://www.anime-planet.com/manga/all?name=" + comicTitle), "")});

var coverImg = document.createElement('div');
coverImg.className = "btn-detail detail-read J_readFromStart";
coverImg.style = "margin-left: 260px; position: absolute; cursor: pointer;"
coverImg.innerHTML = `<img src="` + document.querySelector('.detail-cover img').src + `" style="float: left;height: 30px;top: 8px; position: relative; margin-left: 20px"><p style="font-size: 16px">Open Cover Image</p>`;
document.querySelector('.detail-info').insertBefore(coverImg, document.querySelector('.detail-info').lastElementChild);
coverImg.addEventListener("click", function() {open(document.querySelector('.detail-cover img').src, "")});

document.querySelector('.catalogPageList.clearfix').addEventListener("click", function() {{setTimeout(injectDates, 50)}}, true);
document.querySelector('.chapter-page-more').addEventListener("click", function() {{setTimeout(injectDates, 50)}}, true);