Projets
Voir sur GitHub
scx567888/live-room-watcher
À propos
📺 Permet de récupérer les messages du chat, les cadeaux, les mentions « J’aime », les URL du flux original et bien plus encore depuis une salle de livestream
Productivité et automatisationProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- +2
- in 15 days
- +2
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalLive Room Watcher
📺 可抓取直播间 弹幕, 礼物, 点赞, 原始流地址等 (仅供学习使用,不得用于商业用途)
| 平台 | 弹幕(消息) | 点赞 | 礼物 | 进入直播间 | 关注 | 原始流地址 |
|---|---|---|---|---|---|---|
| 抖音(Hack) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| TikTok (Hack) | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
Maven
<dependency>
<groupId>cool.scx</groupId>
<artifactId>live-room-watcher</artifactId>
<version>{version}</version>
</dependency>
基本用法
import cool.scx.live_room_watcher.impl.douyin_hack.DouYinHackLiveRoomWatcher;
import static cool.scx.live_room_watcher.impl.douyin_hack.DouYinHackLiveRoomInfoResolver.resolveLiveRoomInfo;
import static cool.scx.live_room_watcher.impl.douyin_hack.DouYinHackWebSocketOptionsProvider.ofPlaywright;
public class Main {
public static void main(String[] args) {
var liveRoomURL = "https://live.douyin.com/510200350291";
var cookiesStr = "xxxxxx";
System.out.println("解析 直播间 中...");
var liveRoomInfo = resolveLiveRoomInfo(liveRoomURL);
System.out.println("解析 直播间 完成 -> " + liveRoomInfo.title() + " (ID : " + liveRoomInfo.roomID() + ")");
System.out.println("[直播流地址] " + liveRoomInfo.webStreamURLs());
var liveRoomWatcher = new DouYinHackLiveRoomWatcher(ofPlaywright(liveRoomURL, cookiesStr));
liveRoomWatcher.onChat(chat -> {
System.out.println("[消息] " + chat.user().nickname() + " : " + chat.content());
}).onUser(user -> {
System.out.println("[来了] " + user.nickname());
}).onLike(like -> {
System.out.println("[点赞] " + like.user().nickname() + " x " + like.count());
}).onFollow(follow -> {
System.out.println("[关注] " + follow.user().nickname());
}).onGift(gift -> {
System.out.println("[礼物] " + gift.user().nickname() + " : " + gift.name() + " x " + gift.count());
});
liveRoomWatcher.startWatch();
}
}
关于 Cookies 和 WebSocket 地址的获取
这里提供一个小 Chrome 插件 "chrome-extension"
chrome-extension 使用方法
1, 安装到 Chrome 浏览器中 (相同内核都可以)
2, 打开一个抖音 直播间
3, 打开插件 复制 Cookie 字符串 和 WebSocket (最长的那个)
4, 使用 DouYinHackLiveRoomWatcher 监听 这里有两种方式
4.1, 如果使用 ofPlaywright(), 只需要 直播间页面地址 + cookie 就可以
4.2, 如果使用 ofWebSocketURL(), 需要 刚刚复制的 WebSocket 地址 + cookie
如果连接失败, 建议重试几次
由于第三方的系统总是在不断的更新升级 如果功能失效请提 issues 并详细说明情况 .
Explorer des projets similaires
Chargement…