From 60dcbb64d8202b96550e464ca391a8e96ad52df9 Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 9 Nov 2020 08:35:24 +0100 Subject: [PATCH] Update Adidas endpoints --- sites/adidas.json | 37 ++++++++++++++++++++++++------------- src/proxy.py | 12 ++++++------ 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/sites/adidas.json b/sites/adidas.json index 3a2c444..98a3166 100644 --- a/sites/adidas.json +++ b/sites/adidas.json @@ -1,19 +1,30 @@ { "base": "https://www.adidas.de", "monitor": "https://www.adidas.de/release-termine", - "register": "https://www.adidas.de/account-register", + "register": { + "url" : "https://www.adidas.de/account-register", + "required-fields": { + "firstname": "registration-firstname-field", + "lastname": "registration-lastname-field", + "email": "registration-email-field", + "password": "registration-password-field", + "ageconfirm": "undefined-registration-ageconfirmation-field", + "gender": "gl-radio-input__input", + "submit": "registration-submit-button" + } + }, "headers": { - "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36", - "referer": "https://www.adidas.de/account-login", - "accept-encoding": "gzip, deflate, br", - "accept-language": "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7", - "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", - "cache-control": "max-age=0", - "sec-fetch-dest": "document", - "sec-fetch-mode": "navigate", - "sec-fetch-site": "same-origin", - "sec-fetch-user": "?1", - "upgrade-insecure-requests": "1", - "dnt": "1" + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36", + "referer": "https://www.adidas.de/account-login", + "accept-encoding": "gzip, deflate, br", + "accept-language": "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7", + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + "cache-control": "max-age=0", + "sec-fetch-dest": "document", + "sec-fetch-mode": "navigate", + "sec-fetch-site": "same-origin", + "sec-fetch-user": "?1", + "upgrade-insecure-requests": "1", + "dnt": "1" } } \ No newline at end of file diff --git a/src/proxy.py b/src/proxy.py index 4e0eb9e..3857114 100644 --- a/src/proxy.py +++ b/src/proxy.py @@ -76,13 +76,13 @@ class Proxy: def testurl(self, siteobj): self.session.headers = siteobj.headers - url = siteobj.register + url = siteobj.register['url'] - print(f"Starting URL Test {url}") - print(self.isworking) - print(self.session) + print(f"Starting URL Test: {url}") + print(f"Is working: {self.isworking}") if self.isworking: r = self.session.get(url, timeout=10) - print(r) + print(f"Statuscode: {r.status_code}") data = r.text - print(data) + with open("webd.html", 'w', encoding='utf-8', errors='ignore') as f: + f.write(data)