piliang.java 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. package com.cyksj.web.util;
  2. import cn.hutool.http.HttpRequest;
  3. import cn.hutool.http.HttpResponse;
  4. import cn.hutool.http.Method;
  5. import cn.hutool.json.JSONObject;
  6. import java.io.BufferedReader;
  7. import java.io.FileReader;
  8. import java.io.IOException;
  9. import java.util.ArrayList;
  10. import java.util.Arrays;
  11. import java.util.List;
  12. import java.util.concurrent.atomic.AtomicInteger;
  13. /**
  14. * @author chan
  15. * @date 2024/11/15 12:09
  16. */
  17. public class piliang {
  18. public static void main(String[] args) {
  19. //addChatgpt();
  20. addClaude();
  21. }
  22. public static void addChatgpt(){
  23. // List<String> list = Arrays.asList(stringBuilder.toString().split("\n"));
  24. //System.out.println(list);
  25. AtomicInteger count = new AtomicInteger(1400);
  26. String filePath = "/Users/chenbiao/project/yhlxj/netflix-web/src/main/java/com/cyksj/web/util/pojie.txt"; // 文件路径
  27. try (BufferedReader reader = new BufferedReader(new FileReader(filePath))) {
  28. String line;
  29. while ((line = reader.readLine()) != null) {
  30. String[] split = line.split("----");
  31. String email = split[0];
  32. String password = split[1];
  33. String rt = split[2];
  34. System.out.println(email);
  35. System.out.println(password);
  36. JSONObject rtObj = new JSONObject();
  37. rtObj.putOpt("refresh_token",rt);
  38. JSONObject jsonObject = new JSONObject();
  39. int andIncrement = count.getAndIncrement();
  40. jsonObject.putOpt("carId","PG" + andIncrement);
  41. jsonObject.putOpt("email", email);
  42. jsonObject.putOpt("password",password);
  43. jsonObject.putOpt("carName","PRO" + andIncrement);
  44. jsonObject.putOpt("officialSession",rtObj.toString());
  45. jsonObject.putOpt("status",1);
  46. jsonObject.putOpt("isPlus",1);
  47. jsonObject.putOpt("remark","船长破解");
  48. 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();
  49. System.out.println(jsonObject.get("carId") + ":" + execute.body());
  50. }
  51. } catch (IOException e) {
  52. e.printStackTrace();
  53. }
  54. }
  55. public static void addClaude(){
  56. String filePath = "/Users/chenbiao/project/yhlxj/netflix-web/src/main/java/com/cyksj/web/util/claude.txt"; // 文件路径
  57. AtomicInteger count = new AtomicInteger(227);
  58. try (BufferedReader reader = new BufferedReader(new FileReader(filePath))) {
  59. String line;
  60. while ((line = reader.readLine()) != null) {
  61. String[] split = line.split("----");
  62. String email = split[0];
  63. String password = split[1];
  64. String rt = split[2];
  65. System.out.println(email);
  66. System.out.println(password);
  67. JSONObject jsonObject = new JSONObject();
  68. int andIncrement = count.getAndIncrement();
  69. jsonObject.putOpt("carID","Claude-PRO-" + andIncrement);
  70. jsonObject.putOpt("email", email);
  71. jsonObject.putOpt("password",password);
  72. jsonObject.putOpt("officialSession",rt);
  73. HttpResponse execute = new HttpRequest("https://kelaode.nf.video/adminapi/chatgpt/session/add").method(Method.POST).header("apiauth", "chan").body(jsonObject.toString()).execute();
  74. System.out.println(jsonObject.get("carID") + ":" + execute.body());
  75. }
  76. }catch (IOException e) {
  77. e.printStackTrace();
  78. }
  79. }
  80. }