vaccuchuoi 0 Posted July 27, 2020 muốn xem code Quote Share this post Link to post Share on other sites
quimao 2 Posted August 4, 2020 hay quá, cảm ơn bác đã dày công nghiên cứu Quote Share this post Link to post Share on other sites
sonnt98 2 Posted November 18, 2020 cảm ơn bác Quote Share this post Link to post Share on other sites
Sunan Malik 0 Posted November 25, 2020 good thread upppp sir can i ask ? when i want add too cart why error 19 appear ? please give me som solution thanks before response = r.get('https://shopee.vn/api/v2/login') cookie_string = "; ".join([str(x)+"="+str(y) for x,y in response.cookies.get_dict().items()]) headers = { 'user-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36', 'referer' : 'https://shopee.vn/vivo-Y30-6GB-128GB-6-47-Ultra-O-Screen-Fast-Charging-MTK6765-i.30843261.4744153777', #example product 'x-requested-with': 'XMLHttpRequest', 'x-api-source' : 'pc', 'x-csrftoken' : csrftoken_gen, 'cookie' : "csrftoken=" + csrftoken_gen + ";"+ cookie_string } url="https://shopee.vn/api/v2/cart/add_to_cart" response = r.request("POST",url,headers=headers, json={"quantity":1,"checkout":"true","update_checkout_only":"false","donot_add_quantity":"false","source":"{\"refer_urls\":[]}","client_source":1,"shopid":30843261,"itemid":4744153777,"modelid":30736206168}) cart_url = 'https://shopee.co.id/api/v1/account_info/?need_cart=1&skip_address=1' go_cart = r.get(cart_url, headers=headers, verify=False) Quote Share this post Link to post Share on other sites
Thiên Chi Kiều Nữ 532 Posted November 27, 2020 On 11/25/2020 at 4:06 PM, Sunan Malik said: good thread upppp sir can i ask ? when i want add too cart why error 19 appear ? please give me som solution thanks before response = r.get('https://shopee.vn/api/v2/login') cookie_string = "; ".join([str(x)+"="+str(y) for x,y in response.cookies.get_dict().items()]) headers = { 'user-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36', 'referer' : 'https://shopee.vn/vivo-Y30-6GB-128GB-6-47-Ultra-O-Screen-Fast-Charging-MTK6765-i.30843261.4744153777', #example product 'x-requested-with': 'XMLHttpRequest', 'x-api-source' : 'pc', 'x-csrftoken' : csrftoken_gen, 'cookie' : "csrftoken=" + csrftoken_gen + ";"+ cookie_string } url="https://shopee.vn/api/v2/cart/add_to_cart" response = r.request("POST",url,headers=headers, json={"quantity":1,"checkout":"true","update_checkout_only":"false","donot_add_quantity":"false","source":"{\"refer_urls\":[]}","client_source":1,"shopid":30843261,"itemid":4744153777,"modelid":30736206168}) cart_url = 'https://shopee.co.id/api/v1/account_info/?need_cart=1&skip_address=1' go_cart = r.get(cart_url, headers=headers, verify=False) sorry for i was late =.='' ... but seem you are using python, here for autoit program language =.='' next time you need creat new topic in python question, i will get your question soon.. here is python success code (add item to cart) : import requests import json request = requests.Session() sp_cookie = {...} #fill your shopee cookie was login. sp_csrf_token = '' #using csrf token in your cookie was login. request.cookies.update(sp_cookie) sp_header = {'referer': 'https://shopee.vn/', 'content-type': 'application/json', 'x-csrftoken' : sp_csrf_token, 'x-requested-with':'XMLHttpRequest', 'x-shopee-language':'vi'} request.headers.update(sp_header) payload1 = { "quantity":1, "checkout":True, "update_checkout_only":False, "donot_add_quantity":False, "source":"{\"refer_urls\":[]}", "add_on_deal_id":1132637, "client_source":1, "shopid":131195741, "itemid":6902964859, "modelid":8493121868, } response = request.post('https://shopee.vn/api/v2/cart/add_to_cart', data=json.dumps(payload1)) print(response) Quote Share this post Link to post Share on other sites
Công Dũng 3 Posted December 11, 2020 có bác nào kết nối websocket shopee bằng c# , em thấy cái websocket này khoai quá chưa bắt đầu từ đâu Quote Share this post Link to post Share on other sites
Nguyễn Tiến Quang 0 Posted December 11, 2020 Đỉnh quá thầy ơi Quote Share this post Link to post Share on other sites
Thiên Chi Kiều Nữ 532 Posted December 11, 2020 11 hours ago, Công Dũng said: có bác nào kết nối websocket shopee bằng c# , em thấy cái websocket này khoai quá chưa bắt đầu từ đâu bạn phải học websocket trước đã.. sau đó mới làm được cái này. Quote Share this post Link to post Share on other sites
Công Dũng 3 Posted December 21, 2020 On 11/12/2020 at 21:06, Thiên Chi Kiều Nữ said: bạn phải học websocket trước đã.. sau đó mới làm được cái này. em request lên shopee trong 1 khoảng thời gian nhiều request quá nên shopee nó chặn k cho request nữa Mỵ có giải pháp gì k giúp em với ạ Quote Share this post Link to post Share on other sites
Thiên Chi Kiều Nữ 532 Posted December 21, 2020 4 hours ago, Công Dũng said: em request lên shopee trong 1 khoảng thời gian nhiều request quá nên shopee nó chặn k cho request nữa Mỵ có giải pháp gì k giúp em với ạ thay ip khác nha em ...chặn thì phải thay thôi Quote Share this post Link to post Share on other sites
Công Dũng 3 Posted December 22, 2020 15 giờ trước, Thiên Chi Kiều Nữ said: thay ip khác nha em ...chặn thì phải thay thôi too_many_requestsToo Many Requests nó báo lỗi này Mỵ Quote Share this post Link to post Share on other sites
Thiên Chi Kiều Nữ 532 Posted December 22, 2020 1 hour ago, Công Dũng said: too_many_requestsToo Many Requests nó báo lỗi này Mỵ khó nhỉ =.='' thay cả user agent và reffrer luôn đi bạn Quote Share this post Link to post Share on other sites
Công Dũng 3 Posted December 25, 2020 On 22/12/2020 at 10:01, Thiên Chi Kiều Nữ said: khó nhỉ =.='' thay cả user agent và reffrer luôn đi bạn em thử cũng không được. em tìm hiểu mà cũng k biết Shopee nó chặn theo tiêu chí gì luôn Quote Share this post Link to post Share on other sites