From ba0bf308b4dafca92063d7805bc4fa16c0dc831b Mon Sep 17 00:00:00 2001 From: yuriy Date: Sat, 8 Jun 2024 18:26:22 -0400 Subject: [PATCH] added ability to schedule an upload for a later time --- .gitignore | 2 + Freedomain Video Uploader.ahk | 149 +++++++++++++----------- Lib/Freedomain-Posters-Shared-Functions | 2 +- Modules/GUI-Main-Window.ahk | 5 +- 4 files changed, 91 insertions(+), 67 deletions(-) diff --git a/.gitignore b/.gitignore index 33977a4..5b46393 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,6 @@ Lib/LBRY Process Killer.exe Lib/chrome-win64 Lib/Version.ini Lib/Version-FVU.ini +Lib/Version-FPS.ini **/Scheduled-Posts +Freedomain Post Scheduler.exe diff --git a/Freedomain Video Uploader.ahk b/Freedomain Video Uploader.ahk index 95409bc..d080b23 100644 --- a/Freedomain Video Uploader.ahk +++ b/Freedomain Video Uploader.ahk @@ -6,6 +6,7 @@ SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. CoordMode, ToolTip, Screen CoordMode, Mouse, Screen FileEncoding, UTF-8-RAW ; Needed for special symbols that are used in video descritions +DetectHiddenWindows, ON ; used for finding Running .ahk scripts ; Only Set tool tray icon if this is the source .ahk script. ; The .exe has the icon compiled into it @@ -180,10 +181,21 @@ if(DiscordErrorLoggingWebhookBotURL = ""){ } -;---Auto Updater Settings--- -;------------------------------------------------ +; Auto Updater Settings +; ------------------------------------------------ global GitReleasesAPIURL -GitReleasesAPIURL = https://freedomain.dev/api/v1/repos/yuriy/Freedomain-Video-Uploader/releases +GitReleasesAPIURL = https://freedomain.dev/api/v1/repos/yuriy/video-uploader/releases + +; Post Scheduler Settings +; ------------------------------------------------ +global PostSchedulerGitReleasesAPIURL +PostSchedulerGitReleasesAPIURL = https://freedomain.dev/api/v1/repos/yuriy/post-scheduler/releases +IniRead, PostSchedulerVersion, %SettingsIniFilepath%, Freedomain Post Scheduler, Version, 0.0 +IniRead, PostSchedulerFilepath, %SettingsIniFilepath%, Filepaths, PostScheduler, %A_Space% + + +; Msgbox % "PostSchedulerVersion: " PostSchedulerVersion +; IniRead, OutputVar, Filename, Section, Key [, Default] ;---LBRY Settings--- @@ -449,96 +461,100 @@ if(PassedInArgument2_Action = "Scheduled"){ (InStr(PassedInArgument3_Details, "Brighteon"))?(Brighteon := 1) : (Brighteon := 0) (InStr(PassedInArgument3_Details, "DailyMotion"))?(DailyMotion := 1) : (DailyMotion := 0) - ; } - goto, StartScheduledPost -} + ; } + goto, StartScheduledPost + } -;---/Read Info From Previous Run And Set Upload Options--- -;-------------------------------------------------------- + ;---/Read Info From Previous Run And Set Upload Options--- + ;-------------------------------------------------------- -if(PassedInArgument2_Action = "ShowResults"){ - goto, DisplayResults -} + if(PassedInArgument2_Action = "ShowResults"){ + goto, DisplayResults + } -; Main GUI Window -; ------------------------------------------------ -gosub, SetAndShowMainGUI + ; Main GUI Window + ; ------------------------------------------------ + gosub, SetAndShowMainGUI -; Write current project to ini file for easy reloading -IniWrite, %BodyTextFilePath%, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost + ; Write current project to ini file for easy reloading + IniWrite, %BodyTextFilePath%, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost -RunTimeToShowGui := round(((A_TickCount - UStartTime) / 1000), 2) + RunTimeToShowGui := round(((A_TickCount - UStartTime) / 1000), 2) -Return + Return -; -------------------------------GUI GoSubs------------------------------- -; Kill the script if user clicks on cancel button -KillScript: -; GuiClose: -ExitApp -Return + ; -------------------------------GUI GoSubs------------------------------- + ; Kill the script if user clicks on cancel button + KillScript: + ; GuiClose: + ExitApp + Return -PauseScript: -Pause,Toggle -Return + PauseScript: + Pause,Toggle + Return -CancelPost: -GuiClose: -; ExitApp -Gui, Submit, -Return + CancelPost: + GuiClose: + ; ExitApp + Gui, Submit, + Return -ReloadScript: -Reload -Return + ReloadScript: + Reload + Return -; Gets activated each time that text gets input into any of the text boxes -; updates the variables with the new text -UpdateVars: -Gui, Submit, NoHide -Return + ; Gets activated each time that text gets input into any of the text boxes + ; updates the variables with the new text + UpdateVars: + Gui, Submit, NoHide + Return -SubmitDescription: -Gui, Submit, NoHide -DescriptionCharCount := StrLen(VideoDescription) -GuiControl,, DescriptionCharCount, %DescriptionCharCount% -Return + SubmitDescription: + Gui, Submit, NoHide + DescriptionCharCount := StrLen(VideoDescription) + GuiControl,, DescriptionCharCount, %DescriptionCharCount% + Return -; Open folder of the project -OpenProjectFolder: -run, %VideoFolderDir% -Return + ; Open folder of the project + OpenProjectFolder: + run, %VideoFolderDir% + Return -ClearVideoLinks: -FileDelete, %VideoLinksIniFile% -Return + ClearVideoLinks: + FileDelete, %VideoLinksIniFile% + Return -OpenErrorLog: -run, %ErrorLoggingFilePath% -Return -ToggleTestingMode: -ToggleTestingMode() -run, "%A_ScriptFullPath%" "LastPost" -Return -ToggleDevMode: -ToggleDevMode() -run, "%A_ScriptFullPath%" "LastPost" -Return + ToggleTestingMode: + ToggleTestingMode() + run, "%A_ScriptFullPath%" "LastPost" + Return + ToggleDevMode: + ToggleDevMode() + run, "%A_ScriptFullPath%" "LastPost" + Return +/* OpenGiteaPage: run, https://freedomain.dev/yuriy/video-uploader Return +OpenErrorLog: +run, %ErrorLoggingFilePath% +Return + +*/ + UncheckAllPlatforms: GuiControl,,Bitchute, 0 GuiControl,,Locals, 0 @@ -941,8 +957,11 @@ IniWrite, %VideoTitle%, %ScheduleFileFilepath%, Schedule-Info, Title IniWrite, %VideoSites%, %ScheduleFileFilepath%, Schedule-Info, Sites -IniRead, OutputVar, Filename, Section, Key [, Default] - +if(!FileExist(PostSchedulerFilepath)){ + gosub, UpdatePostScheduler +} +else, +run, %PostSchedulerFilepath% Return diff --git a/Lib/Freedomain-Posters-Shared-Functions b/Lib/Freedomain-Posters-Shared-Functions index cf56ae8..a3d89a9 160000 --- a/Lib/Freedomain-Posters-Shared-Functions +++ b/Lib/Freedomain-Posters-Shared-Functions @@ -1 +1 @@ -Subproject commit cf56ae8136def874793895733d595349b20d9c19 +Subproject commit a3d89a989282e2c852b72b7e6d02a1a88ee53ee4 diff --git a/Modules/GUI-Main-Window.ahk b/Modules/GUI-Main-Window.ahk index 9a618f5..382b226 100644 --- a/Modules/GUI-Main-Window.ahk +++ b/Modules/GUI-Main-Window.ahk @@ -194,7 +194,7 @@ Gui, Add, Button, x+%MarginSize% yp+0 h%EditBoxHeight% gSelectMP3Filepath, Selec Gui, Font, s%GuiFontSize% gui, Font, Bold -Gui, Add, Button, w%EditBoxFourthWidths% x%MarginSize% gUpdateScript vUpdateAvailable h%SecondaryButtonHeights% center,FVU Up-to-Date +Gui, Add, Button, w%EditBoxFourthWidths% x%MarginSize% vUpdateAvailable h%SecondaryButtonHeights% gUpdateScript,FVU Up-to-Date Gui, Add, Button, x+%MarginSize% w%EditBoxFourthWidths% h%SecondaryButtonHeights% gOpenProjectFolder, Open Folder @@ -207,6 +207,9 @@ Gui, Add, Button, w%EditBoxFourthWidths% h%SecondaryButtonHeights% x%MarginSize% Gui, Add, Button, x+%MarginSize% yp+0 w%EditBoxFourthWidths% h%SecondaryButtonHeights% gDisplayResults, View Status Gui, Add, Button, x+%MarginSize% w%EditBoxHalfWidths% h%SecondaryButtonHeights% gStartScript, UPLOAD +Gui, Add, Button, w%EditBoxFourthWidths% h%SecondaryButtonHeights% x%MarginSize% y+%MarginSize% vPostSchedulerUpdateAvailable gUpdatePostScheduler, Post Scheduler Up-To-Date +; Gui, Add, Button, w%EditBoxFourthWidths% h%SecondaryButtonHeights% x%MarginSize% y+%MarginSize% vPostSchedulerUpdateAvailable, Post Scheduler Up-To-Date + if(DevMode){ Gui, Add, Button, x%MarginSize% w%EditBoxFourthWidths% h30 y+5 h%SecondaryButtonHeights% gOpenErrorLog, Open ErrorLog