Compare commits

..

17 Commits
1.0 ... main

3
.gitignore vendored

@ -1,3 +1,5 @@
Freedomain Livestream Scheduler.exe
Lib/Templates-FLS/
Settings.ini Settings.ini
VideoLinks.ini VideoLinks.ini
body.txt body.txt
@ -20,3 +22,4 @@ Freedomain Video Uploader.exe
Lib/LBRY Process Killer.exe Lib/LBRY Process Killer.exe
Lib/chrome-win64 Lib/chrome-win64
Lib/Version.ini Lib/Version.ini

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

@ -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-----------------------------------------------------------------------

@ -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%, Livestream-Scheduler, Version, 0.0 ; , Filename, Section, Key [, Default]
VersionNumber += .01
VersionNumber := SubStr(VersionNumber, 1, 4)
IniWrite, %VersionNumber%, %VersionIniFP%,Livestream-Scheduler, 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-----------------------------------------------------------------------

@ -49,8 +49,7 @@ CheckIfUpdateInstalled(PassedInArgument)
#include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Zip.ahk #include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Zip.ahk
#include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\URLDownloadToVar.ahk #include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\URLDownloadToVar.ahk
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Miscellaneous-Functions.ahk #Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Miscellaneous-Functions.ahk
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\LBRY-Functions.ahk
@ -65,10 +64,13 @@ global FullScriptName
global PostStatusesFilepath global PostStatusesFilepath
global ErrorLoggingDirectory global ErrorLoggingDirectory
global ConfirmBeforeSubmit
global DiscordErrorLoggingWebhookBotURL global DiscordErrorLoggingWebhookBotURL
global DiscordVideosWebhookURL global DiscordVideosWebhookURL
global VideoFolderDir global VideoFolderDir
global LogErrorsToMsgbox global LogErrorsToMsgbox
global ErrorLogToDiscord
; global LogErrorsToTextFile ; global LogErrorsToTextFile
global CurrentSite global CurrentSite
global Driver global Driver
@ -104,12 +106,18 @@ 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
global ScriptAbbreviatedName := "FLS" ; used for error logging ScriptName := "Freedomain Livestream Scheduler"
global ScriptAbbreviatedName
ScriptAbbreviatedName := "FLS" ; used for error logging
FullScriptName := ScriptName . " - " . ScriptVersion FullScriptName := ScriptName . " - " . ScriptVersion
global GitReleasesAPIURL
GitReleasesAPIURL = https://freedomain.dev/api/v1/repos/yuriy/livestream-scheduler/releases
; Read Info From Files ; Read Info From Files
@ -144,135 +152,281 @@ 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
IniRead, ErrorLogToDiscord, %SettingsIniFilepath%, %ScriptSettingsSection%, ErrorLogToDiscord, 1
if(ErrorLogToDiscord){
; Discord
IniRead, DiscordErrorLoggingWebhookBotURL, %SettingsIniFilepath%, General, DiscordWebhookBotURL, %A_space%
if(DiscordErrorLoggingWebhookBotURL = ""){
Message = DiscordErrorLoggingWebhookBotURL is blank. `nWill not be able to post error messages or upload status to discord.`nPlease add discord webhook URL in settings.ini under: `n`n[General]`DiscordErrorLoggingWebhookBotURL=
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,ErrorSummaryVar")
}
}
; GUI Variables ; GUI Variables
; ------------------------------------------------ ; ------------------------------------------------
IniRead, XPosition, %SettingsIniFilepath%, %ScriptSettingsSection%, XPosition, 0
IniRead, YPosition, %SettingsIniFilepath%, %ScriptSettingsSection%, YPosition, 0
GuiFontSize = 15
MarginSize := 10 MarginSize := 10
MarginSizeDoubled := MarginSize * 2 MarginSizeDoubled := MarginSize * 2
ButtonHeights := 30 ButtonHeights := 30
ThumbnailPreviewWidth := 200 ThumbnailPreviewWidth := 150
GuiHeight := 500
VerticalLineHeight := GuiHeight - 100
GuiHeight := 450
; Column One ; Column One
ColumnOneWidth := 400 ColumnOneWidth := 550
ColumnOneEditBoxWidth := ColumnOneWidth - (MarginSize * 2) ColumnOneEditBoxWidth := ColumnOneWidth - (MarginSize * 2)
GuiFontSize = 10 ColumnOneEditBoxHalfWidth := (ColumnOneEditBoxWidth / 2) + 5
; Column Two ; Column Two
ColumnTwoXPosition := ColumnOneWidth + (MarginSize * 2) ColumnTwoXPosition := ColumnOneWidth + (MarginSize * 2)
ColumnTwoVerticalLineXPosition := ColumnTwoXPosition - (MarginSize * 2)
ColumnTwoEditBoxWidth := 200 ColumnTwoEditBoxWidth := 200
ColumnTwoEditBoxHalfWidth := ColumnTwoEditBoxWidth / 2
; Column Three
ColumnThreeXPosition := ColumnTwoXPosition + ColumnTwoEditBoxWidth + (MarginSizeDoubled * 2)
ColumnThreeVerticalLineXPosition := ColumnThreeXPosition - (MarginSize * 2)
ColumnThreeEditBoxWidth := 180
GUIWidth := ColumnThreeXPosition + ColumnThreeEditBoxWidth + MarginSize
; Results Screen ; Results Screen
ResultButtonWidth := 150 ResultButtonWidth := 250
ResultButtonEditWidth := 250 ResultButtonEditWidth := 350
ResultButtonHeights := 30 ResultButtonHeights := 35
ResultButtonDoubleHeights := ResultButtonHeights * 2
ResultButtonAndEditWidth := ResultButtonWidth + ResultButtonEditWidth + MarginSize
; START OF GUI ; START OF GUI
; ------------------------------------------------ ; ------------------------------------------------
Gui, Margin, %MarginSize%, %MarginSize%
Gui, Font, s%GuiFontSize% ; Gui Color, 0193C4
; Column One ; Column One
;------------------------------------------------ ;------------------------------------------------
Gui, Font, s%GuiFontSize%
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Text,, Title Gui, Add, Text,x%MarginSize%, Title
Gui, Font, s10
Gui, Font, Normal Gui, Font, Normal
Gui, Add, Edit,w%ColumnOneEditBoxWidth% vLivestreamTitle, %LivestreamTitle% Gui, Add, Button, x+%MarginSize% gPasteClipboardToEditBox vPasteClipboardToFLSTitle, Paste Clipboard
Gui, Font, Bold Gui, Font, s%GuiFontSize%
Gui, Add, Text,, Description
Gui, Font, Normal Gui, Font, Normal
Gui, Add, Edit,w%ColumnOneEditBoxWidth% h150 vLivestreamDescription, %LivestreamDescription% Gui, Add, Edit,x%MarginSize% w%ColumnOneEditBoxWidth% vLivestreamTitle, %LivestreamTitle%
Gui, Font, s%GuiFontSize%
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Text,, Tags Gui, Add, Text,, Description
Gui, Font, s10
Gui, Font, Normal Gui, Font, Normal
Gui, Add, Edit,w%ColumnOneEditBoxWidth% vLivestreamTags, %LivestreamTags% Gui, Add, Button, x+%MarginSize% gPasteClipboardToEditBox vPasteClipboardToFLSDescription, Paste Clipboard
Gui, Font, s%GuiFontSize%
Gui, Font, Normal
Gui, Add, Edit,x%MarginSize% w%ColumnOneEditBoxWidth% h200 vLivestreamDescription, %LivestreamDescription%
Gui, Font, s%GuiFontSize%
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Text,, Thumbnail Gui, Add, Text,, Tags (Comma Seperated)
Gui, Font, s10
Gui, Font, Normal
Gui, Add, Button, x+%MarginSize% gPasteClipboardToEditBox vPasteClipboardToFLSTags, Paste Clipboard
Gui, Font, s%GuiFontSize%
Gui, Font, Normal Gui, Font, Normal
Gui, Add, Button, x+%MarginSize% yp-3 gSelectThumbnail, Select Gui, Add, Edit,x%MarginSize% w%ColumnOneEditBoxWidth% vLivestreamTags, %LivestreamTags%
Gui, Add, Picture, x%MarginSize% w%ThumbnailPreviewWidth% h-1 vThumbnailPreview, %LivestreamThumbnail%
; Buttons at Bottom of Page
; ------------------------------------------------
; Start with Column one and go across
ScheduleButtonWidths := 250
ScheduleButtonHeight := 55
ScheduleButtonHalfHeight := ScheduleButtonHeight / 2
Gui, add, Text, x0 y+%marginsizeDoubled% w%GUIWidth% 0x10
; Gui, Add, Edit,w%ColumnOneEditBoxWidth% h150 vLivestreamDescription, This livestream is happening soon! Gui, Font, s10
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% yp+%marginsizeDoubled% w%ColumnTwoEditBoxWidth% h%ScheduleButtonHalfHeight% gLoadPrevious , Load Previous
Gui, Add, Button, y+0 w%ColumnTwoEditBoxWidth% h%ScheduleButtonHalfHeight% gShowResultsScreen , Show Results
Gui, Font, s%GuiFontSize%
Gui, Font, Bold
Gui, Add, Button, x+%marginsize% yp-%ScheduleButtonHalfHeight% w%ScheduleButtonWidths% h%ScheduleButtonHeight% gSaveAsTemplate, Save As Template
Gui, Add, Button,x+%marginsize% gSchedulePost h%ScheduleButtonHeight% w%ScheduleButtonWidths% gLoadTemplate, Load Template
Gui, Add, Button, x+%marginsize% gSchedulePost h%ScheduleButtonHeight% w%ScheduleButtonWidths% gSchedulePost, Schedule
; Column Two ; Column Two
; ------------------------------------------------ ; ------------------------------------------------
Gui, add, text, x%ColumnTwoVerticalLineXPosition% y%marginSize% h%VerticalLineHeight% 0x11 ;Vertical Line > Etched Gray
Gui, Font, s%GuiFontSize% Gui, Font, s%GuiFontSize%
Gui, Font, Bold Gui, Font, Bold
; Gui, Add, Text, , Settings ; Gui, Add, Text, , Thumbnail
Gui, Add, Text,y0 x%ColumnTwoXPosition%, Settings Gui, Add, GroupBox, r2.5 x%ColumnTwoXPosition% y%marginSize% vImageThumbnail w%ColumnTwoEditBoxWidth%,Thumbnail
Gui, Font, s10
Gui, Font, Normal Gui, Font, Normal
Gui, Add, Checkbox, vConfirmBeforeSubmit checked, Confirm Before Submit Gui, Add, Button, xp+120 yp-3 gSelectThumbnail, Select
; Gui, Font, Normal
; Gui, Font, s%GuiFontSize%
Gui, Add, Picture, x%ColumnTwoXPosition% y+%marginsize% w%ThumbnailPreviewWidth% h-1 vThumbnailPreview, %LivestreamThumbnail%
Gui, Font, s%GuiFontSize% Gui, Font, s%GuiFontSize%
Gui, Font, Bold Gui, Font, Bold
; Gui, Add, Text, , Settings Gui, Add, Text, x%ColumnTwoXPosition% yp+100 , Date and Time
Gui, Add, Text, y+%MarginSizeDoubled%, Date and Time of Livestream
Gui, Font, Normal Gui, Font, Normal
Gui, Add, DateTime, vLivestreamDate w%ColumnTwoEditBoxWidth%, MM/dd/yyyy Gui, Add, DateTime, vLivestreamDate w%ColumnTwoEditBoxWidth%, MM/dd/yyyy
Gui, Add, DateTime, vLivestreamTime w%ColumnTwoEditBoxWidth%, HH:mm Gui, Add, DateTime, vLivestreamTime w%ColumnTwoEditBoxWidth% Choose200505311900, Time
Gui, Font, s8
Gui, Font, Normal
Gui, Add, Button, gSetLivestreamTimeMorning yp+35 w%ColumnTwoEditBoxHalfWidth%,Morning
Gui, Add, Button,yp+0 x+0 gSetLivestreamTimeMorning w%ColumnTwoEditBoxHalfWidth%,Evening
Gui, Font, s%GuiFontSize%
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Text,y+%MarginSizeDoubled%, Platform to Schedule On Gui, Add, Text,y+%MarginSizeDoubled% x%ColumnTwoXPosition%, Platforms
Gui, Font, Normal Gui, Font, Normal
Gui, Font, s8
Gui, Add, Button, x+%marginsize% yp+5 gUncheckAllPlatforms, Uncheck All
; Gui, Add, Checkbox,, Dlive ; Gui, Add, Checkbox,, Dlive
Gui, Add, Checkbox, checked vLocals, Locals
; Gui, Add, Checkbox,checked vOdysee, Odysee
Gui, Font, s%GuiFontSize%
Gui, Add, Checkbox,x%ColumnTwoXPosition% y+%marginsize% checked vOdysee, Odysee
Gui, Add, Checkbox, x+%marginSize% yp+0 checked vLocals, Locals
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, add, text, x%ColumnThreeVerticalLineXPosition% y%marginSize% h%VerticalLineHeight% 0x11 ;Vertical Line > Etched Gray
; Column Three
; ------------------------------------------------
Gui, Font, s%GuiFontSize%
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Button,gSchedulePost w%ColumnTwoEditBoxWidth% y+100 gSaveAsTemplate, Save as Template Gui, Add, Text,y%MarginSize% x%ColumnThreeXPosition%, Settings
Gui, Add, Button,gSchedulePost w%ColumnTwoEditBoxWidth% gLoadTemplate, Load Template
Gui, Font, s15 Gui, Font, s12
Gui, Add, Button,gSchedulePost w%ColumnTwoEditBoxWidth% h40 y+50, Schedule
Gui, Font, Normal Gui, Font, Normal
Gui, Add, Checkbox, vAutoUpdateCheck Checked%AutoUpdateCheck%, Auto Update Check
Gui, Add, Checkbox, vErrorLogToDiscord Checked%ErrorLogToDiscord%, Error Log to Discord
Gui, Add, Checkbox, vConfirmBeforeSubmit checked%ConfirmBeforeSubmit%, Confirm Before Submit
Gui, Font, s%GuiFontSize%
Gui, Font, Bold
Gui, Add, Text, y+%MarginSizeDoubled% x%ColumnThreeXPosition%, System
Gui, Font, S10
/*if(UpdateAvailable)
Gui, Add, Button, cRed w%ColumnTwoEditBoxWidth% center vUpdateAvailable gUpdateScript, %ScriptAbbreviatedName% Update Available!
else,
*/
Gui, Add, Button, w%ColumnThreeEditBoxWidth% center vUpdateAvailable gUpdateScript, %ScriptAbbreviatedName% Up-to-Date
/*if(ChromeUpdateAvailable)
Gui, Add, Button, cRed w%ColumnThreeEditBoxWidth% center vChromeUpdateAvailable gUpdateChrome,Chrome Update Available!
else,
*/
Gui, Add, Button, w%ColumnThreeEditBoxWidth% center vChromeUpdateAvailable gUpdateChrome, Chrome Up-to-Date
Gui, Add, Button, x%ColumnThreeXPosition% y+%MarginSize% w%ColumnThreeEditBoxWidth% center gOpenGiteaPage, Report Bug
Gui, Show, h%GuiHeight% w%GUIWidth% x%XPosition% y%YPosition%, %FullScriptName%
;---Check for Updates---
;------------------------------------------------
if(AutoUpdateCheck AND !UpdateAvailable){
SetTimer, CheckForUpdates, -1000
}
Gui, Show, h%GuiHeight%
Return Return
SetLivestreamTimeMorning:
if(A_GuiControl = "Morning")
GuiControl, , LivestreamTime, 200505311100
if(A_GuiControl = "Evening")
GuiControl, , LivestreamTime, 200505311900
Return
UncheckAllPlatforms:
GuiControl,,Odysee,0
GuiControl,,Locals,0
GuiControl,,Rumble,0
GuiControl,,InputRumbleCustomRTMP,0
Return
; Functions ; Functions
;------------------------------------------------ ;------------------------------------------------
GUIUpdateVars:
Gui, Submit, NoHide
Return
SaveAsTemplate: SaveAsTemplate:
Gui, submit, NoHide ; Update variables for all modified fields Gui, submit, NoHide ; Update variables for all modified fields
TemplateDirectory = %A_ScriptDir%\Lib\Templates TemplateDirectory = %A_ScriptDir%\Lib\Templates-%ScriptAbbreviatedName%
if(!FileExist(TemplateDirectory)){ if(!FileExist(TemplateDirectory)){
FileCreateDir, %TemplateDirectory% FileCreateDir, %TemplateDirectory%
} }
@ -281,7 +435,7 @@ InputBox, TemplateName, Input Name, Please Input Name for the Template:
if(ErrorLevel) if(ErrorLevel)
Return Return
TemplateDirectory = %A_ScriptDir%\Lib\Templates\%TemplateName% TemplateDirectory = %TemplateDirectory%\%TemplateName%
ErrorLoggingDirectory := TemplateDirectory ErrorLoggingDirectory := TemplateDirectory
; FileCreateDir, %TemplateDirectory% ; FileCreateDir, %TemplateDirectory%
CreateErrorLoggingFiles(ErrorLoggingDirectory) CreateErrorLoggingFiles(ErrorLoggingDirectory)
@ -298,13 +452,20 @@ if(LivestreamThumbnail){ ; copy thumbnail into folder
Return Return
LoadPrevious:
LoadTemplate: LoadTemplate:
if(A_GuiControl = "Load Previous"){
ErrorLoggingDirectory = %A_ScriptDir%\Lib\ErrorLogging
Message = Loading Previous Post
}
if(A_GuiControl = "Load Template"){
ErrorLoggingDirectory = %A_ScriptDir%\Lib\Templates-%ScriptAbbreviatedName%\
Message = Loading Template Message = Loading Template
}
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,DiscordErrorLogging")
ErrorLoggingDirectory = %A_ScriptDir%\Lib\Templates\ ; ErrorLoggingDirectory = %A_ScriptDir%\Lib\Templates-%ScriptAbbreviatedName%\
FileSelectFolder, ErrorLoggingDirectory, %ErrorLoggingDirectory% FileSelectFolder, ErrorLoggingDirectory, %ErrorLoggingDirectory%
if(ErrorLevel){ if(ErrorLevel){
Tooltip Tooltip
@ -318,8 +479,8 @@ ExitApp
SelectThumbnail: SelectThumbnail:
FileSelectFile, LivestreamThumbnail, FileSelectFile, LivestreamThumbnail,
; Msgbox % "ThumbnailPreviewWidth: " ThumbnailPreviewWidth
GuiControl, , ThumbnailPreview, *w%ThumbnailPreviewWidth% *h-1 %LivestreamThumbnail% GuiControl, , ThumbnailPreview, *h130 *w-1 %LivestreamThumbnail%
Return Return
@ -329,6 +490,17 @@ Return
SchedulePost: SchedulePost:
Gui, submit, NoHide Gui, submit, NoHide
WinGetPos, XPosition, YPosition, , , A
; Save Settings.ini
; ------------------------------------------------
IniWrite, %ConfirmBeforeSubmit%, %SettingsIniFilepath%, %ScriptSettingsSection%, ConfirmBeforeSubmit
IniWrite, %AutoUpdateCheck%, %SettingsIniFilepath%, %ScriptSettingsSection%, AutoUpdateCheck
IniWrite, %ErrorLogToDiscord%, %SettingsIniFilepath%, %ScriptSettingsSection%, ErrorLogToDiscord
IniWrite, %XPosition%, %SettingsIniFilepath%, %ScriptSettingsSection%, XPosition
IniWrite, %YPosition%, %SettingsIniFilepath%, %ScriptSettingsSection%, YPosition
; 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\"))
CreateErrorLoggingFiles(PassedInArgument) CreateErrorLoggingFiles(PassedInArgument)
@ -361,10 +533,22 @@ if(Locals){
Gosub, LocalsSchedule Gosub, LocalsSchedule
} }
if(Rumble)
gosub, RumbleSchedule
if(InputRumbleCustomRTMP){
gosub, RumbleSetRTMP
}
; msgbox, done! ; msgbox, done!
; Gui, Add, ; Gui, Add,
ShowResultsScreen:
ToolTip ; hide any existing tooltips
Gui, Destroy Gui, Destroy
@ -373,28 +557,86 @@ Gui, Destroy
; ------------------------------------------------
; RESULTS SCREEN
; ------------------------------------------------
; Results Screen ; Read Info From .ini Files
; ------------------------------------------------ ; ------------------------------------------------
IniRead, LocalsRTMPURL, %PostStatusesFilepath%, Livestream,LocalsRTMPURL, %A_Space% IniRead, LocalsRTMPURL, %PostStatusesFilepath%, Livestream,LocalsRTMPURL, %A_Space%
IniRead, LocalsRTMPKey, %PostStatusesFilepath%, Livestream,LocalsRTMPKey, %A_Space% IniRead, LocalsRTMPKey, %PostStatusesFilepath%, Livestream,LocalsRTMPKey, %A_Space%
IniRead, LocalsLivestreamURL, %PostStatusesFilepath%, Livestream,LocalsLivestreamURL, %A_Space%
; IniRead, OutputVar, Filename, Section, Key [, Default] IniRead, OdyseeLivestreamURL, %PostStatusesFilepath%, Livestream,OdyseeLivestreamURL, %A_Space%
IniRead, OdyseeRTMPKey, %PostStatusesFilepath%, Livestream,OdyseeRTMPKey, %A_Space%
IniRead, OdyseeRTMPURL, %PostStatusesFilepath%, Livestream,OdyseeRTMPURL, %A_Space%
IniRead, RumbleLivestreamURL, %PostStatusesFilepath%, Livestream,RumbleLivestreamURL, %A_Space%
IniRead, RumbleCustomRTMPs, %PostStatusesFilepath%, Livestream,RumbleCustomRTMPs, %A_Space%
Gui, Font, Bold
Gui, Font, Bold
Gui, Font, s%GuiFontSize% Gui, Font, s%GuiFontSize%
Gui, Add, Button, x10 y+10 h%ResultButtonHeights% w%ResultButtonWidth%, Locals RTMP Key
Gui, Add, Edit, x+5 yp+0 h%ResultButtonHeights% w%ResultButtonEditWidth% vLocalsRTMPKey center, %LocalsRTMPKey%
Gui, Add, Button, x10 y+10 h%ResultButtonHeights% w%ResultButtonWidth%, Locals RTMP URL Gui, Add, Button,x%MarginSize% y+10 h%ResultButtonHeights% w%ResultButtonWidth% gResultsGUIAction, Copy Title
Gui, Add, Button, x+5 yp+0 h%ResultButtonHeights% w%ResultButtonEditWidth% center gResultsGUIAction, Copy Description
Gui, add, text, x%MarginSize% y+%marginsize% w%ResultButtonAndEditWidth% 0x10 ;Horizontal Line > Etched Gray
Gui, Add, Button,x%MarginSize% yp+%marginsizeDoubled% h%ResultButtonHeights% w%ResultButtonWidth% gResultsGUIAction, Locals RTMP URL
Gui, Add, Edit, x+5 yp+0 h%ResultButtonHeights% w%ResultButtonEditWidth% vLocalsRTMPURL center, %LocalsRTMPURL% Gui, Add, Edit, x+5 yp+0 h%ResultButtonHeights% w%ResultButtonEditWidth% vLocalsRTMPURL center, %LocalsRTMPURL%
Gui, Add, Button, x%MarginSize% y+10 h%ResultButtonHeights% w%ResultButtonWidth% gResultsGUIAction, Locals RTMP Key
Gui, Add, Edit, x+5 yp+0 h%ResultButtonHeights% w%ResultButtonEditWidth% vLocalsRTMPKey gGUIUpdateVars center, %LocalsRTMPKey%
Gui, Add, Button, x%MarginSize% y+10 h%ResultButtonHeights% w%ResultButtonWidth% gResultsGUIAction, Locals URL
Gui, Add, Edit, x+5 yp+0 h%ResultButtonHeights% w%ResultButtonEditWidth% vLocalsLivestreamURL gGUIUpdateVars center, %LocalsLivestreamURL%
Gui, Add, Button, x%MarginSize% y+10 h%ResultButtonHeights% w%ResultButtonWidth% gResultsGUIAction, Odysee RTMP URL
Gui, Add, Edit, x+5 yp+0 h%ResultButtonHeights% w%ResultButtonEditWidth% vOdyseeRTMPURL gGUIUpdateVars center, %OdyseeRTMPURL%
Gui, Add, Button, x%MarginSize% y+10 h%ResultButtonHeights% w%ResultButtonWidth% gResultsGUIAction, Odysee RTMP Key
Gui, Add, Edit, x+5 yp+0 h%ResultButtonHeights% w%ResultButtonEditWidth% vOdyseeRTMPKey gGUIUpdateVars center, %OdyseeRTMPKey%
Gui, Add, Button, x%MarginSize% y+10 h%ResultButtonHeights% w%ResultButtonWidth% gResultsGUIAction, Odysee URL
Gui, Add, Edit, x+5 yp+0 h%ResultButtonHeights% w%ResultButtonEditWidth% vOdyseeLivestreamURL gGUIUpdateVars center, %OdyseeLivestreamURL%
Gui, Add, Button, x%MarginSize% y+10 h%ResultButtonHeights% w%ResultButtonWidth% gResultsGUIAction, Rumble URL
Gui, Add, Edit, x+5 yp+0 h%ResultButtonHeights% w%ResultButtonEditWidth% vRumbleLivestreamURL gGUIUpdateVars center, %RumbleLivestreamURL%
Gui, Font, s10
Gui, Add, Button, x%MarginSize% y+10 h%ResultButtonHeights% w%ResultButtonWidth% gResultsGUIAction, RTMPs Updated on Rumble
Gui, Add, Edit, x+5 yp+0 h%ResultButtonHeights% w%ResultButtonEditWidth% vRumbleCustomRTMPs gGUIUpdateVars center, %RumbleCustomRTMPs%
Gui, Font, s%GuiFontSize%
Gui, Add, Button, x%MarginSize% y+10 h%ResultButtonHeights% w%ResultButtonWidth%
Gui, Add, Button, x+5 yp+0 h%ResultButtonHeights% w%ResultButtonEditWidth% gResultsGUIAction ,Save Changes
Gui, add, text, x%MarginSize% y+%marginsize% w%ResultButtonAndEditWidth% 0x10 ;Horizontal Line > Etched Gray
Gui, Font, s%GuiFontSize%
Gui, Add, Button, x%MarginSize% yp+%marginsize% h%ResultButtonHeights% w%ResultButtonWidth% gStartSMP, Start SMP
Gui, Add, Button, x+%marginsize% h%ResultButtonHeights% w%ResultButtonEditWidth% gUpdateRedirects, Update M.M. Redirects
Gui, Add, Button, x%MarginSize% h%ResultButtonHeights% w%ResultButtonWidth%
Gui, Add, Button, x+%marginsize% h%ResultButtonHeights% w%ResultButtonEditWidth% gRetryUpload ,Try Failed Again
Gui, Font, s%GuiFontSize%
Gui, Add, Button, gRetryUpload,Try Failed Again
Gui, Show Gui, Add, Button, y%MarginSize% w%ResultButtonEditWidth% Center, Error Log
Gui, Font, s8
Gui, Font, Normal
Gui, Add, Edit, y+5 h450 w%ResultButtonEditWidth%, %ErrorLogVar%
; Gui, Add, Button, x%MarginSize% gRetryUpload h%ResultButtonHeights% w%ResultButtonEditWidth%,Try Failed Again
Gui, Show, x%XPosition% y%YPosition% w%GUIWidth%, %FullScriptName% - Results
Return Return
@ -402,6 +644,119 @@ Return
; GoSubs ; GoSubs
; ------------------------------------------------ ; ------------------------------------------------
OpenGiteaPage:
run, https://freedomain.dev/yuriy/video-uploader/issues
Return
StartSMP:
; IniWrite, %A_ScriptFullPath%, %SettingsIniFilepath%, Filepaths, SMPFilepath
IniRead, SocialMediaPosterFilepath, %SettingsIniFilepath%, Filepaths, SocialMediaPosterFilepath, %A_Space%
if(SocialMediaPosterFilepath = "" or !FileExist(SocialMediaPosterFilepath)){
OnMessage(0x44, "OnMsgBoxSocialMediaPoster")
MsgBox 0x21, Filepath Not Found, Unable to find filepath for Social Media Poster`nWould you like to add it?
OnMessage(0x44, "")
IfMsgBox OK, {
FileSelectFile, SocialMediaPosterFilepath,,, Please Select Social Media Poster Filepath
if(ErrorLevel)
Return
if(!InStr(SocialMediaPosterFilepath, ".exe"))
Return
} Else IfMsgBox Cancel, {
Return
}
IniWrite, %SocialMediaPosterFilepath%, %SettingsIniFilepath%, Filepaths, SocialMediaPosterFilepath
}
run, %SocialMediaPosterFilepath% %StatusFileFilePath%
Return
/*
*/
UpdateRedirects:
gosub, MediaManagerUpdate
Return
ResultsGUIAction:
; Msgbox % "A_GuiControl: " A_GuiControl
if(A_GuiControl = "Open Post Folder"){
run, %ErrorLoggingDirectory%
Return
}
if(A_GuiControl = "Save Changes"){
Message = Changes Saved Successfully
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
IniWrite, %LocalsRTMPURL%, %PostStatusesFilepath%, Livestream,LocalsRTMPURL
IniWrite, %LocalsRTMPKey%, %PostStatusesFilepath%, Livestream,LocalsRTMPKey
IniWrite, %LocalsLivestreamURL%, %PostStatusesFilepath%, Livestream,LocalsLivestreamURL
IniWrite, %RumbleLivestreamURL%, %PostStatusesFilepath%, Livestream,RumbleLivestreamURL
IniWrite, %RumbleCustomRTMPs%, %PostStatusesFilepath%, Livestream,RumbleCustomRTMPs
IniWrite, %OdyseeLivestreamURL%, %PostStatusesFilepath%, Livestream,OdyseeLivestreamURL
IniWrite, %OdyseeRTMPURL%, %PostStatusesFilepath%, Livestream,OdyseeRTMPURL
IniWrite, %OdyseeRTMPKey%, %PostStatusesFilepath%, Livestream,OdyseeRTMPKey
sleep, 1000
Tooltip
Return
}
Message = Copying %A_GuiControl% to Clipboard
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
if(A_GuiControl = "Copy Title"){
Clipboard := LivestreamTitle
}
if(A_GuiControl = "Copy Description"){
Clipboard := LivestreamDescription
}
if(A_GuiControl = "Rumble URL"){
Clipboard := RumbleLivestreamURL
}
if(A_GuiControl = "Odysee URL"){
Clipboard := OdyseeLivestreamURL
}
if(A_GuiControl = "Odysee RTMP URL "){
Clipboard := OdyseeRTMPURL
}
if(A_GuiControl = "Odysee RTMP Key "){
Clipboard := OdyseeRTMPKey
}
if(A_GuiControl = "Locals URL"){
Clipboard := LocalsLivestreamURL
}
if(A_GuiControl = "Locals RTMP URL"){
Clipboard := LocalsRTMPURL
}
if(A_GuiControl = "Locals RTMP Key"){
Clipboard := LocalsRTMPKey
}
sleep, 1000
ToolTip
Return
KillScript: KillScript:
ExitApp ExitApp
@ -415,11 +770,18 @@ Return
; GoSubs for Selenium Automation
; ------------------------------------------------
#Include %A_ScriptDir%\Modules\Locals-Schedule.ahk #Include %A_ScriptDir%\Modules\Locals-Schedule.ahk
#Include %A_ScriptDir%\Modules\Odysee-Schedule.ahk
#Include %A_ScriptDir%\Modules\Odysee-Grab-URL.ahk
#Include %A_ScriptDir%\Modules\Rumble-Schedule.ahk
#Include %A_ScriptDir%\Modules\Rumble-Set-RTMP.ahk
#Include %A_ScriptDir%\Modules\Media-Manager-Update-Redirects.ahk
#Include %A_ScriptDir%\Modules\Odysee-Schedule.ahk
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Shared-GoTos.ahk
; Misc ; Misc

@ -1 +1 @@
Subproject commit b8ffb10db187c70219c594ddfe7cdebc6885d552 Subproject commit cf56ae8136def874793895733d595349b20d9c19

@ -7,8 +7,8 @@ Try, PageURL := driver.Url
if(InStr(PageURL, "/register")) if(InStr(PageURL, "/register"))
{ {
LoginPageURL := LocalsPostPageURL . "/login" LoginPageURL := LocalsPostPageURL . "/login"
Message = Website Login Expired. Trying to log back in. Navigating to: %LoginPageURL% Message = Website Login Expired. Please log back in and then try again.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
try, driver.Get(LoginPageURL) ;Open selected URL try, driver.Get(LoginPageURL) ;Open selected URL
Return
} }

@ -34,9 +34,14 @@ 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){
Message = Failed to input Livestream Title
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Xpath = //textarea[@id='body'] Xpath = //textarea[@id='body']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LivestreamDescription) Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LivestreamDescription)
@ -50,7 +55,7 @@ Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000
; Create a Livestream - Second Screen ; Create a Livestream - Second Screen
; ------------------------------------------------ ; ------------------------------------------------
; check if "Schedule Livestream" checkbox is checked, check it if not ; check if "Schedule Livestream" checkbox is checked, check it if not
LivestreamScheduledCheckbox := driver.findElementByID("is_scheduled_livestream").isSelected() ;Checks if a checkbox is ticked or not and saves it to a variable, usually: 0 = Unchecked, -1 = Checked try, LivestreamScheduledCheckbox := driver.findElementByID("is_scheduled_livestream").isSelected() ;Checks if a checkbox is ticked or not and saves it to a variable, usually: 0 = Unchecked, -1 = Checked
if(LivestreamScheduledCheckbox = 0){ if(LivestreamScheduledCheckbox = 0){
Xpath = //label[normalize-space()='Schedule this live stream?'] Xpath = //label[normalize-space()='Schedule this live stream?']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
@ -63,12 +68,12 @@ if(LivestreamScheduledCheckbox = 0){
} }
; Make sure the "Notify Users" checkbox is checked ; Make sure the "Notify Users" checkbox is checked
NotifyUsersCheckbox := driver.findElementByID("is_do_promo").isSelected() ;Checks if a checkbox is ticked or not and saves it to a variable, usually: 0 = Unchecked, -1 = Checked try, NotifyUsersCheckbox := driver.findElementByID("is_do_promo").isSelected() ;Checks if a checkbox is ticked or not and saves it to a variable, usually: 0 = Unchecked, -1 = Checked
if(NotifyUsersCheckbox = 0){ if(NotifyUsersCheckbox = 0){
Xpath = //label[@for='is_do_promo'] Xpath = //label[@for='is_do_promo']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
NotifyUsersCheckbox := driver.findElementByID("is_do_promo").isSelected() try, NotifyUsersCheckbox := driver.findElementByID("is_do_promo").isSelected()
if(NotifyUsersCheckbox = 0){ if(NotifyUsersCheckbox = 0){
Message = Failed to select the "Notify Users" checkbox Message = Failed to select the "Notify Users" checkbox
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@ -90,10 +95,55 @@ 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)
if(ConfirmBeforeSubmit)
msgbox, Please check that all data was input correctly and then click OK to Finalize Schedule and grab RTMP Settings
; 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){
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.
OnMessage(0x44, "")
IfMsgBox OK, {
} Else IfMsgBox Cancel, {
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
}
/*
*/
; click schedule button ; click schedule button
Xpath = //span[normalize-space()='Schedule'] Xpath = //span[normalize-space()='Schedule']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
@ -102,18 +152,23 @@ if(Status){
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
} }
LivestreamURL := GrabLocalsPostURLUsingTitle(LivestreamTitle) LocalsLivestreamURL := GrabLocalsPostURLUsingTitle(LivestreamTitle)
if(!InStr(LivestreamURL, "https")){ if(!InStr(LocalsLivestreamURL, "https")){
; If url was not grabbed. wait 1 minute, reload page and then try grabbing URL again ; If url was not grabbed. wait 1 minute, reload page and then try grabbing URL again
; @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")
try, driver.Get(LivestreamURL) ;Open selected URL try, driver.Get(LocalsLivestreamURL) ;Open selected URL
driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
@ -160,9 +215,11 @@ Xpath = //div[@class='modal-wrapper modal-wrapper_stream']//div[5]
LocalsRTMPKey := GetHTMLValueFromXpathOuterHTML(XPATH, "value") LocalsRTMPKey := GetHTMLValueFromXpathOuterHTML(XPATH, "value")
ToolTip
; Msgbox % "PostStatusesFilepath: " PostStatusesFilepath
IniWrite, %LocalsRTMPURL%, %PostStatusesFilepath%, Livestream,LocalsRTMPURL IniWrite, %LocalsRTMPURL%, %PostStatusesFilepath%, Livestream,LocalsRTMPURL
IniWrite, %LocalsRTMPKey%, %PostStatusesFilepath%, Livestream,LocalsRTMPKey IniWrite, %LocalsRTMPKey%, %PostStatusesFilepath%, Livestream,LocalsRTMPKey
IniWrite, %LocalsLivestreamURL%, %PostStatusesFilepath%, Livestream,LocalsLivestreamURL
ToolTip
Return Return

@ -0,0 +1,119 @@
MediaManagerUpdate:
; ------------------------------------------------
CurrentSite := "Media Manager"
SaveOrPostProgress(Message:="Navigating to Website",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
IniRead, FDRRadioURL, %SettingsIniFilepath%, General, FDRRadioURL, %A_Space%
if(FDRRadioURL = ""){
Message = FDRRadioURL is blank in Settings.ini. Please add it to the following location: [General]`nFDRRadioURL=
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
FDRRadioBaseURL := "https://" . ExtractBaseURL(FDRRadioURL)
FDRRadioURL := FDRRadioBaseURL . "/manage/"
Status := NavigateFromBaseURLTo(FDRRadioURL)
if(Status)
Return
CheckForAlerts()
Message = Checking Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Try, PageURL := driver.Url
if(InStr(PageURL, "/NotLoggedIn")){
Message = Logged out. Trying to log back in.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = (//span[contains(text(),'Login')])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
sleep, 1000
Try, PageURL := driver.Url
if(InStr(PageURL, "/NotLoggedIn")){
Message = Failed to log back in automatically. Please login and try again.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
}
Message = Updating Redirect URLs
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; URL for each redirect
LocalsLiveRedirectURL := FDRRadioBaseURL . "/manage/#/Redirects/Modify?redirectID=738"
RumbleLiveRedirectURL := FDRRadioBaseURL . "/manage/#/Redirects/Modify?redirectID=739"
OdyseeLiveRedirectURL := FDRRadioBaseURL . "/manage/#/Redirects/Modify?redirectID=742"
; read the url's from the status file
IniRead, LocalsLivestreamURL, %PostStatusesFilepath%, Livestream,LocalsLivestreamURL, %A_Space%
IniRead, RumbleLivestreamURL, %PostStatusesFilepath%, Livestream,RumbleLivestreamURL, %A_Space%
IniRead, OdyseeLivestreamURL, %PostStatusesFilepath%, Livestream,OdyseeLivestreamURL, %A_Space%
if(LocalsLivestreamURL)
UpdateMediaManagerRedirect(LocalsLiveRedirectURL, LocalsLivestreamURL)
else, {
Message = LocalsLivestreamURL is blank. Skipping
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
if(RumbleLivestreamURL)
UpdateMediaManagerRedirect(RumbleLiveRedirectURL, RumbleLivestreamURL)
else, {
Message = RumbleLivestreamURL is blank. Skipping
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
if(OdyseeLivestreamURL)
UpdateMediaManagerRedirect(OdyseeLiveRedirectURL, OdyseeLivestreamURL)
else, {
Message = OdyseeLivestreamURL is blank. Skipping
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
UpdateMediaManagerRedirect(MediaManagerRedirectPageURL, RedirectURL){
try, driver.Get(MediaManagerRedirectPageURL) ;Open selected URL
try, driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
Xpath = (//input[@id='destinationURL'])[1]
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=RedirectURL, ClearElement := 1)
; Snippet to for check:
if (ConfirmBeforeSubmit && ConfirmBeforeSubmitMsgboxFunc() != true) {
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
SaveOrPostProgress(Message:=Message, PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
return
}
; Save button
Xpath = (//span[contains(text(),'Save')])[1]
Status := 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
}
Sleep, 1000
Return "Success"
}

@ -0,0 +1,154 @@
OdyseeGrabURL:
Iniread, OdyseeURLSLUG, %PostStatusesFilepath%, Livestream,OdyseeURLSLUG, %A_Space%
if(OdyseeURLSLUG = ""){
Message = OdyseeURLSLug is empty in the Livestream.ini file.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Status := NavigateFromBaseURLTo("https://odysee.com/$/livestream")
if(Status)
Return
; click on Local Setup button to switch windows
Xpath = //span[contains(text(),'Local Setup')]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
Xpath = //label[normalize-space()='Stream server']
try, Status := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
if(!Status){
Message = Failed to switch to "Stream Server" page
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
/*
Message = Waiting for Livestream Created Confirmation Popup
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = //h2[normalize-space()='Livestream Created']
Loop, 60 {
try, Status := ElementInnerText := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
if(Status = "Livestream Created")
break
else, {
sleep, 1000
Continue
}
}
*/
Message = Grabbing Livestream URL from Livestream Settings Page
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
/*
; Grab and Format the livestream URL
Xpath = //li[@role='link']
Loop, 60 {
URLSLUG := GetHTMLValueFromXpathOuterHTML(XPATH, "href")
if(URLSLug = "Failed"){
Message = Failed to Grab URL SLug from confirmation popup
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Msgbox % "URLSLug: " URLSLug
if(InStr(URLSLug, OdyseeLivestreamSlug))
break
if(A_Index = 60){
Message = Odysee did not generate permanant livestream URL after 1 minute of waiting. Congestion Issues?
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
sleep, 1000
}
*/
/*; Message =
Xpath = //span[contains(text(),'View Livestream Settings')]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Failed to click on View Livestream Settigns Button
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Double check that we're on the right page.
Xpath = //label[normalize-space()='Stream server']
try InnerText := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
if(InnerText != "Stream server"){
Message = Failed to Navigate to View Livestream Settings Page
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
*/
Message = Waiting for Livestream to get confirmed and URL to be generated`nWill Give up after 5 minutes
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = //div[@class='section']//li[1]
Loop, 100 {
if(A_Index = 100){
Message = Failed to grab URL after 5 minutes of waiting.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Try ElementOuterHTML := driver.findelementbyxpath(Xpath).Attribute("outerHTML") ;XPATH-ID & Tag
if(!InStr(ElementOuterHTML, OdyseeURLSLUG)){
Sleep, 5000
Continue
; Message = Failed to Grab Livestream URL. Please copy and paste it manually.
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
; return
}
else, {
break
}
}
; Clipboard := OdyseeURLSLUG
; Msgbox % "OdyseeURLSLUG: " OdyseeURLSLUG
; Clipboard := ElementOuterHTML
; Msgbox % "ElementOuterHTML: " ElementOuterHTML
Xpath = //div[@class='section']//li[1]
URLSLUG := GetHTMLValueFromXpathOuterHTML(XPATH, "href")
if(URLSLUG = "Failed"){
Message = Failed to Grab Livestream URL from outerHTML of livestream element.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
OdyseeLivestreamURL := "https://odysee.com" . URLSLug
; Msgbox % "OdyseeLivestreamURL: " OdyseeLivestreamURL
; Message = URL Slug Grabbed from Confirmation Popup: %URLSLug%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; OdyseeLivestreamURL := "https://odysee.com" . URLSLug
IniWrite, %OdyseeLivestreamURL%, %PostStatusesFilepath%, Livestream,OdyseeLivestreamURL

@ -20,13 +20,296 @@ if(InStr(PageURL, "/signup")){
Return Return
} }
; If clear button exists, click it and clear any data from a previous attempt
Xpath = //span[contains(text(),'Clear')]
try, Status := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
if(InStr(Status, "Clear")){
Message = Clearing out previous unfinished upload
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; we need to wipe out the previously unfinished upload
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Failed to clear out previous upload
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
}
; create a slug string and format it
FormatTime, OdyseeLivestreamDate , %LivestreamDate%, MM-dd-yyyy ; _hhmmss
OdyseeLivestreamSlug := "livestream-" . OdyseeLivestreamDate
OdyseeURLSLUG := LBRYCMDTextReplacement(OdyseeLivestreamSlug)
IniWrite, %OdyseeURLSLUG%, %PostStatusesFilepath%, Livestream,OdyseeURLSLUG
/*Xpath = (//div[@class='form-field__prefix'])[1]
try OdyseeChannelURL := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
*/
Message = Inputting Livestream Information
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = //input[@placeholder='Descriptive titles work best']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LivestreamTitle)
if(Status){
Message = Failed to Input Livestream Title
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Xpath = //input[@name='content_name']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=OdyseeURLSLUG)
if(Status){
Message = Failed to Input Livestream URL
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Xpath = //textarea[@id='content_description']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LivestreamDescription)
if(Status){
Message = Failed to Input Livestream Description
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Click "Scheduled Time" checkbox
Message = Selecting -Scheduled Time- checkbox
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = //label[normalize-space()='Scheduled Time']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=5000)
if(Status){
Message = Failed to click the "Scheduled Time" checkbox
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Create variables with time and date of timestream
FormatTime, LivestreamYear , %LivestreamDate%, yyyy ; _hhmmss
FormatTime, LivestreamMonth , %LivestreamDate%, MM ; _hhmmss
FormatTime, LivestreamDay , %LivestreamDate%, dd ; _hhmmss
FormatTime, LivestreamHour , %LivestreamTime%, h ; _hhmmss
FormatTime, LivestreamMinute , %LivestreamTime%, m ; _hhmmss
FormatTime, LivestreamAMPM , %LivestreamTime%, tt ; _hhmmss
; Input Livestream Time and Date
Xpath = //input[@placeholder='----']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LivestreamYear)
Xpath = //input[@name='month']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LivestreamMonth, ClearElement:=1)
Xpath = //input[@name='day']
Status := Selenium_LoopToSendValueToXpath(Xpath,NumOfLoops:=1,SleepLength:=1000,StringTextContent:=LivestreamDay, ClearElement:=1)
Xpath = //input[@name='hour12']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LivestreamHour, ClearElement:=1)
Xpath = //input[@name='minute']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LivestreamMinute, ClearElement:=1)
Xpath = //select[@name='amPm']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LivestreamAMPM)
if(LivestreamThumbnail != ""){
; Upload Thumbnail
Xpath = //input[@accept='.png, .jpg, .jpeg, .gif, .webp']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LivestreamThumbnail)
if(Status){
Message = Failed to Upload Thumbnail
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
; check for the Upload Thumbnail Confirmation popup
Xpath = //h1[normalize-space()='Upload thumbnail']
loop, 10 {
if(A_index = 10){
Message = Upload Thumbnail Confirmation did not appear after 10 seconds.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
try, Status := driver.findelementbyxpath(Xpath).Attribute("innerText")
if(Status = "Upload Thumbnail"){
break
}
else, {
sleep, 1000
Continue
}
}
try, Status := driver.findelementbyxpath(Xpath).Attribute("innerText")
if(Status = "Upload Thumbnail"){
; click confirm upload button
Xpath = //div[@class='card__actions']//button[@aria-label='Upload']//span[@class='button__content']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
}
else, {
Message = Upload Failed: Upload thumbnail confirmation popup did not show up.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
/* ; check if the "Are you sure you want to upload this thumbnail to odysee.com?" popup exists
; Xpath = /html/body/div[4]/div/div/label
; try Status := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
if(Status){ ; if element exists, then click the confirm button
Xpath = //div[@class='card__actions']//button[@aria-label='Upload']//span[@class='button__content']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; MsgBox,,Element innerText: `n, % driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
}
else, {
Message = Upload thumbnail confirmation popup did not show up.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
*/
Xpath = //div[@class='column__item thumbnail-picker__preview']
; Get element with Thumbnail and check if image upload was successful
Try, Status := driver.findelementbyxpath(Xpath).Attribute("outerHTML") ;XPATH-ID & Tag
if(!InStr(Status, "thumbs.odycdn.com")){
Message = Thumbnail Upload Failed
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
} else, {
Message = Video Upload Failed. Odysee Requires a thumbnail for video uploads.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
LivestreamTagsArray := StrSplit(LivestreamTags, ",")
Loop % LivestreamTagsArray.Length(){
; ArrayItem := ARRAY[A_Index]
Tag := LivestreamTagsArray[A_Index]
Xpath = //input[@placeholder='gaming, crypto']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Tag)
sleep, 500
driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.ENTER)
sleep, 500
; Odysee accepts max of 5 tags
if(A_Index = 5)
break
}
if(ConfirmBeforeSubmit){
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.
OnMessage(0x44, "")
IfMsgBox OK, {
} Else IfMsgBox Cancel, {
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
}
/*
*/
Message = Submitting Livestream
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; Click Create Button at bottom of the screen
Xpath = //span[contains(text(),'Create')]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Failed to click "Create" button at the bottom of page
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
sleep, 1000
; Click confirm button in the popup
Xpath = //span[contains(text(),'Confirm')]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Failed to click "Confirm" button in confirmation popup
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
IniRead, OdyseeChannelURL, %SettingsIniFilepath%, %ScriptSettingsSection%, OdyseeChannelURL, %A_Space%
if(!OdyseeChannelURL){
OdyseeChannelURL := "https://odysee.com/@freedomain:b/"
IniWrite, %OdyseeChannelURL%, %SettingsIniFilepath%, %ScriptSettingsSection%, OdyseeChannelURL
}
OdyseeLivestreamURL := OdyseeChannelURL . OdyseeURLSLUG
IniWrite, %OdyseeLivestreamURL%, %PostStatusesFilepath%, Livestream,OdyseeLivestreamURL
; Grab RTMP Settings
Message = Waiting for Confirmation Screen to grab RTMP Settings
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = (//span[contains(text(),'View Livestream Settings')])[1]
loop, 60 {
try, InnerText := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
if(InnerText = "View Livestream Settings"){
break
}
sleep, 1000
}
; click on the "View livestream Settings" button
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Failed to click on -View Livestream Settings- Button
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Grab the Stream URL and Key
Xpath = (//input[@name='stream-server'])[1]
loop, 5 {
Try OdyseeRTMPURL := driver.findelementbyxpath(Xpath).Attribute("value") ;Xpath Value
if(OdyseeRTMPURL)
break
else,
sleep, 1000
}
Xpath = (//input[@name='livestream-key'])[1]
Try OdyseeRTMPKey := driver.findelementbyxpath(Xpath).Attribute("value") ;Xpath Value
if(OdyseeRTMPKey = ""){
Message = Failed to grab Odysee RTMP Key. Page did not load?
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
IniWrite, %OdyseeRTMPURL%, %PostStatusesFilepath%, Livestream,OdyseeRTMPURL
IniWrite, %OdyseeRTMPKey%, %PostStatusesFilepath%, Livestream,OdyseeRTMPKey

@ -1,5 +1,5 @@
RumbleUpload: RumbleSchedule:
;------------------------------------------------ ;------------------------------------------------
CurrentSite := "Rumble" CurrentSite := "Rumble"
@ -9,9 +9,6 @@ Status := NavigateFromBaseURLTo("https://studio.rumble.com/api/signin")
if(Status) if(Status)
Return Return
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
CheckForAlerts() CheckForAlerts()
Message = Checking Login Status Message = Checking Login Status
@ -38,326 +35,286 @@ if(InStr(CurrentURL, "/sso/auth/consent")){
; Schedule New Stream
; ------------------------------------------------
Message = Scheduling new stream and inputting information
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Schedule a stream button
Xpath = //div[normalize-space()='Schedule a stream']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to click "Schedule a Stream" button. Livestream Already exists?
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Xpath = (//h2[normalize-space()='Select a template (optional)'])
try ElementInnerText := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
if(!ElementInnerText){
Message = Templates Subwindow did not show up
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Return
}
loop, 3 {
Xpath = (//div[@class='flex items-center justify-between gap-x-8 p-4 bg-indigo rounded-xl'])[%A_Index%]
try, ElementText := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
; use the template with "Freedomain Livestream in the name"
if(InStr(ElementText, "Freedomain Livestream")){
Xpath = (//span[contains(text(),'Select')])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to Select Livestream Template
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
}
}
; input thumbnail
if(Livestreamthumbnail){
Xpath = //input[@id='room-thumbnail']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Livestreamthumbnail)
if(Status){
Message = Faied to upload custom thubmanil
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
}
; input Livestream Title
Xpath = //input[@placeholder='Give your stream a name']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LivestreamTitle, ClearElement:=1)
; input Livestream Description
Xpath = //textarea[@placeholder='Tell the audience more about your stream']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LivestreamDescription, ClearElement:=1)
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'] ; Input Date & Time
driver.FindElementByXPath(Xpath).click() ; ------------------------------------------------
; Create variables with time and date of timestream
FormatTime, RumbleLivestreamDate , %LivestreamDate%, dddd, MMMM
FormatTime, LivestreamOrdinalDay , %LivestreamDate%, d
FormatTime, RumbleLivestreamYear , %LivestreamDate%, yyyy
LivestreamOrdinalDay := GetDateOrdinalSuffix(LivestreamOrdinalDay)
; Msgbox % "LivestreamOrdinalDay: " LivestreamOrdinalDay
js = document.querySelector("button[type='submit']").click(); RumbleLivestreamDate := RumbleLivestreamDate . " " . LivestreamOrdinalDay . ", " . RumbleLivestreamYear
driver.executeScript(js) ; Msgbox % "RumbleLivestreamDate: " RumbleLivestreamDate
; Msgbox % "RumbleLivestreamDate: " RumbleLivestreamDate
; Do a double check to make sure that login worked FormatTime, RumbleLivestreamTime , %LivestreamTime%, h:mm tt
Message = Checking Login Status ; Msgbox % "RumbleLivestreamTime: " RumbleLivestreamTime
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") ; FormatTime, RumbleLivestreamYear , %LivestreamDate%, yyyy
try CurrentURL := driver.URL ; click on box to open time picker dialogue
Xpath = //input[@placeholder='Pick a time']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(!InStr(CurrentURL, "/upload")){ ; generate xpath based on date and click element
Message = Failed to log back in. Please Log Back In Manually Xpath = //div[@aria-label='Choose %RumbleLivestreamDate%']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to select date from popup menu using generated xpath.`nXpath = %Xpath%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return Return
} }
; generate xpath based on time and click element
} Xpath = //li[normalize-space()='%RumbleLivestreamTime%']
else, { ; notify user and return Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
Message = Login Expired. Please Log Back in if(Status){
Message = Failed to select time from popup menu using generated xpath.`nXpath = %Xpath%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return 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'] ; Select Channel for Upload
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoFilepath) ; ------------------------------------------------
; click channel dropdown
Xpath = //span[@class='text-light truncate text-mini']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){ if(Status){
try, CurrentURL := GetCurrentTabURlBase() Message = Failed to click on Channel dropdown menu
Message = Failed to Upload Video File`nCurrent Tab URL: %CurrentURL%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return Return
} }
; Grab inner text of all items in the channel select drop down menu
xpath = (//div[@class='shadow-md rounded-lg overflow-x-hidden bg-indigo'])[1]
try ElementInnerText := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
; Input Title ; pull out name of first channel in dropdown
try driver.findElementsByName("title").item[1].SendKeys(VideoTitle) ;selects element based on Name and sends variable to it. FirstChannelName := StrSplit(ElementInnerText, "`n")[1]
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) Xpath = (//span[normalize-space()='%FirstChannelName%'])[1]
if(!Status) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
Break if(Status){
Message = Failed to select the channel -%FirstChannelName%- from Channel dropdown menu
/* 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") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return 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
*/
}
; Select each Secondary Platform checkbox
; ------------------------------------------------
IniRead, RumbleSecondaryPlatformsList, %SettingsIniFilepath%, %ScriptSettingsSection%, RumbleSecondaryPlatformsList, %A_Space%
; sleep, 5000 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%]
Message = Selecting Channel try SecondaryPlatformCheckboxName := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
if(SecondaryPlatformCheckboxName = "Add new destination" OR SecondaryPlatformCheckboxName = ""){
Break
}
RumbleSecondaryPlatformsList .= SecondaryPlatformCheckboxName . "--"
; try driver.findElementsByID("channelId").item[1].click()
; @todo replace with regex }
js = return document.querySelector("#channelId").innerHTML; IniWrite, %RumbleSecondaryPlatformsList%, %SettingsIniFilepath%, %ScriptSettingsSection%, RumbleSecondaryPlatformsList
try, ChannelIDNumber := driver.executeScript(js) 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=
; Msgbox % "ChannelIDNumber: " ChannelIDNumber }
ChannelIDNumber := StrSplit(ChannelIDNumber, "option value=")
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
ChannelIDNumber := ChannelIDNumber[3] Loop, 10 {
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
SingleQuote = " IndexPlusOne := A_index + 1
ChannelIDNumber := StrSplit(ChannelIDNumber, "data-private") Xpath = (//div[@class='flex shrink-0 items-center gap-x-4'])[%A_index%]
ChannelIDNumber := ChannelIDNumber[1] XpathCheckbox = (//div[@class='relative shrink-0'])[%A_index%]
ChannelIDNumber := StrReplace(ChannelIDNumber, SingleQuote, "")
ChannelIDNumber := StrReplace(ChannelIDNumber, " ", "")
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
try SecondaryPlatformCheckboxName := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
; js = return document.querySelector("#channelId").value; if(SecondaryPlatformCheckboxName = "Add new destination" OR SecondaryPlatformCheckboxName = ""){
; try, ChannelIDNumber := driver.executeScript(js) Break
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
if(ChannelIDNumber = ""){
Message = ChannelIDNumber is blank. Unable to select Upload Channel
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
} }
if(!InStr(RumbleSecondaryPlatformsList,SecondaryPlatformCheckboxName))
Continue
ChannelIDNumber = 6070526 ; freedomain Status := Selenium_LoopToClickXpath(Xpath:=XpathCheckbox,NumOfLoops:=2,SleepLength:=1000)
; ChannelIDNumber = 762377 ; personal if(Status){
Message = Failed to check off the checkbox for: %SecondaryPlatformCheckboxName%
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") 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")
} }
sleep, 250
}
; 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. if(ConfirmBeforeSubmit){
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.
OnMessage(0x44, "")
IfMsgBox OK, {
} Else IfMsgBox Cancel, {
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of automation for this site.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
}
/*
*/
; Custom Thumbnail ; click the "next" button to finalize the upload
if(VideoThumbFilepath != "") { Xpath = (//span[normalize-space()='Next'])[1]
TooltipThis("Uploading Thumbnail") Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
Xpath = //input[@name='customThumb']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoThumbFilepath)
if(Status){ if(Status){
Message = Failed to Upload Thumbanil Message = Failed to click "Next" to finalize the upload
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
} }
; @todo: Add a check to see if progress gets stuck Message = Waiting 15 seconds before Navigating to Rumble and Grabbing Livestream URL
; Check Upload Percentage SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
TooltipThis("Waiting for Video to Finish Uploading") sleep, 15000
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) try, driver.get("https://rumble.com/account/live-streaming")
if(Status = "Failed") catch e {
Message = Failed to Navigate to Rumble.com
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return 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 try, driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
; 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.
Xpath = (//span[@class='video-info-status recorder'])[1]
Loop, 5 {
/* if(A_index = 5){
js = document.getElementById('customThumb').click(); Message = Failed to grab livestream URL. `nAfter 5 checks the top livestream is still not in -Waiting for Stream- status.
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") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return 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
} }
if(ConfirmBeforeSubmit) Xpath = (//h2[@class='video-title'])[1]
msgbox, Please check that all data was input correctly and then click OK to Publish Video
try UploadPageURL := driver.URL RumbleURLSlug := GetHTMLValueFromXpathOuterHTML(XPATH, "href")
if(RumbleURLSlug = "" or RumbleURLSlug = "Failed"){
Message = Failed to grab Rumble URL Slug from Livestreams Page
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Submit Button RumbleLivestreamURL := "https://rumble.com" . RumbleURLSlug
js = document.getElementById('submitForm').click();
try driver.executeScript(js) ;
IniWrite, %RumbleLivestreamURL%, %PostStatusesFilepath%, Livestream,RumbleLivestreamURL
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
return
; 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

@ -0,0 +1,98 @@
RumbleSetRTMP:
;------------------------------------------------
CurrentSite := "Rumble Studio"
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()
Message = Inputting Custom RTMP Settings into Rumble Studio
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
IniRead, LocalsRTMPURL, %PostStatusesFilepath%, Livestream,LocalsRTMPURL, %A_Space%
IniRead, LocalsRTMPKey, %PostStatusesFilepath%, Livestream,LocalsRTMPKey, %A_Space%
IniRead, OdyseeRTMPKey, %PostStatusesFilepath%, Livestream,OdyseeRTMPKey, %A_Space%
IniRead, OdyseeRTMPURL, %PostStatusesFilepath%, Livestream,OdyseeRTMPURL, %A_Space%
if(LocalsRTMPURL = ""){
Message = Skipping. No LocalsRTMPURL in Status.ini file
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
if(OdyseeRTMPURL = ""){
Message = Skipping. No OdyseeRTMPURL 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
if(SecondaryPlatformCheckboxName = "LOCALS RTMP USE" OR SecondaryPlatformCheckboxName = "ODYSEE RTMP"){
if(SecondaryPlatformCheckboxName = "LOCALS RTMP USE"){
SiteRTMPURL := LocalsRTMPURL
SiteRTMPKey := LocalsRTMPKey
}
if(SecondaryPlatformCheckboxName = "ODYSEE RTMP"){
SiteRTMPURL := OdyseeRTMPURL
SiteRTMPKey := OdyseeRTMPKey
}
Status := Selenium_LoopToClickXpath(Xpath:=XpathCheckbox,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to click into 3 dot menu for %SecondaryPlatformCheckboxName%
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 %SecondaryPlatformCheckboxName%
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:=SiteRTMPURL,ClearElement:=1)
Status := Selenium_LoopToSendValueToXpath(Xpath:=XpathStreamkey,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=SiteRTMPKey,ClearElement:=1)
; click save button
Xpath = (//button[@class='rounded-full block px-6 py-2 bg-primary hover:brightness-[0.92] cursor-pointer'])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to Click Save Button for %SecondaryPlatformCheckboxName% modified RMTP Settings
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
break
}
}
RumbleCustomRTMPs := "Success"
IniWrite, %RumbleCustomRTMPs%, %PostStatusesFilepath%, Livestream,RumbleCustomRTMPs

@ -1,3 +1,13 @@
# Freedomain-Livestream-Scheduler # Freedomain-Livestream-Scheduler
Livestream Scheduler written for the [Freedomain Philosophy Show](https://freedomain.com/) Livestream Scheduler written for the [Freedomain Philosophy Show](https://freedomain.com/)
![Alt text](Assets/Preview.png "Screenshot of Main Window")
## Features
Automated scheduling of livestreams on the following platforms using Selenium Chrome automation.
* Odysee
* Locals
* Rumble
- The RTMP information from each platform will be grabbed at the end of the schedule and then input into Rumble Studio for Livestreaming.

Binary file not shown.
Loading…
Cancel
Save