Skip to content

Commit d90ab60

Browse files
authored
Merge pull request #118 from jwdeveloper/develop-1.8.14
Add signature to user class and remove no longer UUC param!
2 parents d74c294 + 33f9862 commit d90ab60

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

API/src/main/java/io/github/jwdeveloper/tiktok/data/models/users/User.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
public class User {
3434
private final Long id;
3535
private final String name;
36+
private String signature;
3637
private String profileName;
3738
private Picture picture;
3839
private long following;
@@ -106,13 +107,15 @@ public User(Long userId,
106107
public User(Long id,
107108
String name,
108109
String profileName,
110+
String signature,
109111
Picture picture,
110112
long following,
111113
long followers,
112114
List<Badge> badges) {
113115
this.id = id;
114116
this.name = name;
115117
this.profileName = profileName;
118+
this.signature = signature;
116119
this.picture = picture;
117120
this.following = following;
118121
this.followers = followers;
@@ -133,7 +136,7 @@ public User(Long userId,
133136
}
134137

135138
public User(long id, String name, String profileId, Picture picture) {
136-
this(id, name, profileId, picture, 0, 0, List.of(Badge.empty()));
139+
this(id, name, profileId, null, picture, 0, 0, List.of(Badge.empty()));
137140
}
138141

139142
public User(WebcastLinkMicBattle.LinkMicBattleHost.HostGroup.Host host) {
@@ -142,6 +145,7 @@ public User(WebcastLinkMicBattle.LinkMicBattleHost.HostGroup.Host host) {
142145

143146
public User(io.github.jwdeveloper.tiktok.messages.data.User user) {
144147
this(user.getId(), user.getDisplayId(), Picture.map(user.getAvatarThumb()));
148+
signature = user.getBioDescription();
145149
profileName = user.getNickname();
146150
following = user.getFollowInfo().getFollowingCount();
147151
followers = user.getFollowInfo().getFollowerCount();

Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveHttpClient.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ protected ActionResult<HttpResponse<byte[]>> getStartingPayload(LiveConnectionDa
219219
protected ActionResult<HttpResponse<byte[]>> getByteResponse(String room_id) {
220220
HttpClientBuilder builder = httpFactory.client(TIKTOK_SIGN_API)
221221
.withParam("client", "ttlive-java")
222-
.withParam("uuc", "1") //MAGIC NUMBER!
223222
.withParam("room_id", room_id);
224223

225224
if (clientSettings.getApiKey() != null)

Client/src/main/java/io/github/jwdeveloper/tiktok/http/mappers/LiveDataMapper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ public User getUser(JsonObject jsonElement) {
131131
var id = jsonElement.get("id").getAsLong();
132132
var name = jsonElement.get("display_id").getAsString();
133133
var profileName = jsonElement.get("nickname").getAsString();
134+
var signature = jsonElement.get("bio_description").getAsString();
134135

135136

136137
var followElement = jsonElement.getAsJsonObject("follow_info");
@@ -142,7 +143,7 @@ public User getUser(JsonObject jsonElement) {
142143
var link = pictureElement.getAsJsonArray("url_list").get(1).getAsString();
143144
var picture = new Picture(link);
144145

145-
var user = new User(id, name, profileName, picture, followingCount, followers, new ArrayList<>());
146+
var user = new User(id, name, profileName, signature, picture, followingCount, followers, new ArrayList<>());
146147
user.addAttribute(UserAttribute.LiveHost);
147148
return user;
148149
}

Client/src/main/java/io/github/jwdeveloper/tiktok/http/mappers/LiveUserDataMapper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public LiveUserData.Response map(String json, Logger logger) {
7272
Long.parseLong(user.get("id").getAsString()),
7373
user.get("uniqueId").getAsString(),
7474
user.get("nickname").getAsString(),
75+
user.get("signature").getAsString(),
7576
new Picture(user.get("avatarLarger").getAsString()),
7677
stats.get("followingCount").getAsLong(),
7778
stats.get("followerCount").getAsLong(),

0 commit comments

Comments
 (0)