Added extra error checks to DailyMotion

pull/2/head
Yuriy 2 years ago
parent 8cd2374736
commit 8cbb26bff2

@ -3674,9 +3674,12 @@ if(DailyMotionParnerUploadPage = ""){
} }
Status := NavigateFromBaseURLTo(DailyMotionParnerUploadPage,"Partner HQ - Dailymotion") Status := NavigateFromBaseURLTo(DailyMotionParnerUploadPage,"Partner HQ - Dailymotion")
if(Status) if(Status){
SaveDriverURLOFErrorPage()
Return Return
}
Message = Waiting for Page to Finish Fully Loading Message = Waiting for Page to Finish Fully Loading
SaveOrPostProgress(Message:=Message,PostType:="Tooltip") SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
@ -3765,9 +3768,6 @@ if(Status){
Message = Failed to Upload Thumbnail: Check Login Status Message = Failed to Upload Thumbnail: Check Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
} }
;
; Message = Inputting Video Details
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Message = Inputting Title Message = Inputting Title
@ -3784,7 +3784,6 @@ if(A_index = 5){
Return Return
} }
Xpath = (//input[@placeholder='Enter text'])[1] Xpath = (//input[@placeholder='Enter text'])[1]
try, driver.FindElementByXPath(Xpath).click() try, driver.FindElementByXPath(Xpath).click()
@ -3793,23 +3792,8 @@ try driver.executeScript(js)
Xpath = (//input[@placeholder='Enter text'])[1] Xpath = (//input[@placeholder='Enter text'])[1]
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.SPACE) try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.SPACE)
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.BackSpace) try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.BackSpace)
/*
Status := Selenium_LoopToSendValueByName(ElementName:="title",NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoTitle)
if(Status){
Message = Upload Failed: Check Login Status: Failed to Input Title
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
*/
; get text in title box and see if it matches video title ; get text in title box and see if it matches video title
js = return document.querySelector("input[placeholder='Enter text']").value; js = return document.querySelector("input[placeholder='Enter text']").value;
try CurrentTitle := driver.executeScript(js) try CurrentTitle := driver.executeScript(js)
@ -3819,9 +3803,6 @@ if(CurrentTitle != VideoTitle){
Message = Failed to input title on attempt %A_index% Message = Failed to input title on attempt %A_index%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
sleep, 1000 sleep, 1000
; DevModeMsgBox("title doesn't match")
; msgbox, title doesn't match
; continue
} }
else, else,
Break Break
@ -3903,6 +3884,7 @@ Loop, 3 {
if(A_index = 3){ if(A_index = 3){
Message = Failed to Select Education Category after %A_index% attempts Message = Failed to Select Education Category after %A_index% attempts
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return Return
} }
@ -3925,17 +3907,17 @@ Loop, 3 {
Message = Inputting Tags Message = Inputting Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; Append comma to end of tags
; DailyMotion page automtically splits the tags into their little boxes when they're seperated by commas
DailyMotionVideoTags := VideoTags . ","
; Msgbox % "VideoTags: " VideoTags
DailyMotionVideoTags := VideoTags . ",,"
Message = DailyMotion Video Tags: %DailyMotionVideoTags% Message = DailyMotion Video Tags: %DailyMotionVideoTags%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; DevModeMsgBox(DailyMotionVideoTags)
Xpath = //div[@class='ant-select-selection-search']//input[@role='combobox'] Xpath = //div[@class='ant-select-selection-search']//input[@role='combobox']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=DailyMotionVideoTags) Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=DailyMotionVideoTags)
; Msgbox % "Status: " Status
; double check the input
js = return document.querySelector("div[name='tags']").textContent; js = return document.querySelector("div[name='tags']").textContent;
try, inputTags := driver.executeScript(js) try, inputTags := driver.executeScript(js)
Message = Tags that got input: %inputTags% (Will be doubled b/c of js) Message = Tags that got input: %inputTags% (Will be doubled b/c of js)
@ -4109,7 +4091,7 @@ DailyMotionURL := StrReplace(ShareLink, "Share link: ","") ; remove the share li
Xpath = //button[@name='submit'] Xpath = //button[@name='submit']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){ if(Status){
Message = Failed to click Publish button Message = Video Uploaded but Failed to click Publish button
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
js = document.getElementsByClassName('ant-btn ant-btn-primary ant-btn-sm')[1].click(); js = document.getElementsByClassName('ant-btn ant-btn-primary ant-btn-sm')[1].click();
@ -4117,7 +4099,6 @@ if(Status){
} }
Message = Upload Complete: %DailyMotionURL% Message = Upload Complete: %DailyMotionURL%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
IniWrite, %DailyMotionURL%, %VideoLinksIniFile%, URLs, DailyMotionURL IniWrite, %DailyMotionURL%, %VideoLinksIniFile%, URLs, DailyMotionURL

@ -1 +1 @@
Subproject commit 7514a03fa8b8b7fded31f2db5c22c7daa24a3b98 Subproject commit 89c1042e013f14eda16477c719e9427045ddfa1e

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save