├── LICENSE ├── README.md └── main.py /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Azerpas 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nikeAPI-Py 2 | 3 | ## 27th Jan 2022: 4 | 5 | Beginner with Akamai? Check out what we've done over [**bpre**](https://github.com/char/bpre) 6 | 7 | ## 30th Jan 2021: 8 | 9 | Join the discord: https://discord.gg/JqYCEAURpm 10 | 11 | ## 16th Nov 2020: 12 | 13 | I've been asked many times for a few advices so here we go: 14 | 15 | This project has been abandoned for a few years. It's more of a documentation of all the endpoints Nike is (or was) using. 16 | As far as I know, Nike hasn't changed much of their internal API, but they now have a strong auth protection. Your best chance is to reverse-engineer Akamai (which a lot people already did) [to generate cookies and bypass their first protection](https://github.com/azerpas/nikeAPI-Py/issues/3). 17 | They also monitor every entries made to a draw, you need to generate valid fingerprint to bypass this protection. 18 | 19 | Good luck! 20 | 21 | ------------------------- 22 | 23 | ## 30th Jan 2020: 24 | **Check out https://paname.io my new project !** 25 | Cloud based bot which currently automate raffles entries. 26 | 27 | ------------------------- 28 | 29 | Hi, I'm making public this Nike SNKRS Script I've been working on last year. With work and studies I didn't have time to work on the script these last 6 months and I think I will not have time for anymore so. 30 | 31 | I think the script itself is not working anymore (Nike has shut down a lot of api endpoints) but with a bit of changes like fixing log-in etc... it could be a good script to start with. Anyway a year or so it was working great and I was making a lot of entries on SNKRS with it. 32 | I might upload a nodeJS based-version too soon (more-advanced). 33 | 34 | I'm making it public for the community, hopefully it will help some of you. 35 | Below I've left some of documentation and WIP. 36 | 37 | Feel free to contact me for any help on it, mail is on my profile and Discord is: **Azerpas#1486** 38 | 39 | **Please do not contact me about how to install Python and any other basic, there's a lot of good tutorials on the internet that will explain it better than myself, I'll be happy to help for any other question though** 40 | 41 | If you're making any progress with it let me know, I would love to see what you achieve with this. 42 | 43 | Please excuse my terrible english. 44 | 45 | ## Documentation 46 | 47 | Update 15/12/2018: decoded parts of JS akamai is using for Nike Bot Detection, can't post here for obvious reasons. 48 | 49 | **Options** 50 | - [ ] Credit cards every option possible (check when adding new card on SNKRS) 51 | - [ ] PayPal option, very easy 52 | - [ ] Make some international options for EU resident (£, different locations) 53 | 54 | ## Functions done: 55 | - [x] Authentification with a password 56 | - [x] Getting accounts infos 57 | - [x] Retrieve current calendar 58 | - [x] Find pair into calendar 59 | - [x] Sizes infos 60 | - [x] Retrieve payment infos 61 | - [x] Checkout decomposed parts (4/4) 62 | - [x] Payment parts (2/2) 63 | - [x] Entry 64 | - [x] Checking entry result 65 | 66 | ###### Authentification with a password 67 | Using grant_type password, submitting accounts email and password to Nike to retrieve an 'access_token' which will be valid for an hour. 68 | It will get the User-id too that might be usefull. 69 | 70 | ###### Account infos 71 | Retrieving phone number, checking if verified, phone number country. 72 | nuId and upmId will be scraped too, we will need them for identification checkout. 73 | 74 | ###### Calendar 75 | Retrieving current calendar (today's date). I will create some other functions to use the response. 76 | 77 | ###### Retrieve payment infos 78 | Retrieving payment infos loaded in the current account. 79 | Infos will be re-used in checkout parts. 80 | 81 | ###### Checkout process 82 | 1/4. Checking if payment methods exist. 83 | - I might need to scrape payment id and other ids. 84 | - I might implement payment methods retrieving or checking if they're the same that the user entered. 85 | 86 | 2/4. Creating shipping id with uuid.uuid4(): seems to work perfectly fine 87 | 88 | 3/4. Creating checkout id with uuid.uuid4(): seems to work perfectly fine, and successfully retrieving status 89 | - Device id might be my only problem in this function as I don't know how to generate it, but it random characters seems to suit. Nike won't check on their server. 90 | 91 | 4/4. Checking if checkout process have been completed with the uuid provided. 92 | 93 | ###### Payment process 94 | 1/2. Posting address + payment method (need to be retrieved when created - technique of delete all payment method and add a new one) 95 | - Retrieving paymentUUID that will be used in 2/2 96 | 97 | 2/2. Checking if payment has been accepted. 98 | 99 | ###### Entry process 100 | 1/2. Posting deviceID, checkoutUUID, paymentUUID, launchId, skuUUID, pricechecksum, and every infos. 101 | - Retrieving entryUUID 102 | 103 | 2/2. Checking win or not with entryUUID. 104 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import requests, json 2 | import os , time , random , datetime, sys, uuid 3 | from requests.packages import urllib3 4 | from tabulate import tabulate 5 | urllib3.disable_warnings() 6 | 7 | def log(event): 8 | d = datetime.datetime.now().strftime("%H:%M:%S") 9 | print("Nike by Azerpas :: " + str(d) + " :: " + event) 10 | 11 | user_id = None 12 | access_token = None 13 | PIDpaymentID = None 14 | CC_UUID = None 15 | PCS = None 16 | 17 | def login(session,email,password,proxy): 18 | global user_id 19 | global access_token 20 | logindata = { 21 | 'keepMeLoggedIn':True, 22 | 'client_id':'PbCREuPr3iaFANEDjtiEzXooFl7mXGQ7',#'MSgX9SH71y8CYkVjrArZS9EsH4ly1ROG', 23 | 'ux_id':'com.nike.commerce.snkrs.v2.ios', 24 | 'grant_type':'password', 25 | 'username':email, 26 | 'password':password 27 | } 28 | a = session.post('https://api.nike.com/idn/shim/oauth/2.0/token',json=logindata,verify=False,proxies=proxy) 29 | if(a.status_code == 200): 30 | log("Connected successfully") 31 | else: 32 | log("Canno't connect") 33 | print(a.text) 34 | raise ValueError("Canno't connect") 35 | user_id = json.loads(a.text)['user_id'] 36 | access_token = json.loads(a.text)['access_token'] 37 | log("User id: " + user_id + " - Access token: " + access_token) 38 | 39 | 40 | def changePassword(session,oldpassword,password,user_id,access_token,proxy): 41 | changedata = { 42 | "password":oldpassword, 43 | "newPassword":password, 44 | "passwordConfirm":password 45 | } 46 | 47 | headers = { 48 | "authority":"www.nike.com", 49 | "method":"PUT", 50 | "path":"/profile/services/users/"+user_id+"/password", 51 | "scheme":"https", 52 | "accept":"application/json, text/javascript, */*; q=0.01", 53 | "accept-encoding":"gzip, deflate, br", 54 | "accept-language":"fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7", 55 | "Authorization":"Bearer "+access_token, 56 | "content-locale":"fr_FR", 57 | "content-type":"application/json", 58 | "origin":"https://www.nike.com", 59 | "referer":"https://www.nike.com/fr/fr_fr/p/settings", 60 | "user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36", 61 | "x-requested-with":"XMLHttpRequest", 62 | } 63 | 64 | b = session.put("https://www.nike.com/profile/services/users/"+user_id+"/password",json=changedata,headers=headers,proxies=proxy) 65 | if(b.status_code == 200): 66 | log("Changed password successfully") 67 | else: 68 | log("Canno't change password") 69 | print(b.text) 70 | raise ValueError("Canno't change password") 71 | 72 | def accountInfos(session,proxy): 73 | global access_token 74 | global user_id 75 | infos_url = "https://api.nike.com/user/commerce" 76 | headers = { 77 | "method":"GET", 78 | "scheme":"https", 79 | "path":"/user/commerce", 80 | "authority":"api.nike.com", 81 | "Authorization":"Bearer "+access_token, 82 | "content-type":"application/json", 83 | "accept":"*/*", 84 | "x-nike-ux-id":"com.nike.commerce.snkrs.v2.ios", 85 | "user-agent":"SNEAKRS/1.1.3 (iPhone; iOS 11.2.2; Scale/3.00)", 86 | "x-requested-with":"XMLHttpRequest", 87 | } 88 | try: 89 | a = session.get(infos_url,verify=False,headers=headers) 90 | except Exception as e: 91 | log("Canno't connect, means you're banned or your internet isn't working") 92 | raise e 93 | if(a.status_code == 200): 94 | log("Successfully scraped user infos") 95 | else: 96 | log("Canno't scrape user infos, please check the password, identification might failed") 97 | print(a.text) 98 | raise ValueError("Canno't scrape user infos (error 101)") 99 | decoded_resp = json.loads(a.text) 100 | try: 101 | phoneNumber = decoded_resp['verifiedphone'] 102 | phoneCountry = decoded_resp['verifiedPhoneCountry'] 103 | # just as infos for user 104 | log("Verified phone number for this account: " + str(phoneNumber) + " : " + str(phoneCountry)) 105 | except Exception as e: 106 | log("Canno't scrape verified phone neither country, it probably means that this account is not verified, please check the error below") 107 | print(e) 108 | try: 109 | nuId = decoded_resp['nuId'] 110 | upmId = decoded_resp['upmId'] 111 | # both will be used when checking out 112 | log("Account infos: " + nuId + " - " + upmId) 113 | except Exception as e: 114 | log("Canno't scrape nuId or upmId, it probably means that the login didn't work, please check the error below and retry") 115 | exit(0) 116 | 117 | def getCalendar(session,proxy): 118 | #"https://api.nike.com/commerce/productfeed/products/snkrs/threads?country=FR&lastUpdatedAfter=2018-03-25-00-00&limit=50&locale=fr_FR&skip=0&withCards=true" 119 | today = datetime.datetime.now().strftime("%Y-%m-%d-00-00") 120 | calendar_url = "https://api.nike.com/commerce/productfeed/products/snkrs/threads?country=FR&lastUpdatedAfter=" + today + "&limit=50&locale=fr_FR&skip=0&withCards=true" 121 | a = session.get(calendar_url,verify=False) 122 | decoded_resp = json.loads(a.text,encoding="utf-8") 123 | # you can do whatever you want with this 124 | return decoded_resp; 125 | 126 | def formatedCalendar(text): 127 | items = [] 128 | for i in text['threads']: 129 | item = [] 130 | 131 | sku = i['product']['style'] +"-"+ i['product']['colorCode'] 132 | try: 133 | price = i['product']['price']['fullRetailPrice'] 134 | except: 135 | price = 0 136 | try: 137 | commerceDate = i['product']['commerceStartDate'] 138 | title = i['seoTitle'].replace("&","&") 139 | date = commerceDate.split("T")[0].split("-") 140 | day = date[2] 141 | month = date[1] 142 | year = date[0] 143 | time = commerceDate.split("T")[1].split(":") 144 | resultH = time[0] 145 | resultM = time[1] 146 | except: 147 | resultH = "" 148 | resultM = "" 149 | day = "" 150 | month = "" 151 | year = "" 152 | 153 | item.append(sku) 154 | item.append(title) 155 | item.append(price) 156 | item.append(resultH+":"+resultM) 157 | item.append(day+":"+month+":"+year) 158 | 159 | items.append(item) 160 | 161 | print (tabulate(items, headers=['sku', 'title', 'price', 'time', 'date'])) 162 | 163 | 164 | def findPairs(calendar,style,keywords,uuid): 165 | for i in calendar['threads']: 166 | if(style != ""): 167 | try: 168 | if(i['product']['style'] == style): 169 | log("Found product with input style") 170 | return i 171 | except: 172 | pass 173 | if(keywords != []): 174 | for k in keywords: 175 | try: 176 | if(k.lower() in i['product']['fullTitle']): 177 | log("Found product with input keywords") 178 | return i 179 | except: 180 | pass 181 | if(uuid != ""): 182 | try: 183 | if(i['product']['id'] == uuid): 184 | log("Found product with input uuid") 185 | return i 186 | except: 187 | pass 188 | log("Can't find any matching product") 189 | 190 | def getPairInfos(product): 191 | try: 192 | thread_id = product['id'] 193 | except: 194 | log("Can't scrape thread id") 195 | try: 196 | short_name = product['name'] 197 | except: 198 | log("Can't scrape short name") 199 | try: 200 | uuid_pair = product['product']['id'] 201 | except: 202 | log("Can't scrape uuid") 203 | try: 204 | style_sku = product['product']['style'] 205 | except: 206 | log("Can't scrape style sku") 207 | try: 208 | pid_pair = product['product']['globalPid'] 209 | except: 210 | log("Can't scrape pid") 211 | try: 212 | full_name = product['product']['fullTitle'] 213 | except: 214 | log("Can't scrape full name") 215 | try: 216 | image_url = product['product']['imageURL'] 217 | except: 218 | log("Can't scrape image") 219 | try: 220 | price = product['product']['price']['fullRetailPrice'] 221 | except: 222 | log("Can't scrape price") 223 | try: 224 | release_date = product['product']['startSellDate'] 225 | except: 226 | log("Can't scrape release date") 227 | try: 228 | maxQuantity = product['product']['quantitylimit'] 229 | except: 230 | log("Can't scrape max quantity") 231 | try: 232 | drawType = product['product']['selectionEngine'] 233 | except: 234 | log("Can't scrape draw type") 235 | try: 236 | waitline = product['product']['waitlineEnabled'] 237 | except: 238 | log("Can't scrape waitline type") 239 | try: 240 | skus = product['product']['skus'] 241 | except: 242 | log("Can't scrape waitline skus") 243 | # to:do, select size by keywords entered by user, easy 244 | 245 | def liveStock(session,proxy,uuid): 246 | liveS_url = "https://api.nike.com/deliver/available_skus/v1?filter=productIds("+uuid+")" 247 | a = session.get(liveS_url,verify=False) 248 | decoded_resp = json.loads(a.text) 249 | sizes = decoded_resp['objects'] 250 | # todo20, compare sizes to calendar sizes 251 | 252 | def retrievePayMethods(session,proxy,profile): 253 | global access_token 254 | global user_id 255 | global PIDpaymentID 256 | 257 | headers = { 258 | "authority":"api.nike.com", 259 | "method":"POST", 260 | "path":"/commerce/storedpayments/consumer/storedpayments?currency=EUR&includeBalance=true", 261 | "scheme":"https", 262 | "accept":"*/*", 263 | "accept-encoding":"gzip;q=1.0, compress;q=0.5", 264 | "accept-language":"fr-FR;q=1.0, en-US;q=0.9, zh-Hans-FR;q=0.8", 265 | "Authorization":"Bearer "+access_token, 266 | "content-locale":"fr_FR", 267 | "content-type":"application/json", 268 | "user-agent":"SNEAKRS/1.1.3 (iPhone; iOS 11.2.2; Scale/3.00)", 269 | "x-nike-caller-id":"nike:sneakrs:ios:1.1", 270 | } 271 | a = session.post('https://api.nike.com/commerce/storedpayments/consumer/storedpayments?currency=EUR&includeBalance=true',verify=False,headers=headers,json={}) 272 | if(a.status_code == 200): 273 | log("Retrieved payment methods successfully") 274 | print(a.text) 275 | else: 276 | log("Canno't retrieve payment methods") 277 | print(a.text) 278 | raise ValueError("Canno't retrieve payment methods") 279 | try: 280 | payments = json.loads(a.text)['payments'] 281 | PIDpaymentID = json.loads(a.text)['payments'][0]['paymentId'] 282 | log("PaymentID retrieved") 283 | return payments 284 | except Exception as e: 285 | log("No payment methods found") 286 | print(e) 287 | 288 | def co1(session,proxy,total,item_uuid): 289 | global access_token 290 | global user_id 291 | 292 | ''' 293 | x-b3-traceid 7845535027403799357 294 | x-newrelic-id VQYGVF5SCBAEVVBUBgMDVg== 295 | ''' 296 | headers = { 297 | "authority":"api.nike.com", 298 | "method":"POST", 299 | "path":"/payment/options/v2", 300 | "scheme":"https", 301 | "accept":"*/*", 302 | "accept-encoding":"gzip;q=1.0, compress;q=0.5", 303 | "accept-language":"fr-FR;q=1.0, en-US;q=0.9, zh-Hans-FR;q=0.8", 304 | "Authorization":"Bearer "+access_token, 305 | "content-type":"application/json", 306 | "user-agent":"SNEAKRS/1.1.3 (iPhone; iOS 11.2.2; Scale/3.00)", 307 | "x-nike-caller-id":"nike:sneakrs:ios:1.1", 308 | } 309 | 310 | payload = { 311 | "total": total, 312 | "items": [item_uuid], 313 | "billingCountry": "FR", 314 | "currency": "EUR", 315 | "country": "FR" 316 | } 317 | 318 | a = session.post('https://api.nike.com/payment/options/v2',verify=False,headers=headers,json=payload) 319 | if(a.status_code == 200): 320 | log("Checkout 1/4") 321 | #print(a.text) 322 | else: 323 | log("Problem while trying to pass 1/4 checkout phase") 324 | print(a.text) 325 | raise ValueError("1/4 checkout (error 612)") 326 | try: 327 | paymentsOptions = json.loads(a.text)['paymentOptions'] 328 | except Exception as e: 329 | log("No payment options found") 330 | print(e) 331 | 332 | def co2(session,proxy,item_uuid,sku_uuid,profile): 333 | global access_token 334 | global user_id 335 | 336 | ''' 337 | x-b3-traceid 3740821007608208046 338 | x-newrelic-id VQYGVF5SCBAEVVBUBgMDVg== 339 | ''' 340 | 341 | headers = { 342 | "authority":"api.nike.com", 343 | "method":"POST", 344 | "path":"/buy/shipping_options/v2", 345 | "scheme":"https", 346 | "accept":"application/json", 347 | "accept-encoding":"gzip;q=1.0, compress;q=0.5", 348 | "accept-language":"fr-FR;q=1.0, en-US;q=0.9, zh-Hans-FR;q=0.8", 349 | "Authorization":"Bearer "+access_token, 350 | "content-type":"application/json; charset=utf-8", 351 | "user-agent":"SNEAKRS/1.1.3 (iPhone; iOS 11.2.2; Scale/3.00)", 352 | "x-nike-caller-id":"nike:sneakrs:ios:1.1", 353 | } 354 | 355 | shippingUUID = str(uuid.uuid4()) 356 | 357 | payload = { 358 | "items": [{ 359 | "id": shippingUUID, 360 | "shippingAddress": { 361 | "postalCode": profile['zip'], 362 | "address1": profile['address'], 363 | "city": profile['city'], 364 | "country": "FR" 365 | }, 366 | "skuId": sku_uuid 367 | }], 368 | "currency": "EUR", 369 | "country": "FR" 370 | } 371 | 372 | a = session.post('https://api.nike.com/buy/shipping_options/v2',verify=False,headers=headers,json=payload) 373 | if(a.status_code == 200): 374 | log("Checkout 2/4") 375 | #print(a.text) 376 | else: 377 | log("Problem while trying to pass 2/4 checkout phase") 378 | print(a.text) 379 | raise ValueError("2/4 checkout (error 613)") 380 | try: 381 | items = json.loads(a.text)['items'] 382 | return shippingUUID 383 | except Exception as e: 384 | log("Shipping options canno't be submit") 385 | print(e) 386 | 387 | def co3(session,proxy,sku_uuid,profile,shippingUUID,deviceId): 388 | global access_token 389 | global user_id 390 | 391 | checkoutUUID = str(uuid.uuid4()) 392 | 393 | headers = { 394 | "authority":"api.nike.com", 395 | "method":"PUT", 396 | "path":"/buy/checkout_previews/v2/"+checkoutUUID, 397 | "scheme":"https", 398 | "accept":"application/json", 399 | "accept-encoding":"gzip;q=1.0, compress;q=0.5", 400 | "accept-language":"fr-FR;q=1.0, en-US;q=0.9, zh-Hans-FR;q=0.8", 401 | "Authorization":"Bearer "+access_token, 402 | "content-type":"application/json", 403 | "user-agent":"SNEAKRS/1.1.3 (iPhone; iOS 11.2.2; Scale/3.00)", 404 | "x-nike-caller-id":"nike:sneakrs:ios:1.1", 405 | } 406 | 407 | payload = { 408 | "request": { 409 | "email": profile['email'], 410 | "clientInfo": { 411 | "deviceId": deviceId, 412 | "client": "com.nike.commerce.snkrs.v2.ios" 413 | }, 414 | "currency": "EUR", #todo 415 | "items": [{ 416 | "recipient": { 417 | "lastName": profile['lname'], 418 | "firstName": profile['fname'] 419 | }, 420 | "shippingAddress": { 421 | "city": profile['city'], 422 | "address1": profile['address'], 423 | "postalCode": profile['zip'], 424 | "country": "FR" 425 | }, 426 | "id": shippingUUID, 427 | "quantity": 1, 428 | "skuId": sku_uuid, 429 | "shippingMethod": "GROUND_SERVICE", 430 | "contactInfo": { 431 | "phoneNumber": profile['phone'], 432 | "email": profile['email'] 433 | } 434 | }], 435 | "channel": "SNKRS", 436 | "locale": "fr_FR", 437 | "country": "FR" 438 | } 439 | } 440 | 441 | a = session.put('https://api.nike.com/buy/checkout_previews/v2/'+checkoutUUID,verify=False,headers=headers,json=payload) 442 | if(a.status_code == 202): 443 | log("Checkout 3/4") 444 | #print(a.text) 445 | else: 446 | log("Problem while trying to pass 3/4 checkout phase") 447 | print(a.text) 448 | raise ValueError("3/4 checkout (error 614)") 449 | try: 450 | status = json.loads(a.text)['status'] 451 | log("Status: " + status) 452 | return checkoutUUID 453 | except Exception as e: 454 | log("Checkout preview canno't be submit") 455 | print(e) 456 | 457 | def co4(session,proxy,checkoutUUID): 458 | global access_token 459 | global user_id 460 | global PCS 461 | 462 | headers = { 463 | "authority":"api.nike.com", 464 | "method":"GET", 465 | "path":"/buy/checkout_previews/v2/jobs/"+checkoutUUID, 466 | "scheme":"https", 467 | "accept":"application/json", 468 | "accept-encoding":"gzip;q=1.0, compress;q=0.5", 469 | "accept-language":"fr-FR;q=1.0, en-US;q=0.9, zh-Hans-FR;q=0.8", 470 | "Authorization":"Bearer "+access_token, 471 | "content-type":"application/json; charset=UTF-8", 472 | "user-agent":"SNEAKRS/1.1.3 (iPhone; iOS 11.2.2; Scale/3.00)", 473 | "x-nike-caller-id":"nike:sneakrs:ios:1.1", 474 | } 475 | 476 | 477 | checkout_url = "https://api.nike.com/buy/checkout_previews/v2/jobs/"+checkoutUUID 478 | a = session.get(checkout_url,verify=False, headers=headers) 479 | #print(a) 480 | #print(a.text) 481 | decoded_resp = json.loads(a.text) 482 | try: 483 | status = decoded_resp['status'] 484 | except: 485 | return False 486 | if(status=="COMPLETED"): 487 | PCS = decoded_resp['response']['priceChecksum'] 488 | return True 489 | else: 490 | return False 491 | 492 | def userCheck(session,proxy,password): 493 | global access_token 494 | global user_id 495 | headers = { 496 | "authority":"api.nike.com", 497 | "method":"POST", 498 | "path":"/userCheck", 499 | "scheme":"https", 500 | "accept":"*/*", 501 | "accept-encoding":"gzip;q=1.0, compress;q=0.5", 502 | "accept-language":"fr-FR;q=1.0, en-US;q=0.9, zh-Hans-FR;q=0.8", 503 | "Authorization":"Bearer "+access_token, 504 | "content-type":"application/json", 505 | "user-agent":"SNEAKRS/1.1.3 (iPhone; iOS 11.2.2; Scale/3.00)", 506 | "x-nike-ux-id":"com.nike.commerce.snkrs.v2.ios", 507 | } 508 | 509 | payload = { 510 | "password": password 511 | } 512 | 513 | a = session.post("https://api.nike.com/userCheck",verify=False,headers=headers,json=payload) 514 | if(a.status_code == 200): 515 | log("User checked successfully") 516 | #print(a.text) 517 | else: 518 | log("Can't check user") 519 | print(a.text) 520 | raise ValueError("Can't check user (error 344)") 521 | try: 522 | nuId = json.loads(a.text)['nuId'] 523 | upmId = json.loads(a.text)['upmId'] 524 | except Exception as e: 525 | log("Can't retrieve nuId or upmId") 526 | print(e) 527 | 528 | def pay1(session,proxy,total,item_uuid,profile,checkoutId):#,paymentInfo): 529 | global user_id 530 | global access_token 531 | 532 | headers = { 533 | "authority":"api.nike.com", 534 | "method":"POST", 535 | "path":"/payment/preview/v2", 536 | "scheme":"https", 537 | "accept":"application/json; charset=utf-8", 538 | "accept-encoding":"gzip;q=1.0, compress;q=0.5", 539 | "accept-language":"fr-FR;q=1.0, en-US;q=0.9, zh-Hans-FR;q=0.8", 540 | "Authorization":"Bearer "+access_token, 541 | "content-type":"application/json", 542 | "user-agent":"SNEAKRS/1.1.3 (iPhone; iOS 11.2.2; Scale/3.00)", 543 | "x-nike-caller-id":"nike:sneakrs:ios:1.1", 544 | } 545 | 546 | payload = { 547 | "total": total, 548 | "items": [{ 549 | "productId": item_uuid, 550 | "shippingAddress": { 551 | "city": profile['city'], 552 | "address1": profile['address'], 553 | "postalCode": profile['postalCode'], 554 | "country": "FR" #todo18 555 | } 556 | }], 557 | "checkoutId": checkoutId, 558 | "currency": "EUR", 559 | "paymentInfo": [{ 560 | "id": PIDpaymentID, 561 | "cardType": "MasterCard", 562 | "accountNumber": "XXXXXXXXXXXX"+paymentInfo['accountNumber'][-4:], 563 | "creditCardInfoId": CC_UUID, 564 | "type": "CreditCard", 565 | "paymentId": PIDpaymentID, 566 | "billingInfo": { 567 | "name": { 568 | "lastName": profile['lname'], 569 | "firstName": profile['fname'] 570 | }, 571 | "contactInfo": { 572 | "phoneNumber": profile['phone'], 573 | "email": profile['email'] 574 | }, 575 | "address": { 576 | "city": profile['city'], 577 | "address1": profile['address'], 578 | "postalCode": profile['zip'], 579 | "country": "FR" 580 | } 581 | } 582 | }], 583 | "country": "FR" 584 | } 585 | 586 | a = session.post('https://api.nike.com/payment/preview/v2',verify=False,headers=headers,json=payload) 587 | if(a.status_code == 202): 588 | log("Payment 1/2") 589 | print(a.text) 590 | else: 591 | log("Problem while trying to pass 1/2 payment phase") 592 | print(a.text) 593 | raise ValueError("1/2 payment (error 615)") 594 | try: 595 | status = json.loads(a.text)['status'] 596 | paymentID = json.loads(a.text)['id'] 597 | log("Status: " + status) 598 | log("Payment: " + paymentID) 599 | return paymentID 600 | except Exception as e: 601 | log("Payment preview canno't be submit") 602 | print(e) 603 | 604 | def pay2(session,proxy,paymentUUID): 605 | global access_token 606 | global user_id 607 | 608 | headers = { 609 | "authority":"api.nike.com", 610 | "method":"GET", 611 | "path":"/payment/preview/v2/jobs/"+paymentUUID, 612 | "scheme":"https", 613 | "accept":"application/json; charset=utf-8", 614 | "accept-encoding":"gzip;q=1.0, compress;q=0.5", 615 | "accept-language":"fr-FR;q=1.0, en-US;q=0.9, zh-Hans-FR;q=0.8", 616 | "Authorization":"Bearer "+access_token, 617 | "content-type":"application/json; charset=UTF-8", 618 | "user-agent":"SNEAKRS/1.1.3 (iPhone; iOS 11.2.2; Scale/3.00)", 619 | "x-nike-caller-id":"nike:sneakrs:ios:1.1", 620 | } 621 | 622 | 623 | #checkout_url = "https://api.nike.com/payment/preview/v2/jobs/"+checkoutUUID 624 | a = session.get("https://api.nike.com/payment/preview/v2/jobs/"+paymentUUID,verify=False, headers=headers) 625 | print(a) 626 | print(a.text) 627 | decoded_resp = json.loads(a.text) 628 | try: 629 | status = decoded_resp['status'] 630 | except: 631 | return False 632 | if(status=="COMPLETED"): 633 | return True 634 | else: 635 | return False 636 | 637 | def entry1(session,proxy,profile,deviceId,checkoutUUID,paymentUUID,sku_uuid,priceChecksum,launchId): 638 | global access_token 639 | global user_id 640 | 641 | headers = { 642 | "authority":"api.nike.com", 643 | "method":"POST", 644 | "path":"/launch/entries/v2", 645 | "scheme":"https", 646 | "accept":"*/*", 647 | "accept-encoding":"gzip;q=1.0, compress;q=0.5", 648 | "accept-language":"fr-FR;q=1.0, en-US;q=0.9, zh-Hans-FR;q=0.8", 649 | "Authorization":"Bearer "+access_token, 650 | "content-type":"application/json", 651 | "user-agent":"SNEAKRS/1.1.3 (iPhone; iOS 11.2.2; Scale/3.00)", 652 | "x-nike-caller-id":"nike:sneakrs:ios:1.1", 653 | } 654 | 655 | payload = { 656 | "deviceId": deviceId, 657 | "checkoutId": checkoutUUID, 658 | "currency": "EUR", 659 | "paymentToken": paymentUUID, 660 | "shipping": { 661 | "recipient": { 662 | "lastName": profile['lname'], 663 | "firstName": profile['fname'], 664 | "email": profile['email'], 665 | "phoneNumber": profile['phone'] 666 | }, 667 | "method": "GROUND_SERVICE", 668 | "address": { 669 | "city": profile['city'], 670 | "address1": profile['address'], 671 | "postalCode": profile['zip'], 672 | "country": "FR" 673 | } 674 | }, 675 | "skuId": sku_uuid,# "df9a23e7-a549-5cb4-91a2-fca03224de28", 676 | "channel": "SNKRS", 677 | "launchId": launchId, # "acedd90d-a7fd-449b-a1fa-149abeade37e", 678 | "locale": "fr_FR", 679 | "priceChecksum": priceChecksum, #"5492053f735d2ea35dcb6a1f10eca05c" 680 | } 681 | 682 | 683 | a = session.post('https://api.nike.com/launch/entries/v2',verify=False,headers=headers,json=payload) 684 | if(a.status_code == 201): 685 | log("Entry 1/2") 686 | print(a.text) 687 | else: 688 | log("Problem while trying to pass 1/2 entry phase") 689 | print(a.text) 690 | raise ValueError("1/2 entry (error 715)") 691 | try: 692 | entryId = json.loads(a.text)['id'] 693 | log("entryId: " + entryId) 694 | return entryId 695 | except Exception as e: 696 | log("Entry canno't be submit") 697 | print(e) 698 | 699 | def entry2(session,proxy,entryUUID): 700 | global access_token 701 | #"estimatedResultAvailability": "2018-03-26T08:03:03.000Z", 702 | 703 | ''' 704 | "result": { 705 | "checkoutId": "bb4b5731-1935-4785-b208-65f38e9988d7", 706 | "status": "NON_WINNER", 707 | "reason": "OUT_OF_STOCK", 708 | "reentryPermitted": true 709 | }, 710 | ''' 711 | 712 | headers = { 713 | "authority":"api.nike.com", 714 | "method":"GET", 715 | "path":"/launch/entries/v2/"+entryUUID, 716 | "scheme":"https", 717 | "accept":"*/*", 718 | "accept-encoding":"gzip;q=1.0, compress;q=0.5", 719 | "accept-language":"fr-FR;q=1.0, en-US;q=0.9, zh-Hans-FR;q=0.8", 720 | "Authorization":"Bearer "+access_token, 721 | "content-type":"application/json", 722 | "user-agent":"SNEAKRS/1.1.3 (iPhone; iOS 11.2.2; Scale/3.00)", 723 | "x-nike-caller-id":"nike:sneakrs:ios:1.1", 724 | } 725 | 726 | a = session.get("https://api.nike.com/launch/entries/v2/"+entryUUID,verify=False, headers=headers) 727 | print(a) 728 | print(a.text) 729 | decoded_resp = json.loads(a.text) 730 | try: 731 | time = decoded_resp['estimatedResultAvailability'] 732 | time = time.split("T")[1] 733 | time = time.split(":") 734 | resultH = time[0] 735 | resultM = time[1] 736 | resultS = time[2][:2] 737 | log("Waiting for result till: " + str(resultH) + ":" + str(resultM) + ":" + str(resultS)) 738 | schedule((int(resultH)-2),int(resultM),int(resultS)) 739 | return 'wait' 740 | # transformer les valeurs en Int et ajouter scheduler puis entry2() 741 | # schedule(int(resultH),int(resultM),int(resultS)) 742 | except: 743 | try: 744 | drawResult = decoded_resp['result']['status'] ####??????????? 745 | log("Result: "+drawResult) 746 | return drawResult 747 | except: 748 | log("Can't fetch result") 749 | print(decoded_resp) 750 | return 'looser' 751 | 752 | # alors resultat disponible, donc result['status'] -- result['reason'] -- result['reentryPermitted'] 753 | # encore un try -- except alors 754 | 755 | 756 | ########## 757 | # NEED TO DELETE EVERY CARD AND REPOST CARD 758 | 759 | def schedule(hour,minu,sec): 760 | for i in xrange(0, 365): 761 | t = datetime.datetime.today() 762 | future = datetime.datetime(t.year, t.month, t.day, hour, minu, sec) 763 | if t.hour >= 2: 764 | future += datetime.timedelta(days=1) 765 | time.sleep((future - t).seconds) 766 | 767 | 768 | def setPayment(session,proxy,profile): 769 | global access_token 770 | global user_id 771 | 772 | payments = retrievePayMethods(session,proxy,profile) 773 | if(payments): 774 | for i in payments: 775 | paymentID = i['paymentId'] 776 | # usual headers 777 | headers = { 778 | "authority":"api.nike.com", "method":"DELETE","path":"/commerce/storedpayments/consumer/storedpayments/"+paymentID, 779 | "scheme":"https","accept":"*/*","accept-encoding":"gzip;q=1.0, compress;q=0.5","accept-language":"fr-FR;q=1.0, en-US;q=0.9, zh-Hans-FR;q=0.8", 780 | "Authorization":"Bearer "+access_token, "content-type":"application/json","user-agent":"SNEAKRS/1.1.3 (iPhone; iOS 11.2.2; Scale/3.00)", 781 | "x-nike-caller-id":"nike:sneakrs:ios:1.1", 782 | } 783 | r = session.delete("https://api.nike.com/commerce/storedpayments/consumer/storedpayments/"+paymentID,verify=False,headers=headers) 784 | print(r) 785 | print(r.text) 786 | if(r.status_code == 204): 787 | log("Successfully deleted paymentID: " + paymentID) 788 | else: 789 | log("There was a problem while trying to delete paymentID:" + paymentID) 790 | 791 | newPaymentID = str(uuid.uuid4()).upper() 792 | headers = { 793 | "authority":"api.nike.com", "method":"POST","path":"/paymentcc/creditcardsubmit/creditcardsubmit/"+newPaymentID+"/store", 794 | "scheme":"https","accept":"*/*","accept-encoding":"gzip;q=1.0, compress;q=0.5","accept-language":"fr-FR;q=1.0, en-US;q=0.9, zh-Hans-FR;q=0.8", 795 | "Authorization":"Bearer "+access_token, "content-type":"application/json","user-agent":"SNEAKRS/1.1.3 (iPhone; iOS 11.2.2; Scale/3.00)", 796 | "x-nike-caller-id":"nike:sneakrs:ios:1.1", 797 | } 798 | 799 | payload = { 800 | "cvNumber": paymentInfo['cvNumber'], 801 | "accountNumber": paymentInfo['accountNumber'], 802 | "expirationYear": paymentInfo['expirationYear'], 803 | "cardType": paymentInfo['cardType'], 804 | "expirationMonth": paymentInfo['expirationMonth'] 805 | } 806 | r = session.post("https://api.nike.com/paymentcc/creditcardsubmit/creditcardsubmit/"+newPaymentID+"/store",verify=False,headers=headers,json=payload) 807 | print(r) 808 | headers = { 809 | "authority":"api.nike.com", "method":"GET","path":"/paymentcc/creditcardsubmit/creditcardsubmit/"+newPaymentID+"/isValid", 810 | "scheme":"https","accept":"*/*","accept-encoding":"gzip;q=1.0, compress;q=0.5","accept-language":"fr-FR;q=1.0, en-US;q=0.9, zh-Hans-FR;q=0.8", 811 | "Authorization":"Bearer "+access_token, "content-type":"application/json","user-agent":"SNEAKRS/1.1.3 (iPhone; iOS 11.2.2; Scale/3.00)", 812 | "x-nike-caller-id":"nike:sneakrs:ios:1.1", 813 | } 814 | r2 = session.get("https://api.nike.com/paymentcc/creditcardsubmit/creditcardsubmit/"+newPaymentID+"/isValid",verify=False,headers=headers) 815 | print(r2) 816 | 817 | headers = { 818 | "authority":"api.nike.com", "method":"POST","path":"/commerce/storedpayments/consumer/savepayment", 819 | "scheme":"https","accept":"*/*","accept-encoding":"gzip;q=1.0, compress;q=0.5","accept-language":"fr-FR;q=1.0, en-US;q=0.9, zh-Hans-FR;q=0.8", 820 | "Authorization":"Bearer "+access_token, "content-type":"application/json","user-agent":"SNEAKRS/1.2.2 (iPhone; iOS 11.2.2; Scale/3.00)", 821 | "x-nike-caller-id":"nike:sneakrs:ios:1.2", 822 | } 823 | 824 | payload = { 825 | "isDefault": "false", 826 | "creditCardInfoId": newPaymentID, 827 | "type": "CreditCard", 828 | "billingAddress": { 829 | "city": profile['city'], 830 | "address1": profile['address'], 831 | "postalCode": profile['zip'], 832 | "phoneNumber": profile['phone'], 833 | "email": profile['email'], 834 | "lastName": profile['lname'], 835 | "firstName": profile['fname'], 836 | "country": "FR" 837 | }, 838 | "currency": "EUR" 839 | } 840 | 841 | r3 = session.post("https://api.nike.com/commerce/storedpayments/consumer/savepayment",verify=False,headers=headers,json=payload) 842 | print(r3) 843 | 844 | if(r3.status_code != 201): 845 | log("Error 4515") 846 | 847 | if(r.status_code == 201): 848 | if(r2.status_code == 200): 849 | log("Successfully added new payment to your account, newPaymentID: " + newPaymentID) 850 | return newPaymentID 851 | # do i have to add something to return -"paymentId" : "pid47391cc2-4206-4f08-919d-42bbd2fb1a29",- ? 852 | # todo15 853 | else: 854 | log("There was a problem while trying to verify if payment is valid (Error 2134)") 855 | else: 856 | log("There was a problem while trying to add a new payment method (Error 9011)") 857 | 858 | def getLaunchID(session,proxy,productUUID): 859 | #https://api.nike.com/launch/launch_views/v2?filter=productId(a06463c7-6c62-5b83-b79f-1c69f5d34e73,be2f17fc-c629-5785-b100-d4cb60278a01,dcc140b0-80ec-5ab2-9ce9-9afa508d898f,0b2410ac-bb99-5330-85dd-18c014474325,d00f855a-c41f-59fc-93b3-690a1857a844,61df791a-b1d7-57c1-a4f6-3bae510ed413,038ee55e-680e-5448-9c12-e4ac93c5ff37,7cb3d5ad-0900-5102-9273-be34312071b3,d303a2d8-547c-508b-94cc-10428e43a32e,b87d3475-ebd3-566d-9aad-6406c11e27a7,e28c6605-09d8-52bc-9b71-34a9d881d61e,b9a97705-5977-5653-b7d7-8292ec603fa0,2b48a9d9-e4cf-579c-8fb9-988e5138b401,1984c803-669c-5b43-9d5d-97c95a137351,01f0c4be-5cfb-56ce-89f3-ea4c6d42ebe8,e453d1e1-d448-5779-bb68-646bb328b4d4,fc65eafd-b440-5bd0-b8ab-9e616304a26d,0febc47a-9aea-50f2-bff7-c78e6727d980,55f2ff6b-2258-5141-8e49-921cc8033431,7d993144-13a6-5cb3-bdfb-f59604e39e58,a49e09e4-de08-52c6-8739-eb8bf5ab7a9d,5c007699-b81c-5f1c-845d-9080b1590184) 860 | global access_token 861 | global user_id 862 | 863 | launch_url = "https://api.nike.com/launch/launch_views/v2?filter=productId("+productUUID+")" 864 | a = session.get(launch_url,verify=False) 865 | decoded_resp = json.loads(a.text,encoding="utf-8") 866 | return decoded_resp['objects'][0]['id'] 867 | 868 | hour = 19 869 | minu = 46 870 | sec = 00 871 | 872 | 873 | s = requests.session() 874 | proxy = {'https' : ''} 875 | 876 | log("Waiting till: " + str(hour) + ":" + str(minu)) 877 | #schedule(hour,minu,sec) 878 | 879 | login(s,"sushi@gmail.com","123456",proxy) 880 | 881 | profile = { 882 | 'zip':'77777', 'address':'1 Rue De la Berge', 'city':'Paris','phone':'646123984', 883 | 'lname':'PAS','fname':'AZER','email':'AZER@gmail.com','password':'' 884 | } 885 | 886 | paymentInfo = { 887 | "cvNumber": "000", 888 | "accountNumber": "4974970013330000", 889 | "expirationYear": "2022", 890 | "cardType": "UNKNOWN", # ? mastercard visa etc? check SNKRS 891 | "expirationMonth": "01" 892 | } 893 | 894 | deviceId = "0500Eit1Aks166fErl0+1uL24qSxO4aEE18ghxXFbqXRnnuyPBqyN19uaGXZIHBuKG\/aUP1MxcsCsaeJVPkOG9WjujlxYtGtOmhVPZiB3G\/Z2peYCWI3GQKtEQSdPHaEZDuR\/KjT1k\/j978OTtSVGP5NSz99g7EZLoEll\/a8im45O8\/qz34bGDcfMVX\/HBFE7ScPJDmdjYymHK6MoqwAJw83f6EMnNMzkmb+OR+UXuf5hzkiVHAZCDkZBa23eIVfu5w+i1pLZczUYzhAhyQVz6dsjBhH3vn6fUaOtK3MzPh1P0UN48PB\/v1j31NoGKmIHgAIJnGTsHlfhzU+dnSs8eZqpF99veg44dZ2E+Kblfjrji0+Y585TFTVfM5WxKtZlZwZAtYsnxv7h\/pEHKneCVCoyXkwNkgHECiI3yUtLrYxMi8X+oZnJLmzaJiBWQjmfFDSqChPFDHt3PJpCy2kbLPlTjHt6wBEyS3019GB5XxcrYvYXL0AVgeGznsHAunMzueORQmtwnPmIuI9dzHmQ6sCmNViPcvwdfKb2AndeTI8uraDu\/VYHu5K1DHmO2kA0M8SEpKIv0zrAHaFxQAmmDh0nVjPF\/JdRPfbLR+Qgtjn9H3mDojNLeJ8V\/mkaNJ6PpRMn+hPi421eewvfCeRxxjZTbFs8cyp5Xo7O8JDX+Sy2nZNHlGo565hs7pmS6YzQa0qPDm1OjwsC8z+JIs6izdlR+7Dsxf3vuZ0vkj1F6CzHlyklfgbfQ0LBCxFIVMuRXZq0efOogUAC7fFDr2H3gwwk7MNslGKQvNwwqCwBcNXtU9VeEh7fFNwtfXU6FJJbxZJSvweLbuU3RXOITrp+ubPFElB4ySLKIRIYmkK\/o0XrRFJ7aU\/QF97zE5D9LhQ2ZJenA0HB+WivcHitrFRl6rNopnnt1YyYSPSrtwrLf\/iS6ZMsSv7GohuMM1WWGcj4A1tb40pSjCCpmU6C9fXpoXrmMcoSVkjHT5pTnNSWX62M2teUBMYv72SD5HZD4fkLtAJ9jvs9hD2+HB57HGrKxPpwSOJrV+lVZsw07FKybAMG6dt498jMVTMuGkmxOhqAkOvfL5TYZXbdJYPX793vkUvskuwlRzGnr0uqWv7n7tl0s0AFQFgAAHBORqpVuFDr6SQ2GzSruGhfQudju+1OqTvjOMem6nt7CHJH1uO9h7xSPy+gYtek6OYYslo+Rq2T7TdDOwgqkd5tGk6D2WtUyp\/qMmVzknmNFX0Wgfm5tUMZGHQzfBZowmuAPLvrzmASOpZJ1dLntMboVCCn0fuJRGrjvl3qX2+MasnDq334tP9puwTZuzVhLQ7ixHq7kLvv8MZozW6BHgs9ACFJnrxciZEWecIHD3b+CdcOlY2fbUKKn0mVomEQ5h9RdVRwOYU3GEs9QWEczR8Va9kfBNl3kRRJJIoWWHx3SOPl5yGysfxASXgPEfQT7Z87cAGB6L4Si89lGsGciAf4DHIdqwBPCI1FhhcYQPsbL60O7dkZomt0d1iRsm0dVPJil9GRL36+PV1GMDbFiK9gQ0f6eBKZBVPc8TatMnHamq2XDmisnUiFmksIIQtT4EHkERXNNt1iP4J7XO1lQp8PFm6yTYLMFFUFo+jcDNkZTrKp5IbmXCS0nRnTGuLsU0uEREWleHZcql283MlL\/e6rIy54+o2wkAcNSM9zlCTOujoemZ4SJHNkaESf3hos\/4ZXW7bQZ5ELmAv4af2DtYkl56k9NPtBL1oXFgEIx21OL60ndj+vhTk4glqGQQxGtw80ow5FyfKOrV\/GeqagWDL5wnWbVvpKbzWQ1QR302koISgC2bH2oTRYr3MS0aiwsfhOfxuH9WMLUfPf9fxQCxxeZL1zzcoHFiS4+gdGp1Ili7QpPDGAXJGd02dlKw0XVHedO0CauQInyxa+xyDQnE4TZoVGWLeDcrlHjQO\/g85Jp2GLwFn2VCC3zJ3GkWGA+3rNLZZALog3MTd6h0tSeBSbF0Na+A+GYeyel26WjzD7NhlkdY2cIyAijewEh\/musEgPRrLzv+3\/qRHtAKtEITeaIV2t\/iNwyK1yAhM1iZYGTrG5xXxEcMnmnaMWRhRfVIGZd6HjTXPZU5ayazspue0Q4+eSvVaPctLmQrikSdTAsn7P4KRzypXrrWMZ20lasLzdiLmH8qavjwUu4wG0OuwvGLqftcJtoHEoH4ClXf7vri8N3xNZR4CRETDzMhML6MzY74ZK1McyMo6xlnuSFrUgOVpnIl6e2QMdz7xUylB6burCR8mWCg26OnX0k01AllSh+f0KD5lkeH9IyCSNzBtkfq2UzIFI1RYlL4R1fNKl6+3F4PQZacpY2mMwM08VK+QL6TlVNpotpBI5KRGOR\/GlpJdTjrtRSAfaXfsMW8+U8AO8dm2rMNb1gRfgj76qzSp3W3xzPURYb4F+yxYZhiFS+lcUbRrrEwE\/V8VudRcQeAoFwBMlQBj5+g5DcAO+IzqHLxNb91XgHL2JsFJzgie2KxWwgWRxeen5LueTFBjKa22AE5ktaCc\/\/Xb1ymVCsi20aqL77nTY8LtTxImyScEXUKXZYz7XjQt+XcV0e4jKomtmcN2gJDw3CEr0HFMJeaT6eIlg5NJRUUtiO9WaO5\/T\/30lLuovz+\/sTK+lBmLclWk6Ttqi1oFJ4cmIqTwloIQzFy9S9JqeFmZ\/qmnGItbIrxjo+Q7zrSHZ1uVWUye5SWPIcXAEjaPSDqKeBRyYhtx6hUsPIEW8wEDrcPYgajS7xnnA+drPzMRpQ==" 895 | 896 | 897 | productUUID = "e1cf9e72-7020-5e4c-84b6-199bc60c88e1" 898 | skuUUID = "4d4bd851-5ab6-5643-bcc1-7930256c5ca9" 899 | retail = 250 900 | 901 | accountInfos(s,proxy) 902 | retrievePayMethods(s,proxy,{}) 903 | 904 | CC_UUID = setPayment(s,proxy,profile) 905 | retrievePayMethods(s,proxy,{}) #todo16 906 | 907 | liveStock(s,proxy,productUUID) 908 | launchID = getLaunchID(s,proxy,productUUID) 909 | co1(s,proxy,retail,productUUID) 910 | shippingUUID = co2(s,proxy,productUUID,skuUUID,profile) 911 | checkoutUUID = co3(s,proxy,skuUUID,profile,shippingUUID,deviceId) 912 | status = co4(s,proxy,checkoutUUID) 913 | if(status): 914 | log("Completed checkout phase, going to payment phase") 915 | userCheck(s,proxy,"123456") 916 | paymentUUID = pay1(s,proxy,retail,productUUID,profile,checkoutUUID)#,paymentInfo) #item_uuid profile paymentInfo 917 | status2 = pay2(s,proxy,paymentUUID) 918 | if(status2): 919 | log("Completed payment phase, going to entry phase") 920 | entryUUID = entry1(s,proxy,profile,deviceId,checkoutUUID,paymentUUID,skuUUID,PCS,launchID) # sku uuid launchid pricecheksum 921 | log("Entry id: " + entryUUID) 922 | 923 | log("Waiting for draw to end, will scrape results later...") 924 | schedule(datetime.datetime.now().hour,30,30) 925 | 926 | response = entry2(s,proxy,entryUUID) 927 | 928 | while(response == 'wait'): 929 | if (response != 'wait'): 930 | if (response != 'looser'): 931 | log("Winner! Check your mail!") 932 | exit(0) 933 | else: 934 | log("No win, maybe next time!") 935 | exit(0) 936 | reponse = entry2(s,proxy,entryUUID) 937 | 938 | --------------------------------------------------------------------------------