package com.yutou.biliapi.utils;

import com.yutou.biliapi.api.UserApi;
import com.yutou.biliapi.bean.live.SpiBean;
import com.yutou.biliapi.bean.login.LoginCookieDatabaseBean;
import com.yutou.biliapi.net.BiliUserNetApiManager;
import com.yutou.common.inter.IHttpApiCheckCallback;
import com.yutou.common.okhttp.HttpBody;
import com.yutou.common.okhttp.HttpCallback;
import com.yutou.common.utils.RedisTools;
import okhttp3.Headers;
import retrofit2.Response;

import java.io.IOException;

public class BiliUserUtils {
    public static String getBuvid(LoginCookieDatabaseBean cookie) {
        Response<HttpBody<SpiBean>> execute = null;
        try {
            execute = BiliUserNetApiManager.getInstance().getUserApi(cookie).getFingerSpi().execute();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        if (execute.isSuccessful()) {
            if (execute.body() != null) {
                return execute.body().getData().getB_3();
            }

        }
        return null;
    }
}
