This commit is contained in:
yutou 2021-04-30 17:49:25 +08:00
parent d70c5a7818
commit 39e9b78581
3 changed files with 5 additions and 10 deletions

View File

@ -180,14 +180,7 @@ public class LiveUtils {
public synchronized static JSONObject http_get(String url) { public synchronized static JSONObject http_get(String url) {
try { try {
if (System.currentTimeMillis() - oldBiliBiliHttpTime < 1000) { Log.i("调用url = "+url);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
com.yutou.bilibili.Tools.Log.e(e);
}
oldBiliBiliHttpTime = System.currentTimeMillis();
}
HttpURLConnection connection = getBiliHttpGet(url, getCookie()); HttpURLConnection connection = getBiliHttpGet(url, getCookie());
BufferedInputStream stream = new BufferedInputStream(connection.getInputStream()); BufferedInputStream stream = new BufferedInputStream(connection.getInputStream());
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
@ -448,11 +441,12 @@ public class LiveUtils {
infoMap.put(upInfo.getRoomid(), json); infoMap.put(upInfo.getRoomid(), json);
} }
try { try {
Thread.sleep(300); Thread.sleep(500);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
Log.i("信息map数量:"+infoMap.size());
} }
public synchronized void check(int roomId) { public synchronized void check(int roomId) {

View File

@ -6,6 +6,7 @@ import com.yutou.bilibili.BiliBili.Live;
import com.yutou.bilibili.BiliBili.LiveUtils; import com.yutou.bilibili.BiliBili.LiveUtils;
import com.yutou.bilibili.QQBot.QQBotManager; import com.yutou.bilibili.QQBot.QQBotManager;
import com.yutou.bilibili.Tools.AppTools; import com.yutou.bilibili.Tools.AppTools;
import com.yutou.bilibili.Tools.FFmpegUtils;
import com.yutou.bilibili.Tools.HttpTools; import com.yutou.bilibili.Tools.HttpTools;
import com.yutou.bilibili.Tools.Log; import com.yutou.bilibili.Tools.Log;

View File

@ -358,7 +358,7 @@ public class QQBotManager implements ApplicationContextAware {
e.printStackTrace(); e.printStackTrace();
} }
}else { }else {
System.out.println("未知指令:"+msg); Log.i("未知指令:"+msg);
} }
} }
} }