当前位置:   article > 正文

autojs- 联众识别_联众图像识别平台

联众图像识别平台
  1. /**
  2. * 联众图像识别函数
  3. * @param {string} username 联众图像识别账号
  4. * @param {string} password 联众图像识别密码
  5. * @param {object} img 识别图片
  6. * 快手极速版
  7. */
  8. if (!requestScreenCapture()) {
  9. toast("请求截图失败");
  10. exit();
  11. }
  12. captureScreen("/sdcard/1" + ".jpg");//截图
  13. var a = className("android.view.View").clickable(true).depth(13).findOne().parent().bounds()
  14. var imgx = a.left
  15. var imgy = a.top
  16. var imgw = a.width()
  17. var imgh = a.height()
  18. var src = images.read("/sdcard/1.jpg");
  19. var clip = images.clip(src,imgx, imgy, imgw, imgh);//裁剪滑块区域图片
  20. images.save(clip, "/sdcard/clip.png");
  21. username = ""//联众账号
  22. password = ""//联众密码
  23. img = images.read("/sdcard/clip.png")//读取本机图片路径
  24. var x1 = getCode(username, password, img).data.res.split("|")[0].split(",")[0]
  25. var x2 = getCode(username, password, img).data.res.split("|")[1].split(",")[0]
  26. log(x1)
  27. log(x2)///返回打码结果
  28. //获取滑动坐标
  29. var h =className("android.view.View").clickable(true).depth(12).findOne().bounds().centerY();
  30. //开始滑动
  31. swipe(x1,h,x2+10,h,1000);
  32. function getCode(username, password, img) {
  33. http.__okhttp__.setTimeout(3e4);
  34. var r = images.toBase64(img, format = "png"), i = device.release, c = device.model, s = device.buildId;
  35. try {
  36. var n = http.postJson("https://v2-api.jsdama.com/upload", {
  37. softwareId: 19017, //软件ID
  38. softwareSecret: "", //秘钥
  39. username: username,
  40. password: password,
  41. captchaData: r,
  42. captchaType: 1310, //识别类型(整形),
  43. captchaMinLength: 0,
  44. captchaMaxLength: 0,
  45. workerTipsId: 0
  46. }, {
  47. headers: {
  48. "User-Agent": "Mozilla/5.0 (Linux; Android " + i + "; " + c + " Build/" + s + "; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 Mobile Safari/537.36",
  49. }
  50. });
  51. } catch (e) {
  52. return {
  53. code: "-1",
  54. msg: "网络链接超时...",
  55. data: {}
  56. };
  57. }
  58. var d = n.body.json(), p = d.code, m = d.message;
  59. if ("10079009" == p) return {
  60. code: p,
  61. msg: m,
  62. data: {}
  63. };
  64. if ("10142006" == p) return {
  65. code: p,
  66. msg: m,
  67. data: {}
  68. };
  69. if ("10142004" == p) return {
  70. code: p,
  71. msg: m,
  72. data: {}
  73. };
  74. if ("10142005" == p) return {
  75. code: p,
  76. msg: m,
  77. data: {}
  78. };
  79. if ("10079006" == p) return {
  80. code: p,
  81. msg: m,
  82. data: {}
  83. };
  84. if ("0" == p) {
  85. return {
  86. code: p,
  87. msg: m,
  88. data: {
  89. res: d.data.recognition
  90. }
  91. };
  92. }
  93. return d;
  94. }

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/488824
推荐阅读
相关标签
  

闽ICP备14008679号