diff --git a/src/main/java/com/yutou/bilibili/BiliBili/Tools/SaveLive.java b/src/main/java/com/yutou/bilibili/BiliBili/Tools/SaveLive.java index e5fc979..f891c99 100644 --- a/src/main/java/com/yutou/bilibili/BiliBili/Tools/SaveLive.java +++ b/src/main/java/com/yutou/bilibili/BiliBili/Tools/SaveLive.java @@ -174,8 +174,6 @@ public class SaveLive { } private void httpDownload(String url) throws Exception { - com.yutou.bilibili.Tools.Log.i("开始录制:" + roomId); - QQBotManager.getInstance().sendMessage(roomId + " 已启动录制"); HttpURLConnection connection = LiveUtils.getBiliHttpGet(url, LiveUtils.getCookie()); connection.setReadTimeout(5000); connection.setConnectTimeout(5000); @@ -195,12 +193,18 @@ public class SaveLive { liveFile.mkdirs(); liveFile.delete(); } + boolean isPrint=false; FileOutputStream outputStream = new FileOutputStream(liveFile); int len; byte[] bytes = new byte[1024]; while ((len = inputStream.read(bytes)) != -1 && isSave) { outputStream.write(bytes, 0, len); outputStream.flush(); + if(!isPrint){ + com.yutou.bilibili.Tools.Log.i("开始录制:" + roomId); + QQBotManager.getInstance().sendMessage(roomId + " 已启动录制"); + isPrint=true; + } } outputStream.close(); inputStream.close();