3 Commits
1.2 ... 1.22

8 changed files with 341 additions and 344 deletions

View File

@@ -0,0 +1,84 @@
;---ENVIRONMENT---------------------------------------------------------------------
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
;#Warn ; Enable warnings to assist with detecting common errors.
;DetectHiddenWindows, On
#SingleInstance, Force
DetectHiddenWindows, ON
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;SetKeyDelay, 500
CoordMode, ToolTip, Screen
CoordMode, Mouse, Screen
; #NoTrayIcon
; Menu, Tray, Icon, RMScriptManager.ico
;---Notes/Extra Info/#Includes------------------------------------------------------
;---VARIABLES-----------------------------------------------------------------------
ScriptName = Freedomain Livestream Scheduler
AHKFilepath = %A_ScriptDir%\%ScriptName%.ahk
Exefilepath = %A_ScriptDir%\%ScriptName%.exe
icopath = %A_ScriptDir%\Assets\Icon.ico
VersionIniFP = %A_ScriptDir%\Version.ini
;---MAIN SCRIPT---------------------------------------------------------------------
; Bump the version number in the version.ini file
IniRead, VersionNumber, %VersionIniFP%, %ScriptName%, Version, 0.0 ; , Filename, Section, Key [, Default]
VersionNumber += .01
VersionNumber := SubStr(VersionNumber, 1, 4)
IniWrite, %VersionNumber%, %VersionIniFP%,%ScriptName%, Version
; Kill any active intances of the uploaders so the .exe file can be overwriten by the compilation
process, close, %ScriptName%.exe
sleep, 1000
; Delete the .exe file so it can be repalced
if(FileExist(Exefilepath)){
FileDelete, %Exefilepath%
if(ErrorLevel){
msgbox, failed to delete Exe file. Please delete manually and re-run the compiler.
ExitApp
}
}
if(!FileExist(AHKFilepath)){
msgbox, %AHKFilepath% does not exist`nExiting
ExitApp
}
if(!FileExist(icopath)){
msgbox, %icopath% does not exist`nExiting
ExitApp
}
run, %comspec% /c ""C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%""
; OldNotify(ScriptToCompile,"Compiled Successfully",5)
; sleep, 5000
ExitApp
;---FUNCTIONS-----------------------------------------------------------------------

View File

@@ -27,11 +27,11 @@ VersionIniFP = %A_ScriptDir%\Version.ini
;---MAIN SCRIPT--------------------------------------------------------------------- ;---MAIN SCRIPT---------------------------------------------------------------------
; Bump the version number in the version.ini file ; Bump the version number in the version.ini file
IniRead, VersionNumber, %VersionIniFP%, %ScriptName%, Version, 0.0 ; , Filename, Section, Key [, Default] IniRead, VersionNumber, %VersionIniFP%, Livestream-Scheduler, Version, 0.0 ; , Filename, Section, Key [, Default]
VersionNumber += .01 VersionNumber += .01
VersionNumber := SubStr(VersionNumber, 1, 4) VersionNumber := SubStr(VersionNumber, 1, 4)
IniWrite, %VersionNumber%, %VersionIniFP%,%ScriptName%, Version IniWrite, %VersionNumber%, %VersionIniFP%,Livestream-Scheduler, Version

View File

@@ -105,12 +105,15 @@ FileInstall, Version.ini, %A_ScriptDir%\Lib\Version.ini, 1
IniRead, ScriptVersion, %A_ScriptDir%\Lib\Version.ini,%ScriptSettingsSection%, Version, 0.0 IniRead, ScriptVersion, %A_ScriptDir%\Lib\Version.ini,%ScriptSettingsSection%, Version, 0.0
; IniRead, ScriptName, %A_ScriptDir%\Lib\Version.ini,%ScriptSettingsSection%, Name, %ScriptSettingsSection% ; IniRead, ScriptName, %A_ScriptDir%\Lib\Version.ini,%ScriptSettingsSection%, Name, %ScriptSettingsSection%
global ScriptName := "Livestream Scheduler" global ScriptName := "Freedomain Livestream Scheduler"
global ScriptAbbreviatedName := "FLS" ; used for error logging global ScriptAbbreviatedName := "FLS" ; used for error logging
FullScriptName := ScriptName . " - " . ScriptVersion FullScriptName := ScriptName . " - " . ScriptVersion
; Msgbox % "FullScriptName: " FullScriptName
global GitReleasesAPIURL
GitReleasesAPIURL = https://freedomain.dev/api/v1/repos/yuriy/livestream-scheduler/releases
; Read Info From Files ; Read Info From Files
@@ -145,13 +148,15 @@ LivestreamThumbnail := ThumbnailJPGFilepath
if(FileExist(ThumbnailJPEGFilepath)) if(FileExist(ThumbnailJPEGFilepath))
LivestreamThumbnail := ThumbnailJPEGFilepath LivestreamThumbnail := ThumbnailJPEGFilepath
} }
; Read settings.ini
; ------------------------------------------------
IniRead, ConfirmBeforeSubmit, %SettingsIniFilepath%, %ScriptSettingsSection%, ConfirmBeforeSubmit, 1
IniRead, AutoUpdateCheck, %SettingsIniFilepath%, %ScriptSettingsSection%, AutoUpdateCheck, 1
@@ -164,12 +169,15 @@ ButtonHeights := 30
ThumbnailPreviewWidth := 200 ThumbnailPreviewWidth := 200
GuiHeight := 550 GuiHeight := 440
; Column One ; Column One
ColumnOneWidth := 500 ColumnOneWidth := 500
ColumnOneEditBoxWidth := ColumnOneWidth - (MarginSize * 2) ColumnOneEditBoxWidth := ColumnOneWidth - (MarginSize * 2)
ColumnOneEditBoxHalfWidth := (ColumnOneEditBoxWidth / 2) + 5
GuiFontSize = 15 GuiFontSize = 15
; Column Two ; Column Two
@@ -195,27 +203,43 @@ Gui, Font, s%GuiFontSize%
Gui, Font, Bold Gui, Font, Bold
Gui, Font, s8
Gui, Add, Text,, Title Gui, Add, Text,, Title
Gui, Font, Normal Gui, Font, Normal
Gui, Font, s%GuiFontSize%
Gui, Add, Edit,w%ColumnOneEditBoxWidth% vLivestreamTitle, %LivestreamTitle% Gui, Add, Edit,w%ColumnOneEditBoxWidth% vLivestreamTitle, %LivestreamTitle%
Gui, Font, Bold Gui, Font, Bold
Gui, Font, s8
Gui, Add, Text,, Description Gui, Add, Text,, Description
Gui, Font, Normal Gui, Font, Normal
Gui, Font, s%GuiFontSize%
Gui, Add, Edit,w%ColumnOneEditBoxWidth% h150 vLivestreamDescription, %LivestreamDescription% Gui, Add, Edit,w%ColumnOneEditBoxWidth% h150 vLivestreamDescription, %LivestreamDescription%
Gui, Font, Bold Gui, Font, Bold
Gui, Font, s8
Gui, Add, Text,, Tags (Comma Seperated) Gui, Add, Text,, Tags (Comma Seperated)
Gui, Font, Normal Gui, Font, Normal
Gui, Font, s%GuiFontSize%
Gui, Add, Edit,w%ColumnOneEditBoxWidth% vLivestreamTags, %LivestreamTags% Gui, Add, Edit,w%ColumnOneEditBoxWidth% vLivestreamTags, %LivestreamTags%
Gui, Font, Bold Gui, Font, Bold
Gui, Font, s8
Gui, Add, Text,, Thumbnail Gui, Add, Text,, Thumbnail
Gui, Font, Normal
Gui, Add, Button, x+%MarginSize% yp-3 gSelectThumbnail, Select Gui, Add, Button, x+%MarginSize% yp-3 gSelectThumbnail, Select
Gui, Font, Normal
Gui, Font, s%GuiFontSize%
Gui, Add, Picture, x%MarginSize% w%ThumbnailPreviewWidth% h-1 vThumbnailPreview, %LivestreamThumbnail% Gui, Add, Picture, x%MarginSize% w%ThumbnailPreviewWidth% h-1 vThumbnailPreview, %LivestreamThumbnail%
Gui, Font, Bold
Gui, Font, S10
Gui, Add, Button, x%ColumnOneEditBoxHalfWidth% yp-%marginsize% w%ColumnOneEditBoxHalfWidth% h40 gSaveAsTemplate, Save As Template
Gui, Add, Button,gSchedulePost w%ColumnOneEditBoxHalfWidth% gLoadTemplate h40 , Load Template
; Gui, Add, Button, yp+0 x%ColumnOneEditBoxHalfWidth% w%ColumnOneEditBoxHalfWidth%, Text button here
; Gui, Add, Edit,w%ColumnOneEditBoxWidth% h150 vLivestreamDescription, This livestream is happening soon! ; Gui, Add, Edit,w%ColumnOneEditBoxWidth% h150 vLivestreamDescription, This livestream is happening soon!
@@ -227,11 +251,18 @@ Gui, Add, Picture, x%MarginSize% w%ThumbnailPreviewWidth% h-1 vThumbnailPreview,
; ------------------------------------------------ ; ------------------------------------------------
Gui, Font, s%GuiFontSize% Gui, Font, s%GuiFontSize%
Gui, Font, Bold Gui, Font, Bold
; Gui, Add, Text, , Settings
Gui, Add, Text,y0 x%ColumnTwoXPosition%, Settings Gui, Add, Text,y0 x%ColumnTwoXPosition%, Settings
Gui, Font, Normal Gui, Font, Normal
Gui, Font, s8 Gui, Font, s8
Gui, Add, Checkbox, vConfirmBeforeSubmit checked, Confirm Before Submit Gui, Add, Checkbox, vConfirmBeforeSubmit checked%ConfirmBeforeSubmit%, Confirm Before Submit
Gui, Add, Checkbox, vAutoUpdateCheck Checked%AutoUpdateCheck%, Auto Update Check
if(UpdateAvailable){
Gui, Add, Button, cRed w%ColumnTwoEditBoxWidth% gUpdateScript vUpdateAvailable center, Update Available!
}
else, {
Gui, Add, Button, w%ColumnTwoEditBoxWidth% gUpdateScript vUpdateAvailable center, No Updates Available
}
Gui, Font, s%GuiFontSize% Gui, Font, s%GuiFontSize%
@@ -256,20 +287,28 @@ Gui, Font, Normal
; Gui, Add, Checkbox,, Dlive ; Gui, Add, Checkbox,, Dlive
Gui, Add, Checkbox, vOdysee, Odysee Gui, Add, Checkbox,checked vOdysee, Odysee
Gui, Add, Checkbox, vLocals, Locals Gui, Add, Checkbox, x+%marginSize% yp+0 checked vLocals, Locals
Gui, Add, Checkbox,checked vRumble, Rumble Gui, Add, Checkbox,x%ColumnTwoXPosition% y+%marginsize% checked vRumble, Rumble
Gui, Font, S8
Gui, Add, Checkbox, x+10 yp+5 Checked vInputRumbleCustomRTMP, Input RTMP
Gui, Font, Bold
Gui, Add, Button,gSchedulePost w%ColumnTwoEditBoxWidth% gSaveAsTemplate y+50, Save as Template
Gui, Add, Button,gSchedulePost w%ColumnTwoEditBoxWidth% gLoadTemplate, Load Template
Gui, Font, s15 Gui, Font, s15
Gui, Add, Button,gSchedulePost w%ColumnTwoEditBoxWidth% h40, Schedule Gui, Add, Button, x%ColumnTwoXPosition% y+%marginsizeDoubled% gSchedulePost w%ColumnTwoEditBoxWidth% h40, Schedule
Gui, Font, Normal ; Gui, Font, Normal
Gui, Show, h%GuiHeight%, %FullScriptName%
;---Check for Updates---
;------------------------------------------------
if(AutoUpdateCheck AND !UpdateAvailable){
SetTimer, CheckForUpdates, -1000
}
Gui, Show, h%GuiHeight%
Return Return
@@ -350,6 +389,11 @@ SchedulePost:
Gui, submit, NoHide Gui, submit, NoHide
; Save Settings.ini
; ------------------------------------------------
IniWrite, %ConfirmBeforeSubmit%, %SettingsIniFilepath%, %ScriptSettingsSection%, ConfirmBeforeSubmit
IniWrite, %AutoUpdateCheck%, %SettingsIniFilepath%, %ScriptSettingsSection%, AutoUpdateCheck
; Re-use an existing errorlog or create new directory ; Re-use an existing errorlog or create new directory
if(InStr(PassedInArgument, "\ErrorLogging\")) if(InStr(PassedInArgument, "\ErrorLogging\"))
@@ -387,6 +431,10 @@ if(Rumble)
gosub, RumbleSchedule gosub, RumbleSchedule
if(InputRumbleCustomRTMP){
gosub, RumbleSetRTMP
}
; msgbox, done! ; msgbox, done!
; Gui, Add, ; Gui, Add,
@@ -435,10 +483,16 @@ Gui, Add, Button, x%MarginSize% y+10 h%ResultButtonHeights% w%ResultButtonWidth%
Gui, Add, Edit, x+5 yp+0 h%ResultButtonHeights% w%ResultButtonEditWidth% vRumbleLivestreamURL center, %RumbleLivestreamURL% Gui, Add, Edit, x+5 yp+0 h%ResultButtonHeights% w%ResultButtonEditWidth% vRumbleLivestreamURL center, %RumbleLivestreamURL%
Gui, Add, Button, x%MarginSize% gResultsGUIAction h%ResultButtonHeights% w%ResultButtonEditWidth%,Copy Title Gui, Add, Button, x%MarginSize% y+50 gResultsGUIAction h%ResultButtonHeights% w%ResultButtonEditWidth%,Copy Title
Gui, Add, Button, x+%marginsize% gResultsGUIAction h%ResultButtonHeights% w%ResultButtonEditWidth%,Copy Description Gui, Add, Button, x+%marginsize% gResultsGUIAction h%ResultButtonHeights% w%ResultButtonEditWidth%,Copy Description
Gui, Add, Button, x%MarginSize% h%ResultButtonHeights% w%ResultButtonEditWidth%, Gui, Add, Button, x%MarginSize% h%ResultButtonHeights% w%ResultButtonEditWidth%,
Gui, Add, Button, x+%marginsize% gRetryUpload h%ResultButtonHeights% w%ResultButtonEditWidth%,Try Failed Again Gui, Add, Button, x+%marginsize% gRetryUpload h%ResultButtonHeights% w%ResultButtonEditWidth%,Try Failed Again
Gui, Font, s8
Gui, Font, Normal
Gui, Add, Button, y%MarginSize% w%ResultButtonEditWidth% Center, Error Log
Gui, Add, Edit, y+5 h300 w%ResultButtonEditWidth%, %ErrorLogVar%
; Gui, Add, Button, x%MarginSize% gRetryUpload h%ResultButtonHeights% w%ResultButtonEditWidth%,Try Failed Again ; Gui, Add, Button, x%MarginSize% gRetryUpload h%ResultButtonHeights% w%ResultButtonEditWidth%,Try Failed Again
Gui, Show Gui, Show
@@ -506,6 +560,11 @@ Return
#Include %A_ScriptDir%\Modules\Odysee-Schedule.ahk #Include %A_ScriptDir%\Modules\Odysee-Schedule.ahk
#Include %A_ScriptDir%\Modules\Odysee-Grab-URL.ahk #Include %A_ScriptDir%\Modules\Odysee-Grab-URL.ahk
#Include %A_ScriptDir%\Modules\Rumble-Schedule.ahk #Include %A_ScriptDir%\Modules\Rumble-Schedule.ahk
#Include %A_ScriptDir%\Modules\Rumble-Set-RTMP.ahk
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Update-Functions.ahk
; Misc ; Misc

View File

@@ -34,7 +34,6 @@ CheckForAlerts()
; Input Title and Description into Create a Livestream - First Screen ; Input Title and Description into Create a Livestream - First Screen
; ------------------------------------------------ ; ------------------------------------------------
Xpath = //input[@id='title'] Xpath = //input[@id='title']
; try, driver.FindElementByXPath(Xpath).SendKeys("TEST STRINGHERE")
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LivestreamTitle) Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LivestreamTitle)
if(Status){ if(Status){
@@ -96,6 +95,39 @@ try, driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.BackSpace).SendKeys(d
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LocalsLivestreamTime) Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LocalsLivestreamTime)
; Upload Custom Thumbnail
; ------------------------------------------------
if(Livestreamthumbnail){
Message = Uploading Thumbnail
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; this `label` element is a child of the thumbnail input element.
xpath = (//label[@id='photo-upload-btn'])[2]
; the element ID for input elements seems to change/be generated each time the page is generated
XpathIDForUploads := GetHTMLValueFromXpathOuterHTML(XPATH, "label for")
if(XpathIDForUploads = "Failed"){
Message = Failed to grab element needed for uploading thumbnail. Please attach thumbnail manually.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
ThubmnailInputXpath = (//input[@id='%XpathIDForUploads%'])[1]
Status := Selenium_LoopToSendValueToXpath(Xpath:=ThubmnailInputXpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Livestreamthumbnail)
if(Status){
Message = Failed to upload livestream thumbnail
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Sleep, 2000
}
if(ConfirmBeforeSubmit){ if(ConfirmBeforeSubmit){
OnMessage(0x44, "OnMsgBoxUserConfirmation") OnMessage(0x44, "OnMsgBoxUserConfirmation")
MsgBox 0x21, User Confirmation, Please check that all data was input correctly and fix any mistakes and then click PROCEED to finalize the Upload.`n`nClick STOP to cancel the rest of this Upload and move on to the next website. MsgBox 0x21, User Confirmation, Please check that all data was input correctly and fix any mistakes and then click PROCEED to finalize the Upload.`n`nClick STOP to cancel the rest of this Upload and move on to the next website.
@@ -127,7 +159,12 @@ if(!InStr(LivestreamURL, "https")){
; @todo ; @todo
} }
; Navigate to the post
; Navigate to the Post and Grab the URL
; ------------------------------------------------
Message = Navigating to Livestream Page to grab RTMP Settings Message = Navigating to Livestream Page to grab RTMP Settings
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")

View File

@@ -174,6 +174,29 @@ if(Status){
; Select each Secondary Platform checkbox ; Select each Secondary Platform checkbox
; ------------------------------------------------ ; ------------------------------------------------
IniRead, RumbleSecondaryPlatformsList, %SettingsIniFilepath%, %ScriptSettingsSection%, RumbleSecondaryPlatforms, %A_Space%
if(RumbleSecondaryPlatformsList = ""){
; if variable is empty, get all items in the list and write them to .ini file
Loop, 10 {
IndexPlusOne := A_index + 1
Xpath = (//div[@class='flex shrink-0 items-center gap-x-4'])[%A_index%]
XpathCheckbox = (//div[@class='relative shrink-0'])[%IndexPlusOne%]
try SecondaryPlatformCheckboxName := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
RumbleSecondaryPlatformsList .= SecondaryPlatformCheckboxName . "--"
if(SecondaryPlatformCheckboxName = "Add new destination" OR SecondaryPlatformCheckboxName = ""){
Break
}
}
IniWrite, %RumbleSecondaryPlatformsList%, %SettingsIniFilepath%, %ScriptSettingsSection%, RumbleSecondaryPlatformsList
MsgBox 0x40, Rumble Secondary Platforms List Generated, Rumble Secondary Platforms List was genearted and all the available options were added to it.`n`nPlease edit the settings.ini file and remove any platforms you do not need selected from the follwoing KEY:`n`n[%ScriptSettingsSection%]`nRumbleSecondaryPlatformsList=
}
Loop, 10 { Loop, 10 {
IndexPlusOne := A_index + 1 IndexPlusOne := A_index + 1
@@ -187,6 +210,9 @@ Loop, 10 {
Break Break
} }
if(!InStr(RumbleSecondaryPlatformsList,SecondaryPlatformCheckboxName))
Continue
Status := Selenium_LoopToClickXpath(Xpath:=XpathCheckbox,NumOfLoops:=2,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=XpathCheckbox,NumOfLoops:=2,SleepLength:=1000)
if(Status){ if(Status){
Message = Failed to check off the checkbox for: %SecondaryPlatformCheckboxName% Message = Failed to check off the checkbox for: %SecondaryPlatformCheckboxName%
@@ -223,17 +249,51 @@ if(Status){
} }
Message = Waiting 15 seconds before Navigating to Rumble and Grabbing Livestream URL
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
sleep, 15000
try, driver.get("https://rumble.com/account/live-streaming") try, driver.get("https://rumble.com/account/live-streaming")
catch e {
Message = Failed to Navigate to Rumble.com
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Xpath = (//a[normalize-space()='Livestream Coming Soonish!'])[1] try, driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
; Try ElementOuterHTML := driver.findelementbyxpath(Xpath).Attribute("outerHTML") ;XPATH-ID & Tag
Xpath = (//span[@class='video-info-status recorder'])[1]
Loop, 5 {
if(A_index = 5){
Message = Failed to grab livestream URL. `nAfter 5 checks the top livestream is still not in -Waiting for Stream- status.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
try StreamStatus := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
if(StreamStatus != "Waiting for Stream"){
Message = First Livestream on the list is not in -Waiting for Stream- status.`nWaiting 30 seconds and checking again.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
sleep, 30000
try, driver.executeScript("history.go(0)") ;refresh page
try, driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
}
else,
break
}
Xpath = (//h2[@class='video-title'])[1]
RumbleURLSlug := GetHTMLValueFromXpathOuterHTML(XPATH, "href") RumbleURLSlug := GetHTMLValueFromXpathOuterHTML(XPATH, "href")
if(RumbleURLSlug = "" or RumbleURLSlug = "Failed"){ if(RumbleURLSlug = "" or RumbleURLSlug = "Failed"){
Message = Failed to grab Rumble URL Slug from Livestreams Page Message = Failed to grab Rumble URL Slug from Livestreams Page
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return Return
} }
RumbleLivestreamURL := "https://rumble.com" . RumbleURLSlug RumbleLivestreamURL := "https://rumble.com" . RumbleURLSlug
@@ -254,319 +314,3 @@ return
try CurrentURL := driver.URL
if(InStr(CurrentURL, "/login.php")){
if(AutoLogin){
Message = Logging in Automatically by clicking into the UN+PW fields for info to register
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; have to click into username and password field for page to register that there's input
; clicking with JS doesn't make it register, but with xpath selenium it does
Xpath = //input[@id='login-username']
driver.FindElementByXPath(Xpath).click()
Xpath = //input[@id='login-password']
driver.FindElementByXPath(Xpath).click()
js = document.querySelector("button[type='submit']").click();
driver.executeScript(js)
; Do a double check to make sure that login worked
Message = Checking Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
try CurrentURL := driver.URL
if(!InStr(CurrentURL, "/upload")){
Message = Failed to log back in. Please Log Back In Manually
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
}
else, { ; notify user and return
Message = Login Expired. Please Log Back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
Message = Waiting 5 seconds for page to fully load
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 5000
}
; CheckForAlerts()
Message = Uploading Video File
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)
if(Status){
try, CurrentURL := GetCurrentTabURlBase()
Message = Failed to Upload Video File`nCurrent Tab URL: %CurrentURL%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
; Input Title
try driver.findElementsByName("title").item[1].SendKeys(VideoTitle) ;selects element based on Name and sends variable to it.
catch e {
Message = Video Upload Failed, Please Check Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
; Input Description
Loop, 5 { ; Attempt to input video description a couple of times
TooltipThis("Inputting Description `nAttempt Number: " A_index)
status := js_SendAndCheckWithID(Element:="description",ValueToCheck:="value",SleepLength:=3000,JSStringText:=JSVideoDescription)
if(!Status)
Break
/* if(A_index = 5){
Clipboard := VideoDescription
Message = Unable to Input Video Description`nDescription copied to clipboard, please paste it in at your earliest convenience.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
js = document.getElementsByName('description')[1].value = "%JSVideoDescription%"; ; Send content through javascript (Great for getting around emoji chrome limitaitons)
try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
try Description := driver.findElementsByName("description").item[2].Attribute("value") ;XPath: ID=site-title & span tag
if(Description != "")
Break
sleep, 2000
*/
}
; sleep, 5000
Message = Selecting Channel
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; try driver.findElementsByID("channelId").item[1].click()
; @todo replace with regex
js = return document.querySelector("#channelId").innerHTML;
try, ChannelIDNumber := driver.executeScript(js)
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
ChannelIDNumber := StrSplit(ChannelIDNumber, "option value=")
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
ChannelIDNumber := ChannelIDNumber[3]
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
SingleQuote = "
ChannelIDNumber := StrSplit(ChannelIDNumber, "data-private")
ChannelIDNumber := ChannelIDNumber[1]
ChannelIDNumber := StrReplace(ChannelIDNumber, SingleQuote, "")
ChannelIDNumber := StrReplace(ChannelIDNumber, " ", "")
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
; js = return document.querySelector("#channelId").value;
; try, ChannelIDNumber := driver.executeScript(js)
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
if(ChannelIDNumber = ""){
Message = ChannelIDNumber is blank. Unable to select Upload Channel
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
ChannelIDNumber = 6070526 ; freedomain
; ChannelIDNumber = 762377 ; personal
Xpath = //option[@value='%ChannelIDNumber%']
try driver.FindElementByXPath(Xpath).click()
catch e {
Message = Failed to click on Channel using %ChannelIDNumber%.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
; Input Tags
Message = Inputting Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
try driver.findElementsByName("tags").item[1].SendKeys(VideoTags) ;selects element based on Name and sends variable to it.
; Custom Thumbnail
if(VideoThumbFilepath != "") {
TooltipThis("Uploading Thumbnail")
Xpath = //input[@name='customThumb']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoThumbFilepath)
if(Status){
Message = Failed to Upload Thumbanil
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
; @todo: Add a check to see if progress gets stuck
; Check Upload Percentage
TooltipThis("Waiting for Video to Finish Uploading")
Loop, %Number_of_loops_to_Check_Upload_status% {
sleep, %Time_Between_Loops_Upload_Status%
jscheck = return document.getElementsByClassName('num_percent')[0].textContent;
try RumbleUploadPercent := driver.executeScript(jsCheck)
; try RumbleUploadPercent := driver.findelementbyxpath(Xpath).Attribute("textContent")
RumbleUploadPercent := StrSplit(RumbleUploadPercent, " ")
RumbleUploadPercent := RumbleUploadPercent[1]
if(InStr(RumbleUploadPercent, "100%")) ; once variable contains 100%, then we can break out of loop and continue
Break
Status := Check_For_Stuck_Video_Upload(A_index, RumbleUploadPercent)
if(Status = "Failed")
Return
; if(HasVal(Array_Index_Num_of_Upload_StatusChecks, A_index)) { ; 30 minutes and 60 minutes - send a notification message
; Message = Upload Progress: %RumbleUploadPercent%
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; }
}
; Msgbox % "RumbleUploadPercent: " RumbleUploadPercent
; Click on one of the video thumbnail options first
; Seems to be a bug on rumble, in order to be able to select a custom thumb through js, gotta select on of the generated ones first.
; Xpath = /html/body/main/div/div/div/section/form[1]/div/div[2]/div[3]/a[2] ; thumbnail option #3
; try driver.FindElementByXPath(Xpath).click() ;Clicks on Xpath based on variable.
/*
js = document.getElementById('customThumb').click();
driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
Status := InputFilePathIntoOpenWindow(VideoThumbFilepath)
if(Status)
{
Message = Upload Failed:`nUnable to Find "Open File" window to input filepath into
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
*/
}
if(ConfirmBeforeSubmit)
msgbox, Please check that all data was input correctly and then click OK to Publish Video
try UploadPageURL := driver.URL
; Submit Button
js = document.getElementById('submitForm').click();
try driver.executeScript(js) ;
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
; Select Rumble Only Licensing
js = document.getElementsByClassName('greenLink mRight last')[0].click(); ; Send content through javascript (Great for getting around emoji chrome limitaitons)
try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
; Check off condition 1
js = document.getElementById("crights").click()
try driver.executeScript(js)
; Check off condition 2
js = document.getElementById("cterms").click()
try driver.executeScript(js)
; Click the Submit Button
js = document.getElementById("submitForm2").click()
try driver.executeScript(js)
; Loop until able to grab the direct link from the result page.
Loop, 24 {
TooltipThis("Waiting for Result Page to load to grab Video URL")
Sleep, 5000
js = return document.getElementById("error_files_2").textContent;
RumbleError := driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
if(RumbleError != "") {
Message = Rumble Upload Failed due to:`n%RumbleError%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
js = return document.getElementById('direct').value;
try RumbleURL := driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
/* try RumbleURL := driver.findElementsByID("direct").item[1].Attribute("value") ;grab Direct Link from the result page
catch e { ; if not able to grab it, then sleep for 5 seconds and then loop again
Continue
}
*/
if(RumbleURL != ""){ ; If URL is grabbed from result page, then kick out of loop
Break
}
if(A_Index = 10) ; if looped for 5 minutes and still no URL grabbed
{ ; @todo: add error check if submit button clicked and error appears
Xpath = /html/body/main/div/div/div/section/form[2]/div/div[9] ; grab inner content of where error usually appears.
try RumbleUploadError := driver.findelementbyxpath(Xpath).Attribute("innerText") ; Grabb innertext
; Msgbox % "UseThumbUploadToolTextExist: " UseThumbUploadToolTextExist
Message = Upload Error (E#1341)`nVideo Uploaded but not able to be finalized.`nPlease fix the issue and click the final submit button. `nError: %RumbleUploadError%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
}
IniWrite, %RumbleURL%, %VideoLinksIniFile%, URLs, RumbleURL
Message = Upload Complete: %RumbleURL%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
SaveDriverURL()
AddToTotalVideosUploadedCount()
Return

View File

@@ -0,0 +1,73 @@
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")
}
; 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)
Status := Selenium_LoopToSendValueToXpath(Xpath:=XpathStreamkey,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LocalsRTMPKey)
; 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
}
}
}

Binary file not shown.