iQiyi Get Chapter Date V2

Fetches and displays the chapter dates for iqiyi manhua

  1. // ==UserScript==
  2. // @name iQiyi Get Chapter Date V2
  3. // @namespace https://gf.qytechs.cn/en/users/689482-quin15
  4. // @version 1.1.12
  5. // @description Fetches and displays the chapter dates for iqiyi manhua
  6. // @author Quin15
  7. // @match https://www.iqiyi.com/manhua/detai*
  8. // @icon https://www.google.com/s2/favicons?domain=iqiyi.com
  9. // @grant GM_xmlhttpRequest
  10. // @grant unsafeWindow
  11. // ==/UserScript==
  12.  
  13. GM_xmlhttpRequest ({
  14. method: 'GET',
  15. url: "https://www.iqiyi.com/manhua/catalog/" + location.pathname.split('detail_')[1].split('.')[0],
  16. onload: function(responseDetails) {
  17. unsafeWindow.episodeList = JSON.parse(responseDetails.responseText).data.episodes;
  18. var checkElems = function() {if (document.querySelector('.chapter-container ol li')) {unsafeWindow.injectDates()} else {setTimeout(checkElems, 100);}};
  19. checkElems();
  20. }
  21. });
  22.  
  23. unsafeWindow.injectDates = function() {
  24. var DOMEpisodeList = document.querySelectorAll('.chapter-fixhei li')
  25. for (var i = 0; i < DOMEpisodeList.length; i++) {
  26. var episodeNum = parseInt(DOMEpisodeList[i].querySelector('.itemcata-order').innerText);
  27. for (var e = 0; e < episodeList.length; e++) {
  28. if (episodeList[e].episodeOrder == episodeNum) {
  29. var episodeDate = (new Intl.DateTimeFormat('en-GB', {timeZone: "Asia/Hong_Kong"}).format(new Date(parseInt(episodeList[e].lastUpdateTime)))).split('/').reverse().join('-');
  30. if (!(DOMEpisodeList[i].querySelector('.DateElem'))) {
  31. var dateElem = document.createElement('div');
  32. dateElem.className = "DateElem";
  33. dateElem.style = "width: 100%; color: #888; font-size: 12px; margin-top: 20px; position:absolute;";
  34. dateElem.innerText = episodeDate;
  35. DOMEpisodeList[i].appendChild(dateElem)
  36. }
  37. };
  38. };
  39. };
  40. };
  41.  
  42. var comicTitle = document.querySelector('.detail-info .detail-tit h1').innerText;
  43.  
  44. var searchAP = document.createElement('div');
  45. searchAP.className = "btn-detail detail-read J_readFromStart";
  46. searchAP.style = "margin-left: 30px; position: absolute; cursor: pointer;"
  47. 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>`;
  48. document.querySelector('.detail-info').insertBefore(searchAP, document.querySelector('.detail-info').lastElementChild);
  49. searchAP.addEventListener("click", function() {open(encodeURI("https://www.anime-planet.com/manga/all?name=" + comicTitle), "")});
  50.  
  51. var coverImg = document.createElement('div');
  52. coverImg.className = "btn-detail detail-read J_readFromStart";
  53. coverImg.style = "margin-left: 260px; position: absolute; cursor: pointer;"
  54. 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>`;
  55. document.querySelector('.detail-info').insertBefore(coverImg, document.querySelector('.detail-info').lastElementChild);
  56. coverImg.addEventListener("click", function() {open(document.querySelector('.detail-cover img').src, "")});
  57.  
  58. document.querySelector('.catalogPageList.clearfix').addEventListener("click", function() {{setTimeout(injectDates, 50)}}, true);
  59. document.querySelector('.chapter-page-more').addEventListener("click", function() {{setTimeout(injectDates, 50)}}, true);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址