I have a doubt. I'm creating a script that lists all classic servers when logging into Minecraft.net. However, my script simply reroutes me to minecraft.net/login when I run it. What I have thus far is as follows:
import urllib2
import urllib
import re
url = "https://www.minecraft.net/login"
page = urllib2.urlopen(url)
data = page.read()
page.close()
authToken = re.search('name="authenticityToken"[\s]+value="(.+)"', data).group(1)
data_dict = {
"username": "USERNAME",
"password": "PASSWORD",
"remember": "true",
#"redirect": "https://www.minecraft.net",
"authenticityToken": authToken
}
print urllib.urlencode(data_dict)
req = urllib2.Request(url, data=urllib.urlencode(data_dict))
page = urllib2.urlopen(req)
data = page.read()
page.close()