Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author General_K1ng
*/
public class LiuLiApiConstant {
public static final String ANIME_URL = "https://tk.illlt.com:759/api.php?type=PC二次元/二次元动漫";
public static final String ANIME_URL = "https://tk.illlt.com:759/api.php?type=%E6%89%8B%E6%9C%BA%E4%BA%8C%E6%AC%A1%E5%85%83/%E4%BA%8C%E6%AC%A1%E5%85%83%E8%80%81%E5%A9%86%E8%90%8C%E5%A6%B9%E5%AD%90%E5%90%88%E9%9B%86";

public static final String BAI_DU_IMG_SEARCH_URL = "https://jk.lllt.top/api/baidu/";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import org.kookies.mirai.pojo.entity.api.request.runoob.CodeRunRequestBody;
import org.kookies.mirai.pojo.entity.api.request.voice.VoiceRequest;

import javax.imageio.ImageIO;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDate;
Expand Down Expand Up @@ -274,7 +276,9 @@ public static byte[] getPhoto(String photoUrl) throws IOException {
// 执行请求并获取响应
Response response = HTTP_CLIENT.newCall(request).execute();
// 从响应中提取并返回照片的字节数据
return response.body().bytes();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ImageIO.write(ImageIO.read(ImageIO.createImageInputStream(response.body().byteStream())), "png" ,byteArrayOutputStream);
return byteArrayOutputStream.toByteArray();
}


Expand Down