Reworked Dailymotion description inputting

pull/2/head
Yuriy 2 years ago
parent 67291b5763
commit 2eb5f5abad

@ -3061,7 +3061,6 @@ if(InStr(CurrentTab, "login")) ; we're logged out
Xpath = //div[@class='overlay__close inside'] Xpath = //div[@class='overlay__close inside']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=100) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=100)
; Try clicking the login button, sometimes this will auto log you back in without having to input credentials ; Try clicking the login button, sometimes this will auto log you back in without having to input credentials
xpath = //a[normalize-space()='Log In'] xpath = //a[normalize-space()='Log In']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=100) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=100)
@ -3690,45 +3689,45 @@ if(StrLen(DailyMotionJSDescription) > 3000){
Message = Inputting Video Description Message = Inputting Video Description
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Loop, 15 { ; make a couple attempts to input description Loop, 5 { ; make a couple attempts to input description
Message = Video Description Input Attempt Number: %A_index%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; TooltipThis("Inputting Video Description") if(A_index = 5){
Message = Failed to input Description after %A_index% attempts.
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
; Return
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
try driver.findElementsByName("description").item[1].SendKeys(driver.Keys.Space) ; send an ENTER keystroke to make it register that data has been input and refresh
sleep, 500
; Clear any text from a previous loop
try driver.findElementsByName("description").item[1].clear()
; try driver.findElementsByName("description").item[1].SendKeys(driver.Keys.SPACE) ;;Clicks Item based on the Element Name ; click into element
Xpath = //textarea[@placeholder='Enter a description']
driver.FindElementByXPath(Xpath).click()
; inut description with javascript
js = document.querySelector("textarea[placeholder='Enter a description']").value = "%JSVideoDescription%"; js = document.querySelector("textarea[placeholder='Enter a description']").value = "%JSVideoDescription%";
try driver.executeScript(js) try driver.executeScript(js)
; try driver.findElementsByName("description").item[1].SendKeys(driver.Keys.Space) ; send an ENTER keystroke to make it register that data has been input and refresh sleep, 1000
sleep, 15000 ; Description dissapears for some reason instantly after inputting sometimes ; send a space and then backspace so element registers the input
try Description := driver.findElementsByName("description").item[1].Attribute("value") Xpath = //textarea[@placeholder='Enter a description']
if(strlen(Description) 10){ try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.SPACE)
try driver.findElementsByName("description").item[1].SendKeys(driver.Keys.Space) ; send an ENTER keystroke to make it register that data has been input and refresh
Break ; break out of the loop
}
if(A_index = 10){ try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.BackSpace)
; Clipboard := VideoDescription
Message = Upload Failed (E#7899): Failed to Input video description
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return ; Kick out of the gosub
}
try Description := driver.findElementsByName("description").item[1].Attribute("value") js = return document.querySelector("textarea[placeholder='Enter a description']").textContent;
if(StrLen(Description) > 10){ try, InputDescription := driver.executeScript(js)
SaveOrPostProgress(Message:="Description was input successfully",PostType:="Tooltip")
Break ; break out of the loop ; if input description is less than 15 chars, try again
if(StrLen(InputDescription)<15){
Continue
} }
} }
; DevModeMsgBox("done") ; DevModeMsgBox("done")

Loading…
Cancel
Save