Reworked Rumble login check

pull/2/head
Yuriy 2 years ago
parent 2eb5f5abad
commit 961fd8bd2e

@ -4929,19 +4929,60 @@ if(Status)
*/ */
Loop, 2 { Message = Checking Login Status
Xpath = //input[@name='Filedata'] SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoFilepath)
if(Status){ try CurrentURL := driver.URL
Message = Trying to Log Back In if(InStr(CurrentURL, "/login.php")){
; AutoLogin := 1
; Msgbox % "AutoLogin: " AutoLogin
if(AutoLogin){
Message = Logging in Automatically by clicking into the UN+PW fields for info to register
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; have to click into username and password field for page to register that there's input
; clicking with JS doesn't make it register, but with xpath selenium it does
Xpath = //input[@id='login-username']
driver.FindElementByXPath(Xpath).click()
Xpath = //input[@id='login-password']
driver.FindElementByXPath(Xpath).click()
js = document.querySelector("button[type='submit']").click();
driver.executeScript(js)
; Do a double check to make sure that login worked
Message = Checking Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = //button[normalize-space()='Sign in'] try CurrentURL := driver.URL
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
sleep, 5000 if(!InStr(CurrentURL, "/upload")){
Continue Message = Failed to log back in. Please Log Back In Manually
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
} }
else, { ; notify user and return
Message = Login Expired. Please Log Back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
} }
; Input Title ; Input Title
try driver.findElementsByName("title").item[1].SendKeys(VideoTitle) ;selects element based on Name and sends variable to it. try driver.findElementsByName("title").item[1].SendKeys(VideoTitle) ;selects element based on Name and sends variable to it.
catch e { catch e {

Loading…
Cancel
Save