Skip to content

Instantly share code, notes, and snippets.

@JamesWCCheng
Created February 3, 2016 06:28
Show Gist options
  • Save JamesWCCheng/70ddd97bbe63c6a1bc63 to your computer and use it in GitHub Desktop.
Save JamesWCCheng/70ddd97bbe63c6a1bc63 to your computer and use it in GitHub Desktop.
print "hello"
import httplib, urllib
hexstring = "436c6f4b54416741456b67414141414341414152585139614c34554a75784d576b3656424a744a6d5146764447354b4376726e656b56725656454c677532555152424f6469315141747875544231455369754856364c434b62597958346876724a523130556c5f6b5a35675342434c7472584d614241674145674153494b79712d734c786b676d31486b36506e336d6a4d42593945435978526e72644f6e4552354c67384c2d4f31"
hexdata = hexstring.decode("hex")
bytedata = bytearray(hexdata)
base64data = "NDM2YzZmNGI1NDQxNjc0MTQ1NmI2NzQxNDE0MTQxNDM0MTQxNDE1MjU4NTEzOTYxNGMzNDU1NGE3NTc4NGQ1NzZiMzY1NjQyNGE3NDRhNmQ1MTQ2NzY0NDQ3MzU0YjQzNzY3MjZlNjU2YjU2NzI1NjU2NDU0YzY3NzUzMjU1NTE1MjQyNGY2NDY5MzE1MTQxNzQ3ODc1NTQ0MjMxNDU1MzY5NzU0ODU2MzY0YzQzNGI2MjU5Nzk1ODM0Njg3NjcyNGE1MjMxMzA1NTZjNWY2YjVhMzU2NzUzNDI0MzRjNzQ3MjU4NGQ2MTQyNDE2NzQxNDU2NzQxNTM0OTRiNzk3MTJkNzM0Yzc4NmI2NzZkMzE0ODZiMzY1MDZlMzM2ZDZhNGQ0MjU5Mzk0NTQzNTk3ODUyNmU3MjY0NGY2ZTQ1NTIzNTRjNjczODRjMmQ0ZjMx"
url = "www.googleapis.com/certificateprovisioning/v1/devicecertificates/create?key=AIzaSyB-5OLKTx2iU5mko18DfdwK5611JIjbUhE"
params = urllib.urlencode({'@signedRequest': hexdata})
headers = {"Content-type": "application/json",
"Accept": "*/*",
"User-Agent": "Widevine CDM v1.0"}
conn = httplib.HTTPSConnection(url)
conn.request("POST", "", params, headers)
response = conn.getresponse()
print response.status, response.reason
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment