I fumbled around and got to the point that there is a site called bad request. So there are more than one redirectors.
Code:
email = myName
password = myPassword
RunWait, %comspec% /c curl -c cookies.txt -L -d "continue=https`%3A`%2F`%2Fwww.google.com`%2Fadsense`%2Flogin-box-gaiaauth&followup=https`%3A`%2F`%2Fwww.google.com`%2Fadsense`%2Flogin-box-gaiaauth&service=adsense&nui=15&fpui=3&ifr=true&rm=hide<mpl=login&hl=en_US&alwf=true&GA3T=51EAgi91cOM&GALX=y8ihavHhm6w&Email=%email%&Passwd=%password%&null=Sign+in" https://www.google.com/accounts/ServiceLoginBoxAuth -k > login.html
Results in
login.htmlQuote:
<html>
<head>
<script language="JavaScript" type="text/javascript">
<!--
function doRedirect(url) {
open(url, "_top");
}
-->
</script>
<script language="JavaScript1.4" type="text/javascript">
<!--
function doRedirect(url) {
try {
open(url, "_top");
} catch (xcp) {
insertContinueLink();
}
}
-->
</script>
<script language="EcmaScript" type="text/javascript">
<!--
function doRedirect(url) {
try {
open(url, "_top");
} catch (xcp) {
insertContinueLink();
}
}
-->
</script>
<script type="text/javascript">
<!--
var firsttime = "firsttime";
var goback = "goback";
var gofwd = "gofwd";
function redirect() {
var url = 'https:\x2F\x2Fwww.google.com\x2Faccounts\x2FTokenAuth?continue=https%3A%2F%2Fwww.goo.....';
var state = document.dummyform.dummyfield.value;
var lastUrl = document.dummyform.dummyfield2.value;
if ((state == firsttime) || (url != lastUrl)) {
// First time visit or passive login
document.dummyform.dummyfield.value = goback;
document.dummyform.dummyfield.defaultvalue = goback;
document.dummyform.dummyfield2.value = url;
document.dummyform.dummyfield2.defaultvalue = url;
doRedirect(url);
} else if (state == goback) {
// Remember that we should go forward next time and go backward.
document.dummyform.dummyfield.value = gofwd;
document.dummyform.dummyfield.defaultvalue = gofwd;
history.back();
} else if (state == gofwd) {
// Remember that we should go backward next time and go forward.
document.dummyform.dummyfield.value = goback;
document.dummyform.dummyfield.defaultvalue = goback;
history.forward();
}
}
// Tells the user we are waiting for the page to redirect
function insertLoadingMessage() {
document.getElementById("loadingDiv").style.visibility = "visible";
}
function insertContinueLink() {
document.getElementById("loadingDiv").style.visibility = "hidden";
document.getElementById("clickToContinue").style.visibility = "visible";
}
-->
</script>
</head>
<body onload="insertLoadingMessage();redirect();"
onpageshow="if (event.persisted) redirect();"
bgcolor="#ffffff" text="#000000"
link="#0000cc" vlink="#551a8b" alink="#ff0000"
dir="ltr">
<div id="loadingDiv"
style="visibility:hidden;font-size:75%;position:absolute;background:#c44;color:white;font-family:arial,sans-serif;width=0%;padding:2">
Loading...
</div>
<div style="visibility:hidden;position:relative;top:40px" id="clickToContinue">
<center><a target="_top" href="https://www.google.com/accounts/TokenAuth?continue=https%3A%2F%2Fwww.goo...." style="font-family: Arial, Helvetica, sans-serif; font-size: smaller;">Click here to continue</a></center>
</div>
<form name="dummyform" action="" >
<input name="dummyfield" value="firsttime" style="visibility:hidden" />
<input name="dummyfield2" value="" style="visibility:hidden" />
</form>
<noscript>
Please
<a href="https://www.google.com/accounts/TokenAuth?continue=https%3A%2F%2Fwww.goog...." target="_top">click here to continue</a>.
</noscript>
</body>
</html>
Code:
; Read out login.html, find the url and pass it
FileRead,Inhalt,login.html
StringGetPos,Start,Inhalt,<a href="https://www.google.com/accounts/TokenAuth?continue
StringGetPos,Ende,Inhalt,",,% Start + 13
StringMid,Inhalt,Inhalt,% Start + 10, % Ende - Start - 9
RunWait, %comspec% /c curl -b cookies.txt -L -k "%Inhalt%" > afterlogin.html
Results in
afterlogin.htmlQuote:
<html> <head> <title> Redirecting </title> <meta content="0; url='http://www.google.de/accounts/SetSID?ssdc=1&sidt=Lr4V5xUBAAA%3D.I7k....'" http-equiv="refresh"> </head> <body alink="#ff0000" text="#000000" vlink="#551a8b" link="#0000cc" bgcolor="#ffffff"> <script type="text/javascript" language="javascript"><!--
location.replace("http://www.google.de/accounts/SetSID?ssdc\u003d1&sidt\u003dLr4V5xUBAAA%3D.I7k....")
//--> </script> </body> </html>
Code:
;Read out afterlogin.html, find the url and pass it
FileRead,Inhalt2,afterlogin.html
StringGetPos,Start,Inhalt2,"http://www.google.de/accounts/SetSID
StringGetPos,Ende,Inhalt2,",,% Start + 1
StringMid,Inhalt2,Inhalt2,% Start + 2, % Ende - Start - 1
clipboard = curl -b cookies.txt -e "%Inhalt%" -L -k "%Inhalt2%" > afterafterlogin.html
RunWait, %comspec% /c %clipboard%
Results in
afterafterlogin.htmlQuote:
<HTML>
<HEAD>
<TITLE>Bad Request</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Bad Request</H1>
<H2>Error 400</H2>
</BODY>
</HTML>
OFFTOPIC: Is there a template for ahk syntax highlighting in proton available on board somewhere ?