From 584779cc130d8c10b4e03674b6c1efae7112cf0e Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Mon, 18 Jul 2022 12:48:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=8A=A8=E6=BC=AB?= =?UTF-8?q?=E8=8A=B1=E5=9B=AD=E8=AE=A2=E9=98=85=E5=9C=B0=E5=9D=80=E9=9D=9E?= =?UTF-8?q?https=E7=9A=84=E9=97=AE=E9=A2=98=20update=EF=BC=9A=E6=89=8B?= =?UTF-8?q?=E5=8A=A8rss=E4=B8=8B=E8=BD=BD=EF=BC=8C=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E8=B7=B3=E8=BF=87=E4=B8=8B=E4=B8=80=E6=AC=A1=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nas/Controllers/BTDownloadController.java | 12 +++++++++++ .../yutou/nas/Services/IBangumiService.java | 2 ++ .../nas/Services/impl/BangumiServiceImpl.java | 15 +++++++++++++ .../yutou/nas/utils/BTDownloadManager.java | 21 ++++++++++++++++--- .../nas/utils/DmhyRssDownloadManager.java | 20 ++++++++++-------- 5 files changed, 58 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/yutou/nas/Controllers/BTDownloadController.java b/src/main/java/com/yutou/nas/Controllers/BTDownloadController.java index 070c09f..047825c 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.yutou.nas.Services.IBangumiService; import com.yutou.nas.utils.AnimRssManager; import com.yutou.nas.utils.BTDownloadManager; import com.yutou.nas.utils.DmhyRssDownloadManager; @@ -8,8 +9,12 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; + @Controller public class BTDownloadController { + @Resource + IBangumiService bangumiService; @ResponseBody @RequestMapping("/bt/down.do") @@ -25,4 +30,11 @@ public class BTDownloadController { BTDownloadManager.done(id,name); return "ok"; } + @ResponseBody + @RequestMapping("/bt/download.do") + public String download(int id,boolean isDownloadNext,String url){ + Log.i("跳过下载","手动下载 id = " + id + ", isDownloadNext = " + isDownloadNext + ", url = " + url); + bangumiService.download(id,isDownloadNext,url); + return "1"; + } } diff --git a/src/main/java/com/yutou/nas/Services/IBangumiService.java b/src/main/java/com/yutou/nas/Services/IBangumiService.java index c475b66..9370048 100644 --- a/src/main/java/com/yutou/nas/Services/IBangumiService.java +++ b/src/main/java/com/yutou/nas/Services/IBangumiService.java @@ -6,4 +6,6 @@ import java.util.List; public interface IBangumiService { List getAllBangumi(); + + void download(int id,boolean isDownloadNext, String url); } diff --git a/src/main/java/com/yutou/nas/Services/impl/BangumiServiceImpl.java b/src/main/java/com/yutou/nas/Services/impl/BangumiServiceImpl.java index 40b3a76..1c0a013 100644 --- a/src/main/java/com/yutou/nas/Services/impl/BangumiServiceImpl.java +++ b/src/main/java/com/yutou/nas/Services/impl/BangumiServiceImpl.java @@ -4,6 +4,9 @@ import com.yutou.nas.Services.IBangumiService; import com.yutou.nas.mybatis.dao.BangumiItemDao; import com.yutou.nas.mybatis.model.BangumiItem; import com.yutou.nas.mybatis.model.BangumiItemExample; +import com.yutou.nas.utils.BTDownloadManager; +import com.yutou.nas.utils.Log; +import com.yutou.nas.utils.RedisTools; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -19,4 +22,16 @@ public class BangumiServiceImpl implements IBangumiService { example.createCriteria().andEnableEqualTo(1); return itemDao.selectByExample(example); } + + @Override + public void download(int id,boolean isDownloadNext, String url) { + BangumiItem item = itemDao.selectByPrimaryKey(id); + if(item!=null){ + BTDownloadManager.download(item.getTitle(),url); + if(!isDownloadNext){ + Log.i("跳过下载","确定跳过:"+item.getTitle()+"的下载,id = "+item.getId()); + RedisTools.set(item.getId()+"","next"); + } + } + } } diff --git a/src/main/java/com/yutou/nas/utils/BTDownloadManager.java b/src/main/java/com/yutou/nas/utils/BTDownloadManager.java index b830f4a..c77301f 100644 --- a/src/main/java/com/yutou/nas/utils/BTDownloadManager.java +++ b/src/main/java/com/yutou/nas/utils/BTDownloadManager.java @@ -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+"\""; diff --git a/src/main/java/com/yutou/nas/utils/DmhyRssDownloadManager.java b/src/main/java/com/yutou/nas/utils/DmhyRssDownloadManager.java index 1bb8039..1849fc5 100644 --- a/src/main/java/com/yutou/nas/utils/DmhyRssDownloadManager.java +++ b/src/main/java/com/yutou/nas/utils/DmhyRssDownloadManager.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.concurrent.TimeUnit; public class DmhyRssDownloadManager implements ApplicationContextAware { - private static String tmpJson = "{\"status\":\"ok\",\"feed\":{\"url\":\"http://share.dmhy.org/topics/rss/page/1/rss.xml?keyword=无职转生&order=date-desc&sort_id=2&team_id=604\",\"title\":\"c.c动漫-動畫-動漫花園資源網\",\"link\":\"http://share.dmhy.org/\",\"author\":\"\",\"description\":\"動漫花園資訊網是一個動漫愛好者交流的平台,提供最及時,最全面的動畫,漫畫,動漫音樂,動漫下載,BT,ED,動漫遊戲,資訊,分享,交流,讨论.\",\"image\":\"\"},\"items\":[{\"title\":\"\u200B[c.c動漫][1月新番][無職轉生~到了異世界就拿出真本事~][11][BIG5][1080P][MP4]\",\"pubDate\":\"2021-03-25 07:11:12\",\"link\":\"http://share.dmhy.org/topics/view/563676_c_c_1_11_BIG5_1080P_MP4.html\",\"guid\":\"http://share.dmhy.org/topics/view/563676_c_c_1_11_BIG5_1080P_MP4.html\",\"author\":\"lleeopen\",\"thumbnail\":\"https://img.vim-cn.com/43/a8c19df5571ea68c64ed4945cc0187bd82e2f1.jpg\",\"description\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n

\\n\",\"content\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n

\\n\",\"enclosure\":{\"link\":\"magnet:?xt=urn:btih:LVYN5MDZTBFRNNSPYYXKOKJA5PNGB4FD&dn=&tr=http://104.238.198.186:8000/announce&tr=udp://104.238.198.186:8000/announce&tr=http://tracker.openbittorrent.com:80/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=http://tracker4.itzmx.com:2710/announce&tr=http://tracker.publicbt.com:80/announce&tr=http://tracker.prq.to/announce&tr=http://open.acgtracker.com:1096/announce&tr=https://t-115.rhcloud.com/only_for_ylbud&tr=http://tracker1.itzmx.com:8080/announce&tr=http://tracker2.itzmx.com:6961/announce&tr=udp://tracker1.itzmx.com:8080/announce&tr=udp://tracker2.itzmx.com:6961/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=udp://tracker4.itzmx.com:2710/announce&tr=http://tr.bangumi.moe:6969/announce&tr=http://t.nyaatracker.com/announce&tr=http://open.nyaatorrents.info:6544/announce&tr=http://t2.popgo.org:7456/annonce&tr=http://share.camoe.cn:8080/announce&tr=http://opentracker.acgnx.se/announce&tr=http://tracker.acgnx.se/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=http://t.acg.rip:6699/announce&tr=http://opentracker.acgnx.com:6869/announce\",\"type\":\"application/x-bittorrent\",\"length\":1},\"categories\":[\"動畫\"]},{\"title\":\"\u200B[c.c動漫][1月新番][無職轉生~到了異世界就拿出真本事~][10][BIG5][1080P][MP4]\",\"pubDate\":\"2021-03-15 05:12:42\",\"link\":\"http://share.dmhy.org/topics/view/562725_c_c_1_10_BIG5_1080P_MP4.html\",\"guid\":\"http://share.dmhy.org/topics/view/562725_c_c_1_10_BIG5_1080P_MP4.html\",\"author\":\"lleeopen\",\"thumbnail\":\"https://img.vim-cn.com/43/a8c19df5571ea68c64ed4945cc0187bd82e2f1.jpg\",\"description\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"content\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"enclosure\":{\"link\":\"magnet:?xt=urn:btih:QWEVVDWHSWISWGLOQJWD2PRHP3OYJBD3&dn=&tr=http://104.238.198.186:8000/announce&tr=udp://104.238.198.186:8000/announce&tr=http://tracker.openbittorrent.com:80/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=http://tracker4.itzmx.com:2710/announce&tr=http://tracker.publicbt.com:80/announce&tr=http://tracker.prq.to/announce&tr=http://open.acgtracker.com:1096/announce&tr=https://t-115.rhcloud.com/only_for_ylbud&tr=http://tracker1.itzmx.com:8080/announce&tr=http://tracker2.itzmx.com:6961/announce&tr=udp://tracker1.itzmx.com:8080/announce&tr=udp://tracker2.itzmx.com:6961/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=udp://tracker4.itzmx.com:2710/announce&tr=http://tr.bangumi.moe:6969/announce&tr=http://t.nyaatracker.com/announce&tr=http://open.nyaatorrents.info:6544/announce&tr=http://t2.popgo.org:7456/annonce&tr=http://share.camoe.cn:8080/announce&tr=http://opentracker.acgnx.se/announce&tr=http://tracker.acgnx.se/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=http://t.acg.rip:6699/announce&tr=http://opentracker.acgnx.com:6869/announce\",\"type\":\"application/x-bittorrent\",\"length\":1},\"categories\":[\"動畫\"]},{\"title\":\"\u200B[c.c動漫][1月新番][無職轉生~到了異世界就拿出真本事~][09][BIG5][1080P][MP4]\",\"pubDate\":\"2021-03-14 12:56:28\",\"link\":\"http://share.dmhy.org/topics/view/562653_c_c_1_09_BIG5_1080P_MP4.html\",\"guid\":\"http://share.dmhy.org/topics/view/562653_c_c_1_09_BIG5_1080P_MP4.html\",\"author\":\"lleeopen\",\"thumbnail\":\"https://img.vim-cn.com/43/a8c19df5571ea68c64ed4945cc0187bd82e2f1.jpg\",\"description\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"content\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"enclosure\":{\"link\":\"magnet:?xt=urn:btih:Z6M3M7Y5YTIKY4GGCG7PGEP3WWGORS7T&dn=&tr=http://104.238.198.186:8000/announce&tr=udp://104.238.198.186:8000/announce&tr=http://tracker.openbittorrent.com:80/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=http://tracker4.itzmx.com:2710/announce&tr=http://tracker.publicbt.com:80/announce&tr=http://tracker.prq.to/announce&tr=http://open.acgtracker.com:1096/announce&tr=https://t-115.rhcloud.com/only_for_ylbud&tr=http://tracker1.itzmx.com:8080/announce&tr=http://tracker2.itzmx.com:6961/announce&tr=udp://tracker1.itzmx.com:8080/announce&tr=udp://tracker2.itzmx.com:6961/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=udp://tracker4.itzmx.com:2710/announce&tr=http://tr.bangumi.moe:6969/announce&tr=http://t.nyaatracker.com/announce&tr=http://open.nyaatorrents.info:6544/announce&tr=http://t2.popgo.org:7456/annonce&tr=http://share.camoe.cn:8080/announce&tr=http://opentracker.acgnx.se/announce&tr=http://tracker.acgnx.se/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=http://t.acg.rip:6699/announce&tr=http://opentracker.acgnx.com:6869/announce\",\"type\":\"application/x-bittorrent\",\"length\":1},\"categories\":[\"動畫\"]},{\"title\":\"\u200B[c.c動漫][1月新番][無職轉生~到了異世界就拿出真本事~][08][BIG5][1080P][MP4]\",\"pubDate\":\"2021-03-14 12:56:00\",\"link\":\"http://share.dmhy.org/topics/view/562652_c_c_1_08_BIG5_1080P_MP4.html\",\"guid\":\"http://share.dmhy.org/topics/view/562652_c_c_1_08_BIG5_1080P_MP4.html\",\"author\":\"lleeopen\",\"thumbnail\":\"https://img.vim-cn.com/43/a8c19df5571ea68c64ed4945cc0187bd82e2f1.jpg\",\"description\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"content\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"enclosure\":{\"link\":\"magnet:?xt=urn:btih:BMXA6AZF7BCYQ2CIZOS5I6XPTXUZ2W3E&dn=&tr=http://104.238.198.186:8000/announce&tr=udp://104.238.198.186:8000/announce&tr=http://tracker.openbittorrent.com:80/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=http://tracker4.itzmx.com:2710/announce&tr=http://tracker.publicbt.com:80/announce&tr=http://tracker.prq.to/announce&tr=http://open.acgtracker.com:1096/announce&tr=https://t-115.rhcloud.com/only_for_ylbud&tr=http://tracker1.itzmx.com:8080/announce&tr=http://tracker2.itzmx.com:6961/announce&tr=udp://tracker1.itzmx.com:8080/announce&tr=udp://tracker2.itzmx.com:6961/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=udp://tracker4.itzmx.com:2710/announce&tr=http://tr.bangumi.moe:6969/announce&tr=http://t.nyaatracker.com/announce&tr=http://open.nyaatorrents.info:6544/announce&tr=http://t2.popgo.org:7456/annonce&tr=http://share.camoe.cn:8080/announce&tr=http://opentracker.acgnx.se/announce&tr=http://tracker.acgnx.se/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=http://t.acg.rip:6699/announce&tr=http://opentracker.acgnx.com:6869/announce\",\"type\":\"application/x-bittorrent\",\"length\":1},\"categories\":[\"動畫\"]},{\"title\":\"\u200B[c.c動漫][1月新番][無職轉生~到了異世界就拿出真本事~][07][BIG5][1080P][MP4]\",\"pubDate\":\"2021-02-23 09:41:47\",\"link\":\"http://share.dmhy.org/topics/view/560768_c_c_1_07_BIG5_1080P_MP4.html\",\"guid\":\"http://share.dmhy.org/topics/view/560768_c_c_1_07_BIG5_1080P_MP4.html\",\"author\":\"lleeopen\",\"thumbnail\":\"https://img.vim-cn.com/43/a8c19df5571ea68c64ed4945cc0187bd82e2f1.jpg\",\"description\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"content\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"enclosure\":{\"link\":\"magnet:?xt=urn:btih:DDIM47E2UJAXRV54JJQFFPJ7SLYZZYQJ&dn=&tr=http://104.238.198.186:8000/announce&tr=udp://104.238.198.186:8000/announce&tr=http://tracker.openbittorrent.com:80/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=http://tracker4.itzmx.com:2710/announce&tr=http://tracker.publicbt.com:80/announce&tr=http://tracker.prq.to/announce&tr=http://open.acgtracker.com:1096/announce&tr=https://t-115.rhcloud.com/only_for_ylbud&tr=http://tracker1.itzmx.com:8080/announce&tr=http://tracker2.itzmx.com:6961/announce&tr=udp://tracker1.itzmx.com:8080/announce&tr=udp://tracker2.itzmx.com:6961/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=udp://tracker4.itzmx.com:2710/announce&tr=http://tr.bangumi.moe:6969/announce&tr=http://t.nyaatracker.com/announce&tr=http://open.nyaatorrents.info:6544/announce&tr=http://t2.popgo.org:7456/annonce&tr=http://share.camoe.cn:8080/announce&tr=http://opentracker.acgnx.se/announce&tr=http://tracker.acgnx.se/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=http://t.acg.rip:6699/announce&tr=http://opentracker.acgnx.com:6869/announce\",\"type\":\"application/x-bittorrent\",\"length\":1},\"categories\":[\"動畫\"]},{\"title\":\"\u200B[c.c動漫][1月新番][無職轉生~到了異世界就拿出真本事~][06][BIG5][1080P][MP4]\",\"pubDate\":\"2021-02-14 16:51:36\",\"link\":\"http://share.dmhy.org/topics/view/559914_c_c_1_06_BIG5_1080P_MP4.html\",\"guid\":\"http://share.dmhy.org/topics/view/559914_c_c_1_06_BIG5_1080P_MP4.html\",\"author\":\"lleeopen\",\"thumbnail\":\"https://img.vim-cn.com/43/a8c19df5571ea68c64ed4945cc0187bd82e2f1.jpg\",\"description\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"content\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"enclosure\":{\"link\":\"magnet:?xt=urn:btih:MFQR2G2AEZLHXONGKII47FXP2DPE4C3G&dn=&tr=http://104.238.198.186:8000/announce&tr=udp://104.238.198.186:8000/announce&tr=http://tracker.openbittorrent.com:80/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=http://tracker4.itzmx.com:2710/announce&tr=http://tracker.publicbt.com:80/announce&tr=http://tracker.prq.to/announce&tr=http://open.acgtracker.com:1096/announce&tr=https://t-115.rhcloud.com/only_for_ylbud&tr=http://tracker1.itzmx.com:8080/announce&tr=http://tracker2.itzmx.com:6961/announce&tr=udp://tracker1.itzmx.com:8080/announce&tr=udp://tracker2.itzmx.com:6961/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=udp://tracker4.itzmx.com:2710/announce&tr=http://tr.bangumi.moe:6969/announce&tr=http://t.nyaatracker.com/announce&tr=http://open.nyaatorrents.info:6544/announce&tr=http://t2.popgo.org:7456/annonce&tr=http://share.camoe.cn:8080/announce&tr=http://opentracker.acgnx.se/announce&tr=http://tracker.acgnx.se/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=http://t.acg.rip:6699/announce&tr=http://opentracker.acgnx.com:6869/announce\",\"type\":\"application/x-bittorrent\",\"length\":1},\"categories\":[\"動畫\"]},{\"title\":\"\u200B[c.c動漫][1月新番][無職轉生~到了異世界就拿出真本事~][05][BIG5][1080P][MP4]\",\"pubDate\":\"2021-02-07 16:33:23\",\"link\":\"http://share.dmhy.org/topics/view/559282_c_c_1_05_BIG5_1080P_MP4.html\",\"guid\":\"http://share.dmhy.org/topics/view/559282_c_c_1_05_BIG5_1080P_MP4.html\",\"author\":\"lleeopen\",\"thumbnail\":\"https://img.vim-cn.com/43/a8c19df5571ea68c64ed4945cc0187bd82e2f1.jpg\",\"description\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"content\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"enclosure\":{\"link\":\"magnet:?xt=urn:btih:TUDQWT6OAHYS2LFTCURHRLNZS6PVZXX5&dn=&tr=http://104.238.198.186:8000/announce&tr=udp://104.238.198.186:8000/announce&tr=http://tracker.openbittorrent.com:80/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=http://tracker4.itzmx.com:2710/announce&tr=http://tracker.publicbt.com:80/announce&tr=http://tracker.prq.to/announce&tr=http://open.acgtracker.com:1096/announce&tr=https://t-115.rhcloud.com/only_for_ylbud&tr=http://tracker1.itzmx.com:8080/announce&tr=http://tracker2.itzmx.com:6961/announce&tr=udp://tracker1.itzmx.com:8080/announce&tr=udp://tracker2.itzmx.com:6961/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=udp://tracker4.itzmx.com:2710/announce&tr=http://tr.bangumi.moe:6969/announce&tr=http://t.nyaatracker.com/announce&tr=http://open.nyaatorrents.info:6544/announce&tr=http://t2.popgo.org:7456/annonce&tr=http://share.camoe.cn:8080/announce&tr=http://opentracker.acgnx.se/announce&tr=http://tracker.acgnx.se/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=http://t.acg.rip:6699/announce&tr=http://opentracker.acgnx.com:6869/announce\",\"type\":\"application/x-bittorrent\",\"length\":1},\"categories\":[\"動畫\"]},{\"title\":\"\u200B[c.c動漫][1月新番][無職轉生~到了異世界就拿出真本事~][04][BIG5][1080P][MP4]\",\"pubDate\":\"2021-01-31 16:36:34\",\"link\":\"http://share.dmhy.org/topics/view/558624_c_c_1_04_BIG5_1080P_MP4.html\",\"guid\":\"http://share.dmhy.org/topics/view/558624_c_c_1_04_BIG5_1080P_MP4.html\",\"author\":\"lleeopen\",\"thumbnail\":\"https://img.vim-cn.com/43/a8c19df5571ea68c64ed4945cc0187bd82e2f1.jpg\",\"description\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"content\":\"\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"enclosure\":{\"link\":\"magnet:?xt=urn:btih:MVJ3F3DGW5Y4Z7LONWEWN6GBSQAC3TKQ&dn=&tr=http://104.238.198.186:8000/announce&tr=udp://104.238.198.186:8000/announce&tr=http://tracker.openbittorrent.com:80/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=http://tracker4.itzmx.com:2710/announce&tr=http://tracker.publicbt.com:80/announce&tr=http://tracker.prq.to/announce&tr=http://open.acgtracker.com:1096/announce&tr=https://t-115.rhcloud.com/only_for_ylbud&tr=http://tracker1.itzmx.com:8080/announce&tr=http://tracker2.itzmx.com:6961/announce&tr=udp://tracker1.itzmx.com:8080/announce&tr=udp://tracker2.itzmx.com:6961/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=udp://tracker4.itzmx.com:2710/announce&tr=http://tr.bangumi.moe:6969/announce&tr=http://t.nyaatracker.com/announce&tr=http://open.nyaatorrents.info:6544/announce&tr=http://t2.popgo.org:7456/annonce&tr=http://share.camoe.cn:8080/announce&tr=http://opentracker.acgnx.se/announce&tr=http://tracker.acgnx.se/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=http://t.acg.rip:6699/announce&tr=http://opentracker.acgnx.com:6869/announce\",\"type\":\"application/x-bittorrent\",\"length\":1},\"categories\":[\"動畫\"]},{\"title\":\"\u200B[c.c動漫][1月新番][無職轉生~到了異世界就拿出真本事~][03][BIG5][1080P][MP4]\",\"pubDate\":\"2021-01-25 05:27:50\",\"link\":\"http://share.dmhy.org/topics/view/558007_c_c_1_03_BIG5_1080P_MP4.html\",\"guid\":\"http://share.dmhy.org/topics/view/558007_c_c_1_03_BIG5_1080P_MP4.html\",\"author\":\"lleeopen\",\"thumbnail\":\"https://img.vim-cn.com/43/a8c19df5571ea68c64ed4945cc0187bd82e2f1.jpg\",\"description\":\"\\n

[c.c動漫][1月新番][無職轉生~到了異世界就拿出真本事~][03][BIG5][1080P][MP4]

\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"content\":\"\\n

[c.c動漫][1月新番][無職轉生~到了異世界就拿出真本事~][03][BIG5][1080P][MP4]

\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"enclosure\":{\"link\":\"magnet:?xt=urn:btih:OR6WDFDYDAPOGFR3FY3LLCF25P3PHUTG&dn=&tr=http://104.238.198.186:8000/announce&tr=udp://104.238.198.186:8000/announce&tr=http://tracker.openbittorrent.com:80/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=http://tracker4.itzmx.com:2710/announce&tr=http://tracker.publicbt.com:80/announce&tr=http://tracker.prq.to/announce&tr=http://open.acgtracker.com:1096/announce&tr=https://t-115.rhcloud.com/only_for_ylbud&tr=http://tracker1.itzmx.com:8080/announce&tr=http://tracker2.itzmx.com:6961/announce&tr=udp://tracker1.itzmx.com:8080/announce&tr=udp://tracker2.itzmx.com:6961/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=udp://tracker4.itzmx.com:2710/announce&tr=http://tr.bangumi.moe:6969/announce&tr=http://t.nyaatracker.com/announce&tr=http://open.nyaatorrents.info:6544/announce&tr=http://t2.popgo.org:7456/annonce&tr=http://share.camoe.cn:8080/announce&tr=http://opentracker.acgnx.se/announce&tr=http://tracker.acgnx.se/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=http://t.acg.rip:6699/announce&tr=http://opentracker.acgnx.com:6869/announce\",\"type\":\"application/x-bittorrent\",\"length\":1},\"categories\":[\"動畫\"]},{\"title\":\"\u200B[c.c動漫][1月新番][無職轉生~到了異世界就拿出真本事~][02][BIG5][1080P][MP4]\",\"pubDate\":\"2021-01-17 16:35:55\",\"link\":\"http://share.dmhy.org/topics/view/557306_c_c_1_02_BIG5_1080P_MP4.html\",\"guid\":\"http://share.dmhy.org/topics/view/557306_c_c_1_02_BIG5_1080P_MP4.html\",\"author\":\"lleeopen\",\"thumbnail\":\"https://img.vim-cn.com/43/a8c19df5571ea68c64ed4945cc0187bd82e2f1.jpg\",\"description\":\"\\n

[c.c動漫][1月新番][無職轉生~到了異世界就拿出真本事~][02][BIG5][1080P][MP4]

\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"content\":\"\\n

[c.c動漫][1月新番][無職轉生~到了異世界就拿出真本事~][02][BIG5][1080P][MP4]

\\n

P.s.請使用正規的BT軟件下載(utorrent、qbittorrent、bitcomet),下載完成之後不要立即關閉下載軟件,盡量保持上傳一段時間~~

\\n


\\n\",\"enclosure\":{\"link\":\"magnet:?xt=urn:btih:TGON2SU75VGPYQBOHMCXF7M6MNSYS7J3&dn=&tr=http://104.238.198.186:8000/announce&tr=udp://104.238.198.186:8000/announce&tr=http://tracker.openbittorrent.com:80/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=http://tracker4.itzmx.com:2710/announce&tr=http://tracker.publicbt.com:80/announce&tr=http://tracker.prq.to/announce&tr=http://open.acgtracker.com:1096/announce&tr=https://t-115.rhcloud.com/only_for_ylbud&tr=http://tracker1.itzmx.com:8080/announce&tr=http://tracker2.itzmx.com:6961/announce&tr=udp://tracker1.itzmx.com:8080/announce&tr=udp://tracker2.itzmx.com:6961/announce&tr=udp://tracker3.itzmx.com:6961/announce&tr=udp://tracker4.itzmx.com:2710/announce&tr=http://tr.bangumi.moe:6969/announce&tr=http://t.nyaatracker.com/announce&tr=http://open.nyaatorrents.info:6544/announce&tr=http://t2.popgo.org:7456/annonce&tr=http://share.camoe.cn:8080/announce&tr=http://opentracker.acgnx.se/announce&tr=http://tracker.acgnx.se/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=http://t.acg.rip:6699/announce&tr=http://opentracker.acgnx.com:6869/announce\",\"type\":\"application/x-bittorrent\",\"length\":1},\"categories\":[\"動畫\"]}]}"; private static ApplicationContext applicationContext; @Resource IBangumiService bangumiService; @@ -41,9 +40,6 @@ public class DmhyRssDownloadManager implements ApplicationContextAware { List list = bangumiService.getAllBangumi(); AnimationData data = new AnimationData(); Log.i("BT", "启动BT检测,总数:" + list.size()); - for (BangumiItem item : list) { - System.out.println("item.getTitle() = " + item.getTitle()); - } File path = new File(BTDownloadManager.DownloadHomePath); if (!path.exists()) { Log.i("BT", "下载目录已离线,取消扫描"); @@ -53,11 +49,17 @@ public class DmhyRssDownloadManager implements ApplicationContextAware { if (item.getEnable() == 0) { continue; } + JSONObject json = RssXMLtoJson.toJSON(getDmhyUrl(item)); item.setAuthor(data.nameToValue(item.getAuthor(), true) + ""); item.setCategories(data.nameToValue(item.getCategories(), false) + ""); - - JSONObject json = RssXMLtoJson.toJSON(getDmhyUrl(item)); if (json != null) { + String s = RedisTools.get(item.getId() + ""); + if ("next".equals(s)) { + if(BTDownloadManager.skipDownload(item.getTitle(), json)) { + RedisTools.remove(item.getId() + ""); + } + continue; + } BTDownloadManager.download(item.getTitle(), json); } else { QQBotManager.getInstance().sendMessage(item.getTitle() + "\n下载失败\n" + getDmhyUrl(item)); @@ -67,16 +69,16 @@ public class DmhyRssDownloadManager implements ApplicationContextAware { } private String getDmhyUrl(BangumiItem item) { - String dmhyUrl = "http://share.dmhy.org/topics/rss/page/1/rss.xml?keyword=%s%s&order=date-desc"; + String dmhyUrl = "https://share.dmhy.org/topics/rss/page/1/rss.xml?keyword=%s%s&order=date-desc"; + String sort_id=new AnimationData().nameToValue(item.getCategories(),false)+""; dmhyUrl = String.format(dmhyUrl, item.getTitlekey().replace(" ", "+"), - "-1".equals(item.getCategories()) ? "" : String.format("&sort_id=%s", item.getCategories()) + "-1".equals(sort_id) ? "" : String.format("&sort_id=%s", sort_id) ); return dmhyUrl; } - public static void main(String[] args) { }