8Comic.com image list

Lists all images in a chapter/volume

当前为 2021-01-23 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name 8Comic.com image list
  3. // @description Lists all images in a chapter/volume
  4. // @name:zh-TW 8Comic 漫畫列表
  5. // @description:zh-TW 列出章節內所有圖片
  6. // @version 1.6.8
  7. // @include /^https?\:\/\/(.*?\.)?comicvip\.com\/show\//
  8. // @include /^https?\:\/\/(.*?\.)?comicbus\..*\//
  9. // @include /^https?\:\/\/(.*?\.)?nowcomic\.com\//
  10. // @include /^https?\:\/\/(.*?\.)?comicgood\.com\//
  11. // @include /^https?\:\/\/(.*?\.)?8899\.click\//
  12. // @include /^https?\:\/\/.*?\/online\/manga_\d*.html/
  13. // @author willy_sunny
  14. // @license GPL version 2 or any later version; http://www.gnu.org/licenses/gpl-2.0.txt
  15. // @namespace https://greasyfork.org/users/9968
  16. // ==/UserScript==
  17. //
  18. // ************************
  19. // Own Variable Declaration
  20. // ************************
  21. // imgList: the output result
  22. //
  23. // ***********************************
  24. // Site function/variable Declearation
  25. // many can be found in the nview.js
  26. // http://new.comicvip.com/js/nview.js
  27. // ***********************************
  28. //
  29. // ps: total page count, it's also auto stored when nview.js was done loading
  30. //
  31. var imgList = "";
  32. var encStr=document.getElementById('TheImg').src.split("_")[1].substr(0,3);
  33. console.log("ImgFileName=" + encStr);
  34. var theCode="";
  35. var ch=request("ch");var p=1;if(ch.indexOf("-")>0) {p=parseInt(ch.split('-')[1]);ch=ch.split('-')[0];}
  36.  
  37. // Bruteforcing Script tag
  38. var me = null;
  39. var scripts = document.getElementsByTagName("script")
  40. var re=new RegExp(".*\=\'.*\'\;"); // Define RegEx
  41. var cs=null;
  42. var varItem=null;
  43. for (var i=0;i<scripts.length;i++) {
  44. // console.log("i = " + i);
  45. // console.log(scripts[i]);
  46. if ("function request" == scripts[i].innerHTML.substring(1,17)) {
  47. var targetScript = scripts[i].innerHTML;
  48. var varList = targetScript.split('var ');
  49. for (var x=1;x<varList.length;x++) {
  50. if(varList[x].match(re)) {
  51. // console.log("x = " + x);
  52. // console.log(varList[x]);
  53. tmpItem = varList[x].split('=')[0];
  54. tmpStr = eval(tmpItem);
  55. //console.log(tmpItem + " = " + tmpStr.length);
  56. if(tmpStr.length > 50) {
  57. console.log("Using var " + tmpItem);
  58. varItem = tmpItem;
  59. }
  60. }
  61. }
  62. }
  63.  
  64. }
  65. cs = eval(varItem);
  66. console.log(cs);
  67.  
  68. function getStr(inputStr, i, c) {
  69. if(c==null) { c=40; }
  70. var tmpStr = inputStr.substring(i,i+c);
  71. return tmpStr;
  72. }
  73.  
  74. function bruteCode(inputStr) {
  75. //brute force code
  76. //for(var x=60;x>=0;x--){
  77. for(var x=0;x<=1000;x++){
  78. for(var varConst=0;varConst<=10;varConst++) {
  79. var testCode=lc(getStr(cs,x*ci+varConst));
  80. //console.log("Testing with: " + testCode);
  81. if (getStr(testCode,mm(p),3) == encStr) {
  82. console.log("We got at winner @ x = " + x + " & varConst = " + varConst);
  83. console.log("With string\n" + testCode);
  84. return testCode;
  85. }
  86. }
  87. }
  88. }
  89.  
  90. theCode = bruteCode(cs);
  91.  
  92. var imgRoot=document.getElementById('TheImg').src.substr(0,document.getElementById('TheImg').src.lastIndexOf("/")+1); // server root is always the same
  93. console.log("imgRoot = " + imgRoot);
  94. for (var p = 1; p <= ps; p++) {
  95. var picUrl = imgRoot + nn(p) + '_' + getStr(theCode,mm(p),3) + '.jpg';
  96. imgList = imgList + '<a href="'+picUrl+'"><img src="'+picUrl+'"></a><br>';
  97. }
  98.  
  99. imgList += '<a href="#" onClick="jv(ni)">Next >>'; // this enables the user to click the next chapter link on the bottom to follow to the next chapter
  100. document.write("<center>"+imgList+"</center>"); // outputs the list