优化下载

This commit is contained in:
2024-11-26 17:47:27 +08:00
parent 44d23b6bac
commit d9919f4d26
10 changed files with 129 additions and 49 deletions

View File

@@ -45,7 +45,7 @@ public class LiveRoomConfig {
public static LiveRoomConfig buildConfig(String roomId){
BiliLiveConfigDatabase database = new BiliLiveConfigDatabase();
LiveConfigDatabaseBean bean = database.getConfig(new String(roomId));
database.close();
LiveRoomConfig config = new LiveRoomConfig();
config.setLoginUid(bean.getRecordUid());
config.setRoomId(bean.getRoomId());

View File

@@ -35,6 +35,6 @@ public class LoginCookieDatabaseBean extends AbsDatabasesBean {
}
public String toCookieString() {
return "SESSDATA=" + sessdta + "; Path=" + path + "; DedeUserID=" + dedeUserID + "; DedeUserID__ckMd5=" + dedeUserIDCkMd5 + "; bili_jct=" + biliJct + "; Expires=" + expires + "; Domain=" + domain + "; sid=" + sid + "; gourl=" + gourl;
return "SESSDATA=" + sessdta + "; Path=" + path + "; DedeUserID=" + dedeUserID + "; DedeUserID__ckMd5=" + dedeUserIDCkMd5 + "; bili_jct=" + biliJct + "; Expires=" + expires + "; Domain=" + domain + "; sid=" + sid;
}
}

View File

@@ -112,7 +112,7 @@ public class BiliLiveDatabase extends SQLiteManager {
}
public void addSource(WSData bean) {
Log.i("BiliLiveDatabase.addSource", config.getRoomId());
// Log.i("BiliLiveDatabase.addSource", config.getRoomId());
add(new LiveSourceDatabaseBean(bean));
addData(bean);
}

View File

@@ -174,7 +174,7 @@ public class WebSocketManager {
heartbeatTask.setSocket(this);
heartbeatTask.sendInitAuthData();
new Timer().schedule(heartbeatTask, 1000, 30000);
Log.i("WebSocketClientTh.onOpen", roomConfig);
Log.i("WebSocketClientTh.onOpen", roomConfig.getRoomId());
}
@Override
@@ -296,7 +296,7 @@ public class WebSocketManager {
json.put("key", roomConfig.getLiveInfo().getToken());
byte[] bytes = {0, 16, 0, 1, 0, 0, 0, 7, 0, 0, 0, 1};
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Log.i("bytes.length = " + bytes.length);
// Log.i("bytes.length = " + bytes.length);
Log.i(json);
outputStream.write(BytesUtils.toLH(json.toString().length() + 16));
outputStream.write(bytes);