3 Commits
3.54 ... 3.55

2 changed files with 26 additions and 6 deletions

View File

@@ -202,7 +202,7 @@ Loop, 10 {
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="DiscordErrorLogging")
Xpath = //div[@class='e-content e-lib e-keyboard']
Xpath = //div[@id='richtexteditor_747903514_0_rte-edit-view'] ; generated using SelectorHub, using the exclude id tag option.
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoDescription)
if(Status){
SaveOrPostProgress(Message:="Failed to input Video Description",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@@ -302,7 +302,7 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
sleep, %Time_Between_Loops_Upload_Status%
; Get progress status through javascript
jsCheck = return document.getElementsByClassName('video-upload--details')[0].textContent;
jsCheck = return document.querySelector("#UploadDetails").textContent;
try ProgressStatus := driver.executeScript(jsCheck)
if(ProgressStatus = ""){
@@ -332,7 +332,7 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
; "Save Now" button
js = return document.querySelector("button[class='mr-2 btn btn-primary btn-sm']").textContent;
js = return document.querySelector("#Submit").textContent;
try, status := driver.executeScript(js)
if(!InStr(status, "Save Video")){
Message = Save Video Button is not clickable. Please check page for errors.
@@ -345,6 +345,11 @@ if(!InStr(status, "Save Video")){
; Save Video button
TooltipThis("Clicking Save Video Button to finalize Upload")
try BrighteonUploadPageURL := driver.url
js = document.querySelector("#Submit").click();
driver.executeScript(js)
; wait for page to finish loading
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
@@ -372,7 +377,7 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 2000
; Navigate to Videos page to make sure it's refreshed with latest video
try driver.Get("https://www.brighteon.com/dashboard/videos") ;Open selected URL
try driver.Get("https://www.brighteon.com/dashboard?page=1") ;Open selected URL
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
sleep, 2000

View File

@@ -117,14 +117,27 @@ if(Status){
}
; Click on logout button to force a logout. Sometimes the page shows logged in even though cookies have expired?
Xpath = //span[contains(text(),'Logout')]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
Message = Logging in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //input[@id='email']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Username)
; Selenium can't clear out text that's prepopulated by chrome or a password manager until we send some input to the element
; So we input text, then clear it and then input the string we want to work around this.
try, driver.findelementbyxpath(Xpath).clear() ; clear input field in case it's autofilled by chrome or password manager
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Username)
if(!Status){ ; if inputting email did NOT fail, then we are on the login page, input the password and then click login.
Xpath = //input[@id='password']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Password)
try, driver.findelementbyxpath(Xpath).clear() ; clear input field in case it's autofilled by chrome or password manager
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Password)
Xpath = //a[@id='loginButton']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
@@ -271,13 +284,15 @@ ArrayOfPodcastTags := StrSplit(Podcasttags,",")
LengthOfArrayOfPodcastTags := ArrayOfPodcastTags.Length() ; Save total number of items in the array
try pagehtml := driver.pagesource
; Msgbox % "pagehtml: " pagehtml
Loop, %LengthOfArrayOfPodcastTags% {
Tag := ArrayOfPodcastTags[A_Index] ; find value from position in array
SpanID = title">%Tag%</span></div></li><li><div id="tagIDs_easyui_tree_
if(InStr(pagehtml, SpanID)){ ; if tag found in page, do this
; if tag found in the raw HTML source, get the tag # from the source code and use it to click on the appropriate checkbox
if(InStr(pagehtml, SpanID)){
number := StrSplit(pagehtml, SpanID)
Number := Number[2]
; Msgbox % "number: " number