Jump to content

YouTube Login (again...)


arryo
 Share

Recommended Posts

Hello,

I have here my YouTube Script which should work succesfull:

#include <IE.au3> 
$acc = "MyAcc" ; change it perhaps if you want to try it.
$pw = "Iwonttell" ; change it perhaps if you want to try it.
$login = "Unknown"

$checklogin1 = _IECreate("www.youtube.com")
$check =_IEPropertyGet ($checklogin1, "locationname")
_IENavigate ($checklogin1, "http://www.youtube.com/login")

$oForm = _IEFormGetObjByName($checklogin1, "gaia_loginform")

$oUsername = _IEFormElementGetObjByName($oForm, "Email")

_IEFormElementSetValue($oUsername, $acc)

$oPasswd = _IEFormElementGetObjByName($oForm, "Passwd")

ToolTip("1",0,0)
_IEFormElementSetValue($oPasswd, $pw)

Sleep(2000) ; perhaps useless?
ToolTip("2",0,0)
_IEFormSubmit($oForm) ; HERE IT PAUSES FOR SOME REASONS THE SCRIPT!
ToolTip("2.5",0,0)
Sleep(5000) ; perhaps useless?

ToolTip("3",0,0)




ToolTip("4",0,0)
If _IEPropertyGet($checklogin1, "locationname") = "YouTube - "&$acc&"'s YouTube - Windows Internet Explorer" Then
    ToolTip("5",0,0)
$login = "Success!"
Else
    ToolTip("6",0,0)
$login = "Failed!"
EndIf

Msgbox(1, "lol", $login)

Sleep(1000) ; useless. just for tests.

ToolTip("7",0,0)
_IEQuit ($checklogin1)

MsgBox(1, "lol", "Finished!")

The problem is definitely _IEFormSubmit($oForm). Any Solutions?

(This Script only works if you are not logged in in Youtube).

Link to comment
Share on other sites

#include <IE.au3>

Local $oUser, $oPass, $oSubmit
Local $sUser = "testUsername"
Local $sPass = "testPassword"
Local $url = "http://www.youtube.com/login"
Local $oIE = _IECreate($url, 1)

_IELoadWait($oIE)

$oInputs = _IETagNameGetCollection($oIE, "input")
for $oInput in $oInputs
    if $oInput.type = "text" And $oInput.name = "Email" And $oInput.id = "Email" And $oInput.size = "18" Then $oUser = $oInput
    if $oInput.type = "password" And $oInput.name = "Passwd" And $oInput.id = "Passwd" And $oInput.size = "18" Then $oPass = $oInput
    if $oInput.type = "submit" And $oInput.name = "signIn" And $oInput.value = "Sign in" Then $oSubmit = $oInput
    if IsObj($oUser) and IsObj($oPass) and IsObj($oSubmit) then ExitLoop
Next

$oUser.value = $sUser
$oPass.value = $sPass
_IEAction($oSubmit, "click")

_IELoadWait($oIE)

[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...