diff --git a/src/main/java/com/yutou/nas/Controllers/BTDownloadController.java b/src/main/java/com/yutou/nas/Controllers/BTDownloadController.java index 047825c..ff72a46 100644 --- a/src/main/java/com/yutou/nas/Controllers/BTDownloadController.java +++ b/src/main/java/com/yutou/nas/Controllers/BTDownloadController.java @@ -1,5 +1,6 @@ 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; @@ -25,9 +26,9 @@ public class BTDownloadController { } @ResponseBody @RequestMapping("/bt/done.do") - public String done(String id,String name){ - Log.i("BTDownloadController.done","id = " + id + ", name = " + name); - BTDownloadManager.done(id,name); + 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); return "ok"; } @ResponseBody diff --git a/src/main/java/com/yutou/nas/utils/BTDownloadManager.java b/src/main/java/com/yutou/nas/utils/BTDownloadManager.java index c77301f..20003e9 100644 --- a/src/main/java/com/yutou/nas/utils/BTDownloadManager.java +++ b/src/main/java/com/yutou/nas/utils/BTDownloadManager.java @@ -70,7 +70,7 @@ public class BTDownloadManager { public static boolean download(String title, String url) { try { - String exec = String.format("transmission-remote -n yutou:34864394 -w \"%sanim/%s\" -a \"%s\" --torrent-done-script \"/home/yutou/public/servier/btDone.sh\"" + String exec = String.format("qbittorrent-nox --save-path=\"%sanim/%s\" \"%s\"" , DownloadHomePath , title , url @@ -106,31 +106,12 @@ public class BTDownloadManager { return array.contains(key); } - public synchronized static void done(String id, String name) { - AppTools.exec("transmission-remote -n yutou:34864394 -t"+id+" -i | grep Location", new ObjectInterface() { - String remoteLocation; - String remoteName; - @Override - public void out(String data) { - super.out(data); - Log.i("BTDownloadManager.out.location","location= "+data); - remoteLocation=data.replace("Location:","").trim(); - AppTools.exec("transmission-remote -n yutou:34864394 -t"+id+" -i | grep Name:", new ObjectInterface() { - @Override - public void out(String data) { - super.out(data); - Log.i("BTDownloadManager.out.name","name = "+data); - remoteName =data.replace("Name:","").trim(); - grep(remoteLocation, remoteName); - } - },false,true); - } - },false,true); - + public synchronized static void done(String path,String filename,String hash1,String hash2,String tid) { + grep(path,filename); } private static void grep(String remoteLocation, String remoteName) { - if(remoteName.contains("265")){ + /* if(remoteName.contains("265")){ String newName=remoteName.replace("265","贰陸伍"); String exec="mv \"" + remoteLocation + File.separator + remoteName + "\" \"" + remoteLocation + File.separator + newName+"\""; Log.i("执行改名",exec); @@ -141,7 +122,7 @@ public class BTDownloadManager { Log.i("改名结果:",data); } }, false, true); - } + }*/ AppTools.exec("/home/yutou/public/servier/tinyMediaManager/tinyMediaManager tvshow -u --scrapeUnscraped", null, false, true); } }