diff --git a/src/main/java/com/yutou/nas/Controllers/BTDownloadController.java b/src/main/java/com/yutou/nas/Controllers/BTDownloadController.java index 295da50..8a59ae4 100644 --- a/src/main/java/com/yutou/nas/Controllers/BTDownloadController.java +++ b/src/main/java/com/yutou/nas/Controllers/BTDownloadController.java @@ -2,10 +2,7 @@ package com.yutou.nas.Controllers; import com.alibaba.fastjson2.JSONObject; import com.yutou.nas.Services.IBangumiService; -import com.yutou.nas.utils.AnimRssManager; -import com.yutou.nas.utils.BTDownloadManager; -import com.yutou.nas.utils.DmhyRssDownloadManager; -import com.yutou.nas.utils.Log; +import com.yutou.nas.utils.*; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -15,6 +12,7 @@ import javax.servlet.http.HttpServletRequest; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.nio.charset.StandardCharsets; +import java.util.concurrent.TimeUnit; @Controller public class BTDownloadController { @@ -33,7 +31,17 @@ public class BTDownloadController { @RequestMapping("/bt/done.do") public String done(String path, String filename, String hash1, String hash2, String tid) { Log.i("BTDownloadController.done", "path = " + path + ", filename = " + filename + ", hash1 = " + hash1 + ", hash2 = " + hash2 + ", tid = " + tid); - BTDownloadManager.done(path, filename, hash1, hash2, tid); + //BTDownloadManager.done(path, filename, hash1, hash2, tid); + try { + String exec = ConfigTools.load(ConfigTools.CONFIG, "tiny.exec", String.class); + Process process = Runtime.getRuntime().exec(new String[]{"sh" + , "-c" + , exec}); + process.waitFor(120, TimeUnit.SECONDS); + } catch (Exception e) { + Log.e("下崽器", e); + } + return "ok"; }