package com.cyksj.web.util; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; import cn.hutool.http.Method; import cn.hutool.json.JSONObject; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; /** * @author chan * @date 2024/11/15 12:09 */ public class piliang { public static void main(String[] args) { //addChatgpt(); addClaude(); } public static void addChatgpt(){ // List list = Arrays.asList(stringBuilder.toString().split("\n")); //System.out.println(list); AtomicInteger count = new AtomicInteger(1400); String filePath = "/Users/chenbiao/project/yhlxj/netflix-web/src/main/java/com/cyksj/web/util/pojie.txt"; // 文件路径 try (BufferedReader reader = new BufferedReader(new FileReader(filePath))) { String line; while ((line = reader.readLine()) != null) { String[] split = line.split("----"); String email = split[0]; String password = split[1]; String rt = split[2]; System.out.println(email); System.out.println(password); JSONObject rtObj = new JSONObject(); rtObj.putOpt("refresh_token",rt); JSONObject jsonObject = new JSONObject(); int andIncrement = count.getAndIncrement(); jsonObject.putOpt("carId","PG" + andIncrement); jsonObject.putOpt("email", email); jsonObject.putOpt("password",password); jsonObject.putOpt("carName","PRO" + andIncrement); jsonObject.putOpt("officialSession",rtObj.toString()); jsonObject.putOpt("status",1); jsonObject.putOpt("isPlus",1); jsonObject.putOpt("remark","船长破解"); HttpResponse execute = new HttpRequest("https://nf.video/8081/api/manage/account/gptCar/post/mirror/car/session").method(Method.POST).header("satoken", "fbc24d2d-abbe-47b5-b979-0c71c8ef5779").body(jsonObject.toString()).execute(); System.out.println(jsonObject.get("carId") + ":" + execute.body()); } } catch (IOException e) { e.printStackTrace(); } } public static void addClaude(){ String filePath = "/Users/chenbiao/project/yhlxj/netflix-web/src/main/java/com/cyksj/web/util/claude.txt"; // 文件路径 AtomicInteger count = new AtomicInteger(227); try (BufferedReader reader = new BufferedReader(new FileReader(filePath))) { String line; while ((line = reader.readLine()) != null) { String[] split = line.split("----"); String email = split[0]; String password = split[1]; String rt = split[2]; System.out.println(email); System.out.println(password); JSONObject jsonObject = new JSONObject(); int andIncrement = count.getAndIncrement(); jsonObject.putOpt("carID","Claude-PRO-" + andIncrement); jsonObject.putOpt("email", email); jsonObject.putOpt("password",password); jsonObject.putOpt("officialSession",rt); HttpResponse execute = new HttpRequest("https://kelaode.nf.video/adminapi/chatgpt/session/add").method(Method.POST).header("apiauth", "chan").body(jsonObject.toString()).execute(); System.out.println(jsonObject.get("carID") + ":" + execute.body()); } }catch (IOException e) { e.printStackTrace(); } } }