// Path: app/src/main/java/com/lqr/biliblili/app/data/api/Api.java
// public interface Api {
//     String LIVE_BASE_URL = "http://api.live.bilibili.com/";
//     String RECOMMEND_BASE_URL = "https://app.bilibili.com/";
//     String VIDEO_DETAIL_SUMMARY_BASE_URL = "https://app.bilibili.com/";
//     String VIDEO_DETAIL_REPLY_BASE_URL = "https://api.bilibili.com/";
// 
//     // 没有登录的情况下，使用这个User-Agent
//     String COMMON_UA_STR = "Mozilla/5.0 BiliDroid/5.15.0 (bbcallen@gmail.com)";
// }


import com.lqr.biliblili.app.data.api.Api;
import java.io.IOException;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
package com.lqr.biliblili.app.config.applyOptions.intercept;




/**
 * 添加UA拦截器，B站请求API需要加上UA才能正常使用
 */
public class UserAgentInterceptor implements Interceptor {
    @Override
    public Response intercept(Chain chain) throws IOException {
        Request originalRequest = chain.request();
        Request requestWithUserAgent = originalRequest.newBuilder()
                .removeHeader("User-Agent")
// Path: app/src/main/java/com/lqr/biliblili/app/data/api/Api.java
// public interface Api {
//     String LIVE_BASE_URL = "http://api.live.bilibili.com/";
//     String RECOMMEND_BASE_URL = "https://app.bilibili.com/";
//     String VIDEO_DETAIL_SUMMARY_BASE_URL = "https://app.bilibili.com/";
//     String VIDEO_DETAIL_REPLY_BASE_URL = "https://api.bilibili.com/";
// 
//     // 没有登录的情况下，使用这个User-Agent
//     String COMMON_UA_STR = "Mozilla/5.0 BiliDroid/5.15.0 (bbcallen@gmail.com)";
// }


// Path: app/src/main/java/com/lqr/biliblili/app/config/applyOptions/intercept/UserAgentInterceptor.java
import com.lqr.biliblili.app.data.api.Api;
import java.io.IOException;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

package com.lqr.biliblili.app.config.applyOptions.intercept;




/**
 * 添加UA拦截器，B站请求API需要加上UA才能正常使用
 */
public class UserAgentInterceptor implements Interceptor {
    @Override
    public Response intercept(Chain chain) throws IOException {
        Request originalRequest = chain.request();
        Request requestWithUserAgent = originalRequest.newBuilder()
                .removeHeader("User-Agent")
                .addHeader("User-Agent", Api.COMMON_UA_STR)