GUI rework, feature expansions

This commit is contained in:
Yuriy
2024-04-30 23:47:34 -04:00
parent 1b6c9939e5
commit f807b99ecc
4 changed files with 360 additions and 51 deletions

View File

@@ -1,7 +1,9 @@
LocalsSchedule:
;------------------------------------------------
CurrentSite := "Locals"
SaveOrPostProgress(Message:="Scheduling Post in Locals",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
SaveOrPostProgress(Message:="Scheduling Post",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
IniRead, LocalsPostPageURL, %SettingsIniFilepath%, General, LocalsPostPageURL, %A_Space%
if(LocalsPostPageURL = ""){
@@ -21,7 +23,6 @@ Status := NavigateFromBaseURLTo(LocalsPostPageURL)
if(Status)
Return
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
CheckForAlerts()
@@ -89,6 +90,10 @@ try, driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.BackSpace).SendKeys(d
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LocalsLivestreamTime)
if(ConfirmBeforeSubmit)
msgbox, Please check that all data was input correctly and then click OK to Finalize Schedule and grab RTMP Settings
; click schedule button
Xpath = //span[normalize-space()='Schedule']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
@@ -118,13 +123,26 @@ Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000
if(Status){
Message = Failed to switch Livestream to RTMP mode
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Message = Waiting 5 seconds for Page to catch up
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
sleep, 5000
; Open Stream Settings Popup Window
Xpath = //button[normalize-space()='Stream Settings']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Failed grab RTMP Settings. Unable to click the Stream Settings button.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Message = Waiting 5 seconds for Page to catch up
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
sleep, 5000
; Get RTMP Values from the popup
@@ -137,27 +155,14 @@ try, LocalsRTMPKey := driver.findelementbyxpath(Xpath).Attribute("value")
Xpath = //div[@class='modal-wrapper modal-wrapper_stream']//div[5]
; Try ElementOuterHTML := driver.findelementbyxpath(Xpath).Attribute("outerHTML") ;XPATH-ID & Tag
; Pull Out the RTMPKey from the OuterHTML using RegEx
RTMPKey := GetHTMLValueFromXpathOuterHTML(XPATH, "value")
Msgbox % "RTMPKey: " RTMPKey
/*
regexMatch := RegExMatch(ElementOuterHTML, "value=""([^""]+)""", match)
if (regexMatch)
{
LocalsRTMPKey := match1
}
else {
Message = Failed to Pull out RTMPKey from OuterHTML of RTMPKey Element
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
*/
LocalsRTMPKey := GetHTMLValueFromXpathOuterHTML(XPATH, "value")
; Msgbox % "LocalsRTMPURL: " LocalsRTMPURL
; Msgbox % "LocalsRTMPKey: " LocalsRTMPKey
ToolTip
; Msgbox % "PostStatusesFilepath: " PostStatusesFilepath
IniWrite, %LocalsRTMPURL%, %PostStatusesFilepath%, Livestream,LocalsRTMPURL
IniWrite, %LocalsRTMPKey%, %PostStatusesFilepath%, Livestream,LocalsRTMPKey
Return

View File

@@ -0,0 +1,33 @@
OdyseeSchedule:
;------------------------------------------------
CurrentSite := "Odysee"
SaveOrPostProgress(Message:="Scheduling Post",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Status := NavigateFromBaseURLTo("https://odysee.com/$/livestream")
if(Status)
Return
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
CheckForAlerts()
; Check Login Status
Try, PageURL := driver.Url
if(InStr(PageURL, "/signup")){
Message = Website is logged out. Please log back in.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Return