调整BT下载
This commit is contained in:
parent
25bee81d05
commit
a366e15765
@ -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";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user