Jump to content

Recommended Posts

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)

Chia sẻ bài đăng này


Link tới bài viết
Share on other sites
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)

 

Chia sẻ bài đăng này


Link tới bài viết
Share on other sites
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.

Chia sẻ bài đăng này


Link tới bài viết
Share on other sites
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 ạ:a47:

Chia sẻ bài đăng này


Link tới bài viết
Share on other sites
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 ạ:a47:

thay ip khác nha em ...chặn thì phải thay thôi :167788236751796:

Chia sẻ bài đăng này


Link tới bài viết
Share on other sites
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 :167788236751796:

too_many_requestsToo Many Requests nó báo lỗi này Mỵ :c01:

Chia sẻ bài đăng này


Link tới bài viết
Share on other sites
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 :a29:

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 :c02:

Chia sẻ bài đăng này


Link tới bài viết
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Trả lời chủ đề này...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...