Cương Thế Nguyễn 127 Đã viết 3/09/2019 Bác nào có chuyển được cái này về c# được giúp em với ạ :d Code Chat với shop ạ Local $aInfo = Shopee_Login($Username, $Password) $from_userid = '118420826' $to_userid = '61130130' $ShopID = '61128688' $itemid = '1305829881' $Text = 'Test chat thử này ' & Random(0, 1) _HttpRequest(2, 'wss://chat-ws.shopee.vn/socket.io/?EIO=3&transport=websocket') _HttpRequest_WebSocketSend('42["message","13{\"token\":\"ABC\",\"country\":\"VN\"}"]') _HttpRequest_WebSocketSend('42["message","59{\"text_content\":\"{\\\"text\\\":\\\"' & $Text & '\\\"}\",\"to_userid\":' & $to_userid & ',\"from_userid\":' & $from_userid & ',\"itemid\":' & $itemid & ',\"orderid\":0,\"shopid\":' & $ShopID & ',\"type\":0,\"opt\":8,\"read\":true,\"requestid\":\"ABC\"}"]') Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
caubeiuzk 24 Đã viết 3/09/2019 2 giờ trước, Cương Thế Nguyễn said: Bác nào có chuyển được cái này về c# được giúp em với ạ :d Code Chat với shop ạ Local $aInfo = Shopee_Login($Username, $Password) $from_userid = '118420826' $to_userid = '61130130' $ShopID = '61128688' $itemid = '1305829881' $Text = 'Test chat thử này ' & Random(0, 1) _HttpRequest(2, 'wss://chat-ws.shopee.vn/socket.io/?EIO=3&transport=websocket') _HttpRequest_WebSocketSend('42["message","13{\"token\":\"ABC\",\"country\":\"VN\"}"]') _HttpRequest_WebSocketSend('42["message","59{\"text_content\":\"{\\\"text\\\":\\\"' & $Text & '\\\"}\",\"to_userid\":' & $to_userid & ',\"from_userid\":' & $from_userid & ',\"itemid\":' & $itemid & ',\"orderid\":0,\"shopid\":' & $ShopID & ',\"type\":0,\"opt\":8,\"read\":true,\"requestid\":\"ABC\"}"]') Spoiler string sdt = "84794064100"; string pass = "hdshfhfkkjhdfkhsak"; string Shopbanhang = "a84388962384"; //nhập tên nick shop bán hàng vào phía trên nha string dongcanchat = "anh yêu em"; HttpRequest http = new HttpRequest(); string html = ""; string token = str.GetRandomAz(32); http.SetCookie("csrftoken=" + token); html = http.Get("https://shopee.vn/api/v0/buyer/login/").ToString(); http.AddField("login_key", sdt); http.AddField("login_type", "phone"); http.AddField("password_hash", pass.ToMD5().ToSHA256()); http.AddField("captcha", ""); http.AddField("remember_me", "false"); http.AddHeader("x-csrftoken", token); http.AddHeader("accept: */*"); http.AddHeader("x-api-source: pc"); http.AddHeader("origin: https://shopee.vn"); http.AddHeader("x-requested-with: XMLHttpRequest"); http.Referer = "https://shopee.vn/api/v0/buyer/login/"; html = http.Post("https://shopee.vn/api/v0/buyer/login/login_post/").ToString(); string status = ""; if (!html.Contains("\"redirect\":\"/buyer/\"")) { status = "đăng nhập thất bại"; } else { status = "ok"; } string response = http.Get("https://banhang.shopee.vn/api/v2/login/").ToString(); var Shoptoi = Regex.Matches(response, "id\": (\\d+)"); string IdShopNick = Shoptoi[0].Groups[1].Value; string IdNick = Shoptoi[1].Groups[1].Value; string respone1 = http.Get("https://shopee.vn/api/v2/shop/get?username=" + Shopbanhang).ToString(); html = http.Get("https://shopee.vn/api/v2/shop/get?username=" + Shopbanhang).ToString(); string cto_lwid = http.Cookies["REC_T_ID"]; var shopchat = Regex.Matches(respone1, "userid\":(\\d+)"); string IdShopbanhang = shopchat[0].Groups[1].Value; html = http.Post("https://banhang.shopee.vn/webchat/api/v1/sessions?_uid=0-" + IdNick, "{ \"device_id\":\"" + cto_lwid + " \"}", "content-type: text/plain;charset=UTF-8").ToString(); string authorization = html.RegexMatchJsonString("token"); string nono = str.GetRandomAz(12); string id = "b284e128-bb07-4cf7-8d54-" + nono; http.AddHeader("x-csrftoken", token); http.AddHeader("accept: */*"); http.AddHeader("authorization: Bearer " + authorization); http.AddHeader("Pragma: no-cache"); http.AddHeader("Cache-Control: no-cache"); http.AddHeader("origin: https://banhang.shopee.vn"); http.Referer = "https://banhang.shopee.vn/webchat/conversations"; string nana = "{\"content\":{\"text\":\" " + dongcanchat + " \"},\"to_id\":" + IdShopbanhang + ",\"type\":\"text\",\"request_id\":\"" + id + "\",\"shop_id\":156719331,\"translateStatus\":\"pending\",\"id\":\"" + id + "\",\"from_id\":156721296}"; html = http.Post("https://banhang.shopee.vn/webchat/api/v1/messages?_uid=0-" + IdNick, nana, "content-type: text/plain;charset=UTF-8").ToString(); MessageBox.Show("oke"); à nhớ set cái sau ở phần đầu nha public Form1() { InitializeComponent(); } FileHelper file = new FileHelper(); StringHelper str = new StringHelper(); code shopee dễ mà, tất cả các code ngồi mò lúc là ra, mỗi cái code mua hàng cái data nó gửi lên nhiều vl nên ta bó tay, chuyển sang chạy selenium cho đỡ nhức đầu, mấy thằng viết tool đi bán cũng xài selenium đó, nhưng ta ghét xài selenium lắm, thích xài code thuần c# hơn vì nó ngốn ít dung lượng với nhanh, ít sai sót.hức code chuẩn đây nhé, đã thêm lệnh tự chuyển đổi nhận dạng đăng nhập 2 giờ trước, Cương Thế Nguyễn said: HttpRequest http = new HttpRequest(); string Taikhoan = "0398567666"; string Pass = "Binhannhe"; string html = ""; string token = ""; string status = ""; string data = ""; string itemid = ""; string shopid = ""; string modelid = ""; string Shopcanchat = "mamypoko_officialstore"; string dongcanchat = "Bán anh 500 cái bỉm em ơi"; string x = ""; string y = ""; string z = ""; void AddHeader() { http.AddHeader("x-requested-with", "XMLHttpRequest"); http.AddHeader("x-api-source", "pc"); http.AddHeader("x-csrftoken", token); http.AddHeader("accept: */*"); http.AddHeader("origin: https://shopee.vn"); } string UserName = ""; MatchCollection NumberTaikhoan = Regex.Matches(Taikhoan, "(\\d)"); MatchCollection w = Regex.Matches(Taikhoan, "@"); for (int i = 0; i < NumberTaikhoan.Count; i++) { y = x; x = y + NumberTaikhoan[i].Groups[1].Value; } if (x.Length == 11) { if (Taikhoan.Length == 11) { UserName = "phone"; } else { UserName = "username"; } } else if (x.Length == 10) { if (Taikhoan.Length == 10) { z = "84" + Taikhoan.Substring(1, 9); Taikhoan = z; UserName = "phone"; } else { UserName = "username"; } } else if (x.Length == 9) { if (Taikhoan.Length == 9) { z = "84" + Taikhoan; Taikhoan = z; UserName = "phone"; } else { UserName = "username"; } } else { UserName = "username"; } if (w.Count > 0) { UserName = "email"; } else { } token = str.GetRandomAz(32); http.SetCookie("csrftoken=" + token); html = http.Get("https://shopee.vn/api/v0/buyer/login/").ToString(); http.AddField("login_key", Taikhoan); http.AddField("login_type", UserName); http.AddField("password_hash", Pass.ToMD5().ToSHA256()); http.AddField("captcha", ""); http.AddField("remember_me", "false"); AddHeader(); http.AddHeader("x-requested-with: XMLHttpRequest"); http.Referer = "https://shopee.vn/api/v0/buyer/login/"; html = http.Post("https://shopee.vn/api/v0/buyer/login/login_post/").ToString(); if (!html.Contains("\"redirect\":\"/buyer/\"")) { status = "đăng nhập thất bại"; } else { status = "ok"; } string response = http.Get("https://banhang.shopee.vn/api/v2/login/").ToString(); var Shopcuatoi = Regex.Matches(response, "id\": (\\d+)"); string IdShopNick = Shopcuatoi[0].Groups[1].Value; string IdNick = Shopcuatoi[1].Groups[1].Value; string respone1 = http.Get("https://shopee.vn/api/v2/shop/get?username=" + Shopcanchat).ToString(); html = http.Get("https://shopee.vn/api/v2/shop/get?username=" + Shopcanchat).ToString(); string cto_lwid = http.Cookies["REC_T_ID"]; var shopcanchat = Regex.Matches(respone1, "userid\":(\\d+)"); string IdShopcanchat = shopcanchat[0].Groups[1].Value; html = http.Post("https://banhang.shopee.vn/webchat/api/v1/sessions?_uid=0-" + IdNick, "{ \"device_id\":\"" + cto_lwid + " \"}", "content-type: text/plain;charset=UTF-8").ToString(); string authorization = html.RegexMatchJsonString("token"); string random32 = str.GetRandomAz(12); string id = "b284e128-bb07-4cf7-8d54-" + random32; http.AddHeader("x-csrftoken", token); http.AddHeader("accept: */*"); http.AddHeader("authorization: Bearer " + authorization); http.AddHeader("Pragma: no-cache"); http.AddHeader("Cache-Control: no-cache"); http.AddHeader("origin: https://banhang.shopee.vn"); http.Referer = "https://banhang.shopee.vn/webchat/conversations"; data = "{\"content\":{\"text\":\" " + dongcanchat + " \"},\"to_id\":" + IdShopcanchat + ",\"type\":\"text\",\"request_id\":\"" + id + "\",\"shop_id\":156719331,\"translateStatus\":\"pending\",\"id\":\"" + id + "\",\"from_id\":156721296}"; html = http.Post("https://banhang.shopee.vn/webchat/api/v1/messages?_uid=0-" + IdNick, data, "content-type: text/plain;charset=UTF-8").ToString(); MessageBox.Show("oke"); mà sao không xóa được bài viết nhỉ mọi người, chán ghê, sửa cũng không được. -------------------------------------------------------------------------------------------------------------------------------------------- Lý do : Mỵ gộp bài... P/s : không edit không xóa được là do lão Ad kiếm việc cho Mod làm đó =.='' ...chắc mỵ phải kiến nghị lên mới được.. 1 Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
Cương Thế Nguyễn 127 Đã viết 3/09/2019 33 phút trước, caubeiuzk said: Bác không dùng thư viện xNet ạ ? Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
caubeiuzk 24 Đã viết 3/09/2019 1 phút trước, Cương Thế Nguyễn said: Bác không dùng thư viện xNet ạ ? add thư viện sau using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows.Forms; using xNet; code tự động nhận diện email, sđt, nick khi đăng nhập, sau đó vào chat với shop FileHelper file = new FileHelper(); StringHelper str = new StringHelper(); HttpRequest http = new HttpRequest(); string Taikhoan = "mattroicuoipho1234"; string Pass = "Lienmapmap"; string html = ""; string token = ""; string status = ""; string data = ""; string itemid = ""; string shopid = ""; string modelid = ""; string Shopcanchat = "mamypoko_officialstore"; string dongcanchat = "Liêm sỉ gì tầm này nữa"; string x = ""; string y = ""; string z = ""; void AddHeader() { http.AddHeader("x-requested-with", "XMLHttpRequest"); http.AddHeader("x-api-source", "pc"); http.AddHeader("x-csrftoken", token); http.AddHeader("accept: */*"); http.AddHeader("origin: https://shopee.vn"); } string UserName = ""; MatchCollection NumberTaikhoan = Regex.Matches(Taikhoan, "(\\d)"); MatchCollection w = Regex.Matches(Taikhoan, "@"); for (int i = 0; i < NumberTaikhoan.Count; i++) { y = x; x = y + NumberTaikhoan[i].Groups[1].Value; } if (x.Length == 11) { if (Taikhoan.Length == 11) { UserName = "phone"; } else { UserName = "username"; } } else if (x.Length == 10) { if (Taikhoan.Length == 10) { z = "84" + Taikhoan.Substring(1, 9); Taikhoan = z; UserName = "phone"; } else { UserName = "username"; } } else if (x.Length == 9) { if (Taikhoan.Length == 9) { z = "84" + Taikhoan; Taikhoan = z; UserName = "phone"; } else { UserName = "username"; } } else { UserName = "username"; } if (w.Count > 0) { UserName = "email"; } else { } token = str.GetRandomAz(32); http.SetCookie("csrftoken=" + token); html = http.Get("https://shopee.vn/api/v0/buyer/login/").ToString(); http.AddField("login_key", Taikhoan); http.AddField("login_type", UserName); http.AddField("password_hash", Pass.ToMD5().ToSHA256()); http.AddField("captcha", ""); http.AddField("remember_me", "false"); AddHeader(); http.AddHeader("x-requested-with: XMLHttpRequest"); http.Referer = "https://shopee.vn/api/v0/buyer/login/"; html = http.Post("https://shopee.vn/api/v0/buyer/login/login_post/").ToString(); if (!html.Contains("\"redirect\":\"/buyer/\"")) { status = "đăng nhập thất bại"; } else { status = "ok"; } string response = http.Get("https://banhang.shopee.vn/api/v2/login/").ToString(); var Shopcuatoi = Regex.Matches(response, "id\": (\\d+)"); string IdShopNick = Shopcuatoi[0].Groups[1].Value; string IdNick = Shopcuatoi[1].Groups[1].Value; string respone1 = http.Get("https://shopee.vn/api/v2/shop/get?username=" + Shopcanchat).ToString(); html = http.Get("https://shopee.vn/api/v2/shop/get?username=" + Shopcanchat).ToString(); string cto_lwid = http.Cookies["REC_T_ID"]; var shopcanchat = Regex.Matches(respone1, "userid\":(\\d+)"); string IdShopcanchat = shopcanchat[0].Groups[1].Value; html = http.Post("https://banhang.shopee.vn/webchat/api/v1/sessions?_uid=0-" + IdNick, "{ \"device_id\":\"" + cto_lwid + " \"}", "content-type: text/plain;charset=UTF-8").ToString(); string authorization = html.RegexMatchJsonString("token"); string random12 = str.GetRandomAz(12); string serimay = "b284e128-bb07-4cf7-8d54-" + random12; http.AddHeader("x-csrftoken", token); http.AddHeader("accept: */*"); http.AddHeader("authorization: Bearer " + authorization); http.AddHeader("Pragma: no-cache"); http.AddHeader("Cache-Control: no-cache"); http.AddHeader("origin: https://banhang.shopee.vn"); http.Referer = "https://banhang.shopee.vn/webchat/conversations"; data = "{\"content\":{\"text\":\" " + dongcanchat + " \"},\"to_id\":" + IdShopcanchat + ",\"type\":\"text\",\"request_id\":\"" + serimay + "\",\"shop_id\":"+IdShopNick+",\"translateStatus\":\"pending\",\"id\":\"" + serimay + "\",\"from_id\":"+IdNick+"}"; html = http.Post("https://banhang.shopee.vn/webchat/api/v1/messages?_uid=0-" + IdNick, data, "content-type: text/plain;charset=UTF-8").ToString(); MessageBox.Show("oke"); 6 phút trước, Cương Thế Nguyễn said: Bác không dùng thư viện xNet ạ ? cái của thím huân hoàng xài không được đâu, convert sang c# cũng không được đâu, thím ấy dùng cái phiên bản cũ, với lại thấy khá nhiều cái sai với thừa. Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
Cương Thế Nguyễn 127 Đã viết 3/09/2019 13 phút trước, caubeiuzk said: add thư viện sau using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows.Forms; using xNet; code tự động nhận diện email, sđt, nick khi đăng nhập, sau đó vào chat với shop FileHelper file = new FileHelper(); StringHelper str = new StringHelper(); HttpRequest http = new HttpRequest(); string Taikhoan = "mattroicuoipho1234"; string Pass = "Lienmapmap"; string html = ""; string token = ""; string status = ""; string data = ""; string itemid = ""; string shopid = ""; string modelid = ""; string Shopcanchat = "mamypoko_officialstore"; string dongcanchat = "Liêm sỉ gì tầm này nữa"; string x = ""; string y = ""; string z = ""; void AddHeader() { http.AddHeader("x-requested-with", "XMLHttpRequest"); http.AddHeader("x-api-source", "pc"); http.AddHeader("x-csrftoken", token); http.AddHeader("accept: */*"); http.AddHeader("origin: https://shopee.vn"); } string UserName = ""; MatchCollection NumberTaikhoan = Regex.Matches(Taikhoan, "(\\d)"); MatchCollection w = Regex.Matches(Taikhoan, "@"); for (int i = 0; i < NumberTaikhoan.Count; i++) { y = x; x = y + NumberTaikhoan[i].Groups[1].Value; } if (x.Length == 11) { if (Taikhoan.Length == 11) { UserName = "phone"; } else { UserName = "username"; } } else if (x.Length == 10) { if (Taikhoan.Length == 10) { z = "84" + Taikhoan.Substring(1, 9); Taikhoan = z; UserName = "phone"; } else { UserName = "username"; } } else if (x.Length == 9) { if (Taikhoan.Length == 9) { z = "84" + Taikhoan; Taikhoan = z; UserName = "phone"; } else { UserName = "username"; } } else { UserName = "username"; } if (w.Count > 0) { UserName = "email"; } else { } token = str.GetRandomAz(32); http.SetCookie("csrftoken=" + token); html = http.Get("https://shopee.vn/api/v0/buyer/login/").ToString(); http.AddField("login_key", Taikhoan); http.AddField("login_type", UserName); http.AddField("password_hash", Pass.ToMD5().ToSHA256()); http.AddField("captcha", ""); http.AddField("remember_me", "false"); AddHeader(); http.AddHeader("x-requested-with: XMLHttpRequest"); http.Referer = "https://shopee.vn/api/v0/buyer/login/"; html = http.Post("https://shopee.vn/api/v0/buyer/login/login_post/").ToString(); if (!html.Contains("\"redirect\":\"/buyer/\"")) { status = "đăng nhập thất bại"; } else { status = "ok"; } string response = http.Get("https://banhang.shopee.vn/api/v2/login/").ToString(); var Shopcuatoi = Regex.Matches(response, "id\": (\\d+)"); string IdShopNick = Shopcuatoi[0].Groups[1].Value; string IdNick = Shopcuatoi[1].Groups[1].Value; string respone1 = http.Get("https://shopee.vn/api/v2/shop/get?username=" + Shopcanchat).ToString(); html = http.Get("https://shopee.vn/api/v2/shop/get?username=" + Shopcanchat).ToString(); string cto_lwid = http.Cookies["REC_T_ID"]; var shopcanchat = Regex.Matches(respone1, "userid\":(\\d+)"); string IdShopcanchat = shopcanchat[0].Groups[1].Value; html = http.Post("https://banhang.shopee.vn/webchat/api/v1/sessions?_uid=0-" + IdNick, "{ \"device_id\":\"" + cto_lwid + " \"}", "content-type: text/plain;charset=UTF-8").ToString(); string authorization = html.RegexMatchJsonString("token"); string random12 = str.GetRandomAz(12); string serimay = "b284e128-bb07-4cf7-8d54-" + random12; http.AddHeader("x-csrftoken", token); http.AddHeader("accept: */*"); http.AddHeader("authorization: Bearer " + authorization); http.AddHeader("Pragma: no-cache"); http.AddHeader("Cache-Control: no-cache"); http.AddHeader("origin: https://banhang.shopee.vn"); http.Referer = "https://banhang.shopee.vn/webchat/conversations"; data = "{\"content\":{\"text\":\" " + dongcanchat + " \"},\"to_id\":" + IdShopcanchat + ",\"type\":\"text\",\"request_id\":\"" + serimay + "\",\"shop_id\":"+IdShopNick+",\"translateStatus\":\"pending\",\"id\":\"" + serimay + "\",\"from_id\":"+IdNick+"}"; html = http.Post("https://banhang.shopee.vn/webchat/api/v1/messages?_uid=0-" + IdNick, data, "content-type: text/plain;charset=UTF-8").ToString(); MessageBox.Show("oke"); cái của thím huân hoàng xài không được đâu, convert sang c# cũng không được đâu, thím ấy dùng cái phiên bản cũ, với lại thấy khá nhiều cái sai với thừa. Vậy giờ dùng thư viện gì đc ạ bác :((( Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
caubeiuzk 24 Đã viết 3/09/2019 ngay bây giờ, Cương Thế Nguyễn said: Vậy giờ dùng thư viện gì đc ạ bác :((( vl, thím đọc lại đi, dùng xNet mà, ta viết rõ ràng trên đó còn j Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
Cương Thế Nguyễn 127 Đã viết 3/09/2019 3 phút trước, caubeiuzk said: vl, thím đọc lại đi, dùng xNet mà, ta viết rõ ràng trên đó còn j em nhầm ạ :)))) Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
Thiên Chi Kiều Nữ 959 Đã viết 3/09/2019 2 giờ trước, Cương Thế Nguyễn said: Bác nào có chuyển được cái này về c# được giúp em với ạ :d Code Chat với shop ạ Local $aInfo = Shopee_Login($Username, $Password) $from_userid = '118420826' $to_userid = '61130130' $ShopID = '61128688' $itemid = '1305829881' $Text = 'Test chat thử này ' & Random(0, 1) _HttpRequest(2, 'wss://chat-ws.shopee.vn/socket.io/?EIO=3&transport=websocket') _HttpRequest_WebSocketSend('42["message","13{\"token\":\"ABC\",\"country\":\"VN\"}"]') _HttpRequest_WebSocketSend('42["message","59{\"text_content\":\"{\\\"text\\\":\\\"' & $Text & '\\\"}\",\"to_userid\":' & $to_userid & ',\"from_userid\":' & $from_userid & ',\"itemid\":' & $itemid & ',\"orderid\":0,\"shopid\":' & $ShopID & ',\"type\":0,\"opt\":8,\"read\":true,\"requestid\":\"ABC\"}"]') Cái code này của @Huân Hoàng là sử dụng websocket để kết nối và chat. Còn của bạn @caubeiuzk thì vẫn sử dụng xNet để request tới api :) .. @caubeiuzk đã làm qua cái nào về websocket chưa vậy ?? biểu diễn cho mỵ xem với Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
doubleti 0 Đã viết 6/09/2019 On 3/9/2019 at 22:53, caubeiuzk said: add thư viện sau using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows.Forms; using xNet; code tự động nhận diện email, sđt, nick khi đăng nhập, sau đó vào chat với shop FileHelper file = new FileHelper(); StringHelper str = new StringHelper(); HttpRequest http = new HttpRequest(); string Taikhoan = "mattroicuoipho1234"; string Pass = "Lienmapmap"; string html = ""; string token = ""; string status = ""; string data = ""; string itemid = ""; string shopid = ""; string modelid = ""; string Shopcanchat = "mamypoko_officialstore"; string dongcanchat = "Liêm sỉ gì tầm này nữa"; string x = ""; string y = ""; string z = ""; void AddHeader() { http.AddHeader("x-requested-with", "XMLHttpRequest"); http.AddHeader("x-api-source", "pc"); http.AddHeader("x-csrftoken", token); http.AddHeader("accept: */*"); http.AddHeader("origin: https://shopee.vn"); } string UserName = ""; MatchCollection NumberTaikhoan = Regex.Matches(Taikhoan, "(\\d)"); MatchCollection w = Regex.Matches(Taikhoan, "@"); for (int i = 0; i < NumberTaikhoan.Count; i++) { y = x; x = y + NumberTaikhoan[i].Groups[1].Value; } if (x.Length == 11) { if (Taikhoan.Length == 11) { UserName = "phone"; } else { UserName = "username"; } } else if (x.Length == 10) { if (Taikhoan.Length == 10) { z = "84" + Taikhoan.Substring(1, 9); Taikhoan = z; UserName = "phone"; } else { UserName = "username"; } } else if (x.Length == 9) { if (Taikhoan.Length == 9) { z = "84" + Taikhoan; Taikhoan = z; UserName = "phone"; } else { UserName = "username"; } } else { UserName = "username"; } if (w.Count > 0) { UserName = "email"; } else { } token = str.GetRandomAz(32); http.SetCookie("csrftoken=" + token); html = http.Get("https://shopee.vn/api/v0/buyer/login/").ToString(); http.AddField("login_key", Taikhoan); http.AddField("login_type", UserName); http.AddField("password_hash", Pass.ToMD5().ToSHA256()); http.AddField("captcha", ""); http.AddField("remember_me", "false"); AddHeader(); http.AddHeader("x-requested-with: XMLHttpRequest"); http.Referer = "https://shopee.vn/api/v0/buyer/login/"; html = http.Post("https://shopee.vn/api/v0/buyer/login/login_post/").ToString(); if (!html.Contains("\"redirect\":\"/buyer/\"")) { status = "đăng nhập thất bại"; } else { status = "ok"; } string response = http.Get("https://banhang.shopee.vn/api/v2/login/").ToString(); var Shopcuatoi = Regex.Matches(response, "id\": (\\d+)"); string IdShopNick = Shopcuatoi[0].Groups[1].Value; string IdNick = Shopcuatoi[1].Groups[1].Value; string respone1 = http.Get("https://shopee.vn/api/v2/shop/get?username=" + Shopcanchat).ToString(); html = http.Get("https://shopee.vn/api/v2/shop/get?username=" + Shopcanchat).ToString(); string cto_lwid = http.Cookies["REC_T_ID"]; var shopcanchat = Regex.Matches(respone1, "userid\":(\\d+)"); string IdShopcanchat = shopcanchat[0].Groups[1].Value; html = http.Post("https://banhang.shopee.vn/webchat/api/v1/sessions?_uid=0-" + IdNick, "{ \"device_id\":\"" + cto_lwid + " \"}", "content-type: text/plain;charset=UTF-8").ToString(); string authorization = html.RegexMatchJsonString("token"); string random12 = str.GetRandomAz(12); string serimay = "b284e128-bb07-4cf7-8d54-" + random12; http.AddHeader("x-csrftoken", token); http.AddHeader("accept: */*"); http.AddHeader("authorization: Bearer " + authorization); http.AddHeader("Pragma: no-cache"); http.AddHeader("Cache-Control: no-cache"); http.AddHeader("origin: https://banhang.shopee.vn"); http.Referer = "https://banhang.shopee.vn/webchat/conversations"; data = "{\"content\":{\"text\":\" " + dongcanchat + " \"},\"to_id\":" + IdShopcanchat + ",\"type\":\"text\",\"request_id\":\"" + serimay + "\",\"shop_id\":"+IdShopNick+",\"translateStatus\":\"pending\",\"id\":\"" + serimay + "\",\"from_id\":"+IdNick+"}"; html = http.Post("https://banhang.shopee.vn/webchat/api/v1/messages?_uid=0-" + IdNick, data, "content-type: text/plain;charset=UTF-8").ToString(); MessageBox.Show("oke"); cái của thím huân hoàng xài không được đâu, convert sang c# cũng không được đâu, thím ấy dùng cái phiên bản cũ, với lại thấy khá nhiều cái sai với thừa. cho mình hỏi cái serimay lấy đâu ra vậy bạn hay là cứ bịa vào :)) Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
Thiên Chi Kiều Nữ 959 Đã viết 7/09/2019 @doubleti thử đi bạn :v .. theo mỵ thấy chắc là bịa vào Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
caubeiuzk 24 Đã viết 8/09/2019 On 7/9/2019 at 06:03, doubleti said: cho mình hỏi cái serimay lấy đâu ra vậy bạn hay là cứ bịa vào :)) bịa thôi, lấy đoạn code cmt phía sau ấy, đoạn sau ta có chỉnh sửa rồi.ahihi code đăng ký acc shopee Nội dung ẩn Bạn cần Reaction hoặc trả lời chủ đề này để thấy nội dung bị ẩn. sửa lại code đăng ký shopee 1 tý nha ae string chuoi = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; HttpRequest http = new HttpRequest(); string Pass = "adsfdsa"; string html = ""; string token = ""; string status = ""; string data = ""; string UserName = ""; string apikeycaptcha = "sfsfdsfsfsdf"; token = RANDOM(chuoi, 32); string captcha = ""; string vcode = ""; string a = ""; string api_key = "Q_-dsfsfs-aXx_"; string request_id = ""; string phone_canon = ""; string Name = ""; string abc = ""; // api_key là apikey simthue.com, tự liên hệ thằng ad simthue tạo acc và mở apikey nhé // string apikeycaptcha là api giải captcha của hiệp gà, trang web là: http://captcha.hiepga.net/index.php // lấy số điện thoại html = http.Get("http://api.pvaonline.net/request/create?key=" + api_key + "&service_id=34").ToString(); for (int i = 0; request_id.Length < 5; i++) { request_id = Regex.Match(html, "\"id\":\"(.*?)\",\"balance").Groups[1].Value; Thread.Sleep(); //do sim thuê nó chơi chống request, chỉ cho 5s request 1 lần từ 1 địa chỉ ip } for (int i = 0; phone_canon.Length < 5; i++) { html = http.Get("http://api.pvaonline.net/request/check?key=" + api_key + "&id=" + request_id).ToString(); phone_canon = Regex.Match(html, "(\\d{11})").Groups[1].Value; Thread.Sleep(1000); } // gửi mã xác minh html = http.Get("https://shopee.vn/buyer/login/signup/?__classic__=1").ToString(); http.AddField("csrfmiddlewaretoken" ,token); http.SetCookie("csrftoken=" + token); http.AddField("phone_canon", phone_canon); http.AddField("operation", "1"); http.AddField("password_hash", ""); http.AddHeader("accept: */*"); http.AddHeader("origin: https://shopee.vn"); http.AddHeader("x-requested-with: XMLHttpRequest"); http.Referer = "https://shopee.vn/buyer/login/signup/?__classic__=1"; html = http.Post("https://shopee.vn/buyer/login/signup_send_vcode/").ToString(); //check code simthue for (int i = 0; vcode.Length < 5; i++) { abc = http.Get("http://api.pvaonline.net/request/check?key=" + api_key + "&id=" + request_id).ToString(); vcode = Regex.Match(abc, "SHOPEE: (\\d+)").Groups[1].Value; Thread.Sleep(5500); } // giải captcha và đăng ký nick, do giải captcha chỉ đúng khoảng 90% nên phải dùng vòng lặp để tránh sai sót, mà captcha shopee khó chơi phết, giải sai 2-3 lần là lần sau mù đui déo thấy gì luôn //nhớ tạo file chứa captcha get về nha, ở đây mình để là E:\cc\Captcha\captchacangiai.png for (int j = 0; a.Length < 2; j++) { string Milliseconds = DateTimeOffset.Now.ToUnixTimeMilliseconds().ToString(); html = http.Get("https://shopee.vn/buyer/login/signup/verify_vcode/?__classic__=1").ToString(); http.Referer = "https://shopee.vn/buyer/login/signup/verify_vcode/?__classic__=1"; var anna = http.Get("https://shopee.vn/api/v0/captcha?" + Milliseconds); anna.ToFile("E:\\cc\\Captcha\\captchacangiai.png"); var base64String = Convert.ToBase64String(File.ReadAllBytes("E:\\cc\\Captcha\\captchacangiai.png")); string body = "method=base64sv2&key=" + apikeycaptcha + "&body=" + base64String + ""; string Content = "application/x-www-form-urlencoded"; string htmlx = http.Post("http://captcha.hiepga.net/in.php", body, Content).ToString(); for (int i = 0; html == null; i++) { Thread.Sleep(50); } captcha = htmlx; data = "csrfmiddlewaretoken=" + token + "&vcode=" + vcode + "&captcha=" + captcha + "&phone_canon=" + phone_canon + "&operation=1"; http.AddHeader("accept: */*"); http.AddHeader("x-requested-with: XMLHttpRequest"); http.Referer = "https://shopee.vn/buyer/login/signup/verify_vcode/?__classic__=1"; html = http.Post("https://shopee.vn/buyer/login/signup/verify_vcode/?__classic__=1", data, "application/x-www-form-urlencoded; charset=UTF-8").ToString(); a = Regex.Match(html, "plus_(.*?)/").ToString(); } Name = "a" + phone_canon; data = "csrfmiddlewaretoken=" + token + "&username=" + Name + "&password_hash="+ Pass.ToMD5().ToSHA256() + "&password=" + Pass + "&password2=" + Pass; http.AddHeader("accept: */*"); http.AddHeader("origin: https://shopee.vn"); http.AddHeader("x-requested-with: XMLHttpRequest"); http.Referer = "https://shopee.vn/buyer/login/signup/plus_detail/?__classic__=1"; html = http.Post("https://shopee.vn/buyer/login/signup_register/",data, "application/x-www-form-urlencoded; charset=UTF-8").ToString(); MessageBox.Show("oke baby"); //đến đây là xong công đoạn đăng ký acc rồi, còn tắt otp thì tự mò đi nha, cũng khá dễ mà.haha giải captcha của hiệp gà thì mất 10vnđ 1 captcha, còn đăng ký simthue thì khá chát, hiện tại là 2k5, nên kiếm 1 số bạn trên fb có cho thuê sim 1k-1k5 có api FileHelper file = new FileHelper(); StringHelper str = new StringHelper(); public static string RANDOM(string chuoi, int length) { return new string(Enumerable.Repeat(chuoi, length) .Select(s => s[randomvovan.Next(s.Length)]).ToArray()); } quên mất lệnh random, nhớ add công khai lệnh này nha 13 1 1 Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
doubleti 0 Đã viết 10/09/2019 @caubeiuzk Thí chủ có code up sản phẩm ko share bần tăng với Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
caubeiuzk 24 Đã viết 10/09/2019 2 giờ trước, doubleti said: @caubeiuzk Thí chủ có code up sản phẩm ko share bần tăng với tự mò đi, chắc cũng ko khó đâu, up nhiều thông tin quá làm ta cũng nhác test.haha Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
Công Nguyễn 2 Đã viết 12/09/2019 úm ba la :) Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
tk21590 1 Đã viết 15/09/2019 Có bác nào đang làm login hoặc mua hàng bằng app (không phải web) cho mình xin chút hướng dẫn với . Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites