|
@@ -1,38 +1,59 @@
|
|
|
import cn.qqck.kotlin.tools.*
|
|
|
+import dev.botta.json.values.JsonValue
|
|
|
import okhttp3.MediaType.Companion.toMediaType
|
|
|
import okhttp3.RequestBody.Companion.toRequestBody
|
|
|
|
|
|
fun main() {
|
|
|
println(Date.day(1))
|
|
|
- println(ULID.random())
|
|
|
+ println("192.168.1.1".isIpv4())
|
|
|
+ println("2409:8c1e:75b0:1120::16".isIpv6())
|
|
|
+ println("fe80::1ff:fe23:4567:890a".isIpv6())
|
|
|
// println(register_queue.isNet())
|
|
|
// register_queue.get()
|
|
|
}
|
|
|
|
|
|
-private object register_queue {
|
|
|
- private const val host = "http://127.0.0.1"
|
|
|
- private const val port = 10002
|
|
|
- private const val query = "?token=pJ1cX5gC9qU8iG3sW9gL5xG9jC5mV6rJ1uL7"
|
|
|
+fun ggcz(): JsonValue? {
|
|
|
|
|
|
- fun isNet(): Boolean {
|
|
|
- return Okhttp.call("${this.host}:${this.port}") != null
|
|
|
- }
|
|
|
-
|
|
|
- fun get(): String? {
|
|
|
- val j_body = Okhttp.call("${this.host}:${this.port}/api/腾讯QQ/注册/任务列表/获取待处理${this.query}") ?: return null
|
|
|
- if (j_body.body == null) return null
|
|
|
- val j_json = j_body.body!!.string().json()
|
|
|
- if (j_json.path("code")?.asInt() != 1) return null
|
|
|
- val j_id = j_json.path("data.id")?.asString() ?: return null
|
|
|
- val j_area = j_json.path("data.区号")?.asString() ?: return null
|
|
|
- val j_phone = j_json.path("data.手机号")?.asString() ?: return null
|
|
|
- println(j_area)
|
|
|
- println(j_phone)
|
|
|
+ val proxy = Proxy.Info("39.101.128.132", 801, "tx004", "110110")
|
|
|
|
|
|
- val j_url = "${this.host}:${this.port}/api/腾讯QQ/注册/任务列表/更新状态${this.query}"
|
|
|
- val j_post = "id=${j_id}&状态=${10000}"
|
|
|
- while (Okhttp.call(j_url) { it.post(j_post.toRequestBody("application/x-www-form-urlencoded".toMediaType())) } == null) Thread.sleep(1000)
|
|
|
-
|
|
|
- return "aaa"
|
|
|
+ val j_serverip = "1.13.162.140"
|
|
|
+ val j_uid = "3X6W6rkeRhS7GauNNeu5As8E7t2NORlVu4y4J58X4d16WosyvZuLU9dhcPd4xRBE98m9"
|
|
|
+ val j_post = "aid=2031242339&代理地址=${"${proxy.addr}:${proxy.port}"}&代理类型=${
|
|
|
+ when (proxy.type) {
|
|
|
+ Proxy.Type.Http -> 0
|
|
|
+ Proxy.Type.Socks5 -> 1
|
|
|
+ else -> 0
|
|
|
+ }
|
|
|
+ }&代理账号=${proxy.user}&代理密码=${proxy.pass}".toRequestBody("application/x-www-form-urlencoded".toMediaType())
|
|
|
+ for (j_i in 0..2) {
|
|
|
+ var j_url = "http://${j_serverip}/api/腾讯QQ/图形验证码/任务列表/创建任务?token=${j_uid}"
|
|
|
+ val j_data = Okhttp.call(j_url) { it.post(j_post) }?.body?.json() ?: continue
|
|
|
+ println("ggcz -> data:${j_data}")
|
|
|
+ if (j_data.path("code")?.asInt() != 1) continue
|
|
|
+ val j_id = j_data.path("data.id")?.asString() ?: continue
|
|
|
+ Thread.sleep(5000)
|
|
|
+ j_url = "http://${j_serverip}/api/腾讯QQ/图形验证码/任务列表/查询状态?token=${j_uid}"
|
|
|
+ val j_postc = "id=${j_id}".toRequestBody("application/x-www-form-urlencoded".toMediaType())
|
|
|
+ for (j_i in 0..180) {
|
|
|
+ Thread.sleep(1000)
|
|
|
+ val j_result = Okhttp.call(j_url) { it.post(j_postc) }?.body?.json() ?: continue
|
|
|
+ println("ggcz -> result:${j_result}")
|
|
|
+ if (j_result.path("code")?.asInt() != 1) break
|
|
|
+ // 等待处理= 0
|
|
|
+ // 开始处理= 1
|
|
|
+ // 提交信息= 2
|
|
|
+ // 未完成= 100
|
|
|
+ // 成功= 10000
|
|
|
+ // 类型不支持= 10001
|
|
|
+ // 识别错误= 10002
|
|
|
+ // 网络错误= 10003
|
|
|
+ // 返回错误= 10004
|
|
|
+ // 执行错误= 10005
|
|
|
+ val j_状态 = j_result.path("data.状态")?.asInt() ?: break
|
|
|
+ if (j_状态 < 100) continue
|
|
|
+ if (j_状态 == 10000) return j_result.path("data.处理结果")
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
-}
|
|
|
+ return null
|
|
|
+}
|