Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/19/2016 in all areas

  1. trancexx

    WinHttp redirection

    Try adding "https://" before "accounts.google.com" to force secure connection. Maybe it's security issue. You don't need session alive. Just repeat everything. Cookies aren't persistent with WinHttp and there shouldn't be problems. If you insist, just don't close $hOpen and reuse it later (until server kills it). One more thing... You aren't ever closing $hConnNew. That's memory leak.
    2 points
  2. As always: The help file and the wiki are your best friends
    2 points
  3. NatalyB

    WinHttp redirection

    @trancexx Thanks for the input again. Tried to put the "https://" before and i'm still getting error 4, dont know why. Is my aproach wrong? I also tried another thing, to login the main google acc website and then go to the website and check if it would work, but still gives me error. To confirm if i could do that i tried first with the youtube, but when i check after connecting to the youtube url i saw that i was not logged. The code i used: #include "WinHttp.au3" Global $sRead, $hOpen, $hConnect, $hConnNew, $sActionPage, $sUsername, $sPassword, $sUrl Global $hConnect2, $hRequest2, $sChunk, $sData $sUsername = "Email" $sPassword = "Password" $sUrl = "https://accounts.google.com" ;$sActionPage = "ServiceLogin?service=ah&passive=true&continue=https%3A%2F%2Fappengine.google.com%2F_ah%2Fconflogin%3Fcontinue%3Dhttps%3A%2F%2Fwww.raterhub.com%2F&ltmpl=gm&shdf=ChULEgZhaG5hbWUaCVJhdGVyIEh1YgwSAmFoIhThoWkIjshJkJPbt1Ui-tTuWDmknygBMhSVMFKrRs3jzf4xp8WmlV9ZQ5N-cw#identifier" $sActionPage = "ServiceLogin?passive=1209600&continue=https%3A%2F%2Faccounts.google.com%2FManageAccount&followup=https%3A%2F%2Faccounts.google.com%2FManageAccount#identifier" $hOpen = _WinHttpOpen() $hConnect = _WinHttpConnect($hOpen, $sUrl) $sRead = _WinHttpSimpleFormFill($hConnect, _ $sActionPage, "gaia_loginform", _ "name:Email", $sUsername, _ "type:submit", 0) $hConnNew = $sRead $sHTM = _WinHttpSimpleFormFill($hConnNew, _ $hOpen, "gaia_loginform", _ "name:Passwd", $sPassword, _ "type:submit", 0) If @error Then MsgBox(0, "Error", "Error: " & @error) Else ConsoleWrite(@CRLF & $sHTM & @CRLF & @CRLF) EndIf $hConnect2 = _WinHttpConnect($hOpen, "youtube.com") ; Specify the reguest $hRequest2 = _WinHttpOpenRequest($hConnect2) ; Send request _WinHttpSendRequest($hRequest2) ; Wait for the response _WinHttpReceiveResponse($hRequest2) ; Check there is data available... If _WinHttpQueryDataAvailable($hRequest2) Then ; Read While 1 $sChunk = _WinHttpReadData($hRequest2) If @error Then ExitLoop $sData &= $sChunk WEnd ConsoleWrite("###########################################################################") ConsoleWrite(@CRLF & @CRLF & @CRLF & $sData & @CRLF) ; print to console Else MsgBox(48, "Error", "Site is experiencing problems.") EndIf _WinHttpCloseHandle($hConnect2) _WinHttpCloseHandle($hRequest2) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hConnNew) _WinHttpCloseHandle($hOpen) Exit @BetaLeaf Thanks. I'm learning a lot. I must confess, for a person who knows nothing of programming it is a challenge. But i will get there.
    1 point
  4. You should re read my previous post - as was edited before you post your answer.
    1 point
  5. How you think for what purpuoses I use this variable name : $oIE_Div ?? Btw. I not tested my example so if this should not work you can just simply do it like this: Local $oIE_Div = _IEGetObjById($oIE,'blah') ConsoleWrite($oIE_Div.innertext & @CRLF) or Local $oIE_Div = _IEGetObjById($oIE,'results') ConsoleWrite($oIE_Div.innertext & @CRLF) mLipok
    1 point
  6. trancexx

    WinHttp redirection

    Where do you actually use the action page? Try it like this: #include "WinHttp.au3" Global $sRead, $hOpen, $hConnect Global $sUsername, $sPassword $sUsername = "Email" $sPassword = "Password" Global $sUrl = "https://accounts.google.com/" $sActionPage = "ServiceLogin?hl=pt-BR&uilel=3&service=youtube&passive=true&continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Ffeature%3Dsign_in_button%26next%3D%252F%26hl%3Dpt%26action_handle_signin%3Dtrue%26app%3Ddesktop#identifier" $hOpen = _WinHttpOpen('Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0'); create new session $hConnect = _WinHttpConnect($hOpen, $sUrl) $sRead = _WinHttpSimpleFormFill($hConnect, _ $sActionPage, "gaia_loginform", _ "name:Email", $sUsername, _ "type:submit", 0) $hConnNew = $sRead $sHTM = _WinHttpSimpleFormFill($hConnNew, _ $hOpen, "gaia_loginform", _ "name:Passwd", $sPassword, _ "type:submit", 0) If @error Then MsgBox(0, "Error", "Error: " & @error) Else ConsoleWrite(@CRLF & $sHTM & @CRLF & @CRLF) EndIf _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) Exit Do you see the difference? Btw, why that user agent string?
    1 point
  7. NatalyB

    WinHttp redirection

    Hi BetaLeaf. Thanks for the input. I can make the loop part using your suggestion. But im still struggling to get the "auto redirection" that happens when you paste that URL into a browser and login, or even make another _WinHttpConnect() to the desired website (but this needs to be in the same session because the website requires you to be logged). Thanks again.
    1 point
  8. czardas, Added 'sus' in the pattern I know that my little code (and so Malkey's) is raw and incomplete, as I said it doesn't pretend to be fully comprehensive but it should work in the limits of the requirements defined by the title of the thread Obviously as I'm not a professional musician your comments are welcome, so would be some from wysocki to refine the code to better fit their needs if necessary BTW "no hints on that one" ? you rascal, you make our mouthes water
    1 point
  9. @mikell Another common chord type uses 'sus': it should be included. I'm wondering what happened to wysocki, did they get the answer they wanted? Some aspects of my own project are far in advance of many similar commercial music programs on the market, and I am reluctant to give freebies to lazy companies who can't be bothered to employ professional musicians to develop their apps, which seems frequently to be the case. I'm happy to give hints here and there for simple things like this, so please don't get me wrong. One day I'm going to release an amazing program, the likes of which nobody has seen - no hints on that one!
    1 point
  10. Read https://www.autoitscript.com/wiki/Managing_Multiple_GUIs
    1 point
  11. EmilyLove

    WinHttp redirection

    For point 2, see adlibregister. https://www.autoitscript.com/autoit3/docs/functions/AdlibRegister.htm
    1 point
×
×
  • Create New...