From 3210a50b37e1783c0258f64c0593923a3267407a Mon Sep 17 00:00:00 2001 From: czp Date: Tue, 7 Nov 2017 03:08:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90=20live=20?= =?UTF-8?q?=E6=9C=89=E5=85=B3=20RESTFul=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 + pom.xml | 155 ++ .../hiczp/bilibili/api/BilibiliRESTAPI.java | 197 +++ .../java/com/hiczp/bilibili/api/Utils.java | 107 ++ .../interceptor/AddAccessKeyInterceptor.java | 31 + .../api/interceptor/AddAppKeyInterceptor.java | 29 + .../AddFixedHeadersInterceptor.java | 27 + .../AddFixedParamsInterceptor.java | 29 + .../BasicHttpLoggingInterceptor.java | 14 + .../SortParamsAndSignInterceptor.java | 49 + .../hiczp/bilibili/api/live/LiveService.java | 112 ++ .../api/live/entity/ActivityGiftsEntity.java | 161 +++ .../api/live/entity/AppSmallTVEntity.java | 59 + .../live/entity/BulletScreenConfigEntity.java | 81 ++ .../api/live/entity/BulletScreenEntity.java | 125 ++ .../live/entity/FreeSilverAwardEntity.java | 92 ++ .../entity/FreeSilverCurrentTaskEntity.java | 114 ++ .../bilibili/api/live/entity/GiftEntity.java | 112 ++ .../api/live/entity/GiftTopEntity.java | 199 +++ .../live/entity/IsFollowedResponseEntity.java | 70 + .../bilibili/api/live/entity/ItemsEntity.java | 105 ++ .../LiveHistoryBulletScreensEntity.java | 238 ++++ .../api/live/entity/LiveRoomInfoEntity.java | 1254 +++++++++++++++++ .../api/live/entity/PlayUrlEntity.java | 83 ++ .../api/live/entity/PlayerBagEntity.java | 194 +++ .../SendBulletScreenResponseEntity.java | 44 + .../live/entity/SendDailyResponseEntity.java | 59 + .../live/entity/SendGiftResponseEntity.java | 675 +++++++++ .../entity/SendOnlineHeartResponseEntity.java | 57 + .../api/live/entity/SignInfoEntity.java | 205 +++ .../api/live/entity/SpecialGiftEntity.java | 70 + .../api/live/entity/TitlesEntity.java | 149 ++ .../bilibili/api/live/entity/UserEntity.java | 219 +++ .../api/passport/PassportService.java | 24 + .../api/passport/entity/InfoEntity.java | 124 ++ .../api/passport/entity/KeyEntity.java | 85 ++ .../passport/entity/LoginResponseEntity.java | 102 ++ .../passport/entity/LogoutResponseEntity.java | 42 + .../entity/RefreshTokenResponseEntity.java | 102 ++ .../com/hiczp/bilibili/api/test/Config.java | 41 + .../bilibili/api/test/LiveServiceTest.java | 287 ++++ .../hiczp/bilibili/api/test/LoginTest.java | 50 + .../hiczp/bilibili/api/test/LogoutTest.java | 28 + .../hiczp/bilibili/api/test/RuleSuite.java | 40 + src/test/resources/config-template.json | 5 + 45 files changed, 6050 insertions(+) create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/java/com/hiczp/bilibili/api/BilibiliRESTAPI.java create mode 100644 src/main/java/com/hiczp/bilibili/api/Utils.java create mode 100644 src/main/java/com/hiczp/bilibili/api/interceptor/AddAccessKeyInterceptor.java create mode 100644 src/main/java/com/hiczp/bilibili/api/interceptor/AddAppKeyInterceptor.java create mode 100644 src/main/java/com/hiczp/bilibili/api/interceptor/AddFixedHeadersInterceptor.java create mode 100644 src/main/java/com/hiczp/bilibili/api/interceptor/AddFixedParamsInterceptor.java create mode 100644 src/main/java/com/hiczp/bilibili/api/interceptor/BasicHttpLoggingInterceptor.java create mode 100644 src/main/java/com/hiczp/bilibili/api/interceptor/SortParamsAndSignInterceptor.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/LiveService.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/ActivityGiftsEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/AppSmallTVEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/BulletScreenConfigEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/BulletScreenEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/FreeSilverAwardEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/FreeSilverCurrentTaskEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/GiftEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/GiftTopEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/IsFollowedResponseEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/ItemsEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/LiveHistoryBulletScreensEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/LiveRoomInfoEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/PlayUrlEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/PlayerBagEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/SendBulletScreenResponseEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/SendDailyResponseEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/SendGiftResponseEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/SendOnlineHeartResponseEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/SignInfoEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/SpecialGiftEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/TitlesEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/live/entity/UserEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/passport/PassportService.java create mode 100644 src/main/java/com/hiczp/bilibili/api/passport/entity/InfoEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/passport/entity/KeyEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/passport/entity/LoginResponseEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/passport/entity/LogoutResponseEntity.java create mode 100644 src/main/java/com/hiczp/bilibili/api/passport/entity/RefreshTokenResponseEntity.java create mode 100644 src/test/java/com/hiczp/bilibili/api/test/Config.java create mode 100644 src/test/java/com/hiczp/bilibili/api/test/LiveServiceTest.java create mode 100644 src/test/java/com/hiczp/bilibili/api/test/LoginTest.java create mode 100644 src/test/java/com/hiczp/bilibili/api/test/LogoutTest.java create mode 100644 src/test/java/com/hiczp/bilibili/api/test/RuleSuite.java create mode 100644 src/test/resources/config-template.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bed64ff --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# Created by .ignore support plugin (hsz.mobi) +.idea +*.iml +target +src/test/resources/config.json diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..8a974a6 --- /dev/null +++ b/pom.xml @@ -0,0 +1,155 @@ + + + 4.0.0 + + com.hiczp + bilibili-api + bilibili-api + 1.0 + Bilibili API + https://github.com/czp3009/bilibili-api + + + + GNU GENERAL PUBLIC LICENSE Version 3 + https://www.gnu.org/licenses/gpl-3.0.txt + + + + + + czp + czp3009@gmail.com + https://www.hiczp.com/ + + + + + scm:git@github.com:czp3009/bilibili-api.git + scm:git@github.com:czp3009/bilibili-api.git + git@github.com:czp3009/bilibili-api.git + + + + + oss + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + + com.squareup.retrofit2 + retrofit + 2.3.0 + + + + com.squareup.retrofit2 + converter-gson + 2.3.0 + + + + com.google.code.gson + gson + 2.8.2 + + + + com.squareup.okhttp3 + logging-interceptor + 3.9.0 + + + + org.slf4j + slf4j-api + 1.7.25 + + + + + junit + junit + 4.12 + test + + + + org.slf4j + slf4j-log4j12 + 1.7.25 + test + + + + commons-io + commons-io + 2.6 + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + UTF-8 + 1.8 + 1.8 + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar-no-fork + + + + + + + maven-javadoc-plugin + + + attach-javadoc + + jar + + + + + public + UTF-8 + UTF-8 + UTF-8 + + + + + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + + + diff --git a/src/main/java/com/hiczp/bilibili/api/BilibiliRESTAPI.java b/src/main/java/com/hiczp/bilibili/api/BilibiliRESTAPI.java new file mode 100644 index 0000000..415380d --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/BilibiliRESTAPI.java @@ -0,0 +1,197 @@ +package com.hiczp.bilibili.api; + +import com.hiczp.bilibili.api.interceptor.*; +import com.hiczp.bilibili.api.live.LiveService; +import com.hiczp.bilibili.api.passport.PassportService; +import com.hiczp.bilibili.api.passport.entity.*; +import okhttp3.OkHttpClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import retrofit2.Retrofit; +import retrofit2.converter.gson.GsonConverterFactory; +import sun.security.rsa.RSAPublicKeyImpl; + +import javax.security.auth.login.LoginException; +import java.io.IOException; +import java.security.InvalidKeyException; +import java.security.interfaces.RSAPublicKey; +import java.time.Instant; +import java.util.Base64; + +public class BilibiliRESTAPI { + private static final Logger LOGGER = LoggerFactory.getLogger(BilibiliRESTAPI.class); + private static String accessToken; + private static String refreshToken; + private static int mid; + + private static LiveService liveService; + private static PassportService passportService; + + //TODO 尚未实现 未登录, 服务器繁忙 等情况下的统一错误处理拦截器 + public static LiveService getLiveService() { + if (liveService == null) { + OkHttpClient okHttpClient = new OkHttpClient.Builder() + .addInterceptor(new AddFixedHeadersInterceptor( + "Display-ID", Utils.calculateDisplayId(), + "Buvid", Utils.getBUVID(), + "User-Agent", "Mozilla/5.0 BiliDroid/5.15.0 (bbcallen@gmail.com)", + "Device-ID", Utils.getHardwareId() + )).addInterceptor(new AddFixedParamsInterceptor( + "_device", "android", + "_hwid", Utils.getHardwareId(), + "build", Utils.getBUILD(), + "mobi_app", "android", + "platform", "android", + "scale", Utils.getScale(), + "src", "google", + "trace_id", Utils.calculateTraceId(), + "ts", Long.toString(Instant.now().getEpochSecond()), + "version", Utils.getVERSION() + )).addInterceptor(AddAccessKeyInterceptor.getInstance()) + .addInterceptor(AddAppKeyInterceptor.getInstance()) + .addInterceptor(SortParamsAndSignInterceptor.getInstance()) + .addInterceptor(BasicHttpLoggingInterceptor.getInstance()) + .build(); + + liveService = new Retrofit.Builder() + .baseUrl("http://api.live.bilibili.com/") + .addConverterFactory(GsonConverterFactory.create()) + .client(okHttpClient) + .build() + .create(LiveService.class); + } + return liveService; + } + + public static PassportService getPassportService() { + if (passportService == null) { + OkHttpClient okHttpClient = new OkHttpClient().newBuilder() + .addInterceptor(AddAppKeyInterceptor.getInstance()) + .addInterceptor(SortParamsAndSignInterceptor.getInstance()) + .addInterceptor(BasicHttpLoggingInterceptor.getInstance()) + .build(); + + passportService = new Retrofit.Builder() + .baseUrl("https://passport.bilibili.com/") + .addConverterFactory(GsonConverterFactory.create()) + .client(okHttpClient) + .build() + .create(PassportService.class); + } + return passportService; + } + + public static LoginResponseEntity login(String username, String password) throws IOException, LoginException { + LOGGER.debug("Login attempt with username '{}'", username); + PassportService passportService = getPassportService(); + KeyEntity keyEntity = passportService.getKey().execute().body(); + if (keyEntity.getCode() != 0) { + throw new RuntimeException(keyEntity.getMessage()); + } + RSAPublicKey rsaPublicKey; + try { + rsaPublicKey = new RSAPublicKeyImpl( + Base64.getDecoder().decode( + keyEntity.getData().getKey() + .replace("-----BEGIN PUBLIC KEY-----", "") + .replace("-----END PUBLIC KEY-----", "") + .replace("\n", "") + .getBytes() + ) + ); + } catch (InvalidKeyException e) { + throw new IOException("get broken RSA public key"); + } + String cipheredPassword; + try { + cipheredPassword = Utils.cipherPassword( + password, + keyEntity.getData().getHash(), + rsaPublicKey + ); + } catch (InvalidKeyException e) { + throw new IOException("get broken RSA public key"); + } + LoginResponseEntity loginResponseEntity = passportService.login( + username, cipheredPassword + ).execute().body(); + //TODO 不明确用户名和密码不匹配时返回的错误码 + if (loginResponseEntity.getCode() != 0) { + throw new LoginException("username or password invalid"); + } + BilibiliRESTAPI.accessToken = loginResponseEntity.getData().getAccessToken(); + BilibiliRESTAPI.refreshToken = loginResponseEntity.getData().getRefreshToken(); + BilibiliRESTAPI.mid = loginResponseEntity.getData().getMid(); + LOGGER.info("Login success with username '{}'", username); + LOGGER.debug("mid: " + BilibiliRESTAPI.mid); + return loginResponseEntity; + } + + public static InfoEntity getAccountInfo() throws IOException, LoginException { + InfoEntity infoEntity = getPassportService().getInfo(accessToken).execute().body(); + //TODO 不明确未登录时获取用户信息的错误码 + if (infoEntity.getCode() != 0) { + throw new LoginException("please try after login"); + } + return infoEntity; + } + + public static RefreshTokenResponseEntity refreshToken() throws IOException, LoginException { + return refreshToken(accessToken, refreshToken); + } + + public static RefreshTokenResponseEntity refreshToken(String accessToken, String refreshToken) throws IOException, LoginException { + RefreshTokenResponseEntity refreshTokenResponseEntity = getPassportService().refreshToken(accessToken, refreshToken).execute().body(); + //TODO 不明确 access token 和 refresh token 不匹配时的错误码 + if (refreshTokenResponseEntity.getCode() != 0) { + throw new LoginException("access token and refresh token mismatch"); + } + BilibiliRESTAPI.accessToken = refreshTokenResponseEntity.getData().getAccessToken(); + BilibiliRESTAPI.refreshToken = refreshTokenResponseEntity.getData().getRefreshToken(); + BilibiliRESTAPI.mid = refreshTokenResponseEntity.getData().getMid(); + LOGGER.info("Access token refreshed"); + LOGGER.debug("Expires in {} seconds later", refreshTokenResponseEntity.getData().getExpiresIn()); + return refreshTokenResponseEntity; + } + + public static LogoutResponseEntity logout() throws IOException, LoginException { + return logout(accessToken); + } + + public static LogoutResponseEntity logout(String accessToken) throws IOException, LoginException { + LogoutResponseEntity logoutResponseEntity = getPassportService().logout(accessToken).execute().body(); + //TODO 不明确使用无效的 access token 登出时的错误码 + if (logoutResponseEntity.getCode() != 0) { + throw new LoginException("access token invalid"); + } + BilibiliRESTAPI.accessToken = null; + BilibiliRESTAPI.refreshToken = null; + BilibiliRESTAPI.mid = 0; + LOGGER.info("Logout success"); + return logoutResponseEntity; + } + + public static String getAccessToken() { + return accessToken; + } + + public static void setAccessToken(String accessToken) { + BilibiliRESTAPI.accessToken = accessToken; + } + + public static String getRefreshToken() { + return refreshToken; + } + + public static void setRefreshToken(String refreshToken) { + BilibiliRESTAPI.refreshToken = refreshToken; + } + + public static int getMid() { + return mid; + } + + public static void setMid(int mid) { + BilibiliRESTAPI.mid = mid; + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/Utils.java b/src/main/java/com/hiczp/bilibili/api/Utils.java new file mode 100644 index 0000000..8e7b4c8 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/Utils.java @@ -0,0 +1,107 @@ +package com.hiczp.bilibili.api; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import java.math.BigInteger; +import java.security.InvalidKeyException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.interfaces.RSAPublicKey; +import java.text.SimpleDateFormat; +import java.time.Instant; +import java.util.Base64; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +public final class Utils { + private static final String APP_KEY = "1d8b6e7d45233436"; + private static final String APP_SECRET = "560c52ccd288fed045859ed18bffd973"; + private static final String HARDWARE_ID = "JxdyESFAJkcjEicQbBBsCTlbal5uX2Y"; + private static final String SCALE = "xxhdpi"; + private static final String VERSION = "5.15.0.515000"; + private static final String BUILD = VERSION.substring(VERSION.lastIndexOf(".") + 1); + private static final String BUVID = "JxdyESFAJkcjEicQbBBsCTlbal5uX2Yinfoc"; + + private static final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmm000ss"); + + //Display-ID 的值在未登录前为 Buvid-客户端启动时间, 在登录后为 mid-客户端启动时间 + public static String calculateDisplayId() { + int mid = BilibiliRESTAPI.getMid(); + if (mid != 0) { //已登录 + return calculateDisplayId(mid); + } else { //未登录 + return String.format("%s-%d", BUVID, Instant.now().getEpochSecond()); + } + } + + public static String calculateDisplayId(int mid) { + return String.format("%d-%d", mid, Instant.now().getEpochSecond()); + } + + public static String calculateTraceId() { + return simpleDateFormat.format(new Date()); + } + + //排序 params 并计算 sign + //传入值为 name1=value1 形式 + public static String calculateSign(List nameAndValues) { + Collections.sort(nameAndValues); + String encodedQuery = nameAndValues.stream().collect(Collectors.joining("&")); + try { + MessageDigest messageDigest = MessageDigest.getInstance("MD5"); + messageDigest.update((encodedQuery + APP_SECRET).getBytes()); + String md5 = new BigInteger(1, messageDigest.digest()).toString(16); + //md5 不满 32 位时左边加 0 + return ("00000000000000000000000000000000" + md5).substring(md5.length()); + } catch (NoSuchAlgorithmException e) { + throw new Error(e); + } + } + + //加密密码 + public static String cipherPassword(String password, String hash, RSAPublicKey rsaPublicKey) throws InvalidKeyException { + try { + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.ENCRYPT_MODE, rsaPublicKey); + return new String( + Base64.getEncoder().encode( + cipher.doFinal((hash + password).getBytes()) + ) + ); + } catch (NoSuchAlgorithmException | NoSuchPaddingException | IllegalBlockSizeException | BadPaddingException e) { + throw new Error(e); + } + } + + public static String getAppKey() { + return APP_KEY; + } + + public static String getAppSecret() { + return APP_SECRET; + } + + public static String getHardwareId() { + return HARDWARE_ID; + } + + public static String getScale() { + return SCALE; + } + + public static String getVERSION() { + return VERSION; + } + + public static String getBUILD() { + return BUILD; + } + + public static String getBUVID() { + return BUVID; + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/interceptor/AddAccessKeyInterceptor.java b/src/main/java/com/hiczp/bilibili/api/interceptor/AddAccessKeyInterceptor.java new file mode 100644 index 0000000..f5cfc83 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/interceptor/AddAccessKeyInterceptor.java @@ -0,0 +1,31 @@ +package com.hiczp.bilibili.api.interceptor; + +import com.hiczp.bilibili.api.BilibiliRESTAPI; +import okhttp3.HttpUrl; +import okhttp3.Interceptor; +import okhttp3.Request; +import okhttp3.Response; + +import java.io.IOException; + +public class AddAccessKeyInterceptor implements Interceptor { + private static AddAccessKeyInterceptor addAccessKeyInterceptor; + + public static AddAccessKeyInterceptor getInstance() { + if (addAccessKeyInterceptor == null) { + addAccessKeyInterceptor = new AddAccessKeyInterceptor(); + } + return addAccessKeyInterceptor; + } + + @Override + public Response intercept(Chain chain) throws IOException { + Request request = chain.request(); + HttpUrl.Builder httpUrlBuilder = request.url().newBuilder(); + String accessKey = BilibiliRESTAPI.getAccessToken(); + if (accessKey != null && accessKey.length() != 0) { + httpUrlBuilder.addQueryParameter("access_key", accessKey); + } + return chain.proceed(request.newBuilder().url(httpUrlBuilder.build()).build()); + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/interceptor/AddAppKeyInterceptor.java b/src/main/java/com/hiczp/bilibili/api/interceptor/AddAppKeyInterceptor.java new file mode 100644 index 0000000..56e6154 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/interceptor/AddAppKeyInterceptor.java @@ -0,0 +1,29 @@ +package com.hiczp.bilibili.api.interceptor; + +import com.hiczp.bilibili.api.Utils; +import okhttp3.Interceptor; +import okhttp3.Request; +import okhttp3.Response; + +import java.io.IOException; + +public class AddAppKeyInterceptor implements Interceptor { + private static AddAppKeyInterceptor addAppKeyInterceptor; + + public static AddAppKeyInterceptor getInstance() { + if (addAppKeyInterceptor == null) { + addAppKeyInterceptor = new AddAppKeyInterceptor(); + } + return addAppKeyInterceptor; + } + + @Override + public Response intercept(Chain chain) throws IOException { + Request request = chain.request(); + return chain.proceed(request.newBuilder().url( + request.url().newBuilder() + .addQueryParameter("appkey", Utils.getAppKey()) + .build() + ).build()); + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/interceptor/AddFixedHeadersInterceptor.java b/src/main/java/com/hiczp/bilibili/api/interceptor/AddFixedHeadersInterceptor.java new file mode 100644 index 0000000..531702d --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/interceptor/AddFixedHeadersInterceptor.java @@ -0,0 +1,27 @@ +package com.hiczp.bilibili.api.interceptor; + +import okhttp3.Interceptor; +import okhttp3.Request; +import okhttp3.Response; + +import java.io.IOException; + +public class AddFixedHeadersInterceptor implements Interceptor { + private String[] headerAndValues; + + public AddFixedHeadersInterceptor(String... headerAndValues) { + if (headerAndValues.length % 2 != 0) { + throw new IllegalArgumentException("header must have value"); + } + this.headerAndValues = headerAndValues; + } + + @Override + public Response intercept(Chain chain) throws IOException { + Request.Builder requestBuilder = chain.request().newBuilder(); + for (int i = 0; i < headerAndValues.length; i += 2) { + requestBuilder.addHeader(headerAndValues[i], headerAndValues[i + 1]); + } + return chain.proceed(requestBuilder.build()); + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/interceptor/AddFixedParamsInterceptor.java b/src/main/java/com/hiczp/bilibili/api/interceptor/AddFixedParamsInterceptor.java new file mode 100644 index 0000000..83b3e7b --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/interceptor/AddFixedParamsInterceptor.java @@ -0,0 +1,29 @@ +package com.hiczp.bilibili.api.interceptor; + +import okhttp3.HttpUrl; +import okhttp3.Interceptor; +import okhttp3.Request; +import okhttp3.Response; + +import java.io.IOException; + +public class AddFixedParamsInterceptor implements Interceptor { + private String[] paramAndValues; + + public AddFixedParamsInterceptor(String... paramAndValues) { + if (paramAndValues.length % 2 != 0) { + throw new IllegalArgumentException("param must have value"); + } + this.paramAndValues = paramAndValues; + } + + @Override + public Response intercept(Chain chain) throws IOException { + Request request = chain.request(); + HttpUrl.Builder httpUrlBuilder = request.url().newBuilder(); + for (int i = 0; i < paramAndValues.length; i += 2) { + httpUrlBuilder.addQueryParameter(paramAndValues[i], paramAndValues[i + 1]); + } + return chain.proceed(request.newBuilder().url(httpUrlBuilder.build()).build()); + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/interceptor/BasicHttpLoggingInterceptor.java b/src/main/java/com/hiczp/bilibili/api/interceptor/BasicHttpLoggingInterceptor.java new file mode 100644 index 0000000..6b17e53 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/interceptor/BasicHttpLoggingInterceptor.java @@ -0,0 +1,14 @@ +package com.hiczp.bilibili.api.interceptor; + +import okhttp3.logging.HttpLoggingInterceptor; + +public class BasicHttpLoggingInterceptor { + private static HttpLoggingInterceptor httpLoggingInterceptor; + + public static HttpLoggingInterceptor getInstance() { + if (httpLoggingInterceptor == null) { + httpLoggingInterceptor = new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BASIC); + } + return httpLoggingInterceptor; + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/interceptor/SortParamsAndSignInterceptor.java b/src/main/java/com/hiczp/bilibili/api/interceptor/SortParamsAndSignInterceptor.java new file mode 100644 index 0000000..06497a3 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/interceptor/SortParamsAndSignInterceptor.java @@ -0,0 +1,49 @@ +package com.hiczp.bilibili.api.interceptor; + +import com.hiczp.bilibili.api.Utils; +import okhttp3.HttpUrl; +import okhttp3.Interceptor; +import okhttp3.Request; +import okhttp3.Response; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +public class SortParamsAndSignInterceptor implements Interceptor { + private static SortParamsAndSignInterceptor sortParamsAndSignInterceptor; + + public static SortParamsAndSignInterceptor getInstance() { + if (sortParamsAndSignInterceptor == null) { + sortParamsAndSignInterceptor = new SortParamsAndSignInterceptor(); + } + return sortParamsAndSignInterceptor; + } + + @Override + public Response intercept(Chain chain) throws IOException { + Request request = chain.request(); + HttpUrl httpUrl = request.url(); + List nameAndValues = new ArrayList<>(httpUrl.querySize() + 1); + httpUrl.queryParameterNames().forEach(name -> + httpUrl.queryParameterValues(name).forEach(value -> { + try { + nameAndValues.add(String.format("%s=%s", name, URLEncoder.encode(value, StandardCharsets.UTF_8.toString()))); + } catch (UnsupportedEncodingException e) { + throw new Error(e); + } + } + ) + ); + nameAndValues.add(String.format("%s=%s", "sign", Utils.calculateSign(nameAndValues))); + return chain.proceed( + request.newBuilder() + .url(httpUrl.newBuilder().encodedQuery(nameAndValues.stream().collect(Collectors.joining("&"))).build()) + .build() + ); + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/LiveService.java b/src/main/java/com/hiczp/bilibili/api/live/LiveService.java new file mode 100644 index 0000000..b405de6 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/LiveService.java @@ -0,0 +1,112 @@ +package com.hiczp.bilibili.api.live; + +import com.hiczp.bilibili.api.live.entity.*; +import retrofit2.Call; +import retrofit2.http.*; + +public interface LiveService { + @GET("AppRoom/danmuConfig") + Call getBulletScreenConfig(@Query("type") String type); + + @GET("AppRoom/msg") + Call getHistoryBulletScreens(@Query("room_id") int roomId); + + @GET("AppRoom/index") + Call getRoomInfo(@Query("room_id") int roomId); + + @POST("feed/v1/feed/isFollowed") + Call isFollowed(@Query("follow") int follow); + + @GET("AppBag/sendDaily") + Call sendDaily(); + + @GET("AppIndex/getAllItem") + Call getAllItem(); + + @GET("AppSmallTV/index") + Call getAppSmallTV(); + + @GET("appUser/getTitle") + Call getTitle(); + + @GET("SpecialGift/room/{roomId}") + Call getSpecialGift(@Path("roomId") int roomId); + + @GET("mobile/getUser") + Call getUserInfo(); + + @GET("api/playurl") + Call getPlayUrl(@Query("cid") int cid, @Query("otype") String outputType); + + @POST("mobile/userOnlineHeart") + @FormUrlEncoded + Call sendOnlineHeart(@Field("room_id") int roomId, @Field("scale") String scale); + + @POST("api/sendmsg") + @FormUrlEncoded + Call sendBulletScreen(@Field("cid") int cid, + @Field("mid") int mid, + @Field("msg") String message, + @Field("rnd") long random, + @Field("mode") int mode, + @Field("pool") int pool, + @Field("type") String type, + @Field("color") int color, + @Field("fontsize") int fontSize, + @Field("playTime") String playTime); + + default Call sendBulletScreen(BulletScreenEntity bulletScreenEntity) { + return sendBulletScreen( + bulletScreenEntity.getCid(), + bulletScreenEntity.getMid(), + bulletScreenEntity.getMessage(), + bulletScreenEntity.getRandom(), + bulletScreenEntity.getMode(), + bulletScreenEntity.getPool(), + bulletScreenEntity.getType(), + bulletScreenEntity.getColor(), + bulletScreenEntity.getFontSize(), + bulletScreenEntity.getPlayTime() + ); + } + + @GET("mobile/freeSilverCurrentTask") + Call getFreeSilverCurrentTask(); + + @GET("mobile/freeSilverAward") + Call getFreeSilverAward(); + + @GET("AppBag/playerBag") + Call getPlayerBag(); + + @GET("AppRoom/activityGift") + Call getActivityGifts(@Query("room_id") int roomId); + + @POST("AppBag/send") + @FormUrlEncoded + Call sendGift(@Field("giftId") int giftId, + @Field("num") int number, + @Field("ruid") int roomUserId, + @Field("roomid") int roomId, + @Field("timestamp") long timeStamp, + @Field("bag_id") int bagId, + @Field("rnd") long random); + + default Call sendGift(GiftEntity giftEntity) { + return sendGift( + giftEntity.getGiftId(), + giftEntity.getNumber(), + giftEntity.getRoomUserId(), + giftEntity.getRoomId(), + giftEntity.getTimeStamp(), + giftEntity.getBagId(), + giftEntity.getRandom() + ); + } + + @GET("AppRoom/getGiftTop") + Call getGiftTop(@Query("room_id") int roomId); + + @GET("AppUser/getSignInfo") + Call getSignInfo(); +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/ActivityGiftsEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/ActivityGiftsEntity.java new file mode 100644 index 0000000..10bf9cf --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/ActivityGiftsEntity.java @@ -0,0 +1,161 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; +import java.util.Map; + +public class ActivityGiftsEntity { + /** + * code : 0 + * message : OK + * data : [{"id":102,"bag_id":48843715,"name":"秘银水壶","num":9,"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-102.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/102.gif?20171010161652","combo_num":5,"super_num":225,"count_set":"1,5,9","count_map":{"1":"","5":"连击","9":"全部"}}] + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataEntity { + /** + * id : 102 + * bag_id : 48843715 + * name : 秘银水壶 + * num : 9 + * img : http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-102.png?20171010161652 + * gift_url : http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/102.gif?20171010161652 + * combo_num : 5 + * super_num : 225 + * count_set : 1,5,9 + * count_map : {"1":"","5":"连击","9":"全部"} + */ + + @SerializedName("id") + private int id; + @SerializedName("bag_id") + private int bagId; + @SerializedName("name") + private String name; + @SerializedName("num") + private int num; + @SerializedName("img") + private String img; + @SerializedName("gift_url") + private String giftUrl; + @SerializedName("combo_num") + private int comboNum; + @SerializedName("super_num") + private int superNum; + @SerializedName("count_set") + private String countSet; + @SerializedName("count_map") + private Map countMap; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getBagId() { + return bagId; + } + + public void setBagId(int bagId) { + this.bagId = bagId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getNum() { + return num; + } + + public void setNum(int num) { + this.num = num; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + + public String getGiftUrl() { + return giftUrl; + } + + public void setGiftUrl(String giftUrl) { + this.giftUrl = giftUrl; + } + + public int getComboNum() { + return comboNum; + } + + public void setComboNum(int comboNum) { + this.comboNum = comboNum; + } + + public int getSuperNum() { + return superNum; + } + + public void setSuperNum(int superNum) { + this.superNum = superNum; + } + + public String getCountSet() { + return countSet; + } + + public void setCountSet(String countSet) { + this.countSet = countSet; + } + + public Map getCountMap() { + return countMap; + } + + public void setCountMap(Map countMap) { + this.countMap = countMap; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/AppSmallTVEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/AppSmallTVEntity.java new file mode 100644 index 0000000..004ccaa --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/AppSmallTVEntity.java @@ -0,0 +1,59 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +public class AppSmallTVEntity { + /** + * code : -400 + * message : no + * data : {"status":-1} + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + /** + * status : -1 + */ + + @SerializedName("status") + private int status; + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/BulletScreenConfigEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/BulletScreenConfigEntity.java new file mode 100644 index 0000000..b1b2113 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/BulletScreenConfigEntity.java @@ -0,0 +1,81 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +public class BulletScreenConfigEntity { + /** + * code : 0 + * message : OK + * data : {"refresh_row_factor":0.125,"refresh_rate":100,"max_delay":5000} + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + /** + * refresh_row_factor : 0.125 + * refresh_rate : 100 + * max_delay : 5000 + */ + + @SerializedName("refresh_row_factor") + private double refreshRowFactor; + @SerializedName("refresh_rate") + private int refreshRate; + @SerializedName("max_delay") + private int maxDelay; + + public double getRefreshRowFactor() { + return refreshRowFactor; + } + + public void setRefreshRowFactor(double refreshRowFactor) { + this.refreshRowFactor = refreshRowFactor; + } + + public int getRefreshRate() { + return refreshRate; + } + + public void setRefreshRate(int refreshRate) { + this.refreshRate = refreshRate; + } + + public int getMaxDelay() { + return maxDelay; + } + + public void setMaxDelay(int maxDelay) { + this.maxDelay = maxDelay; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/BulletScreenEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/BulletScreenEntity.java new file mode 100644 index 0000000..88b5a60 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/BulletScreenEntity.java @@ -0,0 +1,125 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; +import com.hiczp.bilibili.api.BilibiliRESTAPI; + +public class BulletScreenEntity { + private int cid; + + private int mid = BilibiliRESTAPI.getMid(); + + @SerializedName("msg") + private String message; + + //该随机数不包括符号位有 9 位 + @SerializedName("rnd") + private long random = (long) (Math.random() * (999999999 - (-999999999)) + (-999999999)); + + private int mode = 1; + + private int pool = 0; + + private String type = "json"; + + private int color = 16777215; + + @SerializedName("fontsize") + private int fontSize = 25; + + private String playTime = "0.0"; + + public BulletScreenEntity(int cid, String message) { + this.cid = cid; + this.message = message; + } + + public int getCid() { + return cid; + } + + public BulletScreenEntity setCid(int cid) { + this.cid = cid; + return this; + } + + public int getMid() { + return mid; + } + + public BulletScreenEntity setMid(int mid) { + this.mid = mid; + return this; + } + + public String getMessage() { + return message; + } + + public BulletScreenEntity setMessage(String message) { + this.message = message; + return this; + } + + public long getRandom() { + return random; + } + + public BulletScreenEntity setRandom(long random) { + this.random = random; + return this; + } + + public int getMode() { + return mode; + } + + public BulletScreenEntity setMode(int mode) { + this.mode = mode; + return this; + } + + public int getPool() { + return pool; + } + + public BulletScreenEntity setPool(int pool) { + this.pool = pool; + return this; + } + + public String getType() { + return type; + } + + public BulletScreenEntity setType(String type) { + this.type = type; + return this; + } + + public int getColor() { + return color; + } + + public BulletScreenEntity setColor(int color) { + this.color = color; + return this; + } + + public int getFontSize() { + return fontSize; + } + + public BulletScreenEntity setFontSize(int fontSize) { + this.fontSize = fontSize; + return this; + } + + public String getPlayTime() { + return playTime; + } + + public BulletScreenEntity setPlayTime(String playTime) { + this.playTime = playTime; + return this; + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/FreeSilverAwardEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/FreeSilverAwardEntity.java new file mode 100644 index 0000000..328092b --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/FreeSilverAwardEntity.java @@ -0,0 +1,92 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +public class FreeSilverAwardEntity { + /** + * code : 0 + * message : ok + * data : {"surplus":-1039.6166666667,"silver":2426,"awardSilver":30,"isEnd":0} + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + /** + * surplus : -1039.6166666667 + * silver : 2426 + * awardSilver : 30 + * isEnd : 0 + */ + + @SerializedName("surplus") + private double surplus; + @SerializedName("silver") + private int silver; + @SerializedName("awardSilver") + private int awardSilver; + @SerializedName("isEnd") + private int isEnd; + + public double getSurplus() { + return surplus; + } + + public void setSurplus(double surplus) { + this.surplus = surplus; + } + + public int getSilver() { + return silver; + } + + public void setSilver(int silver) { + this.silver = silver; + } + + public int getAwardSilver() { + return awardSilver; + } + + public void setAwardSilver(int awardSilver) { + this.awardSilver = awardSilver; + } + + public int getIsEnd() { + return isEnd; + } + + public void setIsEnd(int isEnd) { + this.isEnd = isEnd; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/FreeSilverCurrentTaskEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/FreeSilverCurrentTaskEntity.java new file mode 100644 index 0000000..ebcf3c3 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/FreeSilverCurrentTaskEntity.java @@ -0,0 +1,114 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +public class FreeSilverCurrentTaskEntity { + /** + * code : 0 + * message : + * data : {"minute":3,"silver":30,"time_start":1509821442,"time_end":1509821622,"times":1,"max_times":3} + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + /** + * minute : 3 + * silver : 30 + * time_start : 1509821442 + * time_end : 1509821622 + * times : 1 + * max_times : 3 + */ + + @SerializedName("minute") + private int minute; + @SerializedName("silver") + private int silver; + @SerializedName("time_start") + private int timeStart; + @SerializedName("time_end") + private int timeEnd; + @SerializedName("times") + private int times; + @SerializedName("max_times") + private int maxTimes; + + public int getMinute() { + return minute; + } + + public void setMinute(int minute) { + this.minute = minute; + } + + public int getSilver() { + return silver; + } + + public void setSilver(int silver) { + this.silver = silver; + } + + public int getTimeStart() { + return timeStart; + } + + public void setTimeStart(int timeStart) { + this.timeStart = timeStart; + } + + public int getTimeEnd() { + return timeEnd; + } + + public void setTimeEnd(int timeEnd) { + this.timeEnd = timeEnd; + } + + public int getTimes() { + return times; + } + + public void setTimes(int times) { + this.times = times; + } + + public int getMaxTimes() { + return maxTimes; + } + + public void setMaxTimes(int maxTimes) { + this.maxTimes = maxTimes; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/GiftEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/GiftEntity.java new file mode 100644 index 0000000..33dc264 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/GiftEntity.java @@ -0,0 +1,112 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +import java.time.Instant; + +public class GiftEntity { + @SerializedName("giftId") + private int giftId; + + @SerializedName("bag_id") + private int bagId; + + @SerializedName("num") + private int number; + + @SerializedName("roomid") + private int roomId; + + @SerializedName("ruid") + private int roomUserId; + + @SerializedName("timestamp") + private long timeStamp = Instant.now().getEpochSecond(); + + //该随机数有 10 位, 暂时未见到负数的情况 + @SerializedName("rnd") + private long random = (long) (Math.random() * 9999999999L); + + public GiftEntity(int giftId, int bagId, int number, int roomId, int roomUserId) { + this.giftId = giftId; + this.bagId = bagId; + this.number = number; + this.roomId = roomId; + this.roomUserId = roomUserId; + } + + public GiftEntity(int giftId, int bagId, int number, LiveRoomInfoEntity.LiveRoomEntity liveRoomEntity) { + this(giftId, bagId, number, liveRoomEntity.getRoomId(), liveRoomEntity.getMid()); + } + + public GiftEntity(PlayerBagEntity.BagGiftEntity bagGiftEntity, int number, int roomId, int roomUserId) { + this(bagGiftEntity.getGiftId(), bagGiftEntity.getId(), number, roomId, roomUserId); + } + + public GiftEntity(PlayerBagEntity.BagGiftEntity bagGiftEntity, int number, LiveRoomInfoEntity.LiveRoomEntity liveRoomEntity) { + this(bagGiftEntity.getGiftId(), bagGiftEntity.getId(), number, liveRoomEntity.getRoomId(), liveRoomEntity.getMid()); + } + + public int getGiftId() { + return giftId; + } + + public GiftEntity setGiftId(int giftId) { + this.giftId = giftId; + return this; + } + + public int getBagId() { + return bagId; + } + + public GiftEntity setBagId(int bagId) { + this.bagId = bagId; + return this; + } + + public int getNumber() { + return number; + } + + public GiftEntity setNumber(int number) { + this.number = number; + return this; + } + + public int getRoomId() { + return roomId; + } + + public GiftEntity setRoomId(int roomId) { + this.roomId = roomId; + return this; + } + + public int getRoomUserId() { + return roomUserId; + } + + public GiftEntity setRoomUserId(int roomUserId) { + this.roomUserId = roomUserId; + return this; + } + + public long getTimeStamp() { + return timeStamp; + } + + public GiftEntity setTimeStamp(long timeStamp) { + this.timeStamp = timeStamp; + return this; + } + + public long getRandom() { + return random; + } + + public GiftEntity setRandom(long random) { + this.random = random; + return this; + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/GiftTopEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/GiftTopEntity.java new file mode 100644 index 0000000..9081465 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/GiftTopEntity.java @@ -0,0 +1,199 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class GiftTopEntity { + /** + * code : 0 + * message : OK + * data : {"unlogin":0,"uname":"czp3009","rank":1,"coin":25000,"list":[{"uid":20293030,"rank":1,"isSelf":1,"score":25000,"uname":"czp3009","coin":25000,"face":"http://i0.hdslb.com/bfs/face/4f65e79399ad5a1bf3f877851b2f819d5870b494.jpg","guard_level":0},{"uid":19946822,"rank":2,"isSelf":0,"score":8000,"uname":"罗非鱼追上来了","coin":8000,"face":"http://i2.hdslb.com/bfs/face/e71031a931125617fad2c148213381bb6e0e9f26.jpg","guard_level":0},{"uid":8353249,"rank":3,"isSelf":0,"score":3500,"uname":"TcCoke","coin":3500,"face":"http://i2.hdslb.com/bfs/face/7c3c131f89380db0046024d1a903d3a6e4dc6128.jpg","guard_level":0},{"uid":12872641,"rank":4,"isSelf":0,"score":2000,"uname":"biggy2","coin":2000,"face":"http://i2.hdslb.com/bfs/face/418ac05726b3e6d4c35ff6bcda7a2751266126b5.jpg","guard_level":0},{"uid":33577376,"rank":5,"isSelf":0,"score":1100,"uname":"SASA协会-MF设计局","coin":1100,"face":"http://i2.hdslb.com/bfs/face/33ac7325236b34bb36a34dc58502c322c6ceaced.jpg","guard_level":0},{"uid":35225572,"rank":6,"isSelf":0,"score":100,"uname":"kk东子","coin":100,"face":"http://i0.hdslb.com/bfs/face/278f12f9993c84ef673785a48968aef78dbde92e.jpg","guard_level":0}]} + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + /** + * unlogin : 0 + * uname : czp3009 + * rank : 1 + * coin : 25000 + * list : [{"uid":20293030,"rank":1,"isSelf":1,"score":25000,"uname":"czp3009","coin":25000,"face":"http://i0.hdslb.com/bfs/face/4f65e79399ad5a1bf3f877851b2f819d5870b494.jpg","guard_level":0},{"uid":19946822,"rank":2,"isSelf":0,"score":8000,"uname":"罗非鱼追上来了","coin":8000,"face":"http://i2.hdslb.com/bfs/face/e71031a931125617fad2c148213381bb6e0e9f26.jpg","guard_level":0},{"uid":8353249,"rank":3,"isSelf":0,"score":3500,"uname":"TcCoke","coin":3500,"face":"http://i2.hdslb.com/bfs/face/7c3c131f89380db0046024d1a903d3a6e4dc6128.jpg","guard_level":0},{"uid":12872641,"rank":4,"isSelf":0,"score":2000,"uname":"biggy2","coin":2000,"face":"http://i2.hdslb.com/bfs/face/418ac05726b3e6d4c35ff6bcda7a2751266126b5.jpg","guard_level":0},{"uid":33577376,"rank":5,"isSelf":0,"score":1100,"uname":"SASA协会-MF设计局","coin":1100,"face":"http://i2.hdslb.com/bfs/face/33ac7325236b34bb36a34dc58502c322c6ceaced.jpg","guard_level":0},{"uid":35225572,"rank":6,"isSelf":0,"score":100,"uname":"kk东子","coin":100,"face":"http://i0.hdslb.com/bfs/face/278f12f9993c84ef673785a48968aef78dbde92e.jpg","guard_level":0}] + */ + + @SerializedName("unlogin") + private int unlogin; + @SerializedName("uname") + private String uname; + @SerializedName("rank") + private int rank; + @SerializedName("coin") + private int coin; + @SerializedName("list") + private List list; + + public int getUnlogin() { + return unlogin; + } + + public void setUnlogin(int unlogin) { + this.unlogin = unlogin; + } + + public String getUname() { + return uname; + } + + public void setUname(String uname) { + this.uname = uname; + } + + public int getRank() { + return rank; + } + + public void setRank(int rank) { + this.rank = rank; + } + + public int getCoin() { + return coin; + } + + public void setCoin(int coin) { + this.coin = coin; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public static class ListEntity { + /** + * uid : 20293030 + * rank : 1 + * isSelf : 1 + * score : 25000 + * uname : czp3009 + * coin : 25000 + * face : http://i0.hdslb.com/bfs/face/4f65e79399ad5a1bf3f877851b2f819d5870b494.jpg + * guard_level : 0 + */ + + @SerializedName("uid") + private int uid; + @SerializedName("rank") + private int rank; + @SerializedName("isSelf") + private int isSelf; + @SerializedName("score") + private int score; + @SerializedName("uname") + private String uname; + @SerializedName("coin") + private int coin; + @SerializedName("face") + private String face; + @SerializedName("guard_level") + private int guardLevel; + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } + + public int getRank() { + return rank; + } + + public void setRank(int rank) { + this.rank = rank; + } + + public int getIsSelf() { + return isSelf; + } + + public void setIsSelf(int isSelf) { + this.isSelf = isSelf; + } + + public int getScore() { + return score; + } + + public void setScore(int score) { + this.score = score; + } + + public String getUname() { + return uname; + } + + public void setUname(String uname) { + this.uname = uname; + } + + public int getCoin() { + return coin; + } + + public void setCoin(int coin) { + this.coin = coin; + } + + public String getFace() { + return face; + } + + public void setFace(String face) { + this.face = face; + } + + public int getGuardLevel() { + return guardLevel; + } + + public void setGuardLevel(int guardLevel) { + this.guardLevel = guardLevel; + } + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/IsFollowedResponseEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/IsFollowedResponseEntity.java new file mode 100644 index 0000000..602c4f6 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/IsFollowedResponseEntity.java @@ -0,0 +1,70 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +public class IsFollowedResponseEntity { + /** + * code : 0 + * msg : success + * message : success + * data : {"follow":1} + */ + + @SerializedName("code") + private int code; + @SerializedName("msg") + private String msg; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + /** + * follow : 1 + */ + + @SerializedName("follow") + private int follow; + + public int getFollow() { + return follow; + } + + public void setFollow(int follow) { + this.follow = follow; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/ItemsEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/ItemsEntity.java new file mode 100644 index 0000000..e6113c7 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/ItemsEntity.java @@ -0,0 +1,105 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class ItemsEntity { + /** + * code : 0 + * message : ok + * data : [{"id":99,"name":"花酒","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-99.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/99.gif?20171010161652","type":2},{"id":98,"name":"花糕","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-98.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/98.gif?20171010161652","type":3},{"id":97,"name":"「矢量箭头」","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-97.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/97.gif?20171010161652","type":2},{"id":96,"name":"女装","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-96.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/96.gif?20171010161652","type":2},{"id":95,"name":"桂花酒","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-95.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/95.gif?20171010161652","type":2},{"id":94,"name":"月饼","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-94.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/94.gif?20171010161652","type":3},{"id":93,"name":"国庆礼炮","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-93.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/93.gif?20171010161652","type":2},{"id":92,"name":"小红星","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-92.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/92.gif?20171010161652","type":3},{"id":91,"name":"I ❤ LOL","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-91.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/91.gif?20171010161652","type":2},{"id":90,"name":"鸡大腿","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-90.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/90.gif?20171010161652","type":2},{"id":89,"name":"月觉","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-89.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/89.gif?20171010161652","type":2},{"id":88,"name":"日觉","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-88.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/88.gif?20171010161652","type":2},{"id":87,"name":"看板娘限定头饰","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-87.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/87.gif?20171010161652","type":3},{"id":86,"name":"学生卡","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-86.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/86.gif?20171010161652","type":2},{"id":85,"name":"神之记事本","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-85.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/85.gif?20171010161652","type":2},{"id":84,"name":"自动铅笔","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-84.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/84.gif?20171010161652","type":3},{"id":70,"name":"游戏中心","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-70.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/70.gif?20171010161652","type":0},{"id":13,"name":"FFF","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-13.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/13.gif?20171010161652","type":1},{"id":7,"name":"666","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-7.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/7.gif?20171010161652","type":1},{"id":8,"name":"233","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-8.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/8.gif?20171010161652","type":1},{"id":25,"name":"小电视","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-25.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/25.gif?20171010161652","type":0},{"id":39,"name":"节奏风暴","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-39.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/39.gif?20171010161652","type":0},{"id":10,"name":"蓝白胖次","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-10.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/10.gif?20171010161652","type":0},{"id":9,"name":"爱心便当","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-9.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/9.gif?20171010161652","type":0},{"id":3,"name":"B坷垃","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-3.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/3.gif?20171010161652","type":0},{"id":4,"name":"喵娘","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-4.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/4.gif?20171010161652","type":0},{"id":6,"name":"亿圆","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-6.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/6.gif?20171010161652","type":0},{"id":1,"name":"辣条","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-1.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/1.gif?20171010161652","type":0},{"id":83,"name":"护身符","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-83.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/83.gif?20171010161652","type":3},{"id":82,"name":"吃货","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-82.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/82.gif?20171010161652","type":3},{"id":81,"name":"22的鬼画符","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-81.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/81.gif?20171010161652","type":3},{"id":80,"name":"吸茶","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-80.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/80.gif?20171010161652","type":3},{"id":79,"name":"看板娘限定草帽","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-79.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/79.gif?20171010161652","type":3},{"id":78,"name":"夏日水枪","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-78.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/78.gif?20171010161652","type":3},{"id":77,"name":"水箭炮","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-77.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/77.gif?20171010161652","type":2},{"id":76,"name":"柠檬茶","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-76.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/76.gif?20171010161652","type":3},{"id":75,"name":"柠檬桶","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-75.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/75.gif?20171010161652","type":3},{"id":74,"name":"超级壁咚","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-74.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/74.gif?20171010161652","type":2},{"id":73,"name":"壁咚","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-73.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/73.gif?20171010161652","type":3},{"id":72,"name":"记忆面包","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-72.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/72.gif?20171010161652","type":2},{"id":71,"name":"铜锣烧","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-71.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/71.gif?20171010161652","type":3},{"id":69,"name":"应援棒","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-69.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/69.gif?20171010161652","type":3},{"id":68,"name":"握手券","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-68.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/68.gif?20171010161652","type":2},{"id":67,"name":"小拳拳","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-67.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/67.gif?20171010161652","type":3},{"id":66,"name":"普通拳","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-66.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/66.gif?20171010161652","type":2},{"id":65,"name":"花嫁头饰礼盒","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-65.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/65.gif?20171010161652","type":3},{"id":64,"name":"狗粮","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-64.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/64.gif?20171010161652","type":2},{"id":63,"name":"肉骨头","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-63.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/63.gif?20171010161652","type":3},{"id":62,"name":"棒棒糖","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-62.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/62.gif?20171010161652","type":3},{"id":61,"name":"巧克力","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-61.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/61.gif?20171010161652","type":2},{"id":60,"name":"春联","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-60.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/60.gif?20171010161652","type":2},{"id":59,"name":"新年红包","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-59.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/59.gif?20171010161652","type":3},{"id":58,"name":"限量版圣诞帽","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-58.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/58.gif?20171010161652","type":3},{"id":57,"name":"Me More Cool","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-57.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/57.gif?20171010161652","type":3},{"id":56,"name":"绘马板","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-56.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/56.gif?20171010161652","type":2},{"id":55,"name":"圣诞星","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-55.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/55.gif?20171010161652","type":2},{"id":54,"name":"南瓜灯","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-54.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/54.gif?20171010161652","type":2},{"id":53,"name":"速子核心","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-53.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/53.gif?20171010161652","type":2},{"id":52,"name":"聚变核心","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-52.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/52.gif?20171010161652","type":3},{"id":51,"name":"金币","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-51.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/51.gif?20171010161652","type":3},{"id":50,"name":"角色应援棒","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-50.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/50.gif?20171010161652","type":3},{"id":49,"name":"萌萌哒","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-49.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/49.gif?20171010161652","type":2},{"id":48,"name":"中秋月饼","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-48.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/48.gif?20171010161652","type":2},{"id":47,"name":"王之财宝","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-47.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/47.gif?20171010161652","type":2},{"id":46,"name":"烟花","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-46.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/46.gif?20171010161652","type":2},{"id":45,"name":"烤红薯","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-45.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/45.gif?20171010161652","type":3},{"id":44,"name":"金鱼胖次","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-44.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/44.gif?20171010161652","type":0},{"id":43,"name":"命格转盘","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-43.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/43.gif?20171010161652","type":3},{"id":42,"name":"颜料","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-42.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/42.gif?20171010161652","type":2},{"id":41,"name":"笔","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-41.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/41.gif?20171010161652","type":2},{"id":38,"name":"西瓜","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-38.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/38.gif?20171010161652","type":2},{"id":37,"name":"团扇","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-37.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/37.gif?20171010161652","type":3},{"id":36,"name":"刨冰","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-36.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/36.gif?20171010161652","type":2},{"id":32,"name":"咸粽子","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-32.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/32.gif?20171010161652","type":2},{"id":31,"name":"甜粽子","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-31.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/31.gif?20171010161652","type":2},{"id":29,"name":"菠菜罐头","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-29.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/29.gif?20171010161652","type":2},{"id":28,"name":"被窝","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-28.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/28.gif?20171010161652","type":2},{"id":26,"name":"美人愚","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-26.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/26.gif?20171010161652","type":2},{"id":23,"name":"本子","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-23.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/23.gif?20171010161652","type":2},{"id":22,"name":"橡皮擦","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-22.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/22.gif?20171010161652","type":2},{"id":21,"name":"Are you ok","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-21.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/21.gif?20171010161652","type":2},{"id":20,"name":"应援巾","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-20.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/20.gif?20171010161652","type":2},{"id":19,"name":"应援棒","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-19.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/19.gif?20171010161652","type":2},{"id":18,"name":"年糕","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-18.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/18.gif?20171010161652","type":2},{"id":5,"name":"锅","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-5.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/5.gif?20171010161652"},{"id":2,"name":"王♂者肥皂","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-2.png?20171010161652","gif_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/2.gif?20171010161652","type":0}] + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataEntity { + /** + * id : 99 + * name : 花酒 + * img : http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-99.png?20171010161652 + * gif_url : http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/99.gif?20171010161652 + * type : 2 + */ + + @SerializedName("id") + private int id; + @SerializedName("name") + private String name; + @SerializedName("img") + private String img; + @SerializedName("gif_url") + private String gifUrl; + @SerializedName("type") + private int type; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + + public String getGifUrl() { + return gifUrl; + } + + public void setGifUrl(String gifUrl) { + this.gifUrl = gifUrl; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/LiveHistoryBulletScreensEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/LiveHistoryBulletScreensEntity.java new file mode 100644 index 0000000..d9dd2a8 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/LiveHistoryBulletScreensEntity.java @@ -0,0 +1,238 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class LiveHistoryBulletScreensEntity { + /** + * code : 0 + * message : OK + * data : {"room":[{"text":"这是自动发送的弹幕","uid":20293030,"nickname":"czp3009","timeline":"2017-10-20 02:40:10","isadmin":0,"vip":0,"svip":0,"medal":[],"title":[""],"user_level":[12,0,6406234,">50000"],"rank":10000,"teamid":0,"rnd":-979658878,"user_title":"","guard_level":0},{"text":"这是自动发送的弹幕","uid":20293030,"nickname":"czp3009","timeline":"2017-10-20 02:40:59","isadmin":0,"vip":0,"svip":0,"medal":[],"title":[""],"user_level":[12,0,6406234,">50000"],"rank":10000,"teamid":0,"rnd":-979658878,"user_title":"","guard_level":0},{"text":"这是自动发送的弹幕","uid":20293030,"nickname":"czp3009","timeline":"2017-10-20 02:42:03","isadmin":0,"vip":0,"svip":0,"medal":[],"title":[""],"user_level":[12,0,6406234,">50000"],"rank":10000,"teamid":0,"rnd":-979658878,"user_title":"","guard_level":0},{"text":"这是自动发送的弹幕","uid":20293030,"nickname":"czp3009","timeline":"2017-10-20 02:42:08","isadmin":0,"vip":0,"svip":0,"medal":[],"title":[""],"user_level":[12,0,6406234,">50000"],"rank":10000,"teamid":0,"rnd":-979658878,"user_title":"","guard_level":0},{"text":"这是自动发送的弹幕","uid":20293030,"nickname":"czp3009","timeline":"2017-10-20 02:42:26","isadmin":0,"vip":0,"svip":0,"medal":[],"title":[""],"user_level":[12,0,6406234,">50000"],"rank":10000,"teamid":0,"rnd":-979658878,"user_title":"","guard_level":0},{"text":"这是自动发送的弹幕","uid":20293030,"nickname":"czp3009","timeline":"2017-10-20 02:42:31","isadmin":0,"vip":0,"svip":0,"medal":[],"title":[""],"user_level":[12,0,6406234,">50000"],"rank":10000,"teamid":0,"rnd":-979658878,"user_title":"","guard_level":0},{"text":"这是自动发送的弹幕","uid":20293030,"nickname":"czp3009","timeline":"2017-10-20 02:42:46","isadmin":0,"vip":0,"svip":0,"medal":[],"title":[""],"user_level":[12,0,6406234,">50000"],"rank":10000,"teamid":0,"rnd":-979658878,"user_title":"","guard_level":0},{"text":"感谢 czp3009 的 辣条","uid":20293030,"nickname":"czp3009","timeline":"2017-10-20 02:43:31","isadmin":0,"vip":0,"svip":0,"medal":[],"title":[""],"user_level":[12,0,6406234,">50000"],"rank":10000,"teamid":0,"rnd":-979658878,"user_title":"","guard_level":0},{"text":"感谢 czp3009 的 辣条","uid":20293030,"nickname":"czp3009","timeline":"2017-10-20 17:41:29","isadmin":0,"vip":0,"svip":0,"medal":[],"title":[""],"user_level":[12,0,6406234,">50000"],"rank":10000,"teamid":0,"rnd":-979658878,"user_title":"","guard_level":0},{"text":"感谢 czp3009 的 辣条","uid":20293030,"nickname":"czp3009","timeline":"2017-10-21 01:10:51","isadmin":0,"vip":0,"svip":0,"medal":[],"title":[""],"user_level":[12,0,6406234,">50000"],"rank":10000,"teamid":0,"rnd":-979658878,"user_title":"","guard_level":0}],"admin":[]} + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + @SerializedName("room") + private List room; + @SerializedName("admin") + private List admin; + + public List getRoom() { + return room; + } + + public void setRoom(List room) { + this.room = room; + } + + public List getAdmin() { + return admin; + } + + public void setAdmin(List admin) { + this.admin = admin; + } + + public static class LiveHistoryBulletScreenEntity { + /** + * text : 这是自动发送的弹幕 + * uid : 20293030 + * nickname : czp3009 + * timeline : 2017-10-20 02:40:10 + * isadmin : 0 + * vip : 0 + * svip : 0 + * medal : [] + * title : [""] + * user_level : [12,0,6406234,">50000"] + * rank : 10000 + * teamid : 0 + * rnd : -979658878 + * user_title : + * guard_level : 0 + */ + + @SerializedName("text") + private String text; + @SerializedName("uid") + private int uid; + @SerializedName("nickname") + private String nickname; + @SerializedName("timeline") + private String timeline; + @SerializedName("isadmin") + private int isadmin; + @SerializedName("vip") + private int vip; + @SerializedName("svip") + private int svip; + @SerializedName("rank") + private int rank; + @SerializedName("teamid") + private int teamid; + @SerializedName("rnd") + private long rnd; + @SerializedName("user_title") + private String userTitle; + @SerializedName("guard_level") + private int guardLevel; + @SerializedName("medal") + private List medal; + @SerializedName("title") + private List title; + @SerializedName("user_level") + private List userLevel; + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } + + public String getNickname() { + return nickname; + } + + public void setNickname(String nickname) { + this.nickname = nickname; + } + + public String getTimeline() { + return timeline; + } + + public void setTimeline(String timeline) { + this.timeline = timeline; + } + + public int getIsadmin() { + return isadmin; + } + + public void setIsadmin(int isadmin) { + this.isadmin = isadmin; + } + + public int getVip() { + return vip; + } + + public void setVip(int vip) { + this.vip = vip; + } + + public int getSvip() { + return svip; + } + + public void setSvip(int svip) { + this.svip = svip; + } + + public int getRank() { + return rank; + } + + public void setRank(int rank) { + this.rank = rank; + } + + public int getTeamid() { + return teamid; + } + + public void setTeamid(int teamid) { + this.teamid = teamid; + } + + public long getRnd() { + return rnd; + } + + public void setRnd(long rnd) { + this.rnd = rnd; + } + + public String getUserTitle() { + return userTitle; + } + + public void setUserTitle(String userTitle) { + this.userTitle = userTitle; + } + + public int getGuardLevel() { + return guardLevel; + } + + public void setGuardLevel(int guardLevel) { + this.guardLevel = guardLevel; + } + + public List getMedal() { + return medal; + } + + public void setMedal(List medal) { + this.medal = medal; + } + + public List getTitle() { + return title; + } + + public void setTitle(List title) { + this.title = title; + } + + public List getUserLevel() { + return userLevel; + } + + public void setUserLevel(List userLevel) { + this.userLevel = userLevel; + } + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/LiveRoomInfoEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/LiveRoomInfoEntity.java new file mode 100644 index 0000000..dfe67c2 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/LiveRoomInfoEntity.java @@ -0,0 +1,1254 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class LiveRoomInfoEntity { + /** + * code : 0 + * data : {"room_id":29434,"title":"继续玩游戏~","cover":"http://i0.hdslb.com/bfs/live/744637d38c9f0a994bf7164a3b73493f537c3876.jpg","mid":2866663,"uname":"hyx5020","face":"http://i2.hdslb.com/bfs/face/0434dccc0ec4de223e8ca374dea06a6e1e8eb471.jpg","m_face":"http://i2.hdslb.com/bfs/face/0434dccc0ec4de223e8ca374dea06a6e1e8eb471.jpg","background_id":1,"attention":310,"is_attention":0,"online":261,"create":1438266869,"create_at":"2015-07-30 22:34:29","sch_id":0,"status":"PREPARING","area":"单机联机","area_id":1,"area_v2_id":107,"area_v2_parent_id":2,"schedule":{"cid":10029434,"sch_id":0,"title":"继续玩游戏~","mid":2866663,"manager":[],"start":1438266869,"start_at":"2015-07-30 22:34:29","aid":0,"stream_id":20393,"online":261,"status":"PREPARING","meta_id":0,"pending_meta_id":0},"meta":{"tag":["坎巴拉太空计划"],"description":"


<\/p>


<\/h1>


<\/p>","typeid":1,"tag_ids":{"0":24},"cover":"http://i0.hdslb.com/bfs/live/744637d38c9f0a994bf7164a3b73493f537c3876.jpg","check_status":"VERIFY","aid":0},"cmt":"livecmt-2.bilibili.com","cmt_port":88,"cmt_port_goim":2243,"recommend":[{"owner":{"face":"http://i1.hdslb.com/bfs/face/cdb0ddf5087248eb30c05ac9257f3f87c3f9f42d.jpg","mid":13661517,"name":"萌萌哒少女深海酱"},"cover":{"src":"http://i0.hdslb.com/bfs/live/1081638.jpg?11020048"},"title":"ASMR~鸽子王主播居然......","room_id":1081638,"online":7708},{"owner":{"face":"http://i0.hdslb.com/bfs/face/b60b42e1a570589cac62e4e3c6f5d0e8a4c994a7.jpg","mid":4186467,"name":"鹿島ちゃんは可愛い"},"cover":{"src":"http://i0.hdslb.com/bfs/live/1266586.jpg?11020045"},"title":"想找个萌妹连麦","room_id":1266586,"online":5520}],"toplist":[],"isvip":0,"opentime":0,"prepare":"主播正在摔♂跤中...","isadmin":0,"hot_word":[{"id":45,"words":"当然是选择原谅她啊!"},{"id":44,"words":"还有这种操作!"},{"id":42,"words":"怕是要修仙哦"},{"id":41,"words":"gay里gay气"},{"id":39,"words":"请大家注意弹幕礼仪哦!"},{"id":37,"words":"那你很棒哦!"},{"id":36,"words":"向大佬低头"},{"id":30,"words":"bilibili-(゜-゜)つロ乾杯~"},{"id":25,"words":"prprpr"},{"id":22,"words":"excuse me?"},{"id":21,"words":"gg"},{"id":20,"words":"你为什么这么熟练啊"},{"id":19,"words":"老司机带带我"},{"id":13,"words":"666666666"},{"id":12,"words":"啪啪啪啪啪"},{"id":11,"words":"Yooooooo"},{"id":10,"words":"FFFFFFFFFF"},{"id":9,"words":"色情主播"},{"id":7,"words":"红红火火恍恍惚惚"},{"id":5,"words":"喂,妖妖零吗"},{"id":3,"words":"_(:з」∠)_"},{"id":2,"words":"2333333"}],"roomgifts":[{"id":7,"name":"666","price":666,"type":1,"coin_type":{"gold":"gold"},"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-7.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/7.gif?20171010161652","count_set":"1,2,3,4,5","combo_num":0,"super_num":0,"count_map":{"1":"","2":"","3":"","4":"","5":""}},{"id":8,"name":"233","price":233,"type":1,"coin_type":{"gold":"gold"},"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-8.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/8.gif?20171010161652","count_set":"1,2,3,4,5","combo_num":0,"super_num":0,"count_map":{"1":"","2":"","3":"","4":"","5":""}},{"id":25,"name":"小电视","price":1245000,"type":0,"coin_type":{"gold":"gold"},"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-25.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/25.gif?20171010161652","count_set":"1,2,3,4,5","combo_num":1,"super_num":1,"count_map":{"1":"高能","2":"高能","3":"高能","4":"高能","5":"高能"}},{"id":3,"name":"B坷垃","price":9900,"type":0,"coin_type":{"gold":"gold","silver":"silver"},"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-3.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/3.gif?20171010161652","count_set":"1,10,46,520,1314","combo_num":1,"super_num":46,"count_map":{"1":"连击","10":"连击","46":"高能","520":"高能","1314":"高能"}},{"id":4,"name":"喵娘","price":5200,"type":0,"coin_type":{"gold":"gold"},"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-4.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/4.gif?20171010161652","count_set":"1,2,10,87,520","combo_num":2,"super_num":87,"count_map":{"1":"","2":"连击","10":"连击","87":"高能","520":"高能"}},{"id":6,"name":"亿圆","price":1000,"type":0,"coin_type":{"gold":"gold","silver":"silver"},"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-6.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/6.gif?20171010161652","count_set":"1,10,99,450,1314","combo_num":10,"super_num":450,"count_map":{"1":"","10":"连击","99":"连击","450":"高能","1314":"高能"}},{"id":1,"name":"辣条","price":100,"type":0,"coin_type":{"gold":"gold","silver":"silver"},"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-1.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/1.gif?20171010161652","count_set":"1,10,99,520,4500","combo_num":99,"super_num":4500,"count_map":{"1":"","10":"","99":"连击","520":"连击","4500":"高能"}}],"ignore_gift":[{"id":1,"num":10},{"id":21,"num":10}],"msg_mode":1,"msg_color":16777215,"msg_length":20,"master_level":11,"master_level_color":5805790,"broadcast_type":0,"activity_gift":[],"check_version":0,"activity_id":0,"event_corner":[],"guard_level":0,"guard_info":{"heart_status":0,"heart_time":300},"guard_notice":0,"guard_tip_flag":0,"new_year_ceremony":0,"special_gift_gif":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/2/jiezou.gif?2017011901","show_room_id":29434} + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private LiveRoomEntity data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public LiveRoomEntity getData() { + return data; + } + + public void setData(LiveRoomEntity data) { + this.data = data; + } + + public static class LiveRoomEntity { + /** + * room_id : 29434 + * title : 继续玩游戏~ + * cover : http://i0.hdslb.com/bfs/live/744637d38c9f0a994bf7164a3b73493f537c3876.jpg + * mid : 2866663 + * uname : hyx5020 + * face : http://i2.hdslb.com/bfs/face/0434dccc0ec4de223e8ca374dea06a6e1e8eb471.jpg + * m_face : http://i2.hdslb.com/bfs/face/0434dccc0ec4de223e8ca374dea06a6e1e8eb471.jpg + * background_id : 1 + * attention : 310 + * is_attention : 0 + * online : 261 + * create : 1438266869 + * create_at : 2015-07-30 22:34:29 + * sch_id : 0 + * status : PREPARING + * area : 单机联机 + * area_id : 1 + * area_v2_id : 107 + * area_v2_parent_id : 2 + * schedule : {"cid":10029434,"sch_id":0,"title":"继续玩游戏~","mid":2866663,"manager":[],"start":1438266869,"start_at":"2015-07-30 22:34:29","aid":0,"stream_id":20393,"online":261,"status":"PREPARING","meta_id":0,"pending_meta_id":0} + * meta : {"tag":["坎巴拉太空计划"],"description":"


<\/p>


<\/h1>


<\/p>","typeid":1,"tag_ids":{"0":24},"cover":"http://i0.hdslb.com/bfs/live/744637d38c9f0a994bf7164a3b73493f537c3876.jpg","check_status":"VERIFY","aid":0} + * cmt : livecmt-2.bilibili.com + * cmt_port : 88 + * cmt_port_goim : 2243 + * recommend : [{"owner":{"face":"http://i1.hdslb.com/bfs/face/cdb0ddf5087248eb30c05ac9257f3f87c3f9f42d.jpg","mid":13661517,"name":"萌萌哒少女深海酱"},"cover":{"src":"http://i0.hdslb.com/bfs/live/1081638.jpg?11020048"},"title":"ASMR~鸽子王主播居然......","room_id":1081638,"online":7708},{"owner":{"face":"http://i0.hdslb.com/bfs/face/b60b42e1a570589cac62e4e3c6f5d0e8a4c994a7.jpg","mid":4186467,"name":"鹿島ちゃんは可愛い"},"cover":{"src":"http://i0.hdslb.com/bfs/live/1266586.jpg?11020045"},"title":"想找个萌妹连麦","room_id":1266586,"online":5520}] + * toplist : [] + * isvip : 0 + * opentime : 0 + * prepare : 主播正在摔♂跤中... + * isadmin : 0 + * hot_word : [{"id":45,"words":"当然是选择原谅她啊!"},{"id":44,"words":"还有这种操作!"},{"id":42,"words":"怕是要修仙哦"},{"id":41,"words":"gay里gay气"},{"id":39,"words":"请大家注意弹幕礼仪哦!"},{"id":37,"words":"那你很棒哦!"},{"id":36,"words":"向大佬低头"},{"id":30,"words":"bilibili-(゜-゜)つロ乾杯~"},{"id":25,"words":"prprpr"},{"id":22,"words":"excuse me?"},{"id":21,"words":"gg"},{"id":20,"words":"你为什么这么熟练啊"},{"id":19,"words":"老司机带带我"},{"id":13,"words":"666666666"},{"id":12,"words":"啪啪啪啪啪"},{"id":11,"words":"Yooooooo"},{"id":10,"words":"FFFFFFFFFF"},{"id":9,"words":"色情主播"},{"id":7,"words":"红红火火恍恍惚惚"},{"id":5,"words":"喂,妖妖零吗"},{"id":3,"words":"_(:з」∠)_"},{"id":2,"words":"2333333"}] + * roomgifts : [{"id":7,"name":"666","price":666,"type":1,"coin_type":{"gold":"gold"},"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-7.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/7.gif?20171010161652","count_set":"1,2,3,4,5","combo_num":0,"super_num":0,"count_map":{"1":"","2":"","3":"","4":"","5":""}},{"id":8,"name":"233","price":233,"type":1,"coin_type":{"gold":"gold"},"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-8.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/8.gif?20171010161652","count_set":"1,2,3,4,5","combo_num":0,"super_num":0,"count_map":{"1":"","2":"","3":"","4":"","5":""}},{"id":25,"name":"小电视","price":1245000,"type":0,"coin_type":{"gold":"gold"},"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-25.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/25.gif?20171010161652","count_set":"1,2,3,4,5","combo_num":1,"super_num":1,"count_map":{"1":"高能","2":"高能","3":"高能","4":"高能","5":"高能"}},{"id":3,"name":"B坷垃","price":9900,"type":0,"coin_type":{"gold":"gold","silver":"silver"},"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-3.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/3.gif?20171010161652","count_set":"1,10,46,520,1314","combo_num":1,"super_num":46,"count_map":{"1":"连击","10":"连击","46":"高能","520":"高能","1314":"高能"}},{"id":4,"name":"喵娘","price":5200,"type":0,"coin_type":{"gold":"gold"},"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-4.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/4.gif?20171010161652","count_set":"1,2,10,87,520","combo_num":2,"super_num":87,"count_map":{"1":"","2":"连击","10":"连击","87":"高能","520":"高能"}},{"id":6,"name":"亿圆","price":1000,"type":0,"coin_type":{"gold":"gold","silver":"silver"},"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-6.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/6.gif?20171010161652","count_set":"1,10,99,450,1314","combo_num":10,"super_num":450,"count_map":{"1":"","10":"连击","99":"连击","450":"高能","1314":"高能"}},{"id":1,"name":"辣条","price":100,"type":0,"coin_type":{"gold":"gold","silver":"silver"},"img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-1.png?20171010161652","gift_url":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/1.gif?20171010161652","count_set":"1,10,99,520,4500","combo_num":99,"super_num":4500,"count_map":{"1":"","10":"","99":"连击","520":"连击","4500":"高能"}}] + * ignore_gift : [{"id":1,"num":10},{"id":21,"num":10}] + * msg_mode : 1 + * msg_color : 16777215 + * msg_length : 20 + * master_level : 11 + * master_level_color : 5805790 + * broadcast_type : 0 + * activity_gift : [] + * check_version : 0 + * activity_id : 0 + * event_corner : [] + * guard_level : 0 + * guard_info : {"heart_status":0,"heart_time":300} + * guard_notice : 0 + * guard_tip_flag : 0 + * new_year_ceremony : 0 + * special_gift_gif : http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/2/jiezou.gif?2017011901 + * show_room_id : 29434 + */ + + @SerializedName("room_id") + private int roomId; + @SerializedName("title") + private String title; + @SerializedName("cover") + private String cover; + @SerializedName("mid") + private int mid; + @SerializedName("uname") + private String uname; + @SerializedName("face") + private String face; + @SerializedName("m_face") + private String mFace; + @SerializedName("background_id") + private int backgroundId; + @SerializedName("attention") + private int attention; + @SerializedName("is_attention") + private int isAttention; + @SerializedName("online") + private int online; + @SerializedName("create") + private int create; + @SerializedName("create_at") + private String createAt; + @SerializedName("sch_id") + private int schId; + @SerializedName("status") + private String status; + @SerializedName("area") + private String area; + @SerializedName("area_id") + private int areaId; + @SerializedName("area_v2_id") + private int areaV2Id; + @SerializedName("area_v2_parent_id") + private int areaV2ParentId; + @SerializedName("schedule") + private ScheduleEntity schedule; + @SerializedName("meta") + private MetaEntity meta; + @SerializedName("cmt") + private String cmt; + @SerializedName("cmt_port") + private int cmtPort; + @SerializedName("cmt_port_goim") + private int cmtPortGoim; + @SerializedName("isvip") + private int isvip; + @SerializedName("opentime") + private int opentime; + @SerializedName("prepare") + private String prepare; + @SerializedName("isadmin") + private int isadmin; + @SerializedName("msg_mode") + private int msgMode; + @SerializedName("msg_color") + private int msgColor; + @SerializedName("msg_length") + private int msgLength; + @SerializedName("master_level") + private int masterLevel; + @SerializedName("master_level_color") + private int masterLevelColor; + @SerializedName("broadcast_type") + private int broadcastType; + @SerializedName("check_version") + private int checkVersion; + @SerializedName("activity_id") + private int activityId; + @SerializedName("guard_level") + private int guardLevel; + @SerializedName("guard_info") + private GuardInfoEntity guardInfo; + @SerializedName("guard_notice") + private int guardNotice; + @SerializedName("guard_tip_flag") + private int guardTipFlag; + @SerializedName("new_year_ceremony") + private int newYearCeremony; + @SerializedName("special_gift_gif") + private String specialGiftGif; + @SerializedName("show_room_id") + private int showRoomId; + @SerializedName("recommend") + private List recommend; + @SerializedName("toplist") + private List toplist; + @SerializedName("hot_word") + private List hotWord; + @SerializedName("roomgifts") + private List roomgifts; + @SerializedName("ignore_gift") + private List ignoreGift; + @SerializedName("activity_gift") + private List activityGift; + @SerializedName("event_corner") + private List eventCorner; + + public int getRoomId() { + return roomId; + } + + public void setRoomId(int roomId) { + this.roomId = roomId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getCover() { + return cover; + } + + public void setCover(String cover) { + this.cover = cover; + } + + public int getMid() { + return mid; + } + + public void setMid(int mid) { + this.mid = mid; + } + + public String getUname() { + return uname; + } + + public void setUname(String uname) { + this.uname = uname; + } + + public String getFace() { + return face; + } + + public void setFace(String face) { + this.face = face; + } + + public String getMFace() { + return mFace; + } + + public void setMFace(String mFace) { + this.mFace = mFace; + } + + public int getBackgroundId() { + return backgroundId; + } + + public void setBackgroundId(int backgroundId) { + this.backgroundId = backgroundId; + } + + public int getAttention() { + return attention; + } + + public void setAttention(int attention) { + this.attention = attention; + } + + public int getIsAttention() { + return isAttention; + } + + public void setIsAttention(int isAttention) { + this.isAttention = isAttention; + } + + public int getOnline() { + return online; + } + + public void setOnline(int online) { + this.online = online; + } + + public int getCreate() { + return create; + } + + public void setCreate(int create) { + this.create = create; + } + + public String getCreateAt() { + return createAt; + } + + public void setCreateAt(String createAt) { + this.createAt = createAt; + } + + public int getSchId() { + return schId; + } + + public void setSchId(int schId) { + this.schId = schId; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public int getAreaId() { + return areaId; + } + + public void setAreaId(int areaId) { + this.areaId = areaId; + } + + public int getAreaV2Id() { + return areaV2Id; + } + + public void setAreaV2Id(int areaV2Id) { + this.areaV2Id = areaV2Id; + } + + public int getAreaV2ParentId() { + return areaV2ParentId; + } + + public void setAreaV2ParentId(int areaV2ParentId) { + this.areaV2ParentId = areaV2ParentId; + } + + public ScheduleEntity getSchedule() { + return schedule; + } + + public void setSchedule(ScheduleEntity schedule) { + this.schedule = schedule; + } + + public MetaEntity getMeta() { + return meta; + } + + public void setMeta(MetaEntity meta) { + this.meta = meta; + } + + public String getCmt() { + return cmt; + } + + public void setCmt(String cmt) { + this.cmt = cmt; + } + + public int getCmtPort() { + return cmtPort; + } + + public void setCmtPort(int cmtPort) { + this.cmtPort = cmtPort; + } + + public int getCmtPortGoim() { + return cmtPortGoim; + } + + public void setCmtPortGoim(int cmtPortGoim) { + this.cmtPortGoim = cmtPortGoim; + } + + public int getIsvip() { + return isvip; + } + + public void setIsvip(int isvip) { + this.isvip = isvip; + } + + public int getOpentime() { + return opentime; + } + + public void setOpentime(int opentime) { + this.opentime = opentime; + } + + public String getPrepare() { + return prepare; + } + + public void setPrepare(String prepare) { + this.prepare = prepare; + } + + public int getIsadmin() { + return isadmin; + } + + public void setIsadmin(int isadmin) { + this.isadmin = isadmin; + } + + public int getMsgMode() { + return msgMode; + } + + public void setMsgMode(int msgMode) { + this.msgMode = msgMode; + } + + public int getMsgColor() { + return msgColor; + } + + public void setMsgColor(int msgColor) { + this.msgColor = msgColor; + } + + public int getMsgLength() { + return msgLength; + } + + public void setMsgLength(int msgLength) { + this.msgLength = msgLength; + } + + public int getMasterLevel() { + return masterLevel; + } + + public void setMasterLevel(int masterLevel) { + this.masterLevel = masterLevel; + } + + public int getMasterLevelColor() { + return masterLevelColor; + } + + public void setMasterLevelColor(int masterLevelColor) { + this.masterLevelColor = masterLevelColor; + } + + public int getBroadcastType() { + return broadcastType; + } + + public void setBroadcastType(int broadcastType) { + this.broadcastType = broadcastType; + } + + public int getCheckVersion() { + return checkVersion; + } + + public void setCheckVersion(int checkVersion) { + this.checkVersion = checkVersion; + } + + public int getActivityId() { + return activityId; + } + + public void setActivityId(int activityId) { + this.activityId = activityId; + } + + public int getGuardLevel() { + return guardLevel; + } + + public void setGuardLevel(int guardLevel) { + this.guardLevel = guardLevel; + } + + public GuardInfoEntity getGuardInfo() { + return guardInfo; + } + + public void setGuardInfo(GuardInfoEntity guardInfo) { + this.guardInfo = guardInfo; + } + + public int getGuardNotice() { + return guardNotice; + } + + public void setGuardNotice(int guardNotice) { + this.guardNotice = guardNotice; + } + + public int getGuardTipFlag() { + return guardTipFlag; + } + + public void setGuardTipFlag(int guardTipFlag) { + this.guardTipFlag = guardTipFlag; + } + + public int getNewYearCeremony() { + return newYearCeremony; + } + + public void setNewYearCeremony(int newYearCeremony) { + this.newYearCeremony = newYearCeremony; + } + + public String getSpecialGiftGif() { + return specialGiftGif; + } + + public void setSpecialGiftGif(String specialGiftGif) { + this.specialGiftGif = specialGiftGif; + } + + public int getShowRoomId() { + return showRoomId; + } + + public void setShowRoomId(int showRoomId) { + this.showRoomId = showRoomId; + } + + public List getRecommend() { + return recommend; + } + + public void setRecommend(List recommend) { + this.recommend = recommend; + } + + public List getToplist() { + return toplist; + } + + public void setToplist(List toplist) { + this.toplist = toplist; + } + + public List getHotWord() { + return hotWord; + } + + public void setHotWord(List hotWord) { + this.hotWord = hotWord; + } + + public List getRoomgifts() { + return roomgifts; + } + + public void setRoomgifts(List roomgifts) { + this.roomgifts = roomgifts; + } + + public List getIgnoreGift() { + return ignoreGift; + } + + public void setIgnoreGift(List ignoreGift) { + this.ignoreGift = ignoreGift; + } + + public List getActivityGift() { + return activityGift; + } + + public void setActivityGift(List activityGift) { + this.activityGift = activityGift; + } + + public List getEventCorner() { + return eventCorner; + } + + public void setEventCorner(List eventCorner) { + this.eventCorner = eventCorner; + } + + public static class ScheduleEntity { + /** + * cid : 10029434 + * sch_id : 0 + * title : 继续玩游戏~ + * mid : 2866663 + * manager : [] + * start : 1438266869 + * start_at : 2015-07-30 22:34:29 + * aid : 0 + * stream_id : 20393 + * online : 261 + * status : PREPARING + * meta_id : 0 + * pending_meta_id : 0 + */ + + @SerializedName("cid") + private int cid; + @SerializedName("sch_id") + private int schId; + @SerializedName("title") + private String title; + @SerializedName("mid") + private int mid; + @SerializedName("start") + private int start; + @SerializedName("start_at") + private String startAt; + @SerializedName("aid") + private int aid; + @SerializedName("stream_id") + private int streamId; + @SerializedName("online") + private int online; + @SerializedName("status") + private String status; + @SerializedName("meta_id") + private int metaId; + @SerializedName("pending_meta_id") + private int pendingMetaId; + @SerializedName("manager") + private List manager; + + public int getCid() { + return cid; + } + + public void setCid(int cid) { + this.cid = cid; + } + + public int getSchId() { + return schId; + } + + public void setSchId(int schId) { + this.schId = schId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public int getMid() { + return mid; + } + + public void setMid(int mid) { + this.mid = mid; + } + + public int getStart() { + return start; + } + + public void setStart(int start) { + this.start = start; + } + + public String getStartAt() { + return startAt; + } + + public void setStartAt(String startAt) { + this.startAt = startAt; + } + + public int getAid() { + return aid; + } + + public void setAid(int aid) { + this.aid = aid; + } + + public int getStreamId() { + return streamId; + } + + public void setStreamId(int streamId) { + this.streamId = streamId; + } + + public int getOnline() { + return online; + } + + public void setOnline(int online) { + this.online = online; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public int getMetaId() { + return metaId; + } + + public void setMetaId(int metaId) { + this.metaId = metaId; + } + + public int getPendingMetaId() { + return pendingMetaId; + } + + public void setPendingMetaId(int pendingMetaId) { + this.pendingMetaId = pendingMetaId; + } + + public List getManager() { + return manager; + } + + public void setManager(List manager) { + this.manager = manager; + } + } + + public static class MetaEntity { + /** + * tag : ["坎巴拉太空计划"] + * description :




+ * typeid : 1 + * tag_ids : {"0":24} + * cover : http://i0.hdslb.com/bfs/live/744637d38c9f0a994bf7164a3b73493f537c3876.jpg + * check_status : VERIFY + * aid : 0 + */ + + @SerializedName("description") + private String description; + @SerializedName("typeid") + private int typeid; + @SerializedName("tag_ids") + private TagIdsEntity tagIds; + @SerializedName("cover") + private String cover; + @SerializedName("check_status") + private String checkStatus; + @SerializedName("aid") + private int aid; + @SerializedName("tag") + private List tag; + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getTypeid() { + return typeid; + } + + public void setTypeid(int typeid) { + this.typeid = typeid; + } + + public TagIdsEntity getTagIds() { + return tagIds; + } + + public void setTagIds(TagIdsEntity tagIds) { + this.tagIds = tagIds; + } + + public String getCover() { + return cover; + } + + public void setCover(String cover) { + this.cover = cover; + } + + public String getCheckStatus() { + return checkStatus; + } + + public void setCheckStatus(String checkStatus) { + this.checkStatus = checkStatus; + } + + public int getAid() { + return aid; + } + + public void setAid(int aid) { + this.aid = aid; + } + + public List getTag() { + return tag; + } + + public void setTag(List tag) { + this.tag = tag; + } + + public static class TagIdsEntity { + /** + * 0 : 24 + */ + + @SerializedName("0") + private int $0; + + public int get$0() { + return $0; + } + + public void set$0(int $0) { + this.$0 = $0; + } + } + } + + public static class GuardInfoEntity { + /** + * heart_status : 0 + * heart_time : 300 + */ + + @SerializedName("heart_status") + private int heartStatus; + @SerializedName("heart_time") + private int heartTime; + + public int getHeartStatus() { + return heartStatus; + } + + public void setHeartStatus(int heartStatus) { + this.heartStatus = heartStatus; + } + + public int getHeartTime() { + return heartTime; + } + + public void setHeartTime(int heartTime) { + this.heartTime = heartTime; + } + } + + public static class RecommendEntity { + /** + * owner : {"face":"http://i1.hdslb.com/bfs/face/cdb0ddf5087248eb30c05ac9257f3f87c3f9f42d.jpg","mid":13661517,"name":"萌萌哒少女深海酱"} + * cover : {"src":"http://i0.hdslb.com/bfs/live/1081638.jpg?11020048"} + * title : ASMR~鸽子王主播居然...... + * room_id : 1081638 + * online : 7708 + */ + + @SerializedName("owner") + private OwnerEntity owner; + @SerializedName("cover") + private CoverEntity cover; + @SerializedName("title") + private String title; + @SerializedName("room_id") + private int roomId; + @SerializedName("online") + private int online; + + public OwnerEntity getOwner() { + return owner; + } + + public void setOwner(OwnerEntity owner) { + this.owner = owner; + } + + public CoverEntity getCover() { + return cover; + } + + public void setCover(CoverEntity cover) { + this.cover = cover; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public int getRoomId() { + return roomId; + } + + public void setRoomId(int roomId) { + this.roomId = roomId; + } + + public int getOnline() { + return online; + } + + public void setOnline(int online) { + this.online = online; + } + + public static class OwnerEntity { + /** + * face : http://i1.hdslb.com/bfs/face/cdb0ddf5087248eb30c05ac9257f3f87c3f9f42d.jpg + * mid : 13661517 + * name : 萌萌哒少女深海酱 + */ + + @SerializedName("face") + private String face; + @SerializedName("mid") + private int mid; + @SerializedName("name") + private String name; + + public String getFace() { + return face; + } + + public void setFace(String face) { + this.face = face; + } + + public int getMid() { + return mid; + } + + public void setMid(int mid) { + this.mid = mid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + + public static class CoverEntity { + /** + * src : http://i0.hdslb.com/bfs/live/1081638.jpg?11020048 + */ + + @SerializedName("src") + private String src; + + public String getSrc() { + return src; + } + + public void setSrc(String src) { + this.src = src; + } + } + } + + public static class HotWordEntity { + /** + * id : 45 + * words : 当然是选择原谅她啊! + */ + + @SerializedName("id") + private int id; + @SerializedName("words") + private String words; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getWords() { + return words; + } + + public void setWords(String words) { + this.words = words; + } + } + + public static class RoomgiftsEntity { + /** + * id : 7 + * name : 666 + * price : 666 + * type : 1 + * coin_type : {"gold":"gold"} + * img : http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-7.png?20171010161652 + * gift_url : http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift/3/7.gif?20171010161652 + * count_set : 1,2,3,4,5 + * combo_num : 0 + * super_num : 0 + * count_map : {"1":"","2":"","3":"","4":"","5":""} + */ + + @SerializedName("id") + private int id; + @SerializedName("name") + private String name; + @SerializedName("price") + private int price; + @SerializedName("type") + private int type; + @SerializedName("coin_type") + private CoinTypeEntity coinType; + @SerializedName("img") + private String img; + @SerializedName("gift_url") + private String giftUrl; + @SerializedName("count_set") + private String countSet; + @SerializedName("combo_num") + private int comboNum; + @SerializedName("super_num") + private int superNum; + @SerializedName("count_map") + private CountMapEntity countMap; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getPrice() { + return price; + } + + public void setPrice(int price) { + this.price = price; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public CoinTypeEntity getCoinType() { + return coinType; + } + + public void setCoinType(CoinTypeEntity coinType) { + this.coinType = coinType; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + + public String getGiftUrl() { + return giftUrl; + } + + public void setGiftUrl(String giftUrl) { + this.giftUrl = giftUrl; + } + + public String getCountSet() { + return countSet; + } + + public void setCountSet(String countSet) { + this.countSet = countSet; + } + + public int getComboNum() { + return comboNum; + } + + public void setComboNum(int comboNum) { + this.comboNum = comboNum; + } + + public int getSuperNum() { + return superNum; + } + + public void setSuperNum(int superNum) { + this.superNum = superNum; + } + + public CountMapEntity getCountMap() { + return countMap; + } + + public void setCountMap(CountMapEntity countMap) { + this.countMap = countMap; + } + + public static class CoinTypeEntity { + /** + * gold : gold + */ + + @SerializedName("gold") + private String gold; + + public String getGold() { + return gold; + } + + public void setGold(String gold) { + this.gold = gold; + } + } + + public static class CountMapEntity { + /** + * 1 : + * 2 : + * 3 : + * 4 : + * 5 : + */ + + @SerializedName("1") + private String $1; + @SerializedName("2") + private String $2; + @SerializedName("3") + private String $3; + @SerializedName("4") + private String $4; + @SerializedName("5") + private String $5; + + public String get$1() { + return $1; + } + + public void set$1(String $1) { + this.$1 = $1; + } + + public String get$2() { + return $2; + } + + public void set$2(String $2) { + this.$2 = $2; + } + + public String get$3() { + return $3; + } + + public void set$3(String $3) { + this.$3 = $3; + } + + public String get$4() { + return $4; + } + + public void set$4(String $4) { + this.$4 = $4; + } + + public String get$5() { + return $5; + } + + public void set$5(String $5) { + this.$5 = $5; + } + } + } + + public static class IgnoreGiftEntity { + /** + * id : 1 + * num : 10 + */ + + @SerializedName("id") + private int id; + @SerializedName("num") + private int num; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getNum() { + return num; + } + + public void setNum(int num) { + this.num = num; + } + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/PlayUrlEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/PlayUrlEntity.java new file mode 100644 index 0000000..a135fda --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/PlayUrlEntity.java @@ -0,0 +1,83 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class PlayUrlEntity { + /** + * durl : [{"order":1,"length":0,"url":"http://live-play.acgvideo.com/live/241/live_2866663_332_c521e483.flv?wsSecret=562496ace51d8a998295656e7ef50a56&wsTime=59d68da4"}] + * accept_quality : [4] + * current_quality : 4 + */ + + @SerializedName("current_quality") + private int currentQuality; + @SerializedName("durl") + private List durl; + @SerializedName("accept_quality") + private List acceptQuality; + + public int getCurrentQuality() { + return currentQuality; + } + + public void setCurrentQuality(int currentQuality) { + this.currentQuality = currentQuality; + } + + public List getDurl() { + return durl; + } + + public void setDurl(List durl) { + this.durl = durl; + } + + public List getAcceptQuality() { + return acceptQuality; + } + + public void setAcceptQuality(List acceptQuality) { + this.acceptQuality = acceptQuality; + } + + public static class DurlEntity { + /** + * order : 1 + * length : 0 + * url : http://live-play.acgvideo.com/live/241/live_2866663_332_c521e483.flv?wsSecret=562496ace51d8a998295656e7ef50a56&wsTime=59d68da4 + */ + + @SerializedName("order") + private int order; + @SerializedName("length") + private int length; + @SerializedName("url") + private String url; + + public int getOrder() { + return order; + } + + public void setOrder(int order) { + this.order = order; + } + + public int getLength() { + return length; + } + + public void setLength(int length) { + this.length = length; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/PlayerBagEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/PlayerBagEntity.java new file mode 100644 index 0000000..cdabd41 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/PlayerBagEntity.java @@ -0,0 +1,194 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; +import java.util.Map; + +public class PlayerBagEntity { + /** + * code : 0 + * message : ok + * data : [{"id":49345439,"uid":20293030,"gift_id":1,"gift_num":2,"expireat":12797,"gift_type":0,"gift_name":"辣条","gift_price":"100 金瓜子/100 银瓜子","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-1.png?20171010161652","count_set":"1,2","combo_num":99,"super_num":4500,"count_map":{"1":"","2":"全部"}},{"id":49318691,"uid":20293030,"gift_id":1,"gift_num":30,"expireat":531833,"gift_type":0,"gift_name":"辣条","gift_price":"100 金瓜子/100 银瓜子","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-1.png?20171010161652","count_set":"1,10,30","combo_num":99,"super_num":4500,"count_map":{"1":"","30":"全部"}},{"id":48843715,"uid":20293030,"gift_id":102,"gift_num":9,"expireat":2482397,"gift_type":3,"gift_name":"秘银水壶","gift_price":"2000 金瓜子","img":"http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-102.png?20171010161652","count_set":"1,5,9","combo_num":5,"super_num":225,"count_map":{"1":"","5":"连击","9":"全部"}}] + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class BagGiftEntity { + /** + * id : 49345439 + * uid : 20293030 + * gift_id : 1 + * gift_num : 2 + * expireat : 12797 + * gift_type : 0 + * gift_name : 辣条 + * gift_price : 100 金瓜子/100 银瓜子 + * img : http://static.hdslb.com/live-static/live-room/images/gift-section/mobilegift-static-icon/gift-1.png?20171010161652 + * count_set : 1,2 + * combo_num : 99 + * super_num : 4500 + * count_map : {"1":"","2":"全部"} + */ + + @SerializedName("id") + private int id; + @SerializedName("uid") + private int uid; + @SerializedName("gift_id") + private int giftId; + @SerializedName("gift_num") + private int giftNum; + @SerializedName("expireat") + private int expireat; + @SerializedName("gift_type") + private int giftType; + @SerializedName("gift_name") + private String giftName; + @SerializedName("gift_price") + private String giftPrice; + @SerializedName("img") + private String img; + @SerializedName("count_set") + private String countSet; + @SerializedName("combo_num") + private int comboNum; + @SerializedName("super_num") + private int superNum; + @SerializedName("count_map") + private Map countMap; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } + + public int getGiftId() { + return giftId; + } + + public void setGiftId(int giftId) { + this.giftId = giftId; + } + + public int getGiftNum() { + return giftNum; + } + + public void setGiftNum(int giftNum) { + this.giftNum = giftNum; + } + + public int getExpireat() { + return expireat; + } + + public void setExpireat(int expireat) { + this.expireat = expireat; + } + + public int getGiftType() { + return giftType; + } + + public void setGiftType(int giftType) { + this.giftType = giftType; + } + + public String getGiftName() { + return giftName; + } + + public void setGiftName(String giftName) { + this.giftName = giftName; + } + + public String getGiftPrice() { + return giftPrice; + } + + public void setGiftPrice(String giftPrice) { + this.giftPrice = giftPrice; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + + public String getCountSet() { + return countSet; + } + + public void setCountSet(String countSet) { + this.countSet = countSet; + } + + public int getComboNum() { + return comboNum; + } + + public void setComboNum(int comboNum) { + this.comboNum = comboNum; + } + + public int getSuperNum() { + return superNum; + } + + public void setSuperNum(int superNum) { + this.superNum = superNum; + } + + public Map getCountMap() { + return countMap; + } + + public void setCountMap(Map countMap) { + this.countMap = countMap; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/SendBulletScreenResponseEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/SendBulletScreenResponseEntity.java new file mode 100644 index 0000000..cd7ff7c --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/SendBulletScreenResponseEntity.java @@ -0,0 +1,44 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class SendBulletScreenResponseEntity { + /** + * code : 0 + * msg : + * data : [] + */ + + @SerializedName("code") + private int code; + @SerializedName("msg") + private String msg; + @SerializedName("data") + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/SendDailyResponseEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/SendDailyResponseEntity.java new file mode 100644 index 0000000..abb3d75 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/SendDailyResponseEntity.java @@ -0,0 +1,59 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +public class SendDailyResponseEntity { + /** + * code : 0 + * message : ok + * data : {"result":2} + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + /** + * result : 2 + */ + + @SerializedName("result") + private int result; + + public int getResult() { + return result; + } + + public void setResult(int result) { + this.result = result; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/SendGiftResponseEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/SendGiftResponseEntity.java new file mode 100644 index 0000000..6ee807e --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/SendGiftResponseEntity.java @@ -0,0 +1,675 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class SendGiftResponseEntity { + /** + * code : 0 + * message : ok + * data : {"silver":"2696","gold":"0","data":{"giftName":"辣条","num":1,"uname":"czp3009","rcost":31134,"uid":20293030,"top_list":[{"uid":20293030,"uname":"czp3009","coin":25100,"face":"http://i0.hdslb.com/bfs/face/4f65e79399ad5a1bf3f877851b2f819d5870b494.jpg","guard_level":0,"rank":1,"score":25100},{"uid":19946822,"uname":"罗非鱼追上来了","coin":8000,"face":"http://i2.hdslb.com/bfs/face/e71031a931125617fad2c148213381bb6e0e9f26.jpg","guard_level":0,"rank":2,"score":8000},{"uid":8353249,"uname":"TcCoke","coin":3500,"face":"http://i2.hdslb.com/bfs/face/7c3c131f89380db0046024d1a903d3a6e4dc6128.jpg","guard_level":0,"rank":3,"score":3500}],"timestamp":1509972225,"giftId":1,"giftType":0,"action":"喂食","super":0,"price":100,"rnd":"1430788195","newMedal":0,"newTitle":0,"medal":[],"title":"","beatId":0,"biz_source":"live","metadata":"","remain":1,"gold":0,"silver":0,"eventScore":0,"eventNum":0,"smalltv_msg":[],"specialGift":null,"notice_msg":[],"capsule":{"normal":{"coin":10,"change":0,"progress":{"now":2900,"max":10000}},"colorful":{"coin":0,"change":0,"progress":{"now":0,"max":5000}}},"addFollow":0},"remain":1} + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntityX data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntityX getData() { + return data; + } + + public void setData(DataEntityX data) { + this.data = data; + } + + public static class DataEntityX { + /** + * silver : 2696 + * gold : 0 + * data : {"giftName":"辣条","num":1,"uname":"czp3009","rcost":31134,"uid":20293030,"top_list":[{"uid":20293030,"uname":"czp3009","coin":25100,"face":"http://i0.hdslb.com/bfs/face/4f65e79399ad5a1bf3f877851b2f819d5870b494.jpg","guard_level":0,"rank":1,"score":25100},{"uid":19946822,"uname":"罗非鱼追上来了","coin":8000,"face":"http://i2.hdslb.com/bfs/face/e71031a931125617fad2c148213381bb6e0e9f26.jpg","guard_level":0,"rank":2,"score":8000},{"uid":8353249,"uname":"TcCoke","coin":3500,"face":"http://i2.hdslb.com/bfs/face/7c3c131f89380db0046024d1a903d3a6e4dc6128.jpg","guard_level":0,"rank":3,"score":3500}],"timestamp":1509972225,"giftId":1,"giftType":0,"action":"喂食","super":0,"price":100,"rnd":"1430788195","newMedal":0,"newTitle":0,"medal":[],"title":"","beatId":0,"biz_source":"live","metadata":"","remain":1,"gold":0,"silver":0,"eventScore":0,"eventNum":0,"smalltv_msg":[],"specialGift":null,"notice_msg":[],"capsule":{"normal":{"coin":10,"change":0,"progress":{"now":2900,"max":10000}},"colorful":{"coin":0,"change":0,"progress":{"now":0,"max":5000}}},"addFollow":0} + * remain : 1 + */ + + @SerializedName("silver") + private String silver; + @SerializedName("gold") + private String gold; + @SerializedName("data") + private DataEntity data; + @SerializedName("remain") + private int remain; + + public String getSilver() { + return silver; + } + + public void setSilver(String silver) { + this.silver = silver; + } + + public String getGold() { + return gold; + } + + public void setGold(String gold) { + this.gold = gold; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public int getRemain() { + return remain; + } + + public void setRemain(int remain) { + this.remain = remain; + } + + public static class DataEntity { + /** + * giftName : 辣条 + * num : 1 + * uname : czp3009 + * rcost : 31134 + * uid : 20293030 + * top_list : [{"uid":20293030,"uname":"czp3009","coin":25100,"face":"http://i0.hdslb.com/bfs/face/4f65e79399ad5a1bf3f877851b2f819d5870b494.jpg","guard_level":0,"rank":1,"score":25100},{"uid":19946822,"uname":"罗非鱼追上来了","coin":8000,"face":"http://i2.hdslb.com/bfs/face/e71031a931125617fad2c148213381bb6e0e9f26.jpg","guard_level":0,"rank":2,"score":8000},{"uid":8353249,"uname":"TcCoke","coin":3500,"face":"http://i2.hdslb.com/bfs/face/7c3c131f89380db0046024d1a903d3a6e4dc6128.jpg","guard_level":0,"rank":3,"score":3500}] + * timestamp : 1509972225 + * giftId : 1 + * giftType : 0 + * action : 喂食 + * super : 0 + * price : 100 + * rnd : 1430788195 + * newMedal : 0 + * newTitle : 0 + * medal : [] + * title : + * beatId : 0 + * biz_source : live + * metadata : + * remain : 1 + * gold : 0 + * silver : 0 + * eventScore : 0 + * eventNum : 0 + * smalltv_msg : [] + * specialGift : null + * notice_msg : [] + * capsule : {"normal":{"coin":10,"change":0,"progress":{"now":2900,"max":10000}},"colorful":{"coin":0,"change":0,"progress":{"now":0,"max":5000}}} + * addFollow : 0 + */ + + @SerializedName("giftName") + private String giftName; + @SerializedName("num") + private int num; + @SerializedName("uname") + private String uname; + @SerializedName("rcost") + private int rcost; + @SerializedName("uid") + private int uid; + @SerializedName("timestamp") + private int timestamp; + @SerializedName("giftId") + private int giftId; + @SerializedName("giftType") + private int giftType; + @SerializedName("action") + private String action; + @SerializedName("super") + private int superX; + @SerializedName("price") + private int price; + @SerializedName("rnd") + private String rnd; + @SerializedName("newMedal") + private int newMedal; + @SerializedName("newTitle") + private int newTitle; + @SerializedName("title") + private String title; + @SerializedName("beatId") + private int beatId; + @SerializedName("biz_source") + private String bizSource; + @SerializedName("metadata") + private String metadata; + @SerializedName("remain") + private int remain; + @SerializedName("gold") + private int gold; + @SerializedName("silver") + private int silver; + @SerializedName("eventScore") + private int eventScore; + @SerializedName("eventNum") + private int eventNum; + @SerializedName("specialGift") + private Object specialGift; + @SerializedName("capsule") + private CapsuleEntity capsule; + @SerializedName("addFollow") + private int addFollow; + @SerializedName("top_list") + private List topList; + @SerializedName("medal") + private List medal; + @SerializedName("smalltv_msg") + private List smalltvMsg; + @SerializedName("notice_msg") + private List noticeMsg; + + public String getGiftName() { + return giftName; + } + + public void setGiftName(String giftName) { + this.giftName = giftName; + } + + public int getNum() { + return num; + } + + public void setNum(int num) { + this.num = num; + } + + public String getUname() { + return uname; + } + + public void setUname(String uname) { + this.uname = uname; + } + + public int getRcost() { + return rcost; + } + + public void setRcost(int rcost) { + this.rcost = rcost; + } + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } + + public int getTimestamp() { + return timestamp; + } + + public void setTimestamp(int timestamp) { + this.timestamp = timestamp; + } + + public int getGiftId() { + return giftId; + } + + public void setGiftId(int giftId) { + this.giftId = giftId; + } + + public int getGiftType() { + return giftType; + } + + public void setGiftType(int giftType) { + this.giftType = giftType; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public int getSuperX() { + return superX; + } + + public void setSuperX(int superX) { + this.superX = superX; + } + + public int getPrice() { + return price; + } + + public void setPrice(int price) { + this.price = price; + } + + public String getRnd() { + return rnd; + } + + public void setRnd(String rnd) { + this.rnd = rnd; + } + + public int getNewMedal() { + return newMedal; + } + + public void setNewMedal(int newMedal) { + this.newMedal = newMedal; + } + + public int getNewTitle() { + return newTitle; + } + + public void setNewTitle(int newTitle) { + this.newTitle = newTitle; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public int getBeatId() { + return beatId; + } + + public void setBeatId(int beatId) { + this.beatId = beatId; + } + + public String getBizSource() { + return bizSource; + } + + public void setBizSource(String bizSource) { + this.bizSource = bizSource; + } + + public String getMetadata() { + return metadata; + } + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + public int getRemain() { + return remain; + } + + public void setRemain(int remain) { + this.remain = remain; + } + + public int getGold() { + return gold; + } + + public void setGold(int gold) { + this.gold = gold; + } + + public int getSilver() { + return silver; + } + + public void setSilver(int silver) { + this.silver = silver; + } + + public int getEventScore() { + return eventScore; + } + + public void setEventScore(int eventScore) { + this.eventScore = eventScore; + } + + public int getEventNum() { + return eventNum; + } + + public void setEventNum(int eventNum) { + this.eventNum = eventNum; + } + + public Object getSpecialGift() { + return specialGift; + } + + public void setSpecialGift(Object specialGift) { + this.specialGift = specialGift; + } + + public CapsuleEntity getCapsule() { + return capsule; + } + + public void setCapsule(CapsuleEntity capsule) { + this.capsule = capsule; + } + + public int getAddFollow() { + return addFollow; + } + + public void setAddFollow(int addFollow) { + this.addFollow = addFollow; + } + + public List getTopList() { + return topList; + } + + public void setTopList(List topList) { + this.topList = topList; + } + + public List getMedal() { + return medal; + } + + public void setMedal(List medal) { + this.medal = medal; + } + + public List getSmalltvMsg() { + return smalltvMsg; + } + + public void setSmalltvMsg(List smalltvMsg) { + this.smalltvMsg = smalltvMsg; + } + + public List getNoticeMsg() { + return noticeMsg; + } + + public void setNoticeMsg(List noticeMsg) { + this.noticeMsg = noticeMsg; + } + + public static class CapsuleEntity { + /** + * normal : {"coin":10,"change":0,"progress":{"now":2900,"max":10000}} + * colorful : {"coin":0,"change":0,"progress":{"now":0,"max":5000}} + */ + + @SerializedName("normal") + private NormalEntity normal; + @SerializedName("colorful") + private ColorfulEntity colorful; + + public NormalEntity getNormal() { + return normal; + } + + public void setNormal(NormalEntity normal) { + this.normal = normal; + } + + public ColorfulEntity getColorful() { + return colorful; + } + + public void setColorful(ColorfulEntity colorful) { + this.colorful = colorful; + } + + public static class NormalEntity { + /** + * coin : 10 + * change : 0 + * progress : {"now":2900,"max":10000} + */ + + @SerializedName("coin") + private int coin; + @SerializedName("change") + private int change; + @SerializedName("progress") + private ProgressEntity progress; + + public int getCoin() { + return coin; + } + + public void setCoin(int coin) { + this.coin = coin; + } + + public int getChange() { + return change; + } + + public void setChange(int change) { + this.change = change; + } + + public ProgressEntity getProgress() { + return progress; + } + + public void setProgress(ProgressEntity progress) { + this.progress = progress; + } + + public static class ProgressEntity { + /** + * now : 2900 + * max : 10000 + */ + + @SerializedName("now") + private int now; + @SerializedName("max") + private int max; + + public int getNow() { + return now; + } + + public void setNow(int now) { + this.now = now; + } + + public int getMax() { + return max; + } + + public void setMax(int max) { + this.max = max; + } + } + } + + public static class ColorfulEntity { + /** + * coin : 0 + * change : 0 + * progress : {"now":0,"max":5000} + */ + + @SerializedName("coin") + private int coin; + @SerializedName("change") + private int change; + @SerializedName("progress") + private ProgressEntityX progress; + + public int getCoin() { + return coin; + } + + public void setCoin(int coin) { + this.coin = coin; + } + + public int getChange() { + return change; + } + + public void setChange(int change) { + this.change = change; + } + + public ProgressEntityX getProgress() { + return progress; + } + + public void setProgress(ProgressEntityX progress) { + this.progress = progress; + } + + public static class ProgressEntityX { + /** + * now : 0 + * max : 5000 + */ + + @SerializedName("now") + private int now; + @SerializedName("max") + private int max; + + public int getNow() { + return now; + } + + public void setNow(int now) { + this.now = now; + } + + public int getMax() { + return max; + } + + public void setMax(int max) { + this.max = max; + } + } + } + } + + public static class TopListEntity { + /** + * uid : 20293030 + * uname : czp3009 + * coin : 25100 + * face : http://i0.hdslb.com/bfs/face/4f65e79399ad5a1bf3f877851b2f819d5870b494.jpg + * guard_level : 0 + * rank : 1 + * score : 25100 + */ + + @SerializedName("uid") + private int uid; + @SerializedName("uname") + private String uname; + @SerializedName("coin") + private int coin; + @SerializedName("face") + private String face; + @SerializedName("guard_level") + private int guardLevel; + @SerializedName("rank") + private int rank; + @SerializedName("score") + private int score; + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } + + public String getUname() { + return uname; + } + + public void setUname(String uname) { + this.uname = uname; + } + + public int getCoin() { + return coin; + } + + public void setCoin(int coin) { + this.coin = coin; + } + + public String getFace() { + return face; + } + + public void setFace(String face) { + this.face = face; + } + + public int getGuardLevel() { + return guardLevel; + } + + public void setGuardLevel(int guardLevel) { + this.guardLevel = guardLevel; + } + + public int getRank() { + return rank; + } + + public void setRank(int rank) { + this.rank = rank; + } + + public int getScore() { + return score; + } + + public void setScore(int score) { + this.score = score; + } + } + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/SendOnlineHeartResponseEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/SendOnlineHeartResponseEntity.java new file mode 100644 index 0000000..047559a --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/SendOnlineHeartResponseEntity.java @@ -0,0 +1,57 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class SendOnlineHeartResponseEntity { + /** + * code : 0 + * message : ok + * data : {"giftlist":[]} + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + @SerializedName("giftlist") + private List giftlist; + + public List getGiftlist() { + return giftlist; + } + + public void setGiftlist(List giftlist) { + this.giftlist = giftlist; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/SignInfoEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/SignInfoEntity.java new file mode 100644 index 0000000..b15b156 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/SignInfoEntity.java @@ -0,0 +1,205 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class SignInfoEntity { + /** + * code : 0 + * message : OK + * data : {"sign_msg":"今天签到已获得
 辣条2个<\/font> 经验3000<\/font> ","maxday_num":30,"sign_day":4,"days_award":[{"id":1,"award":"silver","count":666,"text":"666银瓜子","day":5,"img":{"src":"http://static.hdslb.com/live-static/live-app/dayaward/1/5_1.png?20171102172700","width":56,"height":68}},{"id":2,"award":"vip","count":3,"text":"3天月费老爷","day":10,"img":{"src":"http://static.hdslb.com/live-static/live-app/dayaward/1/10_1.png?20171102172700","width":56,"height":68}},{"id":3,"award":"gift","count":4,"text":"1份喵娘","day":20,"img":{"src":"http://static.hdslb.com/live-static/live-app/dayaward/1/20_1.png?20171102172700","width":56,"height":68}},{"id":4,"award":"title","count":1,"text":"月老头衔","day":30,"img":{"src":"http://static.hdslb.com/live-static/live-app/dayaward/1/30_1.png?20171102172700","width":56,"height":68}}]} + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + /** + * sign_msg : 今天签到已获得
 辣条2个 经验3000  + * maxday_num : 30 + * sign_day : 4 + * days_award : [{"id":1,"award":"silver","count":666,"text":"666银瓜子","day":5,"img":{"src":"http://static.hdslb.com/live-static/live-app/dayaward/1/5_1.png?20171102172700","width":56,"height":68}},{"id":2,"award":"vip","count":3,"text":"3天月费老爷","day":10,"img":{"src":"http://static.hdslb.com/live-static/live-app/dayaward/1/10_1.png?20171102172700","width":56,"height":68}},{"id":3,"award":"gift","count":4,"text":"1份喵娘","day":20,"img":{"src":"http://static.hdslb.com/live-static/live-app/dayaward/1/20_1.png?20171102172700","width":56,"height":68}},{"id":4,"award":"title","count":1,"text":"月老头衔","day":30,"img":{"src":"http://static.hdslb.com/live-static/live-app/dayaward/1/30_1.png?20171102172700","width":56,"height":68}}] + */ + + @SerializedName("sign_msg") + private String signMsg; + @SerializedName("maxday_num") + private int maxdayNum; + @SerializedName("sign_day") + private int signDay; + @SerializedName("days_award") + private List daysAward; + + public String getSignMsg() { + return signMsg; + } + + public void setSignMsg(String signMsg) { + this.signMsg = signMsg; + } + + public int getMaxdayNum() { + return maxdayNum; + } + + public void setMaxdayNum(int maxdayNum) { + this.maxdayNum = maxdayNum; + } + + public int getSignDay() { + return signDay; + } + + public void setSignDay(int signDay) { + this.signDay = signDay; + } + + public List getDaysAward() { + return daysAward; + } + + public void setDaysAward(List daysAward) { + this.daysAward = daysAward; + } + + public static class DaysAwardEntity { + /** + * id : 1 + * award : silver + * count : 666 + * text : 666银瓜子 + * day : 5 + * img : {"src":"http://static.hdslb.com/live-static/live-app/dayaward/1/5_1.png?20171102172700","width":56,"height":68} + */ + + @SerializedName("id") + private int id; + @SerializedName("award") + private String award; + @SerializedName("count") + private int count; + @SerializedName("text") + private String text; + @SerializedName("day") + private int day; + @SerializedName("img") + private ImgEntity img; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getAward() { + return award; + } + + public void setAward(String award) { + this.award = award; + } + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public int getDay() { + return day; + } + + public void setDay(int day) { + this.day = day; + } + + public ImgEntity getImg() { + return img; + } + + public void setImg(ImgEntity img) { + this.img = img; + } + + public static class ImgEntity { + /** + * src : http://static.hdslb.com/live-static/live-app/dayaward/1/5_1.png?20171102172700 + * width : 56 + * height : 68 + */ + + @SerializedName("src") + private String src; + @SerializedName("width") + private int width; + @SerializedName("height") + private int height; + + public String getSrc() { + return src; + } + + public void setSrc(String src) { + this.src = src; + } + + public int getWidth() { + return width; + } + + public void setWidth(int width) { + this.width = width; + } + + public int getHeight() { + return height; + } + + public void setHeight(int height) { + this.height = height; + } + } + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/SpecialGiftEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/SpecialGiftEntity.java new file mode 100644 index 0000000..3fac960 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/SpecialGiftEntity.java @@ -0,0 +1,70 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +public class SpecialGiftEntity { + /** + * code : 0 + * message : OK + * msg : OK + * data : {"gift39":null} + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("msg") + private String msg; + @SerializedName("data") + private DataEntity data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + /** + * gift39 : null + */ + + @SerializedName("gift39") + private Object gift39; + + public Object getGift39() { + return gift39; + } + + public void setGift39(Object gift39) { + this.gift39 = gift39; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/TitlesEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/TitlesEntity.java new file mode 100644 index 0000000..b4556b9 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/TitlesEntity.java @@ -0,0 +1,149 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class TitlesEntity { + /** + * code : 0 + * message : ok + * data : [{"id":"task-color","title":"姹紫嫣红成就","img":"http://static.hdslb.com/live-static/live-app/title/3/task-color.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"task-year","title":"度年如日成就","img":"http://static.hdslb.com/live-static/live-app/title/3/task-year.png?20171102172700","width":186,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"task-winder","title":"追云逐月成就","img":"http://static.hdslb.com/live-static/live-app/title/3/task-winder.png?20171102172700","width":191,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"task-ul-max","title":"方得始终成就","img":"http://static.hdslb.com/live-static/live-app/title/3/task-ul-max.png?20171102172700","width":194,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"task-up-max","title":"久负盛名成就","img":"http://static.hdslb.com/live-static/live-app/title/3/task-up-max.png?20171102172700","width":190,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"task-tv-king","title":"电视王成就","img":"http://static.hdslb.com/live-static/live-app/title/3/task-tv-king.png?20171102172700","width":165,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"task-rich-man","title":"富甲天下成就","img":"http://static.hdslb.com/live-static/live-app/title/3/task-rich-man.png?20171102172700","width":156,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"christmas-top1","title":"2015年圣诞节","img":"http://static.hdslb.com/live-static/live-app/title/3/christmas-top1.png?20171102172700","width":198,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"christmas-top2","title":"2015年圣诞节","img":"http://static.hdslb.com/live-static/live-app/title/3/christmas-top2.png?20171102172700","width":198,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"old-man","title":"2015年圣诞节","img":"http://static.hdslb.com/live-static/live-app/title/3/old-man.png?20171102172700","width":135,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"middle-man","title":"2015年圣诞节","img":"http://static.hdslb.com/live-static/live-app/title/3/middle-man.png?20171102172700","width":164,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"youth-man","title":"2015年圣诞节","img":"http://static.hdslb.com/live-static/live-app/title/3/youth-man.png?20171102172700","width":133,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"child-man","title":"2015年圣诞节","img":"http://static.hdslb.com/live-static/live-app/title/3/child-man.png?20171102172700","width":166,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"festival-top1","title":"春节年糕活动","img":"http://static.hdslb.com/live-static/live-app/title/3/festival-top1.png?20171102172700","width":183,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"festival-top2","title":"春节年糕活动","img":"http://static.hdslb.com/live-static/live-app/title/3/festival-top2.png?20171102172700","width":169,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"cake-dough","title":"春节年糕活动","img":"http://static.hdslb.com/live-static/live-app/title/3/cake-dough.png?20171102172700","width":185,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"cake-flour","title":"春节年糕活动","img":"http://static.hdslb.com/live-static/live-app/title/3/cake-flour.png?20171102172700","width":183,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"carnival-top","title":"冬季嘉年华","img":"http://static.hdslb.com/live-static/live-app/title/3/carnival-top.png?20171102172700","width":177,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"school-top1","title":"保卫学园计划","img":"http://static.hdslb.com/live-static/live-app/title/3/school-top1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"school-top2","title":"保卫学园计划","img":"http://static.hdslb.com/live-static/live-app/title/3/school-top2.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"school-top3","title":"保卫学园计划","img":"http://static.hdslb.com/live-static/live-app/title/3/school-top3.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"school-top4","title":"保卫学园计划","img":"http://static.hdslb.com/live-static/live-app/title/3/school-top4.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"school-top5","title":"保卫学园计划","img":"http://static.hdslb.com/live-static/live-app/title/3/school-top5.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"sweet-1","title":"唱见甜心召集令","img":"http://static.hdslb.com/live-static/live-app/title/3/sweet-1.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"sweet-2","title":"唱见甜心召集令","img":"http://static.hdslb.com/live-static/live-app/title/3/sweet-2.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"sweet-3","title":"唱见甜心召集令","img":"http://static.hdslb.com/live-static/live-app/title/3/sweet-3.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"sweet-4","title":"唱见甜心召集令","img":"http://static.hdslb.com/live-static/live-app/title/3/sweet-4.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"sweet-5","title":"唱见甜心召集令","img":"http://static.hdslb.com/live-static/live-app/title/3/sweet-5.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"sing-1","title":"唱见甜心召集令","img":"http://static.hdslb.com/live-static/live-app/title/3/sing-1.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"sing-2","title":"唱见甜心召集令","img":"http://static.hdslb.com/live-static/live-app/title/3/sing-2.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"sing-3","title":"唱见甜心召集令","img":"http://static.hdslb.com/live-static/live-app/title/3/sing-3.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"sing-4","title":"唱见甜心召集令","img":"http://static.hdslb.com/live-static/live-app/title/3/sing-4.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"sing-5","title":"唱见甜心召集令","img":"http://static.hdslb.com/live-static/live-app/title/3/sing-5.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"warrior-1","title":"唱见甜心召集令","img":"http://static.hdslb.com/live-static/live-app/title/3/warrior-1.png?20171102172700","width":193,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"warrior-2","title":"唱见甜心召集令","img":"http://static.hdslb.com/live-static/live-app/title/3/warrior-2.png?20171102172700","width":195,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"warrior-3","title":"唱见甜心召集令","img":"http://static.hdslb.com/live-static/live-app/title/3/warrior-3.png?20171102172700","width":191,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"warrior-4","title":"唱见甜心召集令","img":"http://static.hdslb.com/live-static/live-app/title/3/warrior-4.png?20171102172700","width":192,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"sign-one-month","title":"签到全勤奖励","img":"http://static.hdslb.com/live-static/live-app/title/3/sign-one-month.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"may-spinach","title":"五月病活动","img":"http://static.hdslb.com/live-static/live-app/title/3/may-spinach.png?20171102172700","width":161,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"may-pillow","title":"五月病活动","img":"http://static.hdslb.com/live-static/live-app/title/3/may-pillow.png?20171102172700","width":161,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"may-high","title":"五月病活动","img":"http://static.hdslb.com/live-static/live-app/title/3/may-high.png?20171102172700","width":185,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"may-sleep","title":"五月病活动","img":"http://static.hdslb.com/live-static/live-app/title/3/may-sleep.png?20171102172700","width":185,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"xiaomi","title":"小米MAX活动","img":"http://static.hdslb.com/live-static/live-app/title/3/xiaomi.png?20171102172700","width":174,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"salty","title":"2016年端午节","img":"http://static.hdslb.com/live-static/live-app/title/3/salty.png?20171102172700","width":160,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"salty-man","title":"2016年端午节","img":"http://static.hdslb.com/live-static/live-app/title/3/salty-man.png?20171102172700","width":197,"height":50,"is_lihui":1,"lihui_img":"http://static.hdslb.com/live-static/live-app/titlie_lihui/3/salty-man.png?20171102172700","lihui_width":400,"lihui_height":564},{"id":"salty-king","title":"2016年端午节","img":"http://static.hdslb.com/live-static/live-app/title/3/salty-king.png?20171102172700","width":192,"height":50,"is_lihui":1,"lihui_img":"http://static.hdslb.com/live-static/live-app/titlie_lihui/3/salty-king.png?20171102172700","lihui_width":400,"lihui_height":564},{"id":"salty-sweet","title":"2016年端午节","img":"http://static.hdslb.com/live-static/live-app/title/3/salty-sweet.png?20171102172700","width":197,"height":50,"is_lihui":1,"lihui_img":"http://static.hdslb.com/live-static/live-app/titlie_lihui/3/salty-sweet.png?20171102172700","lihui_width":400,"lihui_height":564},{"id":"sweet","title":"2016年端午节","img":"http://static.hdslb.com/live-static/live-app/title/3/sweet.png?20171102172700","width":160,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"sweet-fighter","title":"2016年端午节","img":"http://static.hdslb.com/live-static/live-app/title/3/sweet-fighter.png?20171102172700","width":197,"height":50,"is_lihui":1,"lihui_img":"http://static.hdslb.com/live-static/live-app/titlie_lihui/3/sweet-fighter.png?20171102172700","lihui_width":400,"lihui_height":564},{"id":"sweet-princess","title":"2016年端午节","img":"http://static.hdslb.com/live-static/live-app/title/3/sweet-princess.png?20171102172700","width":192,"height":50,"is_lihui":1,"lihui_img":"http://static.hdslb.com/live-static/live-app/titlie_lihui/3/sweet-princess.png?20171102172700","lihui_width":400,"lihui_height":564},{"id":"anniversary","title":"七周年活动","img":"http://static.hdslb.com/live-static/live-app/title/3/anniversary.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"ice-dust","title":"2016夏色活动","img":"http://static.hdslb.com/live-static/live-app/title/3/ice-dust.png?20171102172700","width":192,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"ice-zero","title":"2016夏色活动","img":"http://static.hdslb.com/live-static/live-app/title/3/ice-zero.png?20171102172700","width":192,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"da-shen","title":"绘画招募活动","img":"http://static.hdslb.com/live-static/live-app/title/3/da-shen.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"gao-shou","title":"绘画招募活动","img":"http://static.hdslb.com/live-static/live-app/title/3/gao-shou.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"shen-7","title":"绘画招募活动","img":"http://static.hdslb.com/live-static/live-app/title/3/shen-7.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"nuan-xin","title":"绘画招募活动","img":"http://static.hdslb.com/live-static/live-app/title/3/nuan-xin.png?20171102172700","width":187,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"tao-lu","title":"橙光活动","img":"http://static.hdslb.com/live-static/live-app/title/3/tao-lu.png?20171102172700","width":198,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-56-1","title":"2016红叶祭活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-56-1.png?20171102172700","width":170,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-56-2","title":"2016红叶祭活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-56-2.png?20171102172700","width":190,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-56-3","title":"2016红叶祭活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-56-3.png?20171102172700","width":190,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-56-4","title":"2016红叶祭活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-56-4.png?20171102172700","width":163,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-57-1","title":"2016红叶祭活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-57-1.png?20171102172700","width":150,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-58-1","title":"2016红叶祭活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-58-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-59-1","title":"2016红叶祭活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-59-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-60-1","title":"2016红叶祭活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-60-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-61-1","title":"2016吃瓜活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-61-1.png?20171102172700","width":185,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-62-1","title":"2016拜年祭主播选拔活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-62-1.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-63-1","title":"2016拜年祭主播选拔活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-63-1.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-64-1","title":"2016拜年祭主播选拔活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-64-1.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-65-1","title":"2016拜年祭主播选拔活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-65-1.png?20171102172700","width":95,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-66-1","title":"2016拜年祭主播选拔活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-66-1.png?20171102172700","width":95,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-67-1","title":"2016拜年祭主播选拔活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-67-1.png?20171102172700","width":95,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-68-1","title":"2016拜年祭主播选拔活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-68-1.png?20171102172700","width":95,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-69-1","title":"2016拜年祭主播选拔活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-69-1.png?20171102172700","width":95,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-70-1","title":"2016拜年祭主播选拔活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-70-1.png?20171102172700","width":124,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-71-1","title":"2016拜年祭主播选拔活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-71-1.png?20171102172700","width":124,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-72-1","title":"2016拜年祭主播选拔活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-72-1.png?20171102172700","width":124,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-73-1","title":"2016拜年祭主播选拔活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-73-1.png?20171102172700","width":124,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-74-1","title":"2016拜年祭主播选拔活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-74-1.png?20171102172700","width":124,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-75-1","title":"2016深空远征活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-75-1.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-75-2","title":"2016深空远征活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-75-2.png?20171102172700","width":186,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-75-3","title":"2016深空远征活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-75-3.png?20171102172700","width":190,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-76-1","title":"2016深空远征活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-76-1.png?20171102172700","width":104,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-77-1","title":"2016红叶祭活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-77-1.png?20171102172700","width":185,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-78-1","title":"2016双11活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-78-1.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-79-1","title":"2016双11活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-79-1.png?20171102172700","width":190,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-80-1","title":"Last Order活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-80-1.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-81-1","title":"Last Order活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-81-1.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-82-1","title":"Last Order活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-82-1.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-82-2","title":"Last Order活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-82-2.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-82-3","title":"Last Order活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-82-3.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-83-1","title":"2016年度回馈活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-83-1.png?20171102172700","width":103,"height":49,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-84-1","title":"2016年度回馈活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-84-1.png?20171102172700","width":143,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-85-1","title":"2016年度回馈活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-85-1.png?20171102172700","width":118,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-86-1","title":"2016年度回馈活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-86-1.png?20171102172700","width":107,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-87-1","title":"2016年度回馈活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-87-1.png?20171102172700","width":107,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-88-1","title":"2016年度回馈活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-88-1.png?20171102172700","width":111,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-89-1","title":"丁酉年春节活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-89-1.png?20171102172700","width":103,"height":49,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-89-2","title":"丁酉年春节活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-89-2-2.png?20171102172700","width":103,"height":49,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-89-2-2","title":"丁酉年春节活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-89-2-2.png?20171102172700","width":105,"height":49,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-90-1","title":"丁酉年春节活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-90-1.png?20171102172700","width":156,"height":43,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-91-1","title":"丁酉年春节活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-91-1.png?20171102172700","width":139,"height":44,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-92-1","title":"丁酉年春节活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-92-1.png?20171102172700","width":129,"height":41,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-93-1","title":"2017情人节活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-93-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-94-1","title":"2017情人节活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-94-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-95-1","title":"2017情人节活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-95-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-95-2","title":"2017情人节活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-95-2.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-96-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-96-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-97-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-97-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-98-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-98-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-99-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-99-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-100-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-100-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-101-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-101-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-102-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-102-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-103-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-103-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-104-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-104-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-105-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-105-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-106-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-106-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-107-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-107-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-108-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-108-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-108-2","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-108-2.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-109-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-109-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-110-1","title":"2017超次元文明演武","img":"http://static.hdslb.com/live-static/live-app/title/3/title-110-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-111-1","title":"2017Blink","img":"http://static.hdslb.com/live-static/live-app/title/3/title-111-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-112-1","title":"新主播招募","img":"http://static.hdslb.com/live-static/live-app/title/3/title-112-1.png?20171102172700","width":192,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-113-1","title":"新主播招募","img":"http://static.hdslb.com/live-static/live-app/title/3/title-113-1.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-114-1","title":"新主播招募","img":"http://static.hdslb.com/live-static/live-app/title/3/title-114-1.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-115-1","title":"新主播招募","img":"http://static.hdslb.com/live-static/live-app/title/3/title-115-1.png?20171102172700","width":180,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-116-1","title":"新主播招募","img":"http://static.hdslb.com/live-static/live-app/title/3/title-116-1.png?20171102172700","width":193,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-117-1","title":"新主播招募","img":"http://static.hdslb.com/live-static/live-app/title/3/title-117-1.png?20171102172700","width":195,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-118-1","title":"新主播招募","img":"http://static.hdslb.com/live-static/live-app/title/3/title-118-1.png?20171102172700","width":191,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-119-1","title":"2017排行榜","img":"http://static.hdslb.com/live-static/live-app/title/3/title-119-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-120-1","title":"友爱社头衔","img":"http://static.hdslb.com/live-static/live-app/title/3/title-120-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-121-1","title":"友爱社头衔","img":"http://static.hdslb.com/live-static/live-app/title/3/title-121-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-122-1","title":"友爱社头衔","img":"http://static.hdslb.com/live-static/live-app/title/3/title-122-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-123-1","title":"友爱社头衔","img":"http://static.hdslb.com/live-static/live-app/title/3/title-123-1.png?20171102172700","width":194,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-123-2","title":"友爱社头衔","img":"http://static.hdslb.com/live-static/live-app/title/3/title-123-2.png?20171102172700","width":191,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-124-1","title":"儿童节活动","img":"http://static.hdslb.com/live-static/live-app/title/3/title-124-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-125-1","title":"聊天概率掉落","img":"http://static.hdslb.com/live-static/live-app/title/3/title-125-1.png?20171102172700","width":196,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-126-1","title":"夏日大作战","img":"http://static.hdslb.com/live-static/live-app/title/3/title-126-1.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-126-2","title":"夏日大作战","img":"http://static.hdslb.com/live-static/live-app/title/3/title-126-2.png?20171102172700","width":200,"height":50,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-127-1","title":"开学季","img":"http://static.hdslb.com/live-static/live-app/title/3/title-127-1.png?20171102172700","width":68,"height":20,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-127-2","title":"开学季","img":"http://static.hdslb.com/live-static/live-app/title/3/title-127-2.png?20171102172700","width":68,"height":20,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-128-1","title":"国庆","img":"http://static.hdslb.com/live-static/live-app/title/3/title-128-1.png?20171102172700","width":68,"height":20,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-128-2","title":"国庆","img":"http://static.hdslb.com/live-static/live-app/title/3/title-128-2.png?20171102172700","width":68,"height":20,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-129-1","title":"中秋节","img":"http://static.hdslb.com/live-static/live-app/title/3/title-129-1.png?20171102172700","width":68,"height":20,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-130-1","title":"中秋节","img":"http://static.hdslb.com/live-static/live-app/title/3/title-130-1.png?20171102172700","width":68,"height":20,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-131-1","title":"哔哩谷物语","img":"http://static.hdslb.com/live-static/live-app/title/3/title-131-1.png?20171102172700","width":68,"height":20,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-131-2","title":"哔哩谷物语","img":"http://static.hdslb.com/live-static/live-app/title/3/title-131-2.png?20171102172700","width":68,"height":20,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0},{"id":"title-133-1","title":"秋叶祭","img":"http://static.hdslb.com/live-static/live-app/title/3/title-133-1.png?20171102172700","width":68,"height":20,"is_lihui":0,"lihui_img":"","lihui_width":0,"lihui_height":0}] + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataEntity { + /** + * id : task-color + * title : 姹紫嫣红成就 + * img : http://static.hdslb.com/live-static/live-app/title/3/task-color.png?20171102172700 + * width : 200 + * height : 50 + * is_lihui : 0 + * lihui_img : + * lihui_width : 0 + * lihui_height : 0 + */ + + @SerializedName("id") + private String id; + @SerializedName("title") + private String title; + @SerializedName("img") + private String img; + @SerializedName("width") + private int width; + @SerializedName("height") + private int height; + @SerializedName("is_lihui") + private int isLihui; + @SerializedName("lihui_img") + private String lihuiImg; + @SerializedName("lihui_width") + private int lihuiWidth; + @SerializedName("lihui_height") + private int lihuiHeight; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + + public int getWidth() { + return width; + } + + public void setWidth(int width) { + this.width = width; + } + + public int getHeight() { + return height; + } + + public void setHeight(int height) { + this.height = height; + } + + public int getIsLihui() { + return isLihui; + } + + public void setIsLihui(int isLihui) { + this.isLihui = isLihui; + } + + public String getLihuiImg() { + return lihuiImg; + } + + public void setLihuiImg(String lihuiImg) { + this.lihuiImg = lihuiImg; + } + + public int getLihuiWidth() { + return lihuiWidth; + } + + public void setLihuiWidth(int lihuiWidth) { + this.lihuiWidth = lihuiWidth; + } + + public int getLihuiHeight() { + return lihuiHeight; + } + + public void setLihuiHeight(int lihuiHeight) { + this.lihuiHeight = lihuiHeight; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/live/entity/UserEntity.java b/src/main/java/com/hiczp/bilibili/api/live/entity/UserEntity.java new file mode 100644 index 0000000..2932a79 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/live/entity/UserEntity.java @@ -0,0 +1,219 @@ +package com.hiczp.bilibili.api.live.entity; + +import com.google.gson.annotations.SerializedName; + +public class UserEntity { + /** + * code : 0 + * message : ok + * data : {"silver":1896,"gold":0,"vip":0,"svip":0,"svip_time":"0000-00-00 00:00:00","vip_time":"0000-00-00 00:00:00","room_id":1110317,"user_level":20,"user_level_color":6406234,"vip_view_status":1,"isSign":1,"use_count":0,"wearTitle":{"title":"0","activity":"0"}} + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + /** + * silver : 1896 + * gold : 0 + * vip : 0 + * svip : 0 + * svip_time : 0000-00-00 00:00:00 + * vip_time : 0000-00-00 00:00:00 + * room_id : 1110317 + * user_level : 20 + * user_level_color : 6406234 + * vip_view_status : 1 + * isSign : 1 + * use_count : 0 + * wearTitle : {"title":"0","activity":"0"} + */ + + @SerializedName("silver") + private int silver; + @SerializedName("gold") + private int gold; + @SerializedName("vip") + private int vip; + @SerializedName("svip") + private int svip; + @SerializedName("svip_time") + private String svipTime; + @SerializedName("vip_time") + private String vipTime; + @SerializedName("room_id") + private int roomId; + @SerializedName("user_level") + private int userLevel; + @SerializedName("user_level_color") + private int userLevelColor; + @SerializedName("vip_view_status") + private int vipViewStatus; + @SerializedName("isSign") + private int isSign; + @SerializedName("use_count") + private int useCount; + @SerializedName("wearTitle") + private WearTitleEntity wearTitle; + + public int getSilver() { + return silver; + } + + public void setSilver(int silver) { + this.silver = silver; + } + + public int getGold() { + return gold; + } + + public void setGold(int gold) { + this.gold = gold; + } + + public int getVip() { + return vip; + } + + public void setVip(int vip) { + this.vip = vip; + } + + public int getSvip() { + return svip; + } + + public void setSvip(int svip) { + this.svip = svip; + } + + public String getSvipTime() { + return svipTime; + } + + public void setSvipTime(String svipTime) { + this.svipTime = svipTime; + } + + public String getVipTime() { + return vipTime; + } + + public void setVipTime(String vipTime) { + this.vipTime = vipTime; + } + + public int getRoomId() { + return roomId; + } + + public void setRoomId(int roomId) { + this.roomId = roomId; + } + + public int getUserLevel() { + return userLevel; + } + + public void setUserLevel(int userLevel) { + this.userLevel = userLevel; + } + + public int getUserLevelColor() { + return userLevelColor; + } + + public void setUserLevelColor(int userLevelColor) { + this.userLevelColor = userLevelColor; + } + + public int getVipViewStatus() { + return vipViewStatus; + } + + public void setVipViewStatus(int vipViewStatus) { + this.vipViewStatus = vipViewStatus; + } + + public int getIsSign() { + return isSign; + } + + public void setIsSign(int isSign) { + this.isSign = isSign; + } + + public int getUseCount() { + return useCount; + } + + public void setUseCount(int useCount) { + this.useCount = useCount; + } + + public WearTitleEntity getWearTitle() { + return wearTitle; + } + + public void setWearTitle(WearTitleEntity wearTitle) { + this.wearTitle = wearTitle; + } + + public static class WearTitleEntity { + /** + * title : 0 + * activity : 0 + */ + + @SerializedName("title") + private String title; + @SerializedName("activity") + private String activity; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getActivity() { + return activity; + } + + public void setActivity(String activity) { + this.activity = activity; + } + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/passport/PassportService.java b/src/main/java/com/hiczp/bilibili/api/passport/PassportService.java new file mode 100644 index 0000000..ea3450a --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/passport/PassportService.java @@ -0,0 +1,24 @@ +package com.hiczp.bilibili.api.passport; + +import com.hiczp.bilibili.api.passport.entity.*; +import retrofit2.Call; +import retrofit2.http.GET; +import retrofit2.http.POST; +import retrofit2.http.Query; + +public interface PassportService { + @POST("api/oauth2/getKey") + Call getKey(); + + @POST("api/oauth2/login") + Call login(@Query("username") String username, @Query("password") String password); + + @GET("api/oauth2/info") + Call getInfo(@Query("access_token") String accessToken); + + @POST("api/oauth2/refreshToken") + Call refreshToken(@Query("access_token") String accessToken, @Query("refresh_token") String refreshToken); + + @POST("api/oauth2/revoke") + Call logout(@Query("access_token") String accessToken); +} diff --git a/src/main/java/com/hiczp/bilibili/api/passport/entity/InfoEntity.java b/src/main/java/com/hiczp/bilibili/api/passport/entity/InfoEntity.java new file mode 100644 index 0000000..db5f137 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/passport/entity/InfoEntity.java @@ -0,0 +1,124 @@ +package com.hiczp.bilibili.api.passport.entity; + +import com.google.gson.annotations.SerializedName; + +public class InfoEntity { + /** + * ts : 1509555703 + * code : 0 + * data : {"mid":20293030,"appid":878,"access_token":"ef3981aefcf27013dce6d0571eca79d9","expires_in":1465966,"userid":"bili_1178318619","uname":"czp3009"} + */ + + @SerializedName("ts") + private int ts; + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + + public int getTs() { + return ts; + } + + public void setTs(int ts) { + this.ts = ts; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + /** + * mid : 20293030 + * appid : 878 + * access_token : ef3981aefcf27013dce6d0571eca79d9 + * expires_in : 1465966 + * userid : bili_1178318619 + * uname : czp3009 + */ + + @SerializedName("mid") + private int mid; + @SerializedName("appid") + private int appid; + @SerializedName("access_token") + private String accessToken; + @SerializedName("expires_in") + private int expiresIn; + @SerializedName("userid") + private String userid; + @SerializedName("uname") + private String uname; + + public int getMid() { + return mid; + } + + public void setMid(int mid) { + this.mid = mid; + } + + public int getAppid() { + return appid; + } + + public void setAppid(int appid) { + this.appid = appid; + } + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + public int getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(int expiresIn) { + this.expiresIn = expiresIn; + } + + public String getUserid() { + return userid; + } + + public void setUserid(String userid) { + this.userid = userid; + } + + public String getUname() { + return uname; + } + + public void setUname(String uname) { + this.uname = uname; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/passport/entity/KeyEntity.java b/src/main/java/com/hiczp/bilibili/api/passport/entity/KeyEntity.java new file mode 100644 index 0000000..8721e81 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/passport/entity/KeyEntity.java @@ -0,0 +1,85 @@ +package com.hiczp.bilibili.api.passport.entity; + +import com.google.gson.annotations.SerializedName; + +public class KeyEntity { + /** + * ts : 1509555699 + * code : 0 + * data : {"hash":"8b9030ef5ff6d9f6","key":"-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdScM09sZJqFPX7bvmB2y6i08J\nbHsa0v4THafPbJN9NoaZ9Djz1LmeLkVlmWx1DwgHVW+K7LVWT5FV3johacVRuV98\n37+RNntEK6SE82MPcl7fA++dmW2cLlAjsIIkrX+aIvvSGCuUfcWpWFy3YVDqhuHr\nNDjdNcaefJIQHMW+sQIDAQAB\n-----END PUBLIC KEY-----\n"} + */ + + @SerializedName("ts") + private int ts; + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + + public int getTs() { + return ts; + } + + public void setTs(int ts) { + this.ts = ts; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + /** + * hash : 8b9030ef5ff6d9f6 + * key : -----BEGIN PUBLIC KEY----- + * MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdScM09sZJqFPX7bvmB2y6i08J + * bHsa0v4THafPbJN9NoaZ9Djz1LmeLkVlmWx1DwgHVW+K7LVWT5FV3johacVRuV98 + * 37+RNntEK6SE82MPcl7fA++dmW2cLlAjsIIkrX+aIvvSGCuUfcWpWFy3YVDqhuHr + * NDjdNcaefJIQHMW+sQIDAQAB + * -----END PUBLIC KEY----- + */ + + @SerializedName("hash") + private String hash; + @SerializedName("key") + private String key; + + public String getHash() { + return hash; + } + + public void setHash(String hash) { + this.hash = hash; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/passport/entity/LoginResponseEntity.java b/src/main/java/com/hiczp/bilibili/api/passport/entity/LoginResponseEntity.java new file mode 100644 index 0000000..be69e19 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/passport/entity/LoginResponseEntity.java @@ -0,0 +1,102 @@ +package com.hiczp.bilibili.api.passport.entity; + +import com.google.gson.annotations.SerializedName; + +public class LoginResponseEntity { + /** + * code : 0 + * data : {"access_token":"8501735069b043dd62c3bb88810444fd","refresh_token":"d41affc888082ffa11d7d2c37ad0cf2c","mid":20293030,"expires_in":2592000} + * ts : 1509734025 + */ + + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + @SerializedName("ts") + private int ts; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public int getTs() { + return ts; + } + + public void setTs(int ts) { + this.ts = ts; + } + + public static class DataEntity { + /** + * access_token : 8501735069b043dd62c3bb88810444fd + * refresh_token : d41affc888082ffa11d7d2c37ad0cf2c + * mid : 20293030 + * expires_in : 2592000 + */ + + @SerializedName("access_token") + private String accessToken; + @SerializedName("refresh_token") + private String refreshToken; + @SerializedName("mid") + private int mid; + @SerializedName("expires_in") + private int expiresIn; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + } + + public int getMid() { + return mid; + } + + public void setMid(int mid) { + this.mid = mid; + } + + public int getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(int expiresIn) { + this.expiresIn = expiresIn; + } + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/passport/entity/LogoutResponseEntity.java b/src/main/java/com/hiczp/bilibili/api/passport/entity/LogoutResponseEntity.java new file mode 100644 index 0000000..e67b42b --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/passport/entity/LogoutResponseEntity.java @@ -0,0 +1,42 @@ +package com.hiczp.bilibili.api.passport.entity; + +import com.google.gson.annotations.SerializedName; + +public class LogoutResponseEntity { + /** + * message : access_key not found. + * ts : 1509555707 + * code : -901 + */ + + @SerializedName("message") + private String message; + @SerializedName("ts") + private int ts; + @SerializedName("code") + private int code; + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public int getTs() { + return ts; + } + + public void setTs(int ts) { + this.ts = ts; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } +} diff --git a/src/main/java/com/hiczp/bilibili/api/passport/entity/RefreshTokenResponseEntity.java b/src/main/java/com/hiczp/bilibili/api/passport/entity/RefreshTokenResponseEntity.java new file mode 100644 index 0000000..7e72230 --- /dev/null +++ b/src/main/java/com/hiczp/bilibili/api/passport/entity/RefreshTokenResponseEntity.java @@ -0,0 +1,102 @@ +package com.hiczp.bilibili.api.passport.entity; + +import com.google.gson.annotations.SerializedName; + +public class RefreshTokenResponseEntity { + /** + * ts : 1509734125 + * code : 0 + * data : {"mid":20293030,"refresh_token":"19d64022154e033574df4c753fc7926d","access_token":"f64530df1fb491ae090b67e191d86f58","expires_in":2592000} + */ + + @SerializedName("ts") + private int ts; + @SerializedName("code") + private int code; + @SerializedName("message") + private String message; + @SerializedName("data") + private DataEntity data; + + public int getTs() { + return ts; + } + + public void setTs(int ts) { + this.ts = ts; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public DataEntity getData() { + return data; + } + + public void setData(DataEntity data) { + this.data = data; + } + + public static class DataEntity { + /** + * mid : 20293030 + * refresh_token : 19d64022154e033574df4c753fc7926d + * access_token : f64530df1fb491ae090b67e191d86f58 + * expires_in : 2592000 + */ + + @SerializedName("mid") + private int mid; + @SerializedName("refresh_token") + private String refreshToken; + @SerializedName("access_token") + private String accessToken; + @SerializedName("expires_in") + private int expiresIn; + + public int getMid() { + return mid; + } + + public void setMid(int mid) { + this.mid = mid; + } + + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + } + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + public int getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(int expiresIn) { + this.expiresIn = expiresIn; + } + } +} diff --git a/src/test/java/com/hiczp/bilibili/api/test/Config.java b/src/test/java/com/hiczp/bilibili/api/test/Config.java new file mode 100644 index 0000000..ba2f7a4 --- /dev/null +++ b/src/test/java/com/hiczp/bilibili/api/test/Config.java @@ -0,0 +1,41 @@ +package com.hiczp.bilibili.api.test; + +public class Config { + private static Config config; + + private String username; + private String password; + private int roomId; + + static Config getInstance() { + return config; + } + + static void setConfig(Config config) { + Config.config = config; + } + + String getUsername() { + return username; + } + + void setUsername(String username) { + this.username = username; + } + + String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + int getRoomId() { + return roomId; + } + + public void setRoomId(int roomId) { + this.roomId = roomId; + } +} diff --git a/src/test/java/com/hiczp/bilibili/api/test/LiveServiceTest.java b/src/test/java/com/hiczp/bilibili/api/test/LiveServiceTest.java new file mode 100644 index 0000000..95269d3 --- /dev/null +++ b/src/test/java/com/hiczp/bilibili/api/test/LiveServiceTest.java @@ -0,0 +1,287 @@ +package com.hiczp.bilibili.api.test; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.hiczp.bilibili.api.BilibiliRESTAPI; +import com.hiczp.bilibili.api.Utils; +import com.hiczp.bilibili.api.live.entity.BulletScreenEntity; +import com.hiczp.bilibili.api.live.entity.GiftEntity; +import com.hiczp.bilibili.api.live.entity.LiveRoomInfoEntity; +import com.hiczp.bilibili.api.live.entity.PlayerBagEntity; +import org.junit.After; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Date; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class LiveServiceTest { + private static final Logger LOGGER = LoggerFactory.getLogger(LiveServiceTest.class); + private static final Gson GSON = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create(); + private static int roomId = Config.getInstance().getRoomId(); + private static LiveRoomInfoEntity.LiveRoomEntity liveRoomEntity; + private static PlayerBagEntity.BagGiftEntity firstGiftInPlayerBag; + + @Test + public void _00getBulletScreenConfig() throws IOException { + LOGGER.info("Getting Bullet Screen config"); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .getBulletScreenConfig("all") + .execute() + .body(), + System.out + ); + } + + @Test + public void _01getHistoryBulletScreens() throws Exception { + LOGGER.info("Getting history Bullet Screens of room " + roomId); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .getHistoryBulletScreens(roomId) + .execute() + .body(), + System.out + ); + } + + @Test + public void _02getRoomInfo() throws Exception { + LOGGER.info("Getting info of live room " + roomId); + LiveRoomInfoEntity liveRoomInfoEntity = BilibiliRESTAPI.getLiveService() + .getRoomInfo(roomId) + .execute() + .body(); + liveRoomEntity = liveRoomInfoEntity.getData(); + roomId = liveRoomEntity.getRoomId(); + GSON.toJson( + liveRoomInfoEntity, + System.out); + } + + @Test + public void _03isFollowed() throws Exception { + LOGGER.info("Getting is followed user " + liveRoomEntity.getMid()); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .isFollowed(liveRoomEntity.getMid()) + .execute() + .body(), + System.out + ); + } + + @Test + public void _04sendDaily() throws Exception { + LOGGER.info("Sending daily"); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .sendDaily() + .execute() + .body(), + System.out + ); + } + + @Test + public void _05getAllItem() throws Exception { + LOGGER.info("Getting all items"); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .getAllItem() + .execute() + .body(), + System.out + ); + } + + @Test + public void _06getAppSmallTV() throws Exception { + LOGGER.info("Getting App Small TV info"); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .getAppSmallTV() + .execute() + .body(), + System.out + ); + } + + @Test + public void _07getTitle() throws Exception { + LOGGER.info("Getting titles"); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .getTitle() + .execute() + .body(), + System.out + ); + } + + @Test + public void _08getSpecialGift() throws Exception { + LOGGER.info("Getting special gift"); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .getSpecialGift(roomId) + .execute() + .body(), + System.out + ); + } + + @Test + public void _09getUserInfo() throws Exception { + LOGGER.info("Getting user info"); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .getUserInfo() + .execute() + .body(), + System.out + ); + } + + @Test + public void _10getPlayUrl() throws Exception { + LOGGER.info("Getting play url of room " + roomId); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .getPlayUrl(roomId, "json") + .execute() + .body(), + System.out + ); + } + + @Test + public void _11sendOnlineHeart() throws Exception { + LOGGER.info("Sending online heart to room " + roomId); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .sendOnlineHeart(roomId, Utils.getScale()) + .execute() + .body(), + System.out + ); + } + + @Test + public void _12sendBulletScreen() throws Exception { + LOGGER.info("Sending Bullet Screen to room " + roomId); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .sendBulletScreen(new BulletScreenEntity(roomId, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()))) + .execute() + .body(), + System.out + ); + } + + @Test + public void _13getFreeSilverCurrentTask() throws Exception { + LOGGER.info("Getting free silver current task"); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .getFreeSilverCurrentTask() + .execute() + .body(), + System.out + ); + } + + @Test + public void _14getFreeSilverAward() throws Exception { + LOGGER.info("Getting free silver award"); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .getFreeSilverAward() + .execute() + .body(), + System.out + ); + } + + @Test + public void _15getPlayerBag() throws Exception { + LOGGER.info("Getting player bag"); + PlayerBagEntity playerBagEntity = BilibiliRESTAPI.getLiveService() + .getPlayerBag() + .execute() + .body(); + try { + firstGiftInPlayerBag = playerBagEntity.getData().get(0); + } catch (ArrayIndexOutOfBoundsException e) { + LOGGER.error("Current user don't have any gift"); + } + GSON.toJson( + playerBagEntity, + System.out + ); + } + + @Test + public void _16getActivityGifts() throws Exception { + LOGGER.info("Getting activity gifts"); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .getActivityGifts(roomId) + .execute() + .body(), + System.out + ); + } + + @Test + public void _17sendGift() throws Exception { + if (firstGiftInPlayerBag != null) { + int number = 1; + LOGGER.info("Sending {} {} to room of user '{}'", number, firstGiftInPlayerBag.getGiftName(), liveRoomEntity.getUname()); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .sendGift(new GiftEntity(firstGiftInPlayerBag, number, liveRoomEntity)) + .execute() + .body(), + System.out + ); + } else { + LOGGER.error("No gift available in player bag, ignore sending gift test"); + } + } + + @Test + public void _18getGiftTop() throws Exception { + LOGGER.info("Getting gift top"); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .getGiftTop(roomId) + .execute() + .body(), + System.out + ); + } + + @Test + public void _19getSignInfo() throws Exception { + LOGGER.info("Getting sign info"); + GSON.toJson( + BilibiliRESTAPI.getLiveService() + .getSignInfo() + .execute() + .body(), + System.out + ); + } + + @After + public void endLine() { + System.out.println(); + } +} diff --git a/src/test/java/com/hiczp/bilibili/api/test/LoginTest.java b/src/test/java/com/hiczp/bilibili/api/test/LoginTest.java new file mode 100644 index 0000000..2b06550 --- /dev/null +++ b/src/test/java/com/hiczp/bilibili/api/test/LoginTest.java @@ -0,0 +1,50 @@ +package com.hiczp.bilibili.api.test; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.hiczp.bilibili.api.BilibiliRESTAPI; +import org.junit.After; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class LoginTest { + private static final Logger LOGGER = LoggerFactory.getLogger(LoginTest.class); + private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); + + @Test + public void _0login() throws Exception { + LOGGER.info("Start login test"); + Config config = Config.getInstance(); + GSON.toJson( + BilibiliRESTAPI.login(config.getUsername(), config.getPassword()), + System.out + ); + } + + @Test + public void _1info() throws Exception { + LOGGER.info("Getting user info"); + GSON.toJson( + BilibiliRESTAPI.getAccountInfo(), + System.out + ); + } + + @Test + public void _2refreshToken() throws Exception { + LOGGER.info("Refreshing token"); + GSON.toJson( + BilibiliRESTAPI.refreshToken(), + System.out + ); + } + + @After + public void endLine() { + System.out.println(); + } +} diff --git a/src/test/java/com/hiczp/bilibili/api/test/LogoutTest.java b/src/test/java/com/hiczp/bilibili/api/test/LogoutTest.java new file mode 100644 index 0000000..b4b87bf --- /dev/null +++ b/src/test/java/com/hiczp/bilibili/api/test/LogoutTest.java @@ -0,0 +1,28 @@ +package com.hiczp.bilibili.api.test; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.hiczp.bilibili.api.BilibiliRESTAPI; +import org.junit.After; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class LogoutTest { + private static final Logger LOGGER = LoggerFactory.getLogger(LogoutTest.class); + private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); + + @Test + public void logout() throws Exception { + LOGGER.info("Logout"); + GSON.toJson( + BilibiliRESTAPI.logout(), + System.out + ); + } + + @After + public void endLine() { + System.out.println(); + } +} diff --git a/src/test/java/com/hiczp/bilibili/api/test/RuleSuite.java b/src/test/java/com/hiczp/bilibili/api/test/RuleSuite.java new file mode 100644 index 0000000..0d926be --- /dev/null +++ b/src/test/java/com/hiczp/bilibili/api/test/RuleSuite.java @@ -0,0 +1,40 @@ +package com.hiczp.bilibili.api.test; + +import com.google.gson.Gson; +import org.apache.log4j.BasicConfigurator; +import org.junit.ClassRule; +import org.junit.rules.ExternalResource; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +import java.io.BufferedReader; +import java.io.InputStreamReader; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + LoginTest.class, + LiveServiceTest.class, + LogoutTest.class +}) +public class RuleSuite { + @ClassRule + public static ExternalResource externalResource = new ExternalResource() { + @Override + protected void before() throws Throwable { + //初始化 slf4j + BasicConfigurator.configure(); + //读取配置文件 + try { + Config.setConfig( + new Gson().fromJson( + new BufferedReader(new InputStreamReader(Config.class.getResourceAsStream("/config.json"))), + Config.class + ) + ); + } catch (NullPointerException e) { + //抛出异常就可以取消测试 + throw new RuntimeException("Please create config file before tests"); + } + } + }; +} diff --git a/src/test/resources/config-template.json b/src/test/resources/config-template.json new file mode 100644 index 0000000..6f499b6 --- /dev/null +++ b/src/test/resources/config-template.json @@ -0,0 +1,5 @@ +{ + "username": "xxxxx", + "password": "xxxxx", + "roomId": "23058" +}