|
|
@@ -86,13 +86,16 @@ public class BgServiceImpl implements BgService {
|
|
|
private String ignoreFileTypeSuffix = "";
|
|
|
|
|
|
private Proxy proxy = null;
|
|
|
+ private Proxy proxy2 = null;
|
|
|
|
|
|
public void beforeProxy() {
|
|
|
if (null == proxy) {
|
|
|
if ("dev".equals(env)) {
|
|
|
proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 1080));
|
|
|
+ proxy2 = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 1080));
|
|
|
} else {
|
|
|
proxy = Proxy.NO_PROXY;
|
|
|
+ proxy2 = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 10808));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -551,7 +554,7 @@ public class BgServiceImpl implements BgService {
|
|
|
try {
|
|
|
Map<String, String> headerMap = new HashMap<>();
|
|
|
headerMap.put("referer", url);
|
|
|
- document = JsoupUtil.requestDocument(url, JsoupUtil.HTTP_GET, proxy, null, headerMap, null);
|
|
|
+ document = JsoupUtil.requestDocument(url, JsoupUtil.HTTP_GET, proxy2, null, headerMap, null);
|
|
|
|
|
|
videoInfo = new VideoInfo();
|
|
|
videoInfo.setIdentificationCode(identificationCode);
|
|
|
@@ -632,19 +635,19 @@ public class BgServiceImpl implements BgService {
|
|
|
if (StringUtils.isNotEmpty(videoInfoInfantry.getJavdbUrl())) {
|
|
|
Map<String, String> headerMap = new HashMap<>();
|
|
|
headerMap.put("referer", url);
|
|
|
- document = JsoupUtil.requestDocument(url, JsoupUtil.HTTP_GET, proxy, null, headerMap, null);
|
|
|
+ document = JsoupUtil.requestDocument(url, JsoupUtil.HTTP_GET, proxy2, null, headerMap, null);
|
|
|
} else {
|
|
|
String searchUrl = javdbConstantMap.get("javdb").concat("search?q=").concat(videoInfoInfantry.getIdentificationCode()).concat("&f=all");
|
|
|
Map<String, String> header3Map = new HashMap<>();
|
|
|
header3Map.put("referer", searchUrl);
|
|
|
|
|
|
- javdbSearchDocument = JsoupUtil.requestDocument(searchUrl, JsoupUtil.HTTP_GET, proxy, null, header3Map, null);
|
|
|
+ javdbSearchDocument = JsoupUtil.requestDocument(searchUrl, JsoupUtil.HTTP_GET, proxy2, null, header3Map, null);
|
|
|
|
|
|
itembSelects = javdbSearchDocument.select("div.movie-list").select("div.item");
|
|
|
if (itembSelects.size() == 0) {
|
|
|
String newName = videoInfoInfantry.getName();
|
|
|
searchUrl = javdbConstantMap.get("javdb").concat("search?q=").concat(newName).concat("&f=all");
|
|
|
- javdbSearchDocument = JsoupUtil.requestDocument(searchUrl, JsoupUtil.HTTP_GET, proxy, null, header3Map, null);
|
|
|
+ javdbSearchDocument = JsoupUtil.requestDocument(searchUrl, JsoupUtil.HTTP_GET, proxy2, null, header3Map, null);
|
|
|
itembSelects = javdbSearchDocument.select("div.movie-list").select("div.item");
|
|
|
}
|
|
|
|
|
|
@@ -674,7 +677,7 @@ public class BgServiceImpl implements BgService {
|
|
|
throw new BusinessException(30000, "javdb search result mismatch");
|
|
|
}
|
|
|
|
|
|
- document = JsoupUtil.requestDocument(codeUrl, JsoupUtil.HTTP_GET, proxy, null, header3Map, null);
|
|
|
+ document = JsoupUtil.requestDocument(codeUrl, JsoupUtil.HTTP_GET, proxy2, null, header3Map, null);
|
|
|
videoInfoInfantry.setJavdbUrl(codeUrl);
|
|
|
}
|
|
|
|
|
|
@@ -751,19 +754,19 @@ public class BgServiceImpl implements BgService {
|
|
|
if (StringUtils.isNotEmpty(videoInfoUncensored.getJavdbUrl())) {
|
|
|
Map<String, String> headerMap = new HashMap<>();
|
|
|
headerMap.put("referer", url);
|
|
|
- document = JsoupUtil.requestDocument(url, JsoupUtil.HTTP_GET, proxy, null, headerMap, null);
|
|
|
+ document = JsoupUtil.requestDocument(url, JsoupUtil.HTTP_GET, proxy2, null, headerMap, null);
|
|
|
} else {
|
|
|
String searchUrl = javdbConstantMap.get("javdb").concat("search?q=").concat(videoInfoUncensored.getIdentificationCode()).concat("&f=all");
|
|
|
Map<String, String> header3Map = new HashMap<>();
|
|
|
header3Map.put("referer", searchUrl);
|
|
|
|
|
|
- javdbSearchDocument = JsoupUtil.requestDocument(searchUrl, JsoupUtil.HTTP_GET, proxy, null, header3Map, null);
|
|
|
+ javdbSearchDocument = JsoupUtil.requestDocument(searchUrl, JsoupUtil.HTTP_GET, proxy2, null, header3Map, null);
|
|
|
|
|
|
itembSelects = javdbSearchDocument.select("div.movie-list").select("div.item");
|
|
|
if (itembSelects.size() == 0) {
|
|
|
String newName = videoInfoUncensored.getName();
|
|
|
searchUrl = javdbConstantMap.get("javdb").concat("search?q=").concat(newName).concat("&f=all");
|
|
|
- javdbSearchDocument = JsoupUtil.requestDocument(searchUrl, JsoupUtil.HTTP_GET, proxy, null, header3Map, null);
|
|
|
+ javdbSearchDocument = JsoupUtil.requestDocument(searchUrl, JsoupUtil.HTTP_GET, proxy2, null, header3Map, null);
|
|
|
itembSelects = javdbSearchDocument.select("div.movie-list").select("div.item");
|
|
|
|
|
|
ignoreCodeFlag = true;
|
|
|
@@ -798,7 +801,7 @@ public class BgServiceImpl implements BgService {
|
|
|
throw new BusinessException(30000, "javdb search result mismatch");
|
|
|
}
|
|
|
|
|
|
- document = JsoupUtil.requestDocument(codeUrl, JsoupUtil.HTTP_GET, proxy, null, header3Map, null);
|
|
|
+ document = JsoupUtil.requestDocument(codeUrl, JsoupUtil.HTTP_GET, proxy2, null, header3Map, null);
|
|
|
videoInfoUncensored.setJavdbUrl(codeUrl);
|
|
|
}
|
|
|
|
|
|
@@ -1504,7 +1507,7 @@ public class BgServiceImpl implements BgService {
|
|
|
Map<String, String> headerMap = new HashMap<>();
|
|
|
headerMap.put("referer", identificationCodeArr[1]);
|
|
|
beforeProxy();
|
|
|
- document = JsoupUtil.requestDocument(identificationCodeArr[1], JsoupUtil.HTTP_GET, proxy, null, headerMap, null);
|
|
|
+ document = JsoupUtil.requestDocument(identificationCodeArr[1], JsoupUtil.HTTP_GET, proxy2, null, headerMap, null);
|
|
|
picTime = parseDocument4Javdb(document, identificationCodeArr[0], machiPath, videoInfoPool);
|
|
|
}
|
|
|
|