twitch注册协议

月活1.4亿的平台,用户年龄比较年轻,适合做游戏相关的cpa。

代码是web协议,阉割了一些不必要的功能

.版本 2
.支持库 spec

.程序集 twitch
.程序集变量 http, WinHttpW
.程序集变量 Gcookies, 文本型

.子程序 _初始化, , , 当基于本类的对象被创建后,此方法会被自动调用

http.Open (“get”, “https://www.twitch.tv/”)
http.Send ()
Gcookies = http.GetAllResponseCookies ()
调试输出 (Gcookies)


.子程序 _销毁, , , 当基于本类的对象被销毁前,此方法会被自动调用



.子程序 setuseragent
.参数 useragent, 文本型, 参考 可空
.局部变量 wwwclaim, 文本型
.局部变量 rur, 文本型



.如果真 (useragent = “”)
    useragent = 生成useragent ()
.如果真结束
http.SetUserAgent (useragent)
http.SetRequestHeader (“sec-ch-ua”, “”, )
http.SetRequestHeader (“sec-ch-ua-platform”, “Windows”, )
http.SetAcceptLanguage (“en-us,en;q=0.9”)
http.SetAccept (“*/*”)
http.SetReferer (“https://www.twitch.tv/”)
http.SetRequestHeader (“Sec-Fetch-Dest”, “empty”, )
http.SetRequestHeader (“Sec-Fetch-Mode”, “cors”, )
http.SetRequestHeader (“Sec-Fetch-Site”, “same-site”, )
http.SetContentType (“text/plain;charset=UTF-8”)
http.SetRequestHeader (“Origin”, “https://www.twitch.tv”, )


.子程序 captcha2send, 逻辑型, 公开
.参数 taskid, 文本型
.参数 ipaddress, 文本型
.局部变量 res, 文本型
.局部变量 json, 类_json
.局部变量 代理数组, 文本型, , "0"

' http://2captcha.com/in.php?key=1abc234de56fab7c89012d34e56fa7b8&method=funcaptcha&publickey=12AB34CD-56F7-AB8C-9D01-2EF3456789A0&surl=https://client-api.arkoselabs.com&pageurl=http://mysite.com/page/with/funcaptcha/
.如果 (寻找文本 (ipaddress, “||”, , 假) ≠ -1)
    代理数组 = 分割文本 (ipaddress, “||”, )
    res = 到文本 (网页_访问_对象 (“http://2captcha.com/in.php?key=878f4883c83bdc5fec3cdf62ef042893&method=funcaptcha&publickey=E5554D43-23CC-1982-971D-6A2262A2CA24&surl=https://client-api.arkoselabs.com&pageurl=https://nojs-game3-prod-ap-southeast-1.arkoselabs.com/fc/api/nojs/?pkey=E5554D43-23CC-1982-971D-6A2262A2CA24&json=yes”, 0, , , , , , , , , 代理数组 [1], , 代理数组 [2], 代理数组 [3], , , , , ))

.否则
    res = 到文本 (网页_访问_对象 (“http://2captcha.com/in.php?key=878f4883c83bdc5fec3cdf62ef042893&method=funcaptcha&publickey=E5554D43-23CC-1982-971D-6A2262A2CA24&surl=https://client-api.arkoselabs.com&pageurl=https://nojs-game3-prod-ap-southeast-1.arkoselabs.com/fc/api/nojs/?pkey=E5554D43-23CC-1982-971D-6A2262A2CA24&json=yes”, , , , , , , , , , ipaddress, , , , , , , , ))

.如果结束

调试输出 (res)

json.解析 (res, )
.如果 (json.取属性 (“status”).取数据文本 () = “1”)
    taskid = json.取属性 (“request”).取数据文本 ()
    调试输出 (taskid)

    返回 (真)
.否则
    返回 (假)
.如果结束


.子程序 captcha2get, 文本型, 公开
.参数 taskid, 文本型, 参考 可空
.参数 ipaddress, 文本型, 参考 可空
.局部变量 res, 文本型
.局部变量 json, 类_json
.局部变量 代理数组, 文本型, , "0"
.局部变量 data, 文本型

data = 子文本替换 (#gettaskid, “#taskid#”, taskid, , , 真)
.如果 (寻找文本 (ipaddress, “||”, , 假) ≠ -1)
    代理数组 = 分割文本 (ipaddress, “||”, )
    res = 到文本 (网页_访问_对象 (“http://2captcha.com/res.php?key=878f4883c83bdc5fec3cdf62ef042893&action=get&id=” + taskid + “&json=yes”, 0, , , , , , , , , 代理数组 [1], , 代理数组 [2], 代理数组 [3], , , , , ))

.否则
    res = 到文本 (网页_访问_对象 (“http://2captcha.com/res.php?key=753b6a362d69468f8c52a477445d1534&action=get&id=” + taskid + “&json=yes”, 0, , , , , , , , , ipaddress, , , , , , , , ))

.如果结束
' 调试输出 (res)


.如果 (寻找文本 (res, “arkoselabs”, , 假) = -1)
    .计次循环首 (18, )
        处理事件 ()
        .如果 (寻找文本 (res, “arkoselabs”, , 假) ≠ -1)
            跳出循环 ()
        .否则

            程序_延时 (10, 1)
            .如果 (寻找文本 (ipaddress, “||”, , 假) ≠ -1)
                代理数组 = 分割文本 (ipaddress, “||”, )
                res = 到文本 (网页_访问_对象 (“http://2captcha.com/res.php?key=878f4883c83bdc5fec3cdf62ef042893&action=get&id=” + taskid + “&json=yes”, 0, , , , , , , , , 代理数组 [1], , 代理数组 [2], 代理数组 [3], , , , , ))
            .否则
                res = 到文本 (网页_访问_对象 (“http://2captcha.com/res.php?key=878f4883c83bdc5fec3cdf62ef042893&action=get&id=” + taskid + “&json=yes”, 0, , , , , , , , , ipaddress, , , , , , , , ))
            .如果结束

            调试输出 (res)
            .如果真 (寻找文本 (res, “arkoselabs”, , 假) ≠ -1)
                跳出循环 ()
            .如果真结束

        .如果结束

    .计次循环尾 ()
    .如果 (寻找文本 (res, “arkoselabs”, , 假) ≠ -1)
        json.解析 (res)
        ' 调试输出 (json.取通用属性 (“request”))
        ' 调试输出 (json.取属性 (“request”).取数据文本 ())

        返回 (json.取通用属性 (“request”))
    .否则
        返回 (“”)
    .如果结束

.否则
    调试输出 (“failed”)
    返回 (“”)
.如果结束


.子程序 postdata1, 逻辑型
.参数 username, 文本型
.参数 password, 文本型
.参数 day, 文本型
.参数 month, 文本型
.参数 year, 文本型
.参数 phone, 文本型
.参数 captoken, 文本型
.参数 proof, 文本型, 参考, fanhuizhi
.参数 cookiws, 文本型, 参考 可空, fanhuizhi
.参数 useragent, 文本型
.局部变量 json, 类_json
.局部变量 data, 文本型
.局部变量 res, 文本型
.局部变量 子文本替换, 整数型
.局部变量 ret, 文本型


' {"username":"#username#","password":"#password#","birthday":{"day":#day#,"month":#month#,"year":#year#},"client_id":"kimne78kx3ncx6brgo4mv6wki5h1ko","phone_number'":"#phone#","arkose":{"token":"#token#"}}
data = 子文本替换 (#postdate1, “#username#”, username, , , 真)
data = 子文本替换 (data, “#password#”, password, , , 真)
data = 子文本替换 (data, “#day#”, day, , , 真)
data = 子文本替换 (data, “#month#”, month, , , 真)
data = 子文本替换 (data, “#year#”, year, , , 真)
data = 子文本替换 (data, “#phone#”, phone, , , 真)
data = 子文本替换 (data, “#token#”, captoken, , , 真)
调试输出 (data)

http.Open (“post”, “https://passport.twitch.tv/register”)
http.SetCookie (Gcookies)
http.SetContentType (“text/plain;charset=UTF-8”)
http.SetRequestHeader (“Accept-Encoding”, “gzip, deflate, br”)
http.SetAccept (“*/*”)
http.SetAcceptLanguage (“zh-CN,zh;q=0.9”)
http.SetReferer (“https://www.twitch.tv/”)
http.SetRequestHeader (“Sec-Fetch-Dest”, “empty”)
http.SetRequestHeader (“Sec-Fetch-Mode”, “cors”)
http.SetRequestHeader (“Sec-Fetch-Site”, “same-site”)
http.SetRequestHeader (“sec-ch-ua-platform”, “Windows”)
http.SetRequestHeader (“sec-ch-ua-mobile”, “?0”)
http.SetRequestHeader (“sec-ch-ua”, #常量3)
http.SetRequestHeader (“Connection”, “keep-alive”)
http.SetUserAgent (useragent)
http.Send (data)
ret = http.GetAllResponseCookies ()
cookiws = 网页_Cookie合并更新 (Gcookies, ret)

调试输出 (cookiws)

res = http.GetResponseTextUtf8ToAnsi ()
调试输出 (res)

.如果 (寻找文本 (res, “captcha_proof”, , 假) ≠ -1)
    json.解析 (res)
    proof = json.取通用属性 (“captcha_proof”)
    调试输出 (proof)

    返回 (真)
.否则
    返回 (假)

.如果结束


.子程序 postdata2, 逻辑型
.参数 username, 文本型
.参数 password, 文本型
.参数 day, 文本型
.参数 month, 文本型
.参数 year, 文本型
.参数 phone, 文本型
.参数 sms, 文本型
.参数 proof, 文本型
.参数 cookiws, 文本型, 参考 可空, fanhuizhi
.参数 useragent, 文本型, 参考
.参数 acctoken, 文本型, 参考, fanhuizhi
.参数 userid, 文本型, 参考, fanhuizhi
.局部变量 json, 类_json
.局部变量 data, 文本型
.局部变量 res, 文本型
.局部变量 子文本替换, 整数型
.局部变量 lscook, 文本型

' {"username":"#username#","password":"#password#","birthday":{"day":#day#,"month":#month#,"year":#year#},"client_id":"kimne78kx3ncx6brgo4mv6wki5h1ko","phone_number":"#phone#","verification_code":"#sms#","captcha":{"proof":"#proof#"}}
data = 子文本替换 (#postdate2, “#username#”, username, , , 真)
data = 子文本替换 (data, “#password#”, password, , , 真)
data = 子文本替换 (data, “#day#”, day, , , 真)
data = 子文本替换 (data, “#month#”, month, , , 真)
data = 子文本替换 (data, “#year#”, year, , , 真)
data = 子文本替换 (data, “#phone#”, phone, , , 真)
data = 子文本替换 (data, “#sms#”, sms, , , 真)
data = 子文本替换 (data, “#proof#”, proof, , , 真)
调试输出 (data)
http.Open (“post”, “https://passport.twitch.tv/register”)
http.SetCookie (cookiws)
http.SetContentType (“text/plain;charset=UTF-8”)
http.SetRequestHeader (“Accept-Encoding”, “gzip, deflate, br”)
http.SetAccept (“*/*”)
http.SetAcceptLanguage (“zh-CN,zh;q=0.9”)
http.SetReferer (“https://www.twitch.tv/”)
http.SetRequestHeader (“Sec-Fetch-Dest”, “empty”)
http.SetRequestHeader (“Sec-Fetch-Mode”, “cors”)
http.SetRequestHeader (“Sec-Fetch-Site”, “same-site”)
http.SetRequestHeader (“sec-ch-ua-platform”, “Windows”)
http.SetRequestHeader (“sec-ch-ua-mobile”, “?0”)
http.SetRequestHeader (“sec-ch-ua”, #常量3)
http.SetRequestHeader (“Connection”, “keep-alive”)
http.SetUserAgent (useragent)
http.Send (data)
lscook = http.GetAllResponseCookies ()
cookiws = 网页_Cookie合并更新 (cookiws, lscook)
调试输出 (cookiws)
res = http.GetResponseTextUtf8ToAnsi ()
调试输出 (res)

.如果 (寻找文本 (res, “access_token”, , 假) ≠ -1)
    json.解析 (res)
    acctoken = json.取通用属性 (“access_token”)
    userid = json.取通用属性 (“userID”)
    返回 (真)
.否则
    返回 (假)

.如果结束


.子程序 register, 逻辑型, 公开
.参数 username, 文本型
.参数 password, 文本型
.参数 day, 文本型
.参数 month, 文本型
.参数 year, 文本型
.参数 captoken, 文本型
.参数 phone, 文本型, 参考 可空
.参数 cookiwss, 文本型, 参考 可空
.参数 useragent, 文本型, 参考 可空
.参数 acctoken, 文本型, 参考 可空
.参数 userid, 文本型, 参考 可空
.局部变量 token, 文本型
.局部变量 proof, 文本型
.局部变量 cook, 文本型
.局部变量 smscode, 文本型
.局部变量 pid, 文本型
.局部变量 jisus, mysms

.如果真 (jisus.getnewphonenumber (phone, pid, “313”) = 假)
    返回 (假)
.如果真结束
phone = “+855” + phone
useragent = 生成安卓useragent ()
.如果 (postdata1 (username, password, day, month, year, phone, captoken, proof, cook, useragent))

    .计次循环首 (10, )
        处理事件 ()
        .如果 (jisus.getsmscode (pid, smscode))
            跳出循环 ()
        .否则
            程序_延时 (10, 1)
        .如果结束

    .计次循环尾 ()
    .如果真 (取文本长度 (smscode) ≠ 6)
        返回 (假)
    .如果真结束
    .如果 (postdata2 (username, password, day, month, year, phone, smscode, proof, cookiwss, useragent, acctoken, userid))
        返回 (真)
    .否则
        返回 (假)
    .如果结束

.否则
    返回 (假)
.如果结束





发表评论