From d1e471bd261784305d19ab15ef80467ad78c2909 Mon Sep 17 00:00:00 2001 From: yuriy Date: Sat, 22 Jun 2024 15:14:44 -0400 Subject: [PATCH] added Aspect Ratio check for Brighteon, and set brighteon check status appropriately, added video info to errorlog --- Freedomain Video Uploader.ahk | 20 ++++++++++++++++++-- Modules/GUI-Main-Window.ahk | 11 ++++++++--- Version.ini | 2 +- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Freedomain Video Uploader.ahk b/Freedomain Video Uploader.ahk index f0f61ff..43ee5b7 100644 --- a/Freedomain Video Uploader.ahk +++ b/Freedomain Video Uploader.ahk @@ -310,8 +310,14 @@ Loop, files, %VideoFolderDir%\*.*, F ; loop through the files in the director FileGetSize, VideoFileSizeInMB, %A_LoopFileFullPath%, M VideoInfoObj := Filexpro(VideoFilepath, - , "System.Video.TotalBitrate" ) - VideoTotalBitrate := VideoInfoObj["System.Video.TotalBitrate"] + , "System.Video.TotalBitrate" + , "System.Video.FrameHeight" + , "System.Video.FrameWidth" ) + try, VideoTotalBitrate := VideoInfoObj["System.Video.TotalBitrate"] + try, VideoHeight := VideoInfoObj["System.Video.FrameHeight"] + try, VideoWidth := VideoInfoObj["System.Video.FrameWidth"] + + VideoAspectRatio := getAspectRatio(VideoWidth, VideoHeight) } @@ -355,6 +361,8 @@ Loop, files, %VideoFolderDir%\*.mp3, F ; loop through the files in the direct } + + ;---Read Info From Previous Run And Set Upload Options--- ;-------------------------------------------------------- VideoLinksIniFile = %VideoFolderDir%\VideoLinks.ini @@ -446,6 +454,11 @@ if(VideoFileSizeInMB > 6144){ Brighteon := 0 } +; Brighteon will fail if video does not have one of the following aspect ratios +BrighteonAcceptedAspectRatios := ["4:3","3:4","16:9","9:16"] +; Msgbox % "VideoAspectRatio: " VideoAspectRatio +VideoHasBrighteonCompatibleAspectRatio := HasVal(BrighteonAcceptedAspectRatios, VideoAspectRatio) + ; Override Website statuses if this is a schedule post based on Argument3 ; ------------------------------------------------ @@ -731,6 +744,9 @@ SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile") Message := "TotalVideosUploaded: " TotalVideosUploaded SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile") +Message := "Video Information:`n VideoTotalBitrate:" . VideoTotalBitrate . "`nVideoAspectRatio:" . VideoAspectRatio +SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") + ; Convert Video Title and Description into javascript formatting for sending to pages through js instead of plain selenium JSVideoTitle := FormatTextToJSText(VideoTitle) JSVideoDescription := FormatTextToJSText(VideoDescription) diff --git a/Modules/GUI-Main-Window.ahk b/Modules/GUI-Main-Window.ahk index 272056d..0687ec5 100644 --- a/Modules/GUI-Main-Window.ahk +++ b/Modules/GUI-Main-Window.ahk @@ -279,11 +279,16 @@ Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSize% vOdyseeAudio Checked%O Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSize% vRumble Checked%Rumble% gUpdateVars, Rumble -if(VideoTotalBitrate > 300000) -Gui, Add, Checkbox, vBrighteon y+%MarginSize% Checked%Brighteon% gUpdateVars, Brighteon -else,{ +; Brighteon Does not accept videos lower than 300kbps or that don't have the appropriate aspect ratio +if(VideoTotalBitrate < 300000 OR !VideoHasBrighteonCompatibleAspectRatio){ +if(!VideoHasBrighteonCompatibleAspectRatio) + Gui, Add, Checkbox, cRed vBrighteon y+%MarginSize% Checked0 gUpdateVars, Brighteon (Aspect Ratio is %VideoAspectRatio%) + else, Gui, Add, Checkbox, cRed vBrighteon y+%MarginSize% Checked0 gUpdateVars, Brighteon (Bitrate Below 300kbps) } +else,{ + Gui, Add, Checkbox, vBrighteon y+%MarginSize% Checked%Brighteon% gUpdateVars, Brighteon +} Gui, Add, Checkbox, vDailyMotion y+%MarginSize% Checked%DailyMotion% gUpdateVars, DailyMotion diff --git a/Version.ini b/Version.ini index 5d200c2..0dc3751 100644 --- a/Version.ini +++ b/Version.ini @@ -1,3 +1,3 @@ [Video-Uploader] -Version=3.39 +Version=3.40 Name=Freedomain Video Uploader