You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
livestream-scheduler/Modules/Rumble-Set-RTMP.ahk

74 lines
2.8 KiB
Plaintext

RumbleSetRTMP:
;------------------------------------------------
CurrentSite := "Rumble Studio"
Message = Inputting Custom RTMP Settings into Rumble Studio
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Status := NavigateFromBaseURLTo("https://studio.rumble.com/settings/connections")
if(Status)
Return
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
CheckForAlerts()
IniRead, LocalsRTMPURL, %PostStatusesFilepath%, Livestream,LocalsRTMPURL, %A_Space%
IniRead, LocalsRTMPKey, %PostStatusesFilepath%, Livestream,LocalsRTMPKey, %A_Space%
if(LocalsRTMPURL = ""){
Message = Skipping. No LocalsRTMPURL in Status.ini file
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Loop, 10 {
; IndexPlusOne := A_index + 1
IndexMinusOne := A_index - 1
Xpath = (//div[@class='flex shrink-0 items-center gap-x-4'])[%A_index%]
XpathCheckbox = (//img[@alt='More options'])[%IndexMinusOne%]
try SecondaryPlatformCheckboxName := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
; Msgbox % "SecondaryPlatformCheckboxName: " SecondaryPlatformCheckboxName
if(SecondaryPlatformCheckboxName = "LOCALS RTMP USE"){
Status := Selenium_LoopToClickXpath(Xpath:=XpathCheckbox,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to click into 3 dot menu for -LOCALS RTMP USE-
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; click Edit RTMP in the popup menu
Xpath = (//span[normalize-space()='Edit RTMP'])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to click into 3 dot menu for -LOCALS RTMP USE-
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
; Input New RTMP Info
XpathRTMP = (//input[@placeholder='Enter the RTMP URL'])[1]
XpathStreamkey = (//input[@placeholder='Enter the stream key'])[1]
Status := Selenium_LoopToSendValueToXpath(Xpath:=XpathRTMP,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LocalsRTMPURL,ClearElement:=1)
Status := Selenium_LoopToSendValueToXpath(Xpath:=XpathStreamkey,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LocalsRTMPKey,ClearElement:=1)
; click save button
Xpath = (//button[@class='rounded-full px-6 py-2 bg-primary/50 pointer-events-none'])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to Click Save Button
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
break
}
}