H5stHack.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using dodohold.core;
  2. using Sayaka.Common;
  3. namespace molilian.core
  4. {
  5. public partial class JdUnionPlus
  6. {
  7. public async Task<string> H5stHack(dynamic querystring, CancellationToken cancellationToken)
  8. {
  9. string useragent = _account.user_agent;
  10. if (string.IsNullOrEmpty(useragent)) useragent = ProviderFakeUserAgent.RandomComputer;
  11. var args = new
  12. {
  13. version = "4.9.6",
  14. body = querystring,
  15. pin = _account.pin,
  16. ua = _account.user_agent,
  17. h5st = _account.h5st,
  18. };
  19. string data = args.Convert2Json();
  20. string url = "http://host.docker.internal:3001/h5st";
  21. #if DEBUG
  22. url = "http://bjapi.molilian.com:3001/h5st";
  23. #endif
  24. WebClientUtility client = new WebClientUtility();
  25. client.SetContentType("application/json");
  26. client.Post(data);
  27. var response = await client.RequestAsync(url, "POST", cancellationToken);
  28. string body = response.Body();
  29. var root = body.Convert2JsonElement();
  30. int code = root.Read<int>("code");
  31. string qs = root.PathRead<string>("body.qs");
  32. if (code == 200)
  33. {
  34. return qs;
  35. }
  36. _ = new LoggerLibrary("JdUnion", "h5st").Info(body).SaveAsync();
  37. return string.Empty;
  38. }
  39. }
  40. }