fix:修复动漫花园订阅地址非https的问题
update:手动rss下载,同时跳过下一次自动订阅下载
This commit is contained in:
@@ -11,6 +11,22 @@ import java.util.concurrent.TimeUnit;
|
||||
public class BTDownloadManager {
|
||||
protected static final String DownloadHomePath = "/media/yutou/disk_lvm/public/download/";
|
||||
|
||||
public synchronized static boolean skipDownload(String title, JSONObject json){
|
||||
if ("ok".equals(json.getString("status"))) {
|
||||
JSONArray items = json.getJSONArray("items");
|
||||
for (Object _item : items) {
|
||||
JSONObject item = (JSONObject) _item;
|
||||
if (!isDownload(title, item.getString("title"))) {
|
||||
JSONArray array = getDownload(title);
|
||||
array.add(item.getString("title"));
|
||||
RedisTools.set(title, array.toJSONString());
|
||||
Log.i("跳过下载",title);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public synchronized static void download(String title, JSONObject json) {
|
||||
if ("ok".equals(json.getString("status"))) {
|
||||
JSONArray items = json.getJSONArray("items");
|
||||
@@ -52,7 +68,7 @@ public class BTDownloadManager {
|
||||
//RedisTools.set(item.getString("title"),url);
|
||||
}
|
||||
|
||||
private static boolean download(String title, String url) {
|
||||
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\""
|
||||
, DownloadHomePath
|
||||
@@ -71,7 +87,7 @@ public class BTDownloadManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static JSONArray getDownload(String title) {
|
||||
private static JSONArray getDownload(String title) {
|
||||
String _title = RedisTools.get(title);
|
||||
if (StringUtils.isEmpty(_title)) {
|
||||
return new JSONArray();
|
||||
@@ -114,7 +130,6 @@ public class BTDownloadManager {
|
||||
}
|
||||
|
||||
private static void grep(String remoteLocation, String remoteName) {
|
||||
System.out.println("remoteName = " + remoteName.contains("265"));
|
||||
if(remoteName.contains("265")){
|
||||
String newName=remoteName.replace("265","贰陸伍");
|
||||
String exec="mv \"" + remoteLocation + File.separator + remoteName + "\" \"" + remoteLocation + File.separator + newName+"\"";
|
||||
|
||||
Reference in New Issue
Block a user