Created
December 17, 2016 10:47
-
-
Save naasfu/d8f5e0850080595a3fa7884374b671fa to your computer and use it in GitHub Desktop.
///-washed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import requests | |
import sys | |
import time | |
import os | |
import lxml.html | |
from lxml.cssselect import CSSSelector | |
session = requests.Session() | |
user_agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:50.0) Gecko/20100101 Firefox/50.0" | |
session.headers["User-Agent"]=user_agent | |
proxies={"http":"http://user:password@ip:port/", | |
"https":"http://user:password@ip:port/"} | |
proxies=None | |
imageDomain="it" | |
cartingDomain="ca" | |
response=session.get(url="http://www.adidas.com/"+imageDomain+"/apps/yeezy/",proxies=proxies,allow_redirects=False) | |
root = lxml.html.fromstring(response.text) | |
hmacURL=root.cssselect("img")[-1].get('src') | |
print () | |
print(hmacURL) | |
print () | |
url=hmacURL.replace("m.adidas."+imageDomain,"m.adidas."+cartingDomain).replace("www.adidas."+imageDomain,"www.adidas."+cartingDomain) | |
print () | |
print (url) | |
print () | |
response=session.get(url=url,proxies=proxies) | |
print (response.headers['Set-Cookie']) | |
cookies=response.cookies.get_dict() | |
futureTimestamp=cookies['gceeqs'].split("~")[0].split("=")[-1] | |
timestamp=str(int(futureTimestamp)-600) | |
print (timestamp) | |
print (futureTimestamp) | |
print (cookies['gceeqs']) | |
print (cookies['gceeqs'].split("=")[-1]) | |
print () | |
print () | |
print ("Paste url into browser: \n" + url) | |
print () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment