tujidelv 3 vuotta sitten
vanhempi
commit
80c36c4454

+ 10 - 2
src/main/java/top/lvzhiqiang/service/impl/Crawler4LoveFootServiceImpl.java

@@ -27,6 +27,7 @@ import javax.annotation.Resource;
 import java.io.*;
 import java.net.InetSocketAddress;
 import java.net.Proxy;
+import java.net.URLDecoder;
 import java.nio.charset.StandardCharsets;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
@@ -594,6 +595,8 @@ public class Crawler4LoveFootServiceImpl implements Crawler4LoveFootService {
                 Thread.sleep(1000L);
                 String sourceUrl = sourceSelect.select("a.av_itemLink").attr("abs:href");
 
+                sourceUrl = URLDecoder.decode(sourceUrl, "UTF-8");
+
                 Integer statusInt = 2;
                 Integer typeInt = 1;
                 LocalDate clockDate = null;
@@ -856,7 +859,7 @@ public class Crawler4LoveFootServiceImpl implements Crawler4LoveFootService {
         long start = System.currentTimeMillis();
         Connection.Response response = Jsoup.connect(href).method(Connection.Method.GET).ignoreContentType(true).timeout(50 * 1000).execute();
 
-        String fileName = issueDate.concat(" ").concat(h3).replace("/", "_");
+        String fileName = issueDate.concat(" ").concat(h3).replace("/", "_").replace("[email protected]", "");
         byte[] imgUrlBytes = fileName.getBytes(StandardCharsets.UTF_8);
         if (imgUrlBytes.length > 251) {
             byte[] imgUrlDestBytes = new byte[251];
@@ -897,12 +900,17 @@ public class Crawler4LoveFootServiceImpl implements Crawler4LoveFootService {
         bufferedInputStream.close();
     }
 
-    public static void main(String[] args) {
+    public static void main(String[] args) throws UnsupportedEncodingException {
         String s = "リア充反対!彼女の目の前で彼氏を拘束、●す鬼畜痴女";
         String newName = s.substring(s.length() / 2);
 
         newName = newName.substring(newName.length() / 2);
         System.out.println(newName);
+
+        String s1 = "https://jp-foot.net/av/%e8%bb%9f%e4%bd%93%e5%a5%b3%e5%ad%90%e5%a4%a7%e7%94%9f%e9%bb%92%e5%b7%9d%e3%81%99%e3%81%bf%e3%82%8c%ef%bc%88%e7%a8%b2%e5%b7%9d%e3%81%aa%e3%81%a4%e3%82%81%ef%bc%89%e3%81%ae%e3%82%aa%e3%83%8a%e3%83%8b/";
+        System.out.println(s1.length());
+        String decode = URLDecoder.decode(s1, "UTF-8");
+        System.out.println(decode);
     }
 }
 

+ 1 - 1
src/main/resources/static/js/my-video.js

@@ -166,7 +166,7 @@ function search(pageNo, startFlag, searchSelectFlag) {
                         "           <span class=\"pic-text text-right\" title='" + (videoInfo.comment === '' ? '暂无评论' : videoInfo.comment) + "'>" + scoreStr + "</span>" +
                         "       </a>" +
                         "       <div class=\"myui-vodlist__detail\">" +
-                        "           <h4 class=\"videodetail title text-overflow\" identificationCode='" + videoInfo.identificationCode + "' orginUrl='" + videoInfo.orginUrl + "'><a title=\" " + videoInfo.name + " \">" + videoInfo.name + "</a></h4>" +
+                        "           <h4 class=\"videodetail title text-overflow\" identificationCode='" + videoInfo.identificationCode + "' orginUrl='" + orginUrl + "'><a title=\" " + videoInfo.name + " \">" + videoInfo.name + "</a></h4>" +
                         "           <p class=\"text text-overflow text-muted hidden-xs\" title='" + videoInfo.mainWho + "'>直属:" + videoInfo.mainWho + "</p>" +
                         "       </div>" +
                         "   </div>" +