commented out devmsgboxes that are no longer needed, added some extra error status messages

pull/2/head
Yuriy 2 years ago
parent fe72cc1c35
commit 1f9ce32649

@ -2959,6 +2959,7 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
}
CheckForAlerts()
Message = Inputting Title
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@ -2983,6 +2984,10 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
}
Message = Inputting Description
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; trim description if it's too long
BitchuteDescription := VideoDescription
if(StrLen(BitchuteDescription) > 2995){
@ -2992,8 +2997,6 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
else,
JSBitchuteDescription := FormatTextToJSText(BitchuteDescription)
Message = Inputting Description
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Loop, 10 { ; Attempt to input video description a couple of times
Message = Inputting Description. Attempt #%A_index%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@ -3260,7 +3263,7 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
if(InStr(CurrentTab, "login")) ; we're logged out
{
Message = Closing out of any popups that might appear on loin page
Message = Currently Logged Out`nClosing out of any popups that might appear before clicking Login button
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //body/div[@id='__next']/div[@id='modal-root']/div[2]/div[1]/div[1]//*[local-name()='svg']
@ -3276,7 +3279,7 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
; Try clicking the login button, sometimes this will auto log you back in without having to input credentials
xpath = //a[normalize-space()='Log In']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=100)
DevModeMsgBox(Status)
; DevModeMsgBox(Status)
Message = Checking Login Status
@ -3318,6 +3321,9 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
Message = Navigating to Upload Page
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Navigate to Upload Page
try driver.executeScript("window.location = 'https://www.brighteon.com/dashboard/video-upload'") ;navigate using javascript
@ -3327,6 +3333,11 @@ try driver.executeScript("return document.readyState").equals("complete")
Xpath = //body/div[@id='__next']/div[@id='modal-root']/div/div/div[1]//*[local-name()='svg']
try driver.FindElementByXPath(Xpath).click()
CheckForAlerts()
Message = Uploading Video
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Upload Video
Xpath = //input[@type='file']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoFilepath)
@ -3345,26 +3356,32 @@ loop, 3 {
Return
}
; Input Title of the Video
Xpath = /html/body/div/section[2]/div[2]/div/form/div[1]/div[1]/div[2]/div[1]/div/input
Xpath = //input[@id='name']
try driver.FindElementByXPath(Xpath).SendKeys(VideoTitle) ;Sends Variable to an Xpath Item
; click into keyword box to get focus away from title element and see if the video title registers with website
xpath = //input[@id='keywords']
try driver.FindElementByXPath(Xpath).click()
sleep, 500
; check if title got input
js = return document.querySelector("#name").value;
try, status := driver.executeScript(js)
if(status = ""){
Message = Failed to input Title
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
if(status = "")
continue
}
js = return document.querySelector("#name").value;
try, status := driver.executeScript(js)
Message = Title that got input: %status%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
break
}
; Msgbox % "status: " status
TooltipThis("Inputting Video Description")
@ -3373,7 +3390,7 @@ TooltipThis("Inputting Video Description")
; Attempt to input video description a couple of times
Loop, 10 {
Message = Inputting Description. `nAttempt Number: %A_index%
Message = Inputting Description. Attempt Number: %A_index%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="DiscordErrorLogging")
@ -3469,7 +3486,6 @@ Loop, 5 {
; double check on video description after inputting tags
js = return document.querySelector("div[class='e-content e-lib e-keyboard'] p").innerText;
try Input_Description := driver.executeScript(JS) ;Execute Javascript
DevModeMsgBox(Input_Description)
; if text in description box is longer than x chars, then description input worked
if(StrLen(Input_Description) > 5){
@ -3667,6 +3683,7 @@ try driver.executeScript("return document.readyState").equals("complete") ; wait
sleep, 1500
Message = Uploading Video
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
@ -4810,31 +4827,12 @@ sleep, 5000
Return
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
/*
; "Select Video to Upload" Button
Xpath = /html/body/main/div/div/div/section/form[1]/div/div[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message =Upload Skipped (E#6044)`nLogin Cookies have expired. Please Re-login
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Status := InputFilePathIntoOpenWindow(VideoFilepath)
if(Status)
{
Message = Upload Failed:`nUnable to Find "Open File" window to input filepath into
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
*/
Message = Checking Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
CheckForAlerts()
try CurrentURL := driver.URL
if(InStr(CurrentURL, "/login.php")){
@ -4886,9 +4884,11 @@ if(InStr(CurrentURL, "/login.php")){
sleep, 5000
}
CheckForAlerts()
Message = Uploading Video File
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //input[@id='Filedata']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoFilepath)

Loading…
Cancel
Save