Closed JasonLongBug closed 1 year ago
有具体的直播间ID吗?无法复现问题
截图里面的374458683966
是OK的
截图里面的
374458683966
是OK的
我这边这个ID就不行,我的cookie获取方式正确吗?java版本是否有要求,还有麻烦看下我的存放路径是否正确
这是我的执行语句
请设置debug=true,将房间信息的log输出。预期内容应该与下面类似:
上面log测试了三次,第一次直播间374458683966
;第二三次直播间253265034651
。
看了一下内容response.app.initialState.roomStore.roomInfo
{
"room": {
"id_str": "7149376037145660171",
"status": 4,
"status_str": "4",
"title": "00后学生女,宿舍跳舞。",
"user_count_str": "0",
"mosaic_status": 0,
"mosaic_status_str": "",
"admin_user_ids": [],
"admin_user_ids_str": [],
"live_room_mode": 0,
"has_commerce_goods": false,
"linker_map": {}
},
"roomId": "7149376037145660171",
"web_rid": "374458683966",
"anchor": {
"id_str": "1918010036859630",
"sec_uid": "MS4wLjABAAAAQkLk6441VZzm7rwlydg9BCiSuvK5p_H8d6Y0rOP76JH6ofLV4tMPK_izzSk6m02S",
"nickname": "小穗子🌾",
"avatar_thumb": {
"url_list": ["https://p3.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_d835040d3c33d8bda17789e0fdf119db.jpeg?from=4010531038", "https://p6.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_d835040d3c33d8bda17789e0fdf119db.jpeg?from=4010531038", "https://p9.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_d835040d3c33d8bda17789e0fdf119db.jpeg?from=4010531038"]
},
"follow_info": {
"follow_status": 0,
"follow_status_str": "0"
}
},
"enter_mode": 0,
"qrcode_url": "",
"partition_road_map": {
"partition": {
"id_str": "10000",
"type": 3,
"title": "娱乐天地"
},
"sub_partition": {
"partition": {
"id_str": "2842",
"type": 2,
"title": "语音互动"
}
}
},
}
{"web_rid":"253265034651","relevant_rooms":[]}
{"web_rid":"253265034651","relevant_rooms":[]}
第二三次确实不行,但是第一次如果不是主播已经下线的话,预期是可以录制的。
我本地测试两个直播间均符合预期。
现在只能看看第一次和后面两次有什么不同了。
或者说离线直播间均能获取信息,但是在线直播的话就抛异常org.json.JSONException: JSONObject["anchor"] not found
?
同样的错误
org.json.JSONException: JSONObject["anchor"] not found.
cookie 获取方法如下:
部分日志如下:
"roomStore": {
"roomInfo": {
"web_rid": "327014106755",
"relevant_rooms": []
},
"emojiList": [],
"emojiReflex": {},
"liveStatus": "normal",
"followInfo": {}
},
...
"e0b226782b4c5bc7d1a6f87a8e245e4f": {
"status_code": "10037",
"error": {
"title": "服务出现异常"
},
"abTestData": {
"liveLowLatency": {
"enabled": true,
"abr_pts": -3800
}
},
"messageFrom": "live"
}
我这边更换浏览器和IP都正常,只能换种解析方式,不从网页里面抠了
org.json.JSONException: JSONObject["anchor"] not found. at org.json.JSONObject.get(JSONObject.java:573) at org.json.JSONObject.getJSONObject(JSONObject.java:766) at nicelee.bilibili.live.impl.RoomDealerDouyin4User.getRoomInfo(RoomDealerDouyin4User.java:95) at nicelee.bilibili.Main.getRoomInfo(Main.java:152) at nicelee.bilibili.Main.main(Main.java:85) 抖音需要cookie, 请确认cookie是否存在或失效 解析失败!!