Compare commits

...

11 Commits

Author SHA1 Message Date
Jacek W
2e37b6627b Merge pull request #33 from kohlerpop1/kohlerpop1-fixes/updates
Updates to TikTokGiftEvent & grammar fixes!
2023-12-18 22:56:33 +01:00
kohlerpop1
c4f0d63b43 Add toUser to TikTokGiftEvent to determine the correct user receiving a gift!
Made grammar fix to collaboration.md and README.md!
2023-12-18 16:52:40 -05:00
Jacek W
15550ed703 Update README.md 2023-12-12 19:49:52 +01:00
GitHub Action
c7d84218f2 Update version in pom.xml 2023-12-12 18:49:13 +00:00
Jacek W
1ecd192539 Merge pull request #30 from jwdeveloper/develop-1-0-8
updated structure of WebcastLinkLayerMessage
in proto file
2023-12-12 19:47:35 +01:00
JW
d6c0d50ac3 Changes:
updated structure of WebcastLinkLayerMessage
  in proto file
2023-12-12 19:46:37 +01:00
Jacek W
b4997da0a8 Merge pull request #29 from jwdeveloper/develop-1-0-8
updated structure of WebcastLinkLayerMessage
in proto file
2023-12-12 19:39:51 +01:00
JW
82990665b8 Changes:
updated structure of WebcastLinkLayerMessage
  in proto file
2023-12-12 19:38:55 +01:00
Jacek W
155b47977d Update README.md 2023-12-12 13:04:51 +01:00
Jacek W
3e262773a4 Update README.md 2023-12-11 23:37:30 +01:00
GitHub Action
89fbeb848b Update version in pom.xml 2023-12-11 22:28:01 +00:00
23 changed files with 775 additions and 41 deletions

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>TikTokLiveJava</artifactId> <artifactId>TikTokLiveJava</artifactId>
<groupId>io.github.jwdeveloper.tiktok</groupId> <groupId>io.github.jwdeveloper.tiktok</groupId>
<version>1.0.6-Release</version> <version>1.0.8-Release</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>API</artifactId> <artifactId>API</artifactId>

View File

@@ -33,7 +33,7 @@ import io.github.jwdeveloper.tiktok.messages.webcast.WebcastGiftMessage;
import lombok.Getter; import lombok.Getter;
/* /**
* Triggered when user sends gifts that has * Triggered when user sends gifts that has
* no combo (most of expensive gifts) * no combo (most of expensive gifts)
* or if combo has finished * or if combo has finished
@@ -43,11 +43,13 @@ import lombok.Getter;
public class TikTokGiftEvent extends TikTokHeaderEvent { public class TikTokGiftEvent extends TikTokHeaderEvent {
private final Gift gift; private final Gift gift;
private final User user; private final User user;
private final User toUser;
private final int combo; private final int combo;
public TikTokGiftEvent(Gift gift, WebcastGiftMessage msg) { public TikTokGiftEvent(Gift gift, WebcastGiftMessage msg) {
super(msg.getCommon()); super(msg.getCommon());
this.gift = gift; this.gift = gift;
user = User.map(msg.getUser(), msg.getUserIdentity()); user = User.map(msg.getUser(), msg.getUserIdentity());
toUser = User.map(msg.getToUser());
combo = msg.getComboCount(); combo = msg.getComboCount();
} }
} }

View File

@@ -1,3 +1,25 @@
/*
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.jwdeveloper.tiktok.mappers; package io.github.jwdeveloper.tiktok.mappers;
import com.google.protobuf.GeneratedMessageV3; import com.google.protobuf.GeneratedMessageV3;

View File

@@ -1,3 +1,25 @@
/*
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.jwdeveloper.tiktok.utils; package io.github.jwdeveloper.tiktok.utils;
import java.nio.file.Path; import java.nio.file.Path;

View File

@@ -1,3 +1,25 @@
/*
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.jwdeveloper.tiktok.utils; package io.github.jwdeveloper.tiktok.utils;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;

View File

@@ -1,3 +1,25 @@
/*
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.jwdeveloper.tiktok.utils; package io.github.jwdeveloper.tiktok.utils;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;

View File

@@ -1,3 +1,25 @@
/*
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.jwdeveloper.tiktok.utils; package io.github.jwdeveloper.tiktok.utils;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;

View File

@@ -1130,3 +1130,387 @@ message LinkerUpdateUserSettingContent {
message LinkerWaitingListChangeContent { message LinkerWaitingListChangeContent {
} }
message LinkmicUserSettingInfo {
int64 userId = 1;
int64 layout = 2; // @warning Enum not found, should be Layout
int64 fixMicNum = 3; // @warning Enum not found, should be FixMicNum
int64 allowRequestFromUser = 4; // @warning Enum not found, should be AllowRequestFromUser
int64 allowRequestFromFollowerOnly = 5; // @warning Enum not found, should be AllowRequestFromFollowerOnly
LinkmicApplierSortSetting applierSortSetting = 7; // Enum
}
message Player {
int64 roomId = 1;
int64 userId = 2;
}
message AllListUser {
repeated LinkLayerListUser linkedList = 2;
repeated LinkLayerListUser appliedList = 3;
repeated LinkLayerListUser invitedList = 4;
repeated LinkLayerListUser readyList = 5;
}
message LinkLayerListUser {
User user = 1;
string linkmicId = 2;
Position pos = 3;
int64 linkedTimeNano = 4;
string appVersion = 5;
}
message Position {
int32 type = 1;
LinkPosition link = 2;
}
message LinkPosition {
int32 position = 1;
int32 opt = 2;
}
message GroupPlayer {
int64 channelId = 1;
User user = 2;
}
message DSLConfig {
int32 sceneVersion = 1;
string layoutId = 2;
}
message GroupChannelAllUser {
int64 groupChannelId = 1;
repeated GroupChannelUser userList = 2;
}
message GroupChannelUser {
int64 channelId = 1;
GroupStatus status = 2; // Enum
TextType type = 3; // Enum
AllListUser allUser = 4;
int64 joinTime = 5;
int64 linkedTime = 6;
GroupPlayer ownerUser = 7;
}
message RTCExtraInfo {
RTCEngineConfig liveRtcEngineConfig = 1;
repeated RTCLiveVideoParam liveRtcVideoParamList = 2;
RTCBitrateMap rtcBitrateMap = 3;
int32 rtcFps = 4;
string rtcBusinessId = 8;
int32 interactClientType = 10;
message RTCEngineConfig {
string rtcAppId = 1;
string rtcUserId = 2;
string rtcToken = 3;
int64 rtcChannelId = 4;
}
message RTCLiveVideoParam {
int32 strategyId = 1;
RTCVideoParam params = 2;
}
message RTCVideoParam {
int32 width = 1;
int32 height = 2;
int32 fps = 3;
int32 bitrateKbps = 4;
}
message RTCBitrateMap {
int32 xx1 = 1;
int32 xx2 = 2;
int32 xx3 = 3;
int32 xx4 = 4;
}
}
message CreateChannelContent {
Player owner = 1;
string ownerLinkMicId = 2;
}
message ListChangeContent {
TextType type = 1; // Enum
AllListUser list = 2;
}
message MultiLiveContent {
InviteBizContent inviteBizContent = 2;
ReplyBizContent replyBizContent = 3;
PermitBizContent permitBizContent = 4;
KickOutBizContent kickOutBizContent = 6;
message InviteBizContent {
LinkmicUserSettingInfo anchorSettingInfo = 1;
int64 inviteSource = 2; // @warning Enum not found, should be InviteSource
User operatorUserInfo = 3;
int64 operatorLinkAdminType = 4; // @warning Enum not found, should be OperatorLinkAdminType
User inviteeUserInfo = 5;
}
message ReplyBizContent {
int32 linkType = 1;
int32 isTurnOffInvitation = 2;
User replyUserInfo = 3;
}
message PermitBizContent {
LinkmicUserSettingInfo anchorSettingInfo = 1;
int64 expireTimestamp = 2;
User operatorUserInfo = 3;
int64 operatorLinkAdminType = 4; // @warning Enum not found, should be OperatorLinkAdminType
}
message KickOutBizContent {
User operatorUserInfo = 1;
int64 operatorLinkAdminType = 2; // @warning Enum not found, should be OperatorLinkAdminType
User kickPlayerUserInfo = 3;
}
}
message InviteContent {
Player invitor = 1;
RTCExtraInfo inviteeRtcExtInfo = 2;
string invitorLinkMicId = 3;
string inviteeLinkMicId = 4;
bool isOwner = 5;
Position pos = 6;
DSLConfig dsl = 7;
User invitee = 8;
User operator = 9;
}
// @ApplyContent
// proto.webcast.im
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
message ApplyContent {
Player applier = 1;
string applierLinkMicId = 2;
}
// @PermitApplyContent
// proto.webcast.im
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
message PermitApplyContent {
Player permiter = 1;
string permiterLinkMicId = 2;
Position applierPos = 3;
ReplyStatus replyStatus = 4; // Enum
DSLConfig dsl = 5;
User applier = 6;
User operator = 7;
string applierLinkMicId = 8;
}
// @ReplyInviteContent
// proto.webcast.im
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
message ReplyInviteContent {
Player invitee = 1;
ReplyStatus replyStatus = 2; // Enum
string inviteeLinkMicId = 3;
Position inviteePos = 4;
Player inviteOperatorUser = 5;
}
// @KickOutContent
// proto.webcast.im
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
message KickOutContent {
Player offliner = 1;
KickoutReason kickoutReason = 2; // Enum
}
// @CancelApplyContent
// proto.webcast.im
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
message CancelApplyContent {
Player applier = 1;
string applierLinkMicId = 2;
}
// @CancelInviteContent
// proto.webcast.im
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
message CancelInviteContent {
Player invitor = 1;
string invitorLinkMicId = 2;
string inviteeLinkMicId = 3;
int64 inviteSeqId = 4;
Player invitee = 5;
}
// @LeaveContent
// proto.webcast.im
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
message LeaveContent {
Player leaver = 1;
int64 leaveReason = 2;
}
// @FinishChannelContent
// proto.webcast.im
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
message FinishChannelContent {
Player owner = 1;
int64 finishReason = 2;
}
// @JoinDirectContent
// proto.webcast.im
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
message JoinDirectContent {
LinkLayerListUser joiner = 1;
AllListUser allUsers = 2;
}
// @LeaveJoinGroupContent
// proto.webcast.im
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
message LeaveJoinGroupContent {
GroupPlayer operator = 1;
int64 groupChannelId = 2;
string leaveSource = 3;
}
// @PermitJoinGroupContent
// proto.webcast.im
message PermitJoinGroupContent {
GroupPlayer approver = 1;
AgreeStatus agreeStatus = 2; // Enum
TextType type = 3; // Enum
repeated RTCExtraInfo groupExtInfoList = 4;
GroupChannelAllUser groupUser = 5;
}
// @CancelJoinGroupContent
// proto.webcast.im
message CancelJoinGroupContent {
repeated GroupPlayer leaverList = 1;
GroupPlayer operator = 2;
TextType type = 3; // Enum
}
message P2PGroupChangeContent {
repeated RTCExtraInfo groupExtInfoList = 1;
GroupChannelAllUser groupUser = 2;
}
message BusinessContent {
int64 overLength = 1;
MultiLiveContent multiLiveContent = 100;
CohostContent cohostContent = 200;
message CohostContent {
JoinGroupBizContent joinGroupBizContent = 1;
}
message JoinGroupBizContent {
int32 fromRoomAgeRestricted = 1;
Tag fromTag = 2;
PerceptionDialogInfo dialog = 3;
PunishEventInfo punishInfo = 4;
JoinGroupMessageExtra joinGroupMsgExtra = 101;
}
message Tag {
int32 tagType = 1;
string tagValue = 2;
string tagText = 3;
}
message PerceptionDialogInfo {
int64 iconType = 1; // @warning Enum not found, should be IconType
Text title = 2;
Text subTitle = 3;
Text adviceActionText = 4;
Text defaultActionText = 5;
string violationDetailUrl = 6;
int32 scene = 7;
int64 targetUserId = 8;
int64 targetRoomId = 9;
int64 countDownTime = 10;
bool showFeedback = 11;
repeated PerceptionFeedbackOption feedbackOptionsList = 12;
int64 policyTip = 13;
}
message PerceptionFeedbackOption {
int64 id = 1;
string contentKey = 2;
}
message JoinGroupMessageExtra {
int64 sourceType = 1;
RivalExtra extra = 2;
repeated RivalExtra otherUsersList = 3;
// @RivalExtra
// proto.webcast.im.JoinGroupMessageExtra
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
message RivalExtra {
int64 userCount = 4;
Image avatarThumb = 5;
string displayId = 6;
AuthenticationInfo authenticationInfo = 7;
string nickname = 8;
int64 followStatus = 9;
Hashtag hashtag = 10;
TopHostInfo topHostInfo = 11;
int64 userId = 12;
bool isBestTeammate = 13;
message AuthenticationInfo {
string customVerify = 1;
string enterpriseVerifyReason = 2;
Image authenticationBadge = 3;
}
}
}
message Hashtag {
int64 id = 1;
string title = 2;
Image image = 3;
HashtagNamespace namespace = 4; // Enum
}
message TopHostInfo {
string rankType = 1;
int64 topIndex = 2;
}
}
message JoinGroupContent {
GroupChannelAllUser groupUser = 1;
GroupPlayer joinUser = 2;
TextType type = 3; // Enum
}

View File

@@ -25,6 +25,85 @@ enum EmotePrivateType {
EMOTE_PRIVATE_TYPE_SUB_WAVE = 1; EMOTE_PRIVATE_TYPE_SUB_WAVE = 1;
} }
enum TextType {
DISPLAY_TEXT = 0;
CONTENT = 1;
}
enum LinkmicApplierSortSetting {
LINKMIC_APPLIER_SORT_SETTING_NONE = 0;
LINKMIC_APPLIER_SORT_SETTING_BY_GIFT_SCORE = 1;
}
enum HashtagNamespace {
GLOBAL = 0;
GAMING = 1;
}
enum AgreeStatus {
AGREE_UNKNOWN = 0;
AGREE = 1;
REJECT = 2;
}
enum KickoutReason {
KICKOUT_REASON_UNKNOWN = 0;
KICKOUT_REASON_FIRST_FRAME_TIMEOUT = 1;
KICKOUT_REASON_BY_HOST = 2;
KICKOUT_REASON_RTC_LOST_CONNECTION = 3;
KICKOUT_REASON_BY_PUNISH = 4;
KICKOUT_REASON_BY_ADMIN = 5;
KICKOUT_REASON_HOST_REMOVE_ALL_GUESTS = 6;
}
enum GroupStatus {
GROUP_STATUS_UNKNOWN = 0;
GROUP_STATUS_WAITING = 1;
GROUP_STATUS_LINKED = 3;
}
enum BusinessCase {
BUSINESS_NOT_SET = 0;
APPLY_BIZ_CONTENT = 1;
INVITE_BIZ_CONTENT = 2;
REPLY_BIZ_CONTENT = 3;
PERMIT_BIZ_CONTENT = 4;
JOIN_DIRECT_BIZ_CONTENT = 5;
KICK_OUT_BIZ_CONTENT = 6;
LIST_CHANGE_BIZ_CONTENT = 11;
MULTI_LIVE_CONTENT = 100;
COHOST_CONTENT = 200;
}
enum ReplyStatus {
REPLY_STATUS_UNKNOWN = 0;
REPLY_STATUS_AGREE = 1;
REPLY_STATUS_REFUSE_PERSONALLY = 2;
REPLY_STATUS_REFUSE_TYPE_NOT_SUPPORT = 3;
REPLY_STATUS_REFUSE_PROCESSING_INVITATION = 4;
REPLY_STATUS_REFUSE_BY_TIMEOUT = 5;
REPLY_STATUS_REFUSE_EXCEPTION = 6;
REPLY_STATUS_REFUSE_SYSTEM_NOT_SUPPORTED = 7;
REPLY_STATUS_REFUSE_SUBTYPE_DIFFERENCE = 8;
REPLY_STATUS_REFUSE_IN_MICROOM = 9;
REPLY_STATUS_REFUSE_NOT_LOAD_PLUGIN = 10;
REPLY_STATUS_REFUSE_IN_MULTI_GUEST = 11;
REPLY_STATUS_REFUSE_PAUSE_LIVE = 12;
REPLY_STATUS_REFUSE_OPEN_CAMERA_DIALOG_SHOWING = 13;
REPLY_STATUS_REFUSE_DRAW_GUESSING = 14;
REPLY_STATUS_REFUSE_RANDOM_MATCHING = 15;
REPLY_STATUS_REFUSE_IN_MATCH_PROCESSING = 16;
REPLY_STATUS_REFUSE_IN_MICROOM_FOR_MULTI_COHOST = 17;
REPLY_STATUS_REFUSE_COHOST_FINISHED = 18;
REPLY_STATUS_REFUSE_NOT_CONNECTED = 19;
REPLY_STATUS_REFUSE_LINKMIC_FULL = 20;
REPLY_STATUS_REFUSE_ARC_INCOMPATIBLE = 21;
REPLY_STATUS_REFUSE_PROCESSING_OTHER_INVITE = 22;
REPLY_STATUS_REFUSE_PROCESSING_OTHER_APPLY = 23;
REPLY_STATUS_REFUSE_IN_ANCHOR_COHOST = 24;
REPLY_STATUS_REFUSE_TOPIC_PAIRING = 25;
}
enum SubscribeType { enum SubscribeType {
SUBSCRIBETYPE_ONCE = 0; SUBSCRIBETYPE_ONCE = 0;
@@ -137,3 +216,50 @@ enum EnvelopeDisplay
EnvelopeDisplayNew = 1; EnvelopeDisplayNew = 1;
EnvelopeDisplayHide = 2; EnvelopeDisplayHide = 2;
} }
enum CommonContentCase {
COMMON_CONTENT_NOT_SET = 0;
CREATE_CHANNEL_CONTENT = 100;
LIST_CHANGE_CONTENT = 102;
INVITE_CONTENT = 103;
APPLY_CONTENT = 104;
PERMIT_APPLY_CONTENT = 105;
REPLY_INVITE_CONTENT = 106;
KICK_OUT_CONTENT = 107;
CANCEL_APPLY_CONTENT = 108;
CANCEL_INVITE_CONTENT = 109;
LEAVE_CONTENT = 110;
FINISH_CONTENT = 111;
JOIN_DIRECT_CONTENT = 112;
JOIN_GROUP_CONTENT = 113;
PERMIT_GROUP_CONTENT = 114;
CANCEL_GROUP_CONTENT = 115;
LEAVE_GROUP_CONTENT = 116;
P2P_GROUP_CHANGE_CONTENT = 117;
GROUP_CHANGE_CONTENT = 118;
}
enum MessageType {
MESSAGETYPE_SUBSUCCESS = 0;
MESSAGETYPE_ANCHORREMINDER = 1;
MESSAGETYPE_ENTERROOMEXPIRESOON = 2;
MESSAGETYPE_SUBGOALCREATETOANCHOR = 3;
MESSAGETYPE_SUBGOALCOMPLETETOAUDIENCE = 4;
MESSAGETYPE_SUBGOALCOMPLETETOANCHOR = 5;
MESSAGETYPE_SUBGIFTTIKTOK2USERNOTICE = 6;
MESSAGETYPE_SUBGIFTTIKTOK2ANCHORNOTICE = 7;
MESSAGETYPE_SUBGIFTTRECEIVESENDNOTICE = 8;
MESSAGETYPE_SUBGIFTSENDSUCCEEDROOMMESSAGE = 9;
MESSAGETYPE_SUBGIFTSENDSUCCEEDANCHORNOTICE = 10;
MESSAGETYPE_SUBGIFTLOWVERSIONUPGRADENOTICE = 11;
MESSAGETYPE_SUBGIFTUSERBUYAUTHNOTICE = 12;
}
enum Scene {
SCENE_UNKNOWN = 0;
SCENE_CO_HOST = 2;
SCENE_MULTI_LIVE = 4;
}

View File

@@ -442,7 +442,7 @@ message WebcastMemberMessage {
//@WebcastPollMessage //@WebcastPollMessage
message WebcastPollMessage { message WebcastPollMessage {
Common common = 1; Common common = 1;
int32 messageType = 2; MessageType messageType = 2;
int64 pollId = 3; int64 pollId = 3;
PollStartContent startContent = 4; PollStartContent startContent = 4;
PollEndContent endContent = 5; PollEndContent endContent = 5;
@@ -576,7 +576,7 @@ message WebcastLinkMicFanTicketMethod {
//@WebcastLinkMicMethod //@WebcastLinkMicMethod
message WebcastLinkMicMethod { message WebcastLinkMicMethod {
Common common = 1; Common common = 1;
int64 messageType = 2; MessageType messageType = 2;
string accessKey = 3; string accessKey = 3;
int64 anchorLinkmicId = 4; int64 anchorLinkmicId = 4;
int64 userId = 5; int64 userId = 5;
@@ -683,9 +683,9 @@ message WebcastSystemMessage {
//@WebcastLinkMessage //@WebcastLinkMessage
message WebcastLinkMessage { message WebcastLinkMessage {
Common common = 1; Common common = 1;
int64 MessageType = 2; MessageType MessageType = 2;
int64 LinkerId = 3; int64 LinkerId = 3;
int64 Scene = 4; Scene Scene = 4;
LinkerInviteContent InviteContent = 5; LinkerInviteContent InviteContent = 5;
LinkerReplyContent ReplyContent = 6; LinkerReplyContent ReplyContent = 6;
LinkerCreateContent CreateContent = 7; LinkerCreateContent CreateContent = 7;
@@ -712,14 +712,34 @@ message WebcastLinkMessage {
string TransferExtra = 202; string TransferExtra = 202;
} }
// @WebcastLinkLayerMessage // @WebcastLinkLayerMessage
message WebcastLinkLayerMessage { message WebcastLinkLayerMessage {
Common common = 1; Common common = 1;
LinkLayerMessageType messageType = 2; MessageType messageType = 2; // Enum
int64 channelId = 3; int64 channelId = 3;
Scene scene = 4; // Enum
CreateChannelContent createChannelContent = 100;
ListChangeContent listChangeContent = 102;
InviteContent inviteContent = 103;
ApplyContent applyContent = 104;
PermitApplyContent permitApplyContent = 105;
ReplyInviteContent replyInviteContent = 106;
KickOutContent kickOutContent = 107;
CancelApplyContent cancelApplyContent = 108;
CancelInviteContent cancelInviteContent = 109;
LeaveContent leaveContent = 110;
FinishChannelContent finishContent = 111;
JoinDirectContent joinDirectContent = 112;
JoinGroupContent joinGroupContent = 113;
PermitJoinGroupContent permitGroupContent = 114;
CancelJoinGroupContent cancelGroupContent = 115;
LeaveJoinGroupContent leaveGroupContent = 116;
P2PGroupChangeContent p2pGroupChangeContent = 117;
BusinessContent businessContent = 200;
} }
// @RoomVerifyMessage
message RoomVerifyMessage { message RoomVerifyMessage {
Common common = 1; Common common = 1;
int32 action = 2; int32 action = 2;

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>TikTokLiveJava</artifactId> <artifactId>TikTokLiveJava</artifactId>
<groupId>io.github.jwdeveloper.tiktok</groupId> <groupId>io.github.jwdeveloper.tiktok</groupId>
<version>1.0.6-Release</version> <version>1.0.8-Release</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -1,3 +1,25 @@
/*
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.jwdeveloper.tiktok.mappers; package io.github.jwdeveloper.tiktok.mappers;
import com.google.protobuf.GeneratedMessageV3; import com.google.protobuf.GeneratedMessageV3;

View File

@@ -1,3 +1,25 @@
/*
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.jwdeveloper.tiktok.mappers.events; package io.github.jwdeveloper.tiktok.mappers.events;
import io.github.jwdeveloper.tiktok.data.events.*; import io.github.jwdeveloper.tiktok.data.events.*;
@@ -43,9 +65,9 @@ public class TikTokCommonEventHandler
public TikTokEvent handlePollEvent(byte[] msg) { public TikTokEvent handlePollEvent(byte[] msg) {
var poolMessage = WebcastPollMessage.parseFrom(msg); var poolMessage = WebcastPollMessage.parseFrom(msg);
return switch (poolMessage.getMessageType()) { return switch (poolMessage.getMessageType()) {
case 0 -> new TikTokPollStartEvent(poolMessage); case MESSAGETYPE_SUBSUCCESS -> new TikTokPollStartEvent(poolMessage);
case 1 -> new TikTokPollEndEvent(poolMessage); case MESSAGETYPE_ANCHORREMINDER -> new TikTokPollEndEvent(poolMessage);
case 2 -> new TikTokPollUpdateEvent(poolMessage); case MESSAGETYPE_ENTERROOMEXPIRESOON -> new TikTokPollUpdateEvent(poolMessage);
default -> new TikTokPollEvent(poolMessage); default -> new TikTokPollEvent(poolMessage);
}; };
} }

View File

@@ -41,7 +41,7 @@
<parent> <parent>
<artifactId>TikTokLiveJava</artifactId> <artifactId>TikTokLiveJava</artifactId>
<groupId>io.github.jwdeveloper.tiktok</groupId> <groupId>io.github.jwdeveloper.tiktok</groupId>
<version>1.0.6-Release</version> <version>1.0.8-Release</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -1,3 +1,25 @@
/*
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.jwdeveloper.tiktok; package io.github.jwdeveloper.tiktok;
import io.github.jwdeveloper.tiktok.data.events.TikTokErrorEvent; import io.github.jwdeveloper.tiktok.data.events.TikTokErrorEvent;

View File

@@ -0,0 +1,35 @@
/*
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.jwdeveloper.tiktok;
public class Examplee
{
public static void main(String[] args)
{
TikTokLive.newClient("skullchefasmr")
.onGift((liveClient, event) ->
{
System.out.println("Dzięki za gifta "+event.getGift().getName());
}).buildAndConnect();
}
}

View File

@@ -1,7 +1,6 @@
<div align="center" > <div align="center" >
<a target="blank" > <a target="blank" >
<img src="https://raw.githubusercontent.com/jwdeveloper/TikTokLiveJava/develop-1_0_0/Tools-ReadmeGenerator/src/main/resources/logo.svg" width="15%" > <img src="https://raw.githubusercontent.com/jwdeveloper/TikTokLiveJava/develop-1_0_0/Tools-ReadmeGenerator/src/main/resources/logo.svg" width="15%" >
</img>
</a> </a>
</div> </div>
<div align="center" > <div align="center" >
@@ -12,18 +11,15 @@
<div align="center" > <div align="center" >
<a href="https://jitpack.io/#jwdeveloper/TikTok-Live-Java" target="blank" > <a href="https://jitpack.io/#jwdeveloper/TikTok-Live-Java" target="blank" >
<img src="https://jitpack.io/v/jwdeveloper/TikTok-Live-Java.svg" width="20%" > <img src="https://jitpack.io/v/jwdeveloper/TikTok-Live-Java.svg" width="20%" >
</img>
</a> </a>
<a href="https://discord.gg/e2XwPNTBBr" target="blank" > <a href="https://discord.gg/e2XwPNTBBr" target="blank" >
<img src="https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white" > <img src="https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white" >
</img>
</a> </a>
<a target="blank" > <a target="blank" >
<img src="https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge&logo=openjdk&logoColor=white" > <img src="https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge&logo=openjdk&logoColor=white" >
</img>
</a> </a>
</div> </div>
</div> </div>
@@ -33,6 +29,9 @@ A Java library inspired by [TikTokLive](https://github.com/isaackogan/TikTokLive
The library includes a wrapper that connects to the WebCast service using just the username (`uniqueId`). This allows you to connect to your own live chat as well as the live chat of other streamers. The library includes a wrapper that connects to the WebCast service using just the username (`uniqueId`). This allows you to connect to your own live chat as well as the live chat of other streamers.
No credentials are required. Events such as [Members Joining](#member), [Gifts](#gift), [Subscriptions](#subscribe), [Viewers](#roomuser), [Follows](#social), [Shares](#social), [Questions](#questionnew), [Likes](#like) and [Battles](#linkmicbattle) can be tracked. No credentials are required. Events such as [Members Joining](#member), [Gifts](#gift), [Subscriptions](#subscribe), [Viewers](#roomuser), [Follows](#social), [Shares](#social), [Questions](#questionnew), [Likes](#like) and [Battles](#linkmicbattle) can be tracked.
# Contributors
[Library documentation for contributors](https://github.com/jwdeveloper/TikTokLiveJava/wiki)
<div align="center"> <div align="center">
<a href="https://www.youtube.com/watch?v=eerWGgUKc6c" align="right" target="blank"><img src="https://img.youtube.com/vi/eerWGgUKc6c/hqdefault.jpg" alt="IMAGE ALT TEXT" width="38%" align="right"></a> <a href="https://www.youtube.com/watch?v=eerWGgUKc6c" align="right" target="blank"><img src="https://img.youtube.com/vi/eerWGgUKc6c/hqdefault.jpg" alt="IMAGE ALT TEXT" width="38%" align="right"></a>
</div> </div>
@@ -70,7 +69,7 @@ Maven
<dependency> <dependency>
<groupId>com.github.jwdeveloper.TikTok-Live-Java</groupId> <groupId>com.github.jwdeveloper.TikTok-Live-Java</groupId>
<artifactId>Client</artifactId> <artifactId>Client</artifactId>
<version>1.0.6-Release</version> <version>1.0.8-Release</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@@ -87,7 +86,7 @@ dependencyResolutionManagement {
} }
dependencies { dependencies {
implementation 'com.github.jwdeveloper.TikTok-Live-Java:Client:1.0.6-Release' implementation 'com.github.jwdeveloper.TikTok-Live-Java:Client:1.0.8-Release'
} }
``` ```
@@ -435,9 +434,9 @@ Triggered every time gift is sent
<p>>Combo: 1 -> comboState = GiftSendType.Begin</p> <p>>Combo: 1 -> comboState = GiftSendType.Begin</p>
<p>Combo: 4 -> comboState = GiftSendType.Active</p> <p>Combo: 4 -> comboState = GiftSendType.Active</p>
<p>Combo: 8 -> comboState = GiftSendType.Active</p> <p>Combo: 8 -> comboState = GiftSendType.Active</p>
<p>Combo: 12 -> comboState = GiftSendType.Finsihed</p> <p>Combo: 12 -> comboState = GiftSendType.Finished</p>
Remember if comboState is Finsihed both TikTokGiftComboEvent and TikTokGiftEvent event gets triggered Remember if comboState is Finished both TikTokGiftComboEvent and TikTokGiftEvent event gets triggered
```java ```java

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>TikTokLiveJava</artifactId> <artifactId>TikTokLiveJava</artifactId>
<groupId>io.github.jwdeveloper.tiktok</groupId> <groupId>io.github.jwdeveloper.tiktok</groupId>
<version>1.0.6-Release</version> <version>1.0.8-Release</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>TikTokLiveJava</artifactId> <artifactId>TikTokLiveJava</artifactId>
<groupId>io.github.jwdeveloper.tiktok</groupId> <groupId>io.github.jwdeveloper.tiktok</groupId>
<version>1.0.6-Release</version> <version>1.0.8-Release</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>Tools-EventsWebViewer</artifactId> <artifactId>Tools-EventsWebViewer</artifactId>

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>TikTokLiveJava</artifactId> <artifactId>TikTokLiveJava</artifactId>
<groupId>io.github.jwdeveloper.tiktok</groupId> <groupId>io.github.jwdeveloper.tiktok</groupId>
<version>1.0.6-Release</version> <version>1.0.8-Release</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>TikTokLiveJava</artifactId> <artifactId>TikTokLiveJava</artifactId>
<groupId>io.github.jwdeveloper.tiktok</groupId> <groupId>io.github.jwdeveloper.tiktok</groupId>
<version>1.0.6-Release</version> <version>1.0.8-Release</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -27,7 +27,7 @@ Are you willing to help or improve TikTokLiveJava?
- Connecting to TikTok websocket (PushServer) - Connecting to TikTok websocket (PushServer)
After successful connection to TikTok, `pushServer` starts to send `ProtocolBuffer` After successful connection to TikTok, `pushServer` starts to send `ProtocolBuffer`
messages in binary format. This is very important to understand `ProtocolBuffer. Don't worry it is not complicated :). messages in binary format. This is very important to understand `ProtocolBuffer`. Don't worry it is not complicated :).
All the proto files are included under `API/src/main/proto` After using `Maven compile` command on project, java classes are generated from All the proto files are included under `API/src/main/proto` After using `Maven compile` command on project, java classes are generated from
those files. so then we can easily map incoming bytes to classes, for examples those files. so then we can easily map incoming bytes to classes, for examples
`WebcastGiftMessage message = WebcastGiftMessage.parseFrom(incomingBytesArray)` `WebcastGiftMessage message = WebcastGiftMessage.parseFrom(incomingBytesArray)`
@@ -201,11 +201,3 @@ need to also include it to interface `EventsBuilder`
Finally we are good to go, our event has been included! Finally we are good to go, our event has been included!
![image](https://github.com/jwdeveloper/TikTokLiveJava/assets/79764581/36ad6f1f-b38c-4cf7-93bd-b4cc0638cba0) ![image](https://github.com/jwdeveloper/TikTokLiveJava/assets/79764581/36ad6f1f-b38c-4cf7-93bd-b4cc0638cba0)

View File

@@ -7,7 +7,7 @@
<groupId>io.github.jwdeveloper.tiktok</groupId> <groupId>io.github.jwdeveloper.tiktok</groupId>
<artifactId>TikTokLiveJava</artifactId> <artifactId>TikTokLiveJava</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>1.0.6-Release</version> <version>1.0.8-Release</version>
<modules> <modules>
<module>API</module> <module>API</module>
<module>Client</module> <module>Client</module>