sehuatang

直接把帖子列表转成图片浏览,点击图片可以进入帖子.

Od 16.03.2024.. Pogledajte najnovija verzija.

  1. // ==UserScript==
  2. // @name sehuatang
  3. // @description 直接把帖子列表转成图片浏览,点击图片可以进入帖子.
  4. // @version 1.1.0
  5. // @author armyant
  6. // @namespace https://sleazyfork.org/zh-CN/scripts/489232-sehuatang
  7. // @include https://www.sehuatang.net/forum-*
  8. // @include *://*.sehuatang.org/*
  9. // @include *://*.sehuatang.net/*
  10. // @include *://*.5aylp.com/*
  11. // @include *://*.jq2t4.com/*
  12. // @include *://*.www.0krgb.com/*
  13. // @include *://*.1qyqs.app/*
  14. // @include *://*.ds5hk.app/*
  15. // @match *://*.sehuatang.net/*
  16. // @match *://*.sehuatang.org/*
  17. // @match *://*.sehuatang.*/*
  18. // @match *://*.jq2t4.com/*
  19. // @match *://*.0krgb.com/*
  20. // @match *://*.xxjsnc.co/*
  21. // @match *://*.o4vag.com/*
  22. // @match *://*.weterytrtrr.*/*
  23. // @match *://*.qweqwtret.*/*
  24. // @match *://*.retreytryuyt.*/*
  25. // @match *://*.qwerwrrt.*/*
  26. // @match *://*.ds5hk.app/*
  27. // @match *://*.30fjp.com/*
  28. // @match *://*.18stm.cn/*
  29. // @match *://*.xo6c5.com/*
  30. // @match *://*.mzjvl.com/*
  31. // @match *://*.9xr2.app/*
  32. // @match *://*.kzs1w.com/*
  33. // @match *://*.nwurc.com/*
  34. // @match *://*.zbkz6.app/*
  35. // @match *://*.ql75t.cn/*
  36. // @match *://*.0uzb0.app/*
  37. // @match *://*.d2wpb.com/*
  38. // @match *://*.5aylp.com/*
  39. // @match *://*.8otvk.app/*
  40. // @include https://www.sehuatang.net/forum.php?mod=forumdisplay&fid=103&page=*
  41. // @require https://code.jquery.com/jquery-3.4.1.min.js
  42. // @grant GM_xmlhttpRequest
  43. // @license GNU GPLv3
  44. // ==/UserScript==
  45. $(document).ready(function () {
  46. $("tbody[id*='normalthread']").each(function () {
  47. // 获取当前域名 https://www.sehuatang.net/forum-95-9.html www.sehuatang.net
  48. // let urls = "https://www.sehuatang.net/";
  49. let urls = `https://${document.domain}/`;
  50. // 获取详情页地址
  51. urls += $(this).find(".icn a").attr("href");
  52. // 删除所有子元素
  53. // $(this).children().remove()
  54. $(this).find(".tps").remove()
  55. // 标记当前节点
  56. let icn_td = $(this);
  57. console.log(urls);
  58. let href = document.location.href;
  59.  
  60. GM_xmlhttpRequest({
  61. method: "GET",
  62. url: urls,
  63. headers: {
  64. "User-agent": window.navigator.userAgent,
  65. Accept:
  66. "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
  67. cookie: document.cookie,
  68. referer: href,
  69. },
  70. onerror: function (e) {
  71. console.log(e);
  72. },
  73. onload: function (result) {
  74. let doc = result.responseText;
  75. // console.log(doc);
  76.  
  77. // 获取标题
  78. let title = $(doc).find("#thread_subject").html();
  79. // console.log(title);
  80.  
  81. let temp_imges = [];
  82. // 获取所有的图片
  83. $.each($(doc).find(".zoom"), function (index, value) {
  84. let temp_image_url = $(value).attr("file");
  85. if (temp_image_url == undefined || temp_image_url.toString().indexOf("static") > -1) {
  86. // return 实现continue功能
  87. // return false 实现break功能
  88. return;
  89. }
  90. temp_imges.push(temp_image_url);
  91. });
  92. // console.log(temp_imges)
  93.  
  94. // 获取ed2k
  95. let magnet = [];
  96. $.each($(doc).find(".blockcode li"), function (index, value) {
  97. let temp_magnet = $(value).text();
  98. magnet.push(temp_magnet)
  99. });
  100. // console.log(magnet);
  101.  
  102. // 获取附件
  103. let temp_tattl_str = "";
  104. $.each($(doc).find(".pattl .tattl dd"), function (index, value) {
  105. let temp_file_name = $($(value).find("a")[0]).html();
  106. if ((temp_file_name.toString().indexOf("zip") == -1) &&
  107. (temp_file_name.toString().indexOf("rar") == -1) &&
  108. (temp_file_name.toString().indexOf("torrent") == -1)) {
  109. return;
  110. }
  111. temp_tattl_str += `
  112. <div style="background:url(static/image/filetype/rar.gif) no-repeat left center;display: inline-block;margin-left: 10px;" border="0" class="vm" alt="">
  113. <div style="font-size:14px;padding-left:40px;}"><a href='${$($(value).find("a")[0]).attr("href")}' id="aid8294944" target="_blank" initialized="true">${temp_file_name}</a></div>
  114. <div style="font-size:12px;padding-left:40px;color: royalblue">${$($(value).find("p:nth-child(4)")[0]).html()}</div>
  115. </div>
  116. `
  117. });
  118.  
  119. // 附件的另一种方式
  120. let temp_attach_str = "";
  121. $.each($(doc).find("span[id*='attach']"), function (index, value) {
  122. let temp_file_name = $($(value).find("a")[0]).html();
  123. if ((temp_file_name.toString().indexOf("zip") == -1) &&
  124. (temp_file_name.toString().indexOf("rar") == -1) &&
  125. (temp_file_name.toString().indexOf("txt") == -1) &&
  126. (temp_file_name.toString().indexOf("torrent") == -1)) {
  127. return;
  128. }
  129. temp_tattl_str += `
  130. <div style="background:url(static/image/filetype/rar.gif) no-repeat left center;display: inline-block;margin-left: 10px;" border="0" class="vm" alt="">
  131. <div style="font-size:14px;padding-left:40px;}"><a href='${$($(value).find("a")[0]).attr("href")}' id="aid8294944" target="_blank" initialized="true">${temp_file_name}</a></div>
  132. <div style="font-size:12px;padding-left:40px;color: royalblue">${$($(value).find("em")[0]).html()}</div>
  133. </div>
  134. `
  135. });
  136.  
  137. let temp_html = "";
  138. temp_html += `<tr><td width="100%" colspan="5">`
  139. for (let i = 0; i < temp_imges.length; i++) {
  140. if (i >= 8) {
  141. break;
  142. }
  143. temp_html += `<img src="${temp_imges[i]}" height="150" style="margin: 2px;"/>`
  144. }
  145. temp_html += `</td></tr>`
  146.  
  147. if (magnet.length > 0) {
  148. temp_html += `<tr><td width="100%" colspan="5"`
  149. // 如果没有附件
  150. if (temp_tattl_str.length == 0 || temp_attach_str.length == 0) {
  151. temp_html += `style="border-bottom: blueviolet 4px solid"`;
  152. }
  153. temp_html += `>`
  154. temp_html += `
  155. <div class="blockcode" style="padding: 5px 0 5px 20px;border: 1px solid #CCC;background: #F7F7F7 url(/static/image/common/codebg.gif) repeat-y 0 0;overflow: hidden;">
  156. <div id="code_BN2" style="padding-left: 20px">
  157. <ol>`;
  158. for (const temp_magnet of magnet) {
  159. temp_html += `<li style="list-style-type:decimal-leading-zero;font-family:Monaco,Consolas,'Lucida Console','Courier New',serif;font-size:12px;line-height:1.8em">
  160. <div style="padding-left: 20px">${temp_magnet}</div>
  161. </li>`
  162. }
  163. temp_html += `</ol></div><div style="padding-left: 40px"><em onclick="let temp_magnet_str_01='${magnet.toString().replace(/(\n|\r|\r\n|↵)/g, '')}';setCopy(temp_magnet_str_01.replace(/(,)/g, '\\r\\n'), '复制成功');return false;">复制代码</em></div></div>`
  164. temp_html += `</td></tr>`
  165. }
  166. // temp_html += `<script type="application/javascript">code_BN2_1=magnet;</script>`;
  167. // temp_html += `<tr><td colspan="5" style="background: blue"></td></tr>`;
  168.  
  169. if (temp_tattl_str.length > 0 || temp_attach_str.length > 0) {
  170. temp_html += `<tr><td width="100%" colspan="5" style="border-bottom: blueviolet 4px solid">`
  171. if (temp_tattl_str.length > 0) {
  172. temp_html += temp_tattl_str;
  173. }
  174.  
  175. if (temp_attach_str.length > 0) {
  176. temp_html += temp_attach_str;
  177. }
  178. temp_html += `</td></tr>`;
  179. }
  180.  
  181. if (temp_tattl_str.length == 0 && temp_attach_str.length == 0 && magnet.length == 0) {
  182. temp_html += `<tr><td width="100%" colspan="5" style="border-bottom: blueviolet 4px solid">`
  183. temp_html += `</td></tr>`;
  184. }
  185.  
  186. $(icn_td).append(temp_html);
  187. },
  188. });
  189. });
  190. });