tujidelv 3 年之前
父節點
當前提交
a0001cc509
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      src/main/java/top/lvzhiqiang/service/impl/BgServiceImpl.java

+ 5 - 5
src/main/java/top/lvzhiqiang/service/impl/BgServiceImpl.java

@@ -301,7 +301,7 @@ public class BgServiceImpl implements BgService {
 
             int retryCount = 0;
             while (retryCount <= 3) {
-                javbusUrl = javbusUrlList.get((int) (0 + Math.random() * (javbusUrlList.size() - 0)));
+                javbusUrl = javbusUrlList.get((int) (0 + Math.random() * (javbusUrlList.size())));
                 try {
                     document = Jsoup.connect(javbusUrl.concat("/").concat(identificationCode))
                             .timeout(50000)
@@ -375,7 +375,7 @@ public class BgServiceImpl implements BgService {
 
             int retryCount = 0;
             while (retryCount <= 3) {
-                javbusUrl = javbusUrlList.get((int) (0 + Math.random() * (javbusUrlList.size() - 0)));
+                javbusUrl = javbusUrlList.get((int) (0 + Math.random() * (javbusUrlList.size())));
                 try {
                     document = Jsoup.connect(javbusUrl.concat("/").concat(identificationCode))
                             .timeout(50000)
@@ -622,7 +622,7 @@ public class BgServiceImpl implements BgService {
 
             int retryCount = 0;
             while (retryCount <= 3) {
-                javbusUrl = javbusUrlList.get((int) (0 + Math.random() * (javbusUrlList.size() - 0)));
+                javbusUrl = javbusUrlList.get((int) (0 + Math.random() * (javbusUrlList.size())));
                 try {
                     document = Jsoup.connect(javbusUrl.concat("/").concat(identificationCode))
                             .timeout(50000)
@@ -630,7 +630,7 @@ public class BgServiceImpl implements BgService {
                             //.data()
                             .ignoreContentType(true)
                             .userAgent(getUserAgent())
-                            .header("referer", "https://www.javbus.com/".concat(identificationCode))
+                            .header("referer", javbusUrl.concat("/").concat(identificationCode))
                             .get();
 
                     videoInfoPool = new VideoInfoPool();
@@ -650,7 +650,7 @@ public class BgServiceImpl implements BgService {
                     ++retryCount;
 
                     if (retryCount < 4) {
-                        log.error("jsoupIcodePool error重试:i={},retryCount={},time={},identificationCode={}", i, retryCount, System.currentTimeMillis() - start, identificationCode, e);
+                        log.error("jsoupIcodePool error重试:i={},retryCount={},time={},identificationCode={},javbusUrl={}", i, retryCount, System.currentTimeMillis() - start, identificationCode, javbusUrl, e);
                     } else if (retryCount == 4) {
                         icodePool.setStatus(3);
                         icodePool.setRetryCount(retryCount - 1);