Reworked Dailymotion description inputting
This commit is contained in:
@@ -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.
|
||||||
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
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
sleep, 500
|
; Return
|
||||||
; 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
|
|
||||||
|
|
||||||
js = document.querySelector("textarea[placeholder='Enter a description']").value = "%JSVideoDescription%";
|
|
||||||
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, 15000 ; Description dissapears for some reason instantly after inputting sometimes
|
|
||||||
try Description := driver.findElementsByName("description").item[1].Attribute("value")
|
|
||||||
if(strlen(Description) 10){
|
|
||||||
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){
|
|
||||||
; Clipboard := VideoDescription
|
|
||||||
Message = Upload Failed (E#7899): Failed to Input video description
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
SaveDriverURLOFErrorPage()
|
SaveDriverURLOFErrorPage()
|
||||||
Return ; Kick out of the gosub
|
Return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try Description := driver.findElementsByName("description").item[1].Attribute("value")
|
; click into element
|
||||||
if(StrLen(Description) > 10){
|
Xpath = //textarea[@placeholder='Enter a description']
|
||||||
SaveOrPostProgress(Message:="Description was input successfully",PostType:="Tooltip")
|
driver.FindElementByXPath(Xpath).click()
|
||||||
Break ; break out of the loop
|
|
||||||
|
; inut description with javascript
|
||||||
|
js = document.querySelector("textarea[placeholder='Enter a description']").value = "%JSVideoDescription%";
|
||||||
|
try driver.executeScript(js)
|
||||||
|
|
||||||
|
sleep, 1000
|
||||||
|
|
||||||
|
; send a space and then backspace so element registers the input
|
||||||
|
Xpath = //textarea[@placeholder='Enter a description']
|
||||||
|
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.SPACE)
|
||||||
|
|
||||||
|
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.BackSpace)
|
||||||
|
|
||||||
|
|
||||||
|
js = return document.querySelector("textarea[placeholder='Enter a description']").textContent;
|
||||||
|
try, InputDescription := driver.executeScript(js)
|
||||||
|
|
||||||
|
; if input description is less than 15 chars, try again
|
||||||
|
if(StrLen(InputDescription)<15){
|
||||||
|
Continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
; DevModeMsgBox("done")
|
; DevModeMsgBox("done")
|
||||||
|
|||||||
Reference in New Issue
Block a user