mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 16:59:39 -05:00
Changes:
Generated new Gifts Json TikTokLive.isLiveOnline() new method for checking if live if online TikTokLive.isLiveOnlineAsync()
This commit is contained in:
@@ -29,6 +29,11 @@
|
||||
<artifactId>jdbi3-core</artifactId>
|
||||
<version>3.23.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.googlecode.protobuf-java-format</groupId>
|
||||
<artifactId>protobuf-java-format</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jdbi</groupId>
|
||||
<artifactId>jdbi3-sqlobject</artifactId>
|
||||
|
||||
@@ -38,39 +38,23 @@ public class RunCollector {
|
||||
public static void main(String[] args) throws SQLException, IOException {
|
||||
|
||||
TikTokMessageCollectorClient.create("giftsCollector")
|
||||
.addUser("cbcgod")
|
||||
// .addUser("mr_cios")
|
||||
.addUser("crece.sara")
|
||||
.addUser("moniczkka")
|
||||
// .addUser("cbcgod")
|
||||
// .addUser("psychotropnazywo")
|
||||
// .addUser("accordionistka")
|
||||
.addEventFilter(WebcastGiftMessage.class)
|
||||
.addOnBuilder(liveClientBuilder ->
|
||||
{
|
||||
liveClientBuilder.onGift((liveClient, event) ->
|
||||
{
|
||||
|
||||
});
|
||||
|
||||
liveClientBuilder.onGiftCombo((liveClient, event) ->
|
||||
{
|
||||
|
||||
});
|
||||
|
||||
liveClientBuilder.onGift((liveClient, event) ->
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.append("GIFT User: " + event.getUser().getProfileName()+" ");
|
||||
sb.append("Name: " + event.getGift().name() + " ");
|
||||
sb.append("Combo: " + event.getCombo() + " ");
|
||||
System.out.println(sb.toString());
|
||||
});
|
||||
liveClientBuilder.onGiftCombo((liveClient, event) ->
|
||||
{
|
||||
var gifts = liveClient.getGiftManager().getGifts();
|
||||
|
||||
var sb = new StringBuilder();
|
||||
sb.append("COMBO User: " + event.getUser().getProfileName()+" ");
|
||||
sb.append("Name: " + event.getGift().name() + " ");
|
||||
sb.append("GIFT User: " + event.getUser().getProfileName()+" ");
|
||||
sb.append("Name: " + event.getGift().getName() + " ");
|
||||
sb.append("Combo: " + event.getCombo() + " ");
|
||||
sb.append("Type: " + event.getComboState().name());
|
||||
System.out.println(sb.toString());
|
||||
});
|
||||
})
|
||||
@@ -78,6 +62,7 @@ public class RunCollector {
|
||||
|
||||
System.in.read();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ public class MessageUtil
|
||||
var deserialized = parseMethod.invoke(null, message.getPayload());
|
||||
return JsonUtil.messageToJson(deserialized);
|
||||
} catch (Exception ex) {
|
||||
|
||||
return ConsoleColors.RED+ "Can not find mapper for "+message.getMethod();
|
||||
}
|
||||
}
|
||||
@@ -48,8 +49,13 @@ public class MessageUtil
|
||||
var parseMethod = inputClazz.getDeclaredMethod("parseFrom", byte[].class);
|
||||
var deserialized = parseMethod.invoke(null, bytes);
|
||||
return JsonUtil.messageToJson(deserialized);
|
||||
} catch (Exception ex) {
|
||||
return ConsoleColors.RED+ "Can not find mapper for "+methodName;
|
||||
} catch (Exception ex)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.append("Can not find mapper for "+methodName);
|
||||
sb.append("\n");
|
||||
//String jsonString = JsonFormat.printToString(protobufData);
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1247
Tools-EventsCollector/src/main/resources/web.json
Normal file
1247
Tools-EventsCollector/src/main/resources/web.json
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
Reference in New Issue
Block a user