diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/crawler/problem/HDUProblemStrategy.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/crawler/problem/HDUProblemStrategy.java index ddf80498..907557d0 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/crawler/problem/HDUProblemStrategy.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/crawler/problem/HDUProblemStrategy.java @@ -27,7 +27,7 @@ public class HDUProblemStrategy extends ProblemStrategy { @Override public RemoteProblemInfo getProblemInfo(String problemId, String author) throws Exception { // 验证题号是否符合规范 - Assert.isTrue(problemId.matches("[1-9]\\d*"),"HDU题号格式错误!"); + Assert.isTrue(problemId.matches("[1-9]\\d*"), "HDU题号格式错误!"); Problem info = new Problem(); String url = HOST + String.format(PROBLEM_URL, problemId); Connection connection = JsoupUtils.getConnectionFromUrl(url, null, null); @@ -37,7 +37,8 @@ public class HDUProblemStrategy extends ProblemStrategy { info.setTitle(ReUtil.get("color:#1A5CC8\">([\\s\\S]*?)", html, 1).trim()); info.setTimeLimit(Integer.parseInt(ReUtil.get("(\\d*) MS", html, 1))); info.setMemoryLimit(Integer.parseInt(ReUtil.get("/(\\d*) K", html, 1)) / 1024); - info.setDescription(ReUtil.get(">Problem Description
([\\s\\S]*?)
", html, 1).replaceAll("src=\"../../", "src=\"" + HOST + "/")); + info.setDescription(ReUtil.get(">Problem Description
([\\s\\S]*?)
", html, 1) + .replaceAll("src=\"", "src=\"" + HOST)); info.setInput(ReUtil.get(">Input
([\\s\\S]*?)
", html, 1)); info.setOutput(ReUtil.get(">Output
([\\s\\S]*?)
", html, 1)); StringBuilder sb = new StringBuilder(""); @@ -47,7 +48,7 @@ public class HDUProblemStrategy extends ProblemStrategy { info.setExamples(sb.toString()); info.setHint(ReUtil.get("Hint([\\s\\S]*?)<[^<>]*?panel_title[^<>]*?>", html, 1)); info.setIsRemote(true); - info.setSource(String.format("%s", problemId, JUDGE_NAME + "-" + problemId)); + info.setSource(String.format("%s", problemId, JUDGE_NAME + "-" + problemId)); info.setType(0) .setAuth(1) .setAuthor(author) diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/crawler/problem/POJProblemStrategy.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/crawler/problem/POJProblemStrategy.java index 0d8419b2..0b1e9c43 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/crawler/problem/POJProblemStrategy.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/crawler/problem/POJProblemStrategy.java @@ -34,7 +34,7 @@ public class POJProblemStrategy extends ProblemStrategy { info.setTimeLimit(Integer.parseInt(ReUtil.get("Time Limit: (\\d{3,})MS", html, 1))); info.setMemoryLimit(Integer.parseInt(ReUtil.get("Memory Limit: (\\d{2,})K", html, 1)) / 1024); info.setDescription(ReUtil.get("

Description

([\\s\\S]*?)

", html, 1) - .replaceAll("src=\"../../", "src=\"" + HOST + "/")); + .replaceAll("src=\"", "src=\"" + HOST + "/")); info.setInput(ReUtil.get("

Input

([\\s\\S]*?)

", html, 1)); info.setOutput(ReUtil.get("

Output

([\\s\\S]*?)

", html, 1));