added workaround to send text letter by letter when bitchute fails to input video title with javascript
This commit is contained in:
@@ -31,7 +31,7 @@ global FullScriptName
|
||||
|
||||
|
||||
ScriptName = Freedomain Video Uploader
|
||||
ScriptVersion = 3.19
|
||||
ScriptVersion = 3.20
|
||||
FullScriptName := ScriptName . " - " . ScriptVersion
|
||||
|
||||
|
||||
@@ -2979,24 +2979,42 @@ CheckForAlerts()
|
||||
Message = Inputting Title
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
; Try to input video title and if fail try to login again
|
||||
; Try to input video title, check if input and if not, try again
|
||||
loop, 5 {
|
||||
if(A_index = 5){
|
||||
try CurrentURL := driver.url
|
||||
; CurrentURL := ExtractBaseURL(URL)
|
||||
; currentTabURL := SubStr(currentTabURL, 1, 40)
|
||||
Message = Failed to input Video Title after %A_index% attempts.`nCurrent Tab URL: %currentTabURL%
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
|
||||
status := js_SendAndCheckWithQuerySelector(Selector:="#title",ValueToCheck:="value",SleepLength:=1000,JSStringText:=VideoTitle)
|
||||
; Msgbox % "status: " status
|
||||
|
||||
if(!Status)
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
if(Status){
|
||||
Message = Failed to input Video Title with Javascript. Trying again with Manual Typing
|
||||
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
Xpath = //input[@id='title']
|
||||
Status := Selenium_TypeTextIntoElement(VideoTitle, Xpath)
|
||||
if(Status){
|
||||
Message = Failed to Input Video Title after trying two different ways. Please try Upload again and double check that the website hasn't been updated in a major way.
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar, DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
|
||||
try, TextInputted := driver.findelementbyxpath(Xpath).Attribute("value") ;XPath: ID=site-title & span tag
|
||||
if(InStr(VideoTitle, TextInputted) OR VideoTitle = TextInputted){
|
||||
; Title got input successfully
|
||||
}
|
||||
else, {
|
||||
Message = Title that got input into Bitchute: %TextInputted%
|
||||
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
Message = Failed to Input Video Title after trying two different ways. Please try Upload again and double check that the website hasn't been updated in a major way.
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar, DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user