Untitled

 avatar
user_2299906
plain_text
a year ago
11 kB
5
Indexable
Never
void XMDT(Profile pro, GridRow row, string apikey,string apisim, string appear_comment = "I'm not sure which policy was violated.")
        {
            RequestHTTP request = new RequestHTTP(pro);
            row.Status = "Load HomePage";
            string html = request.Get($"https://www.facebook.com/accountquality/{pro.UID}/?source=spoke&asset_view_type=asset");
            
            if (string.IsNullOrEmpty(html))
            {
                row.Status = "Lỗi mạng";
                return;
            }
           
            string getinfo_AccountQuality = request.GraphAPi("&variables={\"assetOwnerId\":\""+pro.UID+"\"}&doc_id=6139497919470985"); //get xem có nút click review hay ko
            if (string.IsNullOrEmpty(getinfo_AccountQuality))
            {
                row.Status = "Lỗi mạng";
                return;
            }
            string ids_issue_ent_id = Regex.Match(getinfo_AccountQuality, "ids_issue_ent_id\":\"(\\d+)").Groups[1].Value;
            string friction_decision_id = Regex.Match(getinfo_AccountQuality, "friction_decision_id\":\"(\\d+)").Groups[1].Value;
            if(string.IsNullOrEmpty(friction_decision_id)|| string.IsNullOrEmpty(ids_issue_ent_id))
            {
                row.Status = "Không có nút bắt đầu";
                return;
            }
            string clickreview = request.PostAsync($"https://www.facebook.com/accountquality/ufac/?decision_id={friction_decision_id}&ids_issue_id={ids_issue_ent_id}&entity_type=5&entity_id={pro.UID}", $"session_id={RandomString(16)}&__user={pro.UID}&__a=1&__req=v&__hs=&dpr=1&__ccg=&__rev=&__s=&__hsi=&__dyn=&__csr=&__comet_req=0&fb_dtsg={request.Fb_dtsg}&jazoest={request.Jazoest}&lsd={request.LSD}&__spin_r=&__spin_b=&__spin_t=");
            if (string.IsNullOrEmpty(clickreview))
            {
                row.Status = "Lỗi mạng";
                return;
            }
            string enrollment_id = Regex.Match(clickreview, "enrollment_id\":(\\d+)").Groups[1].Value;

            string clickStart = request.GraphAPi("&variables={\"enrollmentID\":"+ enrollment_id + ",\"scale\":1}&doc_id=5976558395731792"); //click start
            string captcha_persist_data = Regex.Match(clickStart, "captcha_persist_data\":\"(.*?)\"").Groups[1].Value;
            string clicksubmitcaptcha = "";          
            //string text_captcha_image_url = Regex.Match(clicktieptuc, "text_captcha_audio_url\":\"(.*?)\"").Groups[1].Value;
            if (!string.IsNullOrEmpty(captcha_persist_data))
            {
                row.Status = "Chuẩn bị giải mã captcha";
                AnyCaptchaHelper.AnyCaptcha any = new AnyCaptchaHelper.AnyCaptcha();
                var res = any.RecaptchaV2Proxyless(apikey, "6Lc9qjcUAAAAADTnJq5kJMjN9aD1lxpRLMnCS2TR", "https://www.fbsbx.com/captcha/recaptcha/iframe/");
                string captchacode = res.Result;
                if (string.IsNullOrEmpty(captchacode))
                {
                    row.Status = "Lỗi giải mã captcha"; // lỗi cú pháp 
                    return;
                }
                else row.Status = "Giải mã captcha thành công";

                clicksubmitcaptcha = request.GraphAPi("&variables={\"input\":{\"client_mutation_id\":\"1\",\"actor_id\":\""+pro.UID+"\",\"action\":\"SUBMIT_BOT_CAPTCHA_RESPONSE\",\"bot_captcha_persist_data\":\""+ captcha_persist_data + "\",\"bot_captcha_response\":\""+ captchacode + "\",\"enrollment_id\":\""+ enrollment_id + "\"},\"scale\":1}&doc_id=9004853972920088");

            }

            if (clicksubmitcaptcha.Contains("REVERIFY_PHONE_NUMBER_WITH_NEW_ADDED_PHONE") || clicksubmitcaptcha.Contains("ADD_NEW_SECURITY_PHONE"))
            {
                //lay phone
                SimCode simc = new SimCode(apisim);
                string phone = simc.GetPhone();
                if (string.IsNullOrEmpty(phone))
                {
                    row.Status = "Lỗi lấy số từ site"; // lỗi cú pháp 
                    return;
                }
                else row.Status = $"Lấy số từ site thành công {phone}";
                string clicksendcode = request.GraphAPi("&variables={\"input\":{\"client_mutation_id\":\"2\",\"actor_id\":\""+pro.UID+"\",\"action\":\"SET_CONTACT_POINT\",\"contactpoint\":\""+phone+"\",\"country_code\":\"VN\",\"enrollment_id\":\""+ enrollment_id + "\"},\"scale\":1}&doc_id=9004853972920088");
                // lấy code
                string code = simc.GetCode();
                if (string.IsNullOrEmpty(code))
                {
                    row.Status = "Lỗi không nhận được code"; // lỗi cú pháp 
                    return;
                }
                else row.Status = $"Lấy OTP từ site thành công {code}";
                string clicksubmitcode = request.GraphAPi("&variables={\"input\":{\"client_mutation_id\":\"3\",\"actor_id\":\""+pro.UID+"\",\"action\":\"SUBMIT_CODE\",\"code\":\""+code+"\",\"enrollment_id\":\""+ enrollment_id + "\"},\"scale\":1}&doc_id=9004853972920088");

            }
            //tải ảnh AI
            row.Status = "Chuẩn bị upload Ảnh";
            string file = Environment.CurrentDirectory + "\\temp\\" + pro.UID + ".jpg";

            if (!File.Exists(file))
            {
                row.Status = "Lỗi chưa có ảnh"; // lỗi cú pháp 
                return;
            }
            string codeimg = request.UploadIMG282(file);
            if (string.IsNullOrEmpty(codeimg))
            {
                row.Status = "Lỗi UpLoad Ảnh"; // lỗi cú pháp 
                return;
            }
            else row.Status = $"Upload Ảnh thành công";
            string submitimg = request.GraphAPi("&variables={\"input\":{\"client_mutation_id\":\"4\",\"actor_id\":\""+pro.UID+"\",\"action\":\"UPLOAD_IMAGE\",\"image_upload_handle\":\""+ codeimg + "\",\"enrollment_id\":\""+ enrollment_id + "\"},\"scale\":1}&doc_id=9004853972920088");

            string clicksend_appear_comment = request.GraphAPi("&variables={\"input\":{\"client_mutation_id\":\"5\",\"actor_id\":\"" + pro.UID + "\",\"entity_id\":\"" + pro.UID + "\",\"ids_issue_ent_id\":\"" + ids_issue_ent_id + "\",\"appeal_comment\":\"" + appear_comment + "\",\"callsite\":\"ACCOUNT_QUALITY\"}}&doc_id=5329872773703511");
                      
            
            string ketqua = Regex.Match(submitimg, "title\":\"(.*?)\"").Groups[1].Value;
            ketqua = Regex.Unescape(ketqua);
            row.Status = ketqua;
        }
         public string UploadIMG282(string file_img)
        {
            try
            {
                if (!File.Exists(file_img)) return "";
                RestRequest request = new RestRequest($"https://rupload.facebook.com/checkpoint_1501092823525282_media_upload/{Guid.NewGuid().ToString()}?__user={UID}&__a=1&__dyn=&__csr=&__req=19&__hs=&dpr=1&__ccg=EXCELLENT&__rev=&__s=&__hsi=&__comet_req=&fb_dtsg={Fb_dtsg}&jazoest={Jazoest}&lsd={LSD}&__spin_r=&__spin_b=&__spin_t=");
                request.AddHeader("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9");
                request.AddHeader("sec-fetch-site", "same-origin");
                request.AddHeader("sec-fetch-dest", "empty");
                request.AddHeader("accept-language", "en-US,en;q=0.9");
                request.AddHeader("sec-fetch-mode", "cors");
                request.AddHeader("referer", "https://www.facebook.com/");
                request.AddHeader("sec-ch-ua-platform", "\"Windows\"");
                request.AddHeader("x-entity-type", "image/jpeg");
                request.AddHeader("offset", "0");
                request.AddHeader("x-entity-name", Path.GetFileName(file_img));
                request.AddHeader("x-entity-length", new FileInfo(file_img).Length);

                request.AddParameter("image/jpeg", File.ReadAllBytes(file_img), ParameterType.RequestBody);               
                request.Method = Method.Post;
                var res = Client.Execute(request);
                string html = res.Content;
                return Regex.Match(html, "h\":\"(.*?)\"").Groups[1].Value;
            }
            catch (Exception ex)
            {
                return ex.Message;
                //nếu error thì chạy catch
            }

        }
public class SimCode
    {
        string ApiKey { get; set; }
        string sitesim { get; set; }
        RequestHTTP request { get; set; }
        public string Phone { get; set; } = "";
        public string Code { get; set; } = "";
        public string IdRequest { get; set; }
        public SimCode(string api,string site ="chothuesimcode") 
        {
            ApiKey = api;
            sitesim = site;
            request = new RequestHTTP();
        }
        public string GetPhone()
        {
            switch (sitesim)
            {
                case "chothuesimcode": return GetPhoneChothueSimCode();
                case "winmail": return GetPhoneWinMail();
            }
            return "";
        }
        public string GetCode()
        {
            switch(sitesim)
            {
                case "chothuesimcode": return GetCodeChothueSimCode();                   
            }    
            return "";
        }
        string GetPhoneWinMail()
        {
            string getphone = request.Get($"https://api.winmail.shop/phone/rent?clientId={ApiKey}&serviceId=facebook");
            Phone = Regex.Match(getphone, "\"phone\":\"(\\d+)").Groups[1].Value;
            IdRequest = Regex.Match(getphone, "\"phoneId\":\"(.*?)\"").Groups[1].Value;
            return Phone;
        }
        string GetCodeWinMail()
        {
            int dem = 0;
            while (string.IsNullOrEmpty(Code))
            {
                dem++; if (dem > 10) break;
                string getcode = request.Get($"https://api.winmail.shop/phone/code?clientId={ApiKey}&phoneId={IdRequest}");
                Code = Regex.Match(getcode, "\"Code\":\"(\\d+)").Groups[1].Value;
                Task.Delay(6000).Wait();
            }
            return Code;
        }
        string GetPhoneChothueSimCode()
        {
            string getphone = request.Get($"https://chothuesimcode.com/api?act=number&apik={ApiKey}&appId=1001&carrier=Viettel");
            Phone = Regex.Match(getphone, "\"Number\":\"(\\d+)").Groups[1].Value;
            IdRequest = Regex.Match(getphone, "\"Id\":(\\d+)").Groups[1].Value;
            return Phone;
        }
        string GetCodeChothueSimCode()
        {
            int dem = 0;
            while(string.IsNullOrEmpty(Code))
            {
                dem++; if (dem > 20) break;
                string getcode = request.Get($"https://chothuesimcode.com/api?act=code&apik={ApiKey}&id={IdRequest}");
                Code = Regex.Match(getcode, "\"Code\":\"(\\d+)").Groups[1].Value;
                Task.Delay(3000).Wait();
            }                     
            return Code;
        }
    }