新增对Jellyfin的搜刮(但未完成自动化)
新增音乐分享功能 修复BT下载地址错误
This commit is contained in:
parent
ef1ba6f61f
commit
a6b9e4a6ac
@ -3,14 +3,12 @@ package com.yutou.nas.Controllers;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.yutou.nas.mybatis.model.MusicData;
|
import com.yutou.nas.mybatis.model.MusicData;
|
||||||
import com.yutou.nas.utils.ConfigTools;
|
import com.yutou.nas.utils.*;
|
||||||
import com.yutou.nas.Services.impl.MusicToolsServiceImpl;
|
import com.yutou.nas.Services.impl.MusicToolsServiceImpl;
|
||||||
import com.yutou.nas.utils.Tools;
|
|
||||||
import org.springframework.core.io.FileSystemResource;
|
import org.springframework.core.io.FileSystemResource;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import com.yutou.nas.utils.StringUtils;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
@ -21,6 +19,7 @@ import java.io.UnsupportedEncodingException;
|
|||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import static com.yutou.nas.Datas.AppData.defaultMusicPath;
|
import static com.yutou.nas.Datas.AppData.defaultMusicPath;
|
||||||
|
|
||||||
@ -209,5 +208,45 @@ public class MusicController {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@RequestMapping("/nas/music/share.do")
|
||||||
|
@ResponseBody
|
||||||
|
public JSONObject share(@RequestBody JSONObject data){
|
||||||
|
System.out.println(data);
|
||||||
|
String file=data.getString("file");
|
||||||
|
String token=data.getString("token");
|
||||||
|
JSONObject json=new JSONObject();
|
||||||
|
File music=new File(file);
|
||||||
|
if(music.exists()){
|
||||||
|
String key=Tools.getMD5(UUID.randomUUID().toString()+music.getAbsolutePath());
|
||||||
|
RedisTools.set(key,file,3600);
|
||||||
|
JSONObject item=new JSONObject();
|
||||||
|
item.put("share",key);
|
||||||
|
json.put("code",1);
|
||||||
|
json.put("msg","ok");
|
||||||
|
json.put("data",item);
|
||||||
|
}else{
|
||||||
|
json.put("code",-1);
|
||||||
|
json.put("msg","文件不存在");
|
||||||
|
json.put("data","{}");
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
@RequestMapping("/nas/music/playShare.do")
|
||||||
|
@ResponseBody
|
||||||
|
public JSONObject playShare(String token) throws UnsupportedEncodingException {
|
||||||
|
JSONObject json=new JSONObject();
|
||||||
|
String redis=RedisTools.get(token);
|
||||||
|
if(redis!=null&&!"-999".equals(token)){
|
||||||
|
String file=redis;
|
||||||
|
JSONObject item=new JSONObject();
|
||||||
|
item.put("file",file);
|
||||||
|
json.put("code",0);
|
||||||
|
json.put("data",item);
|
||||||
|
}else{
|
||||||
|
json.put("code",-1);
|
||||||
|
json.put("msg","分享已过期");
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import org.springframework.context.annotation.Import;
|
|||||||
@Import(BTDownloadManager.class)
|
@Import(BTDownloadManager.class)
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class NasApplication {
|
public class NasApplication {
|
||||||
public static final String version="1.1.9";
|
public static final String version="1.2";
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(NasApplication.class, args);
|
SpringApplication.run(NasApplication.class, args);
|
||||||
AppData.defaultMusicPath = (String) ConfigTools.load(ConfigTools.CONFIG, "musicDir");
|
AppData.defaultMusicPath = (String) ConfigTools.load(ConfigTools.CONFIG, "musicDir");
|
||||||
|
File diff suppressed because one or more lines are too long
@ -54,6 +54,27 @@ public class ConfigTools {
|
|||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String loadIni(File file, String key) {
|
||||||
|
try {
|
||||||
|
BufferedReader reader = new BufferedReader(new FileReader(file));
|
||||||
|
String tmp, str = null;
|
||||||
|
while ((tmp = reader.readLine()) != null) {
|
||||||
|
if(tmp.startsWith(key+"=")){
|
||||||
|
str=tmp.split("=")[1];
|
||||||
|
if(StringUtils.isEmpty(str)){
|
||||||
|
str=null;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean save(String type, String key, Object data) {
|
public static boolean save(String type, String key, Object data) {
|
||||||
File file = new File(type);
|
File file = new File(type);
|
||||||
String src = readFile(file);
|
String src = readFile(file);
|
||||||
|
@ -9,13 +9,20 @@ import lombok.Data;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class JellyfinAPIManager {
|
public class JellyfinAPIManager {
|
||||||
public static LibsItem getLibs(String key) {
|
private List<LibsItem> mediaItem=new ArrayList<>();
|
||||||
|
|
||||||
|
public JellyfinAPIManager() {
|
||||||
|
mediaItem=getAllItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LibsItem getLibs(String key) {
|
||||||
HashMap<String, String> header = getHeader();
|
HashMap<String, String> header = getHeader();
|
||||||
String httpText = HttpTools.https_get("http://192.168.31.88:8096/Users/e8a13675bb64466dbd81f1e5985ef8c7/Items", header);
|
String httpText = HttpTools.https_get("http://192.168.31.88:8096/Users/e8a13675bb64466dbd81f1e5985ef8c7/Items", header);
|
||||||
JSONObject json = JSONObject.parseObject(httpText);
|
JSONObject json = JSONObject.parseObject(httpText);
|
||||||
@ -32,21 +39,39 @@ public class JellyfinAPIManager {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<JellyfinAPIManager.LibsItem> getLibsItems(String id) {
|
public ItemInfo getInfo(String id) {
|
||||||
|
String http = HttpTools.https_get("http://192.168.31.88:8096/Users/e8a13675bb64466dbd81f1e5985ef8c7/Items/"+id, getHeader());
|
||||||
|
return JSONObject.parseObject(http,ItemInfo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<LibsItem> getAllItem() {
|
||||||
|
String http = HttpTools.https_get("http://192.168.31.88:8096/Users/e8a13675bb64466dbd81f1e5985ef8c7/Items?SortBy=SortName&SortOrder=Ascending&IncludeItemTypes=Series&Recursive=true&Fields=PrimaryImageAspectRatio%2CBasicSyncInfo&ImageTypeLimit=1&EnableImageTypes=Primary%2CBackdrop%2CBanner%2CThumb&ParentId=28e774baf8f2fd279e7d58da9890a7d2", getHeader());
|
||||||
|
JSONObject json = JSONObject.parseObject(http);
|
||||||
|
|
||||||
|
JSONArray items = json.getJSONArray("Items");
|
||||||
|
List<LibsItem> list = JSONArray.parseArray(items.toJSONString(), LibsItem.class);
|
||||||
|
for (LibsItem item : list) {
|
||||||
|
item.setInfo(getInfo(item.getId()));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<JellyfinAPIManager.LibsItem> getLibsItems(String id) {
|
||||||
String httpText = HttpTools.https_get("http://192.168.31.88:8096/Users/e8a13675bb64466dbd81f1e5985ef8c7/Items?ParentId=" + id, getHeader());
|
String httpText = HttpTools.https_get("http://192.168.31.88:8096/Users/e8a13675bb64466dbd81f1e5985ef8c7/Items?ParentId=" + id, getHeader());
|
||||||
JSONObject json = JSONObject.parseObject(httpText);
|
JSONObject json = JSONObject.parseObject(httpText);
|
||||||
JSONArray items = json.getJSONArray("Items");
|
JSONArray items = json.getJSONArray("Items");
|
||||||
return JSONArray.parseArray(items.toJSONString(), LibsItem.class);
|
return JSONArray.parseArray(items.toJSONString(), LibsItem.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JSONObject getItemShows(String id) {
|
public JSONObject getItemShows(String id) {
|
||||||
String data = HttpTools.https_get(String.format("http://192.168.31.88:8096/Shows/%s/Seasons?userId=e8a13675bb64466dbd81f1e5985ef8c7",
|
String data = HttpTools.https_get(String.format("http://192.168.31.88:8096/Shows/%s/Seasons?userId=e8a13675bb64466dbd81f1e5985ef8c7",
|
||||||
id
|
id
|
||||||
), getHeader());
|
), getHeader());
|
||||||
return JSONObject.parseObject(data);
|
return JSONObject.parseObject(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void uploadImage(File image, String id, String model) {
|
|
||||||
|
public void uploadImage(File image, String id, String model) {
|
||||||
try {
|
try {
|
||||||
HashMap<String, String> header = getHeader();
|
HashMap<String, String> header = getHeader();
|
||||||
header.put("Content-Type", "image/jpg");
|
header.put("Content-Type", "image/jpg");
|
||||||
@ -66,7 +91,8 @@ public class JellyfinAPIManager {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static void saveJellyfinMetaData(JSONObject info, JellyfinAPIManager.LibsItem item) {
|
|
||||||
|
public void saveJellyfinMetaData(JSONObject info, JellyfinAPIManager.LibsItem item) {
|
||||||
JSONArray airDate = new JSONArray();
|
JSONArray airDate = new JSONArray();
|
||||||
airDate.add(info.getString("air_date"));
|
airDate.add(info.getString("air_date"));
|
||||||
JSONObject providerIds = new JSONObject();
|
JSONObject providerIds = new JSONObject();
|
||||||
@ -113,7 +139,7 @@ public class JellyfinAPIManager {
|
|||||||
metadata.put("PreferredMetadataCountryCode", "");
|
metadata.put("PreferredMetadataCountryCode", "");
|
||||||
metadata.put("RunTimeTicks", 0);
|
metadata.put("RunTimeTicks", 0);
|
||||||
metadata.put("Taglines", new JSONArray());
|
metadata.put("Taglines", new JSONArray());
|
||||||
HashMap<String, String> headers = JellyfinAPIManager.getHeader();
|
HashMap<String, String> headers = getHeader();
|
||||||
headers.put("Content-Type", "application/json");
|
headers.put("Content-Type", "application/json");
|
||||||
System.out.println(metadata.toString().replace("\"null\"", "null"));
|
System.out.println(metadata.toString().replace("\"null\"", "null"));
|
||||||
String ret = HttpTools.http_post("http://192.168.31.88:8096/Items/" + item.getId()
|
String ret = HttpTools.http_post("http://192.168.31.88:8096/Items/" + item.getId()
|
||||||
@ -123,16 +149,16 @@ public class JellyfinAPIManager {
|
|||||||
System.out.println(ret);
|
System.out.println(ret);
|
||||||
HttpTools.download(
|
HttpTools.download(
|
||||||
info.getJSONObject("images").getString("large").replace("http:", "https:"),
|
info.getJSONObject("images").getString("large").replace("http:", "https:"),
|
||||||
"poster.jpg",
|
item.getName() + "_poster.jpg",
|
||||||
new DownloadInterface() {
|
new DownloadInterface() {
|
||||||
@Override
|
@Override
|
||||||
public void onDownload(File file) {
|
public void onDownload(File file) {
|
||||||
super.onDownload(file);
|
super.onDownload(file);
|
||||||
JellyfinAPIManager.uploadImage(file, item.getId(), "Primary");
|
uploadImage(file, item.getId(), "Primary");
|
||||||
JSONObject items = JellyfinAPIManager.getItemShows(item.getId());
|
JSONObject items = getItemShows(item.getId());
|
||||||
for (Object o : items.getJSONArray("Items")) {
|
for (Object o : items.getJSONArray("Items")) {
|
||||||
JSONObject json = (JSONObject) o;
|
JSONObject json = (JSONObject) o;
|
||||||
JellyfinAPIManager.uploadImage(file, json.getString("Id"), "Primary");
|
uploadImage(file, json.getString("Id"), "Primary");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -140,7 +166,7 @@ public class JellyfinAPIManager {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HashMap<String, String> getHeader() {
|
public HashMap<String, String> getHeader() {
|
||||||
HashMap<String, String> header = new HashMap<>();
|
HashMap<String, String> header = new HashMap<>();
|
||||||
header.put("X-Emby-Authorization", "MediaBrowser Client=\"Jellyfin CLI\", Device=\"Jellyfin-CLI\", DeviceId=\"None\", Version=\"10.7.6\", Token=\"81be0169523e463a8c36a7b752d60ab2\"");
|
header.put("X-Emby-Authorization", "MediaBrowser Client=\"Jellyfin CLI\", Device=\"Jellyfin-CLI\", DeviceId=\"None\", Version=\"10.7.6\", Token=\"81be0169523e463a8c36a7b752d60ab2\"");
|
||||||
return header;
|
return header;
|
||||||
@ -160,9 +186,59 @@ public class JellyfinAPIManager {
|
|||||||
private List<Object> backdropImageTags;
|
private List<Object> backdropImageTags;
|
||||||
private Object imageBlurHashes;
|
private Object imageBlurHashes;
|
||||||
private String locationType;
|
private String locationType;
|
||||||
|
private ItemInfo info;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class ItemInfo {
|
||||||
|
private String name;
|
||||||
|
private String serverID;
|
||||||
|
private String id;
|
||||||
|
private String etag;
|
||||||
|
private OffsetDateTime dateCreated;
|
||||||
|
private OffsetDateTime dateLastMediaAdded;
|
||||||
|
private boolean canDelete;
|
||||||
|
private boolean canDownload;
|
||||||
|
private String sortName;
|
||||||
|
private Object[] externalUrls;
|
||||||
|
private String path;
|
||||||
|
private boolean enableMediaSourceDisplay;
|
||||||
|
private Object channelID;
|
||||||
|
private Object[] taglines;
|
||||||
|
private Object[] genres;
|
||||||
|
private String playAccess;
|
||||||
|
private Object[] remoteTrailers;
|
||||||
|
private boolean isFolder;
|
||||||
|
private String parentID;
|
||||||
|
private String type;
|
||||||
|
private Object[] people;
|
||||||
|
private Object[] studios;
|
||||||
|
private Object[] genreItems;
|
||||||
|
private long localTrailerCount;
|
||||||
|
private UserData userData;
|
||||||
|
private long recursiveItemCount;
|
||||||
|
private long childCount;
|
||||||
|
private long specialFeatureCount;
|
||||||
|
private String displayPreferencesID;
|
||||||
|
private Object[] airDays;
|
||||||
|
private Object[] tags;
|
||||||
|
private double primaryImageAspectRatio;
|
||||||
|
private ImageTags imageTags;
|
||||||
|
private String[] backdropImageTags;
|
||||||
|
private Object[] screenshotImageTags;
|
||||||
|
private String locationType;
|
||||||
|
private Object[] lockedFields;
|
||||||
|
private boolean lockData;
|
||||||
|
|
||||||
|
public String getPath() {
|
||||||
|
if(AppTools.isRuntimeSystemOfWindow()){
|
||||||
|
path=path.replace("/media/yutou/disk_lvm/public/download/anim/","Z:\\download\\anim\\");
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class UserData {
|
public static class UserData {
|
||||||
private long playbackPositionTicks;
|
private long playbackPositionTicks;
|
||||||
@ -177,19 +253,99 @@ public class JellyfinAPIManager {
|
|||||||
private String primary;
|
private String primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public void testItem(String id) {
|
||||||
JellyfinAPIManager.LibsItem item = JellyfinAPIManager.getLibs("番剧");
|
JellyfinAPIManager manager = new JellyfinAPIManager();
|
||||||
|
JellyfinAPIManager.LibsItem item = manager.getLibs("番剧");
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
List<JellyfinAPIManager.LibsItem> list;
|
List<JellyfinAPIManager.LibsItem> list;
|
||||||
list = JellyfinAPIManager.getLibsItems(item.getId());
|
list = manager.getLibsItems(item.getId());
|
||||||
for (JellyfinAPIManager.LibsItem libsItem : list) {
|
for (JellyfinAPIManager.LibsItem libsItem : list) {
|
||||||
if ("寒蝉鸣泣之时_卒".equals(libsItem.getName())) {
|
if ("轻音少女".equals(libsItem.getName())) {
|
||||||
saveJellyfinMetaData(
|
/* saveJellyfinMetaData(
|
||||||
BangumiTools.getBangumiInfo(331033),
|
BangumiTools.getBangumiInfo(1424),
|
||||||
libsItem
|
libsItem
|
||||||
|
);*/
|
||||||
|
System.out.println("libsItem = " + libsItem);
|
||||||
|
System.out.println(manager.getItemShows(libsItem.getId()));
|
||||||
|
JSONObject json = manager.getItemShows(libsItem.getId());
|
||||||
|
JSONArray array = json.getJSONArray("Items");
|
||||||
|
for (Object o : array) {
|
||||||
|
JSONObject _json = (JSONObject) o;
|
||||||
|
System.out.println(_json.getString("Name"));
|
||||||
|
|
||||||
|
if (_json.getString("Name").equals("第一季")) {
|
||||||
|
JellyfinAPIManager.LibsItem _item = JSONObject.parseObject(_json.toJSONString(), JellyfinAPIManager.LibsItem.class);
|
||||||
|
manager.saveJellyfinMetaData(
|
||||||
|
BangumiTools.getBangumiInfo(1424),
|
||||||
|
_item
|
||||||
|
);
|
||||||
|
} else if (_json.getString("Name").equals("第二季")) {
|
||||||
|
JellyfinAPIManager.LibsItem _item = JSONObject.parseObject(_json.toJSONString(), JellyfinAPIManager.LibsItem.class);
|
||||||
|
manager.saveJellyfinMetaData(
|
||||||
|
BangumiTools.getBangumiInfo(3774),
|
||||||
|
_item
|
||||||
|
);
|
||||||
|
} else if (_json.getString("Name").contains("[剧场版]")) {
|
||||||
|
JellyfinAPIManager.LibsItem _item = JSONObject.parseObject(_json.toJSONString(), JellyfinAPIManager.LibsItem.class);
|
||||||
|
manager.saveJellyfinMetaData(
|
||||||
|
BangumiTools.getBangumiInfo(12426),
|
||||||
|
_item
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/* System.out.println("libsItem = " + libsItem);
|
||||||
|
testItem(libsItem.getId());*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void search(String name, File path) {
|
||||||
|
for (LibsItem item : mediaItem) {
|
||||||
|
System.out.println(item.getName()+" > "+item.getInfo().getPath());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(File path) {
|
||||||
|
if (path.isDirectory()) {
|
||||||
|
File file = new File(path.getAbsolutePath() + File.separator + "info.ini");
|
||||||
|
if (!file.exists()) {
|
||||||
|
try {
|
||||||
|
file.createNewFile();
|
||||||
|
System.out.println("创建:" + file.getAbsolutePath());
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
String id = ConfigTools.loadIni(file, "id");
|
||||||
|
if (id != null) {
|
||||||
|
for (LibsItem item : mediaItem) {
|
||||||
|
|
||||||
|
if(item.getInfo().getPath().contains(path.getPath())){
|
||||||
|
System.out.println(item.getName()+" "+id);
|
||||||
|
// new JellyfinAPIManager().saveJellyfinMetaData(BangumiTools.getBangumiInfo(Integer.parseInt(id)),item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (File file : path.listFiles()) {
|
||||||
|
if (file.isDirectory()) {
|
||||||
|
// System.out.println("搜索目录:"+file.getAbsolutePath());
|
||||||
|
init(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String mainPath = "Z:\\download\\anim\\";
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
File file = new File("Z:\\download\\anim\\");
|
||||||
|
//new JellyfinAPIManager().search(file.getName(), file);
|
||||||
|
new JellyfinAPIManager().init(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -73,7 +73,7 @@ public class QQBotManager {
|
|||||||
public void run() {
|
public void run() {
|
||||||
long qq = 2476945931L;
|
long qq = 2476945931L;
|
||||||
String password = "zhang34864394";
|
String password = "zhang34864394";
|
||||||
if (ConfigTools.load(ConfigTools.CONFIG, "model").equals("dev")) {
|
if ("dev".equals(ConfigTools.load(ConfigTools.CONFIG, "model"))) {
|
||||||
qq = 3620756944L;
|
qq = 3620756944L;
|
||||||
password = "UAs6YBYMyxJU";
|
password = "UAs6YBYMyxJU";
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ public class QQBotManager {
|
|||||||
{
|
{
|
||||||
setProtocol(MiraiProtocol.ANDROID_PAD);
|
setProtocol(MiraiProtocol.ANDROID_PAD);
|
||||||
fileBasedDeviceInfo("qq_bot_devices_info.json");
|
fileBasedDeviceInfo("qq_bot_devices_info.json");
|
||||||
if (ConfigTools.load(ConfigTools.CONFIG, "model").equals("nas")) {
|
if ("nas".equals(ConfigTools.load(ConfigTools.CONFIG, "model"))) {
|
||||||
noBotLog();
|
noBotLog();
|
||||||
noNetworkLog();
|
noNetworkLog();
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ public class QQBotManager {
|
|||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
String str = sendMessage("姬妻酱上线拉~☆Daze~");
|
String str = sendMessage("姬妻酱上线拉~☆Daze~ 当前版本:"+NasApplication.version);
|
||||||
com.yutou.nas.utils.Log.i(str);
|
com.yutou.nas.utils.Log.i(str);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.yutou.nas.Controllers.UpdateIp;
|
import com.yutou.nas.Controllers.UpdateIp;
|
||||||
import com.yutou.nas.interfaces.DownloadInterface;
|
import com.yutou.nas.interfaces.DownloadInterface;
|
||||||
import com.yutou.nas.interfaces.ObjectInterface;
|
import com.yutou.nas.interfaces.ObjectInterface;
|
||||||
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
import org.springframework.core.io.FileSystemResource;
|
import org.springframework.core.io.FileSystemResource;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
@ -338,6 +339,10 @@ public class Tools {
|
|||||||
return digest.digest();
|
return digest.digest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getMD5(String str){
|
||||||
|
return DigestUtils.md5Hex(str);
|
||||||
|
}
|
||||||
|
|
||||||
private static String bytesToHexString(byte[] src) {
|
private static String bytesToHexString(byte[] src) {
|
||||||
StringBuilder stringBuilder = new StringBuilder("");
|
StringBuilder stringBuilder = new StringBuilder("");
|
||||||
if (src == null || src.length <= 0) {
|
if (src == null || src.length <= 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user