准备上传oss做云备份

This commit is contained in:
yutou
2021-06-09 18:31:48 +08:00
parent e9ff6a0207
commit 44e0a866a3
11 changed files with 194 additions and 54 deletions

View File

@@ -55,21 +55,23 @@ public class BTDownloadManager implements ApplicationContextAware {
JSONObject json = JSONObject.parseObject(_json);
download(item, json);
} else {
QQBotManager.getInstance().sendMessage(item.getTitle() + "\n下载失败");
QQBotManager.getInstance().sendMessage(item.getTitle() + "\n下载失败\n"+getDmhyUrl(item));
Log.i(item.getTitle() + "\n下载失败");
}
}
}
private String getRSSUrl(BangumiItem item) {
String url = "https://api.rss2json.com/v1/api.json?rss_url=%s&api_key=wtfm5pebya13pnl8rtu51wfgfpte0mb9sap1foll&count=500";
private String getDmhyUrl(BangumiItem item){
String dmhyUrl = "http://share.dmhy.org/topics/rss/page/1/rss.xml?keyword=%s%s%s&order=date-desc";
dmhyUrl = String.format(dmhyUrl,
item.getTitlekey().replace(" ", "+"),
"-1".equals(item.getCategories()) ? "" : String.format("&sort_id=%s", item.getCategories()),
"-1".equals(item.getAuthor()) ? "" : String.format("&team_id=%s", item.getAuthor()));
return dmhyUrl;
}
private String getRSSUrl(BangumiItem item) {
String url = "https://api.rss2json.com/v1/api.json?rss_url=%s&api_key=wtfm5pebya13pnl8rtu51wfgfpte0mb9sap1foll&count=500";
try {
return String.format(url, URLEncoder.encode(dmhyUrl, "UTF-8"));
return String.format(url, URLEncoder.encode(getDmhyUrl(item), "UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return null;