@ -6,16 +6,23 @@ SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, ToolTip, Screen
CoordMode, ToolTip, Screen
CoordMode, Mouse, Screen
CoordMode, Mouse, Screen
FileEncoding, UTF-8-RAW ; Needed for special symbols that are used in video descritions
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.
; Only Set tool tray icon if this is the source .ahk script.
; The .exe has the icon compiled into it
; The .exe has the icon compiled into it
if(InStr(A_ScriptFullPath, ".ahk")){
if(InStr(A_ScriptFullPath, ".ahk")){
try Menu, Tray, Icon, %A_ScriptDir%\Assets\FreedomainVideo .ico
try Menu, Tray, Icon, %A_ScriptDir%\Assets\Icon .ico
}
}
; Parameter passed in to script
; Parameter passed in to script
; ------------------------------------------------
; ------------------------------------------------
PassedParameter = %1%
PassedInArgument1_Filepath = %1% ; Filepath of one of the files in the directory of the video project
PassedInArgument2_Action = %2% ; "Scheduled", "ShowResults", "Delete"
PassedInArgument3_Details = %3% ; Details of Argument2, eg list of Sites to Upload to
; Msgbox % "PassedInArgument1_Filepath: " PassedInArgument1_Filepath
; Msgbox % "PassedInArgument2: " PassedInArgument2
; Msgbox % "PassedInArgument3: " PassedInArgument3
; Customize the Toolbar Icon Menu
; Customize the Toolbar Icon Menu
@ -33,7 +40,7 @@ Menu, Tray, Default, Restart with Last Project
; Track how long sections of code take to run
; Track how long sections of code take to run
UStartTime := A_TickCount ; start time
UStartTime := A_TickCount ; start time
; Included FI les and Libraries
; Included Fi les and Libraries
; ------------------------------------------------
; ------------------------------------------------
; These have to be included at the top for the Global variables to get registered early
; These have to be included at the top for the Global variables to get registered early
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\General-Functions.ahk
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\General-Functions.ahk
@ -52,9 +59,7 @@ UStartTime := A_TickCount ; start time
;---Global Variables---
;---Global Variables---
;------------------------------------------------
;------------------------------------------------
global ScriptNameav
global ScriptVersion
global FullScriptName
global LBRYResolveAPICommand
global LBRYResolveAPICommand
global LBRYPermanentURL
global LBRYPermanentURL
global VideoTitle
global VideoTitle
@ -62,7 +67,6 @@ global VideoFilepath
global VideoThumbFilepath
global VideoThumbFilepath
global VideoTags
global VideoTags
global VideoDescription
global VideoDescription
global SocialMediaDescription
global DiscordErrorLoggingWebhookBotURL
global DiscordErrorLoggingWebhookBotURL
global DiscordVideosWebhookURL
global DiscordVideosWebhookURL
global VideoFolderDir
global VideoFolderDir
@ -72,7 +76,6 @@ global CurrentSite
global Driver
global Driver
global DriverStatus
global DriverStatus
global ChromeProfile
global ChromeProfile
global ShowTooltipProgressCheckStatus
global ShowTooltipProgress
global ShowTooltipProgress
global ErrorLogSummary
global ErrorLogSummary
global DiscordParlerWebhookURL
global DiscordParlerWebhookURL
@ -84,6 +87,7 @@ ErrorLogVar :=
global DevMode
global DevMode
; @todo: this can be hardcoded into the lbry functions as it never changes
global LBRYNetFilepath
global LBRYNetFilepath
LBRYNetFilepath := "C:\Program Files\LBRY\resources\static\daemon\lbrynet.exe"
LBRYNetFilepath := "C:\Program Files\LBRY\resources\static\daemon\lbrynet.exe"
@ -104,6 +108,7 @@ Array_Index_Num_of_Upload_StatusChecks := [144,288,432, 576,720,864]
; Check if Lib folder exists and create it if not
; Check if Lib folder exists and create it if not
LibFolder := A_ScriptDir . "\Lib"
LibFolder := A_ScriptDir . "\Lib"
ErrorLoggingFolder := A_ScriptDir . "\Lib\ErrorLogging"
ErrorLoggingFolder := A_ScriptDir . "\Lib\ErrorLogging"
if(!FileExist(ErrorLoggingFolder))
FileCreateDir, %ErrorLoggingFolder%
FileCreateDir, %ErrorLoggingFolder%
; Set filepaths for different files and folders
; Set filepaths for different files and folders
@ -113,20 +118,25 @@ SettingsIniFilepath := A_ScriptDir . "\Settings.ini"
global ScriptSettingsSection
global ScriptSettingsSection
ScriptSettingsSection := "VideoUploader"
ScriptSettingsSection := "VideoUploader"
global ScriptNameAcronym
ScriptNameAcronym := "FVU"
global ScriptName
global ScriptVersion
global FullScriptName
FileInstall, Version.ini, %A_ScriptDir%\Lib\Version.ini, 1
VersionIniFilepath = %A_ScriptDir%\Lib\Version-%ScriptNameAcronym%.ini
IniRead, ScriptVersion, %A_ScriptDir%\Lib\Version.ini,Video-Uploader, Version, 0.0
IniRead, ScriptName, %A_ScriptDir%\Lib\Version.ini,Video-Uploader, Name, "Video Uploader"
; Install the Version.ini file in lib folder (Used by .exe file)
FileInstall, Version.ini, %VersionIniFilepath%, 1
IniRead, ScriptVersion, %VersionIniFilepath%,Video-Uploader, Version, 0.0
IniRead, ScriptName, %VersionIniFilepath%,Video-Uploader, Name,
FullScriptName := ScriptName . " - " . ScriptVersion
FullScriptName := ScriptName . " - " . ScriptVersion
;---Script Settings---
;---Script Settings---
;------------------------------------------------
;------------------------------------------------
; Checkbox Settings
; Checkbox Settings
IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1
(ShowTooltipProgress)?(ShowTooltipProgressCheckStatus := 1) : (ShowTooltipProgressCheckStatus := 0)
IniRead, XPosition, %SettingsIniFilepath%, General, XPosition, 0
IniRead, XPosition, %SettingsIniFilepath%, General, XPosition, 0
IniRead, YPosition, %SettingsIniFilepath%, General, YPosition, 0
IniRead, YPosition, %SettingsIniFilepath%, General, YPosition, 0
@ -137,22 +147,26 @@ IniRead, DevMode, %SettingsIniFilepath%, General, DevMode, 0
IniRead, TotalVideosUploaded, %SettingsIniFilepath%, General, TotalVideosUploaded, 0
IniRead, TotalVideosUploaded, %SettingsIniFilepath%, General, TotalVideosUploaded, 0
IniRead, MouseClicksSaved, %SettingsIniFilepath%, General, MouseClicksSaved, 0
IniRead, MouseClicksSaved, %SettingsIniFilepath%, General, MouseClicksSaved, 0
; Checkbox Settings
IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1
IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1
(ShowTooltipProgress)?(ShowTooltipProgressCheckStatus := 1) : (ShowTooltipProgressCheckStatus := 0)
IniRead, AutoUpdateCheck, %SettingsIniFilepath%, General, AutoUpdateCheck, 1
IniRead, AutoUpdateCheck, %SettingsIniFilepath%, General, AutoUpdateCheck, 1
(AutoUpdateCheck)?(AutoUpdateCheckCheckStatus := 1) : (AutoUpdateCheckCheckStatus := 0)
; AutoLogin setting
; AutoLogin setting
IniRead, AutoLogin, %SettingsIniFilepath%, General, AutoLogin, 1
IniRead, AutoLogin, %SettingsIniFilepath%, General, AutoLogin, 1
(AutoUpdateCheck)?(AutoUpdateCheckCheckStatus := 1) : (AutoUpdateCheckCheckStatus := 0)
IniRead, PingOnCompletion, %SettingsIniFilepath%, General, PingOnCompletion, 1
IniRead, KillLBRYAfterUpload, %SettingsIniFilepath%, General, KillLBRYAfterUpload, 1
(PingOnCompletion)?(PingOnCompletionCheckStatus := 1) : (PingOnCompletionCheckStatus := 0)
IniRead, ConfirmBeforeSubmit, %SettingsIniFilepath%, %ScriptSettingsSection%, ConfirmBeforeSubmit, 0
if(PingOnCompletion){
; Discord Error Logging
; ------------------------------------------------
IniRead, ErrorLogToDiscord, %SettingsIniFilepath%, %ScriptSettingsSection%, ErrorLogToDiscord, 1
IniRead, DiscordPingOnCompletion, %SettingsIniFilepath%, %ScriptSettingsSection%, DiscordPingOnCompletion, 1
if(ErrorLogToDiscord || DiscordPingOnCompletion){
IniRead, DiscordUsernameID, %SettingsIniFilepath%, General, DiscordUsernameID, %A_space%
IniRead, DiscordUsernameID, %SettingsIniFilepath%, General, DiscordUsernameID, %A_space%
if(!DiscordUsernameID){
if(!DiscordUsernameID){
Message = DiscordUsernameID is blank. Will not be able to ping to notify when uploads are complete.`nPlease add user ID in settings.ini under: `n`n[General]`nDiscordUsernameID=`nOr Uncheck "Discord Ping on Completion"
Message = DiscordUsernameID is blank. Will not be able to ping to notify when uploads are complete.`nPlease add user ID in settings.ini under: `n`n[General]`nDiscordUsernameID=`nOr Uncheck "Discord Ping on Completion"
@ -161,10 +175,6 @@ if(PingOnCompletion){
}
}
}
}
IniRead, KillLBRYAfterUpload, %SettingsIniFilepath%, General, KillLBRYAfterUpload, 1
(KillLBRYAfterUpload)?(=KillLBRYAfterUploadCheckStatus := 1) : (KillLBRYAfterUploadCheckStatus := 0)
IniRead, DiscordErrorLoggingWebhookBotURL, %SettingsIniFilepath%, General, DiscordWebhookBotURL, %A_space%
IniRead, DiscordErrorLoggingWebhookBotURL, %SettingsIniFilepath%, General, DiscordWebhookBotURL, %A_space%
if(DiscordErrorLoggingWebhookBotURL = ""){
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=
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=
@ -172,20 +182,21 @@ if(DiscordErrorLoggingWebhookBotURL = ""){
}
}
; Auto Updater Settings
;---Auto Updater Settings---
; ------------------------------------------------
;------------------------------------------------
global GitReleasesAPIURL
global GitReleasesAPIURL
GitReleasesAPIURL = https://freedomain.dev/api/v1/repos/yuriy/Freedomain-Video-U ploader/releases
GitReleasesAPIURL = https://freedomain.dev/api/v1/repos/yuriy/video-u ploader/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%
;---LBRY Settings---
;---LBRY Settings---
;------------------------------------------------
;------------------------------------------------
IniRead, LBRYNewVideoStakeAmount, %SettingsIniFilepath%, General, LBRYNewVideoStakeAmount, %A_Space%
IniRead, LBRYNewVideoStakeAmount, %SettingsIniFilepath%, General, LBRYNewVideoStakeAmount, 1.0
if(LBRYNewVideoStakeAmount = ""){
LBRYNewVideoStakeAmount = 1.0
IniWrite, %LBRYNewVideoStakeAmount%, %SettingsIniFilepath%, General, LBRYNewVideoStakeAmount
}
IniRead, LBRYChannelID, %SettingsIniFilepath%, General, LBRYChannelID, %A_Space%
IniRead, LBRYChannelID, %SettingsIniFilepath%, General, LBRYChannelID, %A_Space%
if(LBRYChannelID = ""){
if(LBRYChannelID = ""){
@ -194,12 +205,10 @@ if(LBRYChannelID = ""){
}
}
; Set Settings based on Passed in Arguments
;---Read Info From Project Files---
; ------------------------------------------------
;------------------------------------------------
; if passed argument is .exe file, then script has just been updated and we need to move the old version
if(InStr(PassedInArgument1_Filepath,ScriptName) and InStr(PassedInArgument1_Filepath,".exe")){
; if passed argument is .exe file, then script has just been udpated and we need to move the old version
if(InStr(PassedParameter,ScriptName) and InStr(PassedParameter,".exe")){
; create backups folder if it doesn't exist
; create backups folder if it doesn't exist
BackupsFolder = %LibFolder%\Backups\
BackupsFolder = %LibFolder%\Backups\
@ -210,44 +219,51 @@ if(InStr(PassedParameter,ScriptName) and InStr(PassedParameter,".exe")){
}
}
; move old version to backups folder, overwrite if name conflict
; move old version to backups folder, overwrite if name conflict
FileMove, %PassedParameter%, %BackupsFolder%\*, 1
FileDelete, %PassedInArgument1_Filepath%
if(ErrorLevel){ ; most likely because the old version hasn't finished exiting yet
if(ErrorLevel){ ; most likely because the old version hasn't finished exiting yet
SaveOrPostProgress(Message:="Moving Old Version to Backups ",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar")
SaveOrPostProgress(Message:="Failed to Delete Old Program Version ",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar")
sleep, 2000
sleep, 2000
FileMove, %PassedParameter%, %BackupsFolder%\*, 1
FileDelete, %PassedInArgument1_Filepath%
if(ErrorLevel){
if(ErrorLevel){
MsgBox,,Update Successful, Update was successful`, but unable to move old version to the Backups folder.`nPlease move it or delete it manually.
MsgBox,,Update Successful, Update was successful`, but failed to delete the old version, most likely due to it running.`nPlease delete it manually.
}
}
ToolTip
ToolTip
}
}
; Change paramter to LastPost so last post gets automatically opened instead of user having to re-select the file again
; Change parame ter to " LastPost" so last post now gets automatically opened instead of user having to re-select the file again
PassedParameter = LastPost
PassedInArgument1_Filepath = LastPost
}
}
if(PassedParameter = "LastPost"){
if(PassedInArgument1_Filepath = "LastPost"){
IniRead, PassedParameter , %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost, %A_Space%
IniRead, PassedInArgument1_Filepath , %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost, %A_Space%
}
}
if(PassedParameter = "ShowResults"){
if(PassedInArgument2_Action = "ShowResults"){
IniRead, PassedParameter , %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost, %A_Space%
IniRead, PassedInArgument1_Filepath , %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost, %A_Space%
}
}
; Show File Selection Dialogue
PassedParameterLength := StrLen(PassedParameter)
; ------------------------------------------------
if(PassedParameterLength < 5 and !InStr(PassedParameter, ".exe")){
PassedInArgument1_FilepathLength := StrLen(PassedInArgument1_Filepath)
if(PassedInArgument1_FilepathLength < 5 and !InStr(PassedInArgument1_Filepath, ".exe")){
FileSelectFile, BodyTextFilePath,,%RootDirToStartIn%,Please Select ANY File Within the Project Folder
FileSelectFile, BodyTextFilePath,,%RootDirToStartIn%,Please Select ANY File Within the Project Folder
if(ErrorLevel)
if(ErrorLevel)
Return
Return
}
}
else, {
else, {
SkipUpdateCheckThisRun := 1
SkipUpdateCheckThisRun := 1
BodyTextFilePath := PassedParameter
BodyTextFilePath := PassedInArgument1_Filepath
}
}
; @todo Do this with an array. Add all filepaths to array and then pull out the ones with the extension.
; get directory from the filepath grabbed
; Read Info From Project Files
;------------------------------------------------
; get project directory from the "BodyTextFilePath"
; BodyTextFilePath will be any file from within the update directory
SplitPath, BodyTextFilePath, OutFileName, VideoFolderDir, OutExtension, OutNameNoExt, OutDrive
SplitPath, BodyTextFilePath, OutFileName, VideoFolderDir, OutExtension, OutNameNoExt, OutDrive
Loop, files, %VideoFolderDir%\*.*, F ; loop through the files in the directory
Loop, files, %VideoFolderDir%\*.*, F ; loop through the files in the directory
@ -256,9 +272,12 @@ Loop, files, %VideoFolderDir%\*.*, F ; loop through the files in the director
if(FileNameWExt = "title.txt"){
if(FileNameWExt = "title.txt"){
FileRead, VideoTitle, %A_LoopFileFullPath%
FileRead, VideoTitle, %A_LoopFileFullPath%
; Generate the LBRY URL Slug on each startup in case Title changes between runs
LBRYURLSlug := VideoTitle
LBRYURLSlug := VideoTitle
LBRYURLSlug := LBRYCMDTextReplacement(LBRYURLSlug)
OriginalVideoTitle := VideoTitle
OriginalVideoTitle := VideoTitle
OriginalLBRYURLSlug := LBRYURLSlug
}
}
if(FileNameWExt = "body.txt"){
if(FileNameWExt = "body.txt"){
@ -277,7 +296,7 @@ Loop, files, %VideoFolderDir%\*.*, F ; loop through the files in the director
FileRead, VideoTags, %A_LoopFileFullPath%
FileRead, VideoTags, %A_LoopFileFullPath%
FileRead, PodcastTags, %A_LoopFileFullPath%
FileRead, PodcastTags, %A_LoopFileFullPath%
OriginalVideoTags := VideoTags
OriginalVideoTags := VideoTags
OriginalPodcastTags := PodcastTags
OriginalPodcastTags := PodcastTags ; set in case there is no keywords_podcast file
}
}
if(FileNameWExt = "keywords_podcast.txt"){
if(FileNameWExt = "keywords_podcast.txt"){
@ -291,8 +310,14 @@ Loop, files, %VideoFolderDir%\*.*, F ; loop through the files in the director
FileGetSize, VideoFileSizeInMB, %A_LoopFileFullPath%, M
FileGetSize, VideoFileSizeInMB, %A_LoopFileFullPath%, M
VideoInfoObj := Filexpro(VideoFilepath,
VideoInfoObj := Filexpro(VideoFilepath,
, "System.Video.TotalBitrate" )
, "System.Video.TotalBitrate"
VideoTotalBitrate := VideoInfoObj["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)
}
}
@ -301,11 +326,6 @@ Loop, files, %VideoFolderDir%\*.*, F ; loop through the files in the director
}
}
}
}
if(VideoDescription = ""){
; @todo: is this used anymore?
FileRead, VideoDescription, %A_scriptDir%\Lib\DescriptionTemplate.txt
}
; Loop through the folder again to find the correct .WAV audio file as Stef has multiple in there and we need the .mp4 file to be found first so we know what to look for file name wise.
; Loop through the folder again to find the correct .WAV audio file as Stef has multiple in there and we need the .mp4 file to be found first so we know what to look for file name wise.
Loop, files, %VideoFolderDir%\*.flac, F ; loop through the files in the directory
Loop, files, %VideoFolderDir%\*.flac, F ; loop through the files in the directory
{ ; D = Directories, F = Files, R = Recursive
{ ; D = Directories, F = Files, R = Recursive
@ -351,10 +371,9 @@ if(FileExist(VideoLinksIniFile)){
IniRead, BitChuteURL, %VideoLinksIniFile%, URLs, BitChuteURL, %A_Space%
IniRead, BitChuteURL, %VideoLinksIniFile%, URLs, BitChuteURL, %A_Space%
; LBRY
; LBRY
IniRead, LBRYURLSlug, %VideoLinksIniFile%, Misc, LBRYURLSlug, %A_Space%
; removed on 2024/06/24, let's regenerate the slug each time in case the video file changes between runs
if(LBRYURLSlug = ""){
; IniRead, LBRYURLSlug, %VideoLinksIniFile%, Misc, LBRYURLSlug, %A_Space%
LBRYURLSlug := OriginalLBRYURLSlug ; video title
}
; LBRY Video
; LBRY Video
IniRead, LBRYVideoURL, %VideoLinksIniFile%, URLs, LBRYVideoURL, %A_Space%
IniRead, LBRYVideoURL, %VideoLinksIniFile%, URLs, LBRYVideoURL, %A_Space%
IniRead, LBRYVideoThumb, %VideoLinksIniFile%, Misc, LBRYVideoThumb, %A_Space%
IniRead, LBRYVideoThumb, %VideoLinksIniFile%, Misc, LBRYVideoThumb, %A_Space%
@ -381,28 +400,26 @@ if(FileExist(VideoLinksIniFile)){
IniRead, UnauthorizedTVURL, %VideoLinksIniFile%, URLs, UnauthorizedTVURL, %A_Space%
IniRead, UnauthorizedTVURL, %VideoLinksIniFile%, URLs, UnauthorizedTVURL, %A_Space%
; MISC
; Misc Info
; ------------------------------------------------
IniRead, ErrorLoggingFilePath, %VideoLinksIniFile%, Misc, ErrorLoggingFilePath, %A_Space%
IniRead, ErrorLoggingFilePath, %VideoLinksIniFile%, Misc, ErrorLoggingFilePath, %A_Space%
IniRead, TempVideoThumbFilepath, %VideoLinksIniFile%, Misc, VideoThumbFilepath, %A_Space%
if(TempVideoThumbFilepath){ ; if Video Thumbnail was saved in last run, overwrite variable path that was grabbed in the file loop above
VideoThumbFilepath := TempVideoThumbFilepath
}
if(VideoFileSizeInMB < 50){
; Double check that the file still exists on the system. if set var to blank so new file can be generated
IniRead, Telegram, %VideoLinksIniFile%, Misc, Telegram, %A_Space%
if(!FileExist(ErrorLoggingFilePath)){
ErrorLoggingFilePath :=
}
}
}
}
; Create a directory for errorlogging if this is the first time working on this project
; Create a directory for errorlogging if this is the first time working on this project
if(ErrorLoggingFilePath = ""){
if(ErrorLoggingFilePath = ""){
; DevModeMsgBox("generating filepath")
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
ErrorLoggingDirectory := ErrorLoggingFolder . "\" . TodayDate . "_FVU "
ErrorLoggingDirectory := ErrorLoggingFolder . "\" . TodayDate . "_" . ScriptNameAcronym
FileCreateDir, %ErrorLoggingDirectory%
FileCreateDir, %ErrorLoggingDirectory%
ErrorLoggingFilePath := ErrorLoggingFolder . "\" . TodayDate . "_FVU \ErrorLogging.txt" ; Set locaiton where error logging text will go
ErrorLoggingFilePath := ErrorLoggingFolder . "\" . TodayDate . "_" . ScriptNameAcronym . " \ErrorLogging.txt" ; Set locaiton where error logging text will go
; Write both filepaths to .ini file
; Save ErrorLoggingFilePath to project settings file so it can be reused if doing multiple runs
IniWrite, %ErrorLoggingFilePath%, %VideoLinksIniFile%, Misc, ErrorLoggingFilePath
IniWrite, %ErrorLoggingFilePath%, %VideoLinksIniFile%, Misc, ErrorLoggingFilePath
}
}
@ -411,113 +428,71 @@ if(PodcastNumber = ""){
PodcastNumber := PodcastNumber[2]
PodcastNumber := PodcastNumber[2]
}
}
; Set Websites to Upload to
; ------------------------------------------------
; Set the checkmark status of each item based on the variable status
; Set the checkmark status of each item based on the variable status
; (StreamanityURL != "")?(StreamanityCheckStatus := 0) : (StreamanityCheckStatus := 1)
(BitChuteURL)?(BitChute := 0) : (BitChute := 1)
(BitChuteURL != "")?(BitChuteCheckStatus := 0) : (BitChuteCheckStatus := 1)
(RumbleURL)?(Rumble := 0) : (Rumble := 1)
(DailyMotionURL)?(DailyMotion := 0) : (DailyMotion := 1)
(OdyseeVideoURL != "")?(OdyseeVideoCheckStatus := 0) : (OdyseeVideoCheckStatus := 1)
(OdyseeVideoThumb != "")?(OdyseeVideoThumbCheckStatus := 0) : (OdyseeVideoThumbCheckStatus := 0)
OdyseeAudioThumbCheckStatus := 0
if(OdyseeAudioURL OR WavAudioFilepath = "")
OdyseeAudioCheckStatus := 0
/*
if(OdyseeAudioThumb OR WavAudioFilepath = "")
OdyseeAudioThumbCheckStatus := 0
*/
; if user tried to upload to locals already and still needs to grab the url
(RumbleURL != "")?(RumbleCheckStatus := 0) : (RumbleCheckStatus := 1)
if(LocalsURL = "" OR LocalsURL = "LocalsUploadStartedNeedToGrabURL"){
; if user tried to upload to locals already and still needs to grab the url, check
Locals := 1
(LocalsURL = "LocalsUploadStartedNeedToGrabURL")?(LocalsCheckStatus := 1) : (LocalsCheckStatus := 0)
(BrighteonURL != "")?(BrighteonCheckStatus := 0) : (BrighteonCheckStatus := 1)
if(VideoFileSizeInMB > 6144){
VideoFileSizeOver6GB := 1
BrighteonCheckStatus := 0
}
}
else,
Locals := 0
(DailyMotionURL != "")?(DailyMotionCheckStatus := 0) : (DailyMotionCheckStatus := 1)
(OdyseeVideoURL)?(OdyseeVideo := 0) : (OdyseeVideo := 1)
FacebookCheckStatus := 0
(OdyseeAudioURL || WavAudioFilepath = "")?(OdyseeAudio := 0) : (OdyseeAudio := 1)
TelegramCheckStatus := 0
;---/Read Info From Previous Run And Set Upload Options---
;--------------------------------------------------------
;---Testing Mode Overrides---
;------------------------------------------------
IniRead, TestingMode, %SettingsIniFilepath%, General, TestingMode, 0
if(TestingMode OR DevMode){ ; save currently seelcted sites to ini file for next test
; IniRead, Streamanity, %SettingsIniFilepath%, Testing, Streamanity, %A_Space%
; (Streamanity)?(StreamanityCheckStatus := 1) : (StreamanityCheckStatus := 0)
IniRead, BitChute, %SettingsIniFilepath%, Testing, BitChute, %A_Space%
(BitChute)?(BitChuteCheckStatus := 1) : (BitChuteCheckStatus := 0)
IniRead, OdyseeVideo, %SettingsIniFilepath%, Testing, OdyseeVideo, %A_Space%
(OdyseeVideo)?(OdyseeVideoCheckStatus := 1) : (OdyseeVideoCheckStatus := 0)
IniRead, OdyseeVideoThumb, %SettingsIniFilepath%, Testing, OdyseeVideoThumb, %A_Space%
(OdyseeVideoThumb)?(OdyseeVideoThumbCheckStatus := 1) : (OdyseeVideoThumbCheckStatus := 0)
IniRead, OdyseeAudio, %SettingsIniFilepath%, Testing, OdyseeAudio, %A_Space%
(OdyseeAudio)?(OdyseeAudioCheckStatus := 1) : (OdyseeAudioCheckStatus := 0)
IniRead, OdyseeAudioThumb, %SettingsIniFilepath%, Testing, OdyseeAudioThumb, %A_Space%
(OdyseeAudioThumb)?(OdyseeAudioThumbCheckStatus := 1) : (OdyseeAudioThumbCheckStatus := 0)
IniRead, Rumble, %SettingsIniFilepath%, Testing, Rumble, %A_Space%
(Rumble)?(RumbleCheckStatus := 1) : (RumbleCheckStatus := 0)
IniRead, Brighteon, %SettingsIniFilepath%, Testing, Brighteon, %A_Space%
(Brighteon)?(BrighteonCheckStatus := 1) : (BrighteonCheckStatus := 0)
IniRead, DailyMotion, %SettingsIniFilepath%, Testing, DailyMotion, %A_Space%
; Brighteon has 6GB video file size limit
(DailyMotion)?(DailyMotionCheckStatus := 1) : (DailyMotionCheckStatus := 0)
(BrighteonURL)?(Brighteon := 0) : (Brighteon := 1)
if(VideoFileSizeInMB > 6144){
VideoFileSizeOver6GB := 1
Brighteon := 0
}
IniRead, Locals, %SettingsIniFilepath%, Testing, Locals, %A_Space%
; Brighteon will fail if video does not have one of the following aspect ratios
(Locals)?(LocalsCheckStatus := 1) : (LocalsCheckStatus := 0)
BrighteonAcceptedAspectRatios := ["4:3","3:4","16:9","9:16"]
VideoHasBrighteonCompatibleAspectRatio := HasVal(BrighteonAcceptedAspectRatios, VideoAspectRatio)
IniRead, Telegram, %SettingsIniFilepath%, Testing, Telegram, %A_Space%
(Telegram)?(TelegramCheckStatus := 1) : (TelegramCheckStatus := 0)
IniRead, Facebook, %SettingsIniFilepath%, Testing, Facebook, %A_Space%
; Override Website statuses if this is a schedule post based on Argument3
(Facebook)?(FacebookCheckStatus := 1) : (FacebookCheckStatus := 0)
; ------------------------------------------------
}
if(PassedInArgument2_Action = "Scheduled"){
; if(PassedInArgument3_Details){
(InStr(PassedInArgument3_Details, "Locals"))?(Locals := 1) : (Locals := 0)
(InStr(PassedInArgument3_Details, "Bitchute"))?(Bitchute := 1) : (Bitchute := 0)
(InStr(PassedInArgument3_Details, "OdyseeVideo"))?(OdyseeVideo := 1) : (OdyseeVideo := 0)
(InStr(PassedInArgument3_Details, "OdyseeAudio"))?(OdyseeAudio := 1) : (OdyseeAudio := 0)
(InStr(PassedInArgument3_Details, "Rumble"))?(Rumble := 1) : (Rumble := 0)
(InStr(PassedInArgument3_Details, "Brighteon"))?(Brighteon := 1) : (Brighteon := 0)
(InStr(PassedInArgument3_Details, "DailyMotion"))?(DailyMotion := 1) : (DailyMotion := 0)
; }
goto, StartScheduledPost
}
/*
*/
;---/Read Info From Previous Run And Set Upload Options---
;--------------------------------------------------------
if(PassedParameter = "ShowResults"){
if(PassedInArgument2_Action = "ShowResults"){
goto, DisplayResults
goto, DisplayResults
}
}
; Main GUI Window
; Main GUI Window
; ------------------------------------------------
; ------------------------------------------------
#include %A_scriptDir%\Modules\GUI-Main-Window.ahk
; Write current project to ini file for easy reloading
; Write current project to ini file for easy reloading
IniWrite, %BodyTextFilePath%, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost
IniWrite, %BodyTextFilePath%, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost
gosub, SetAndShowMainGUI
URunTime1 := round(((A_TickCount - UStartTime) / 1000), 2)
RunTimeToShowGui := round(((A_TickCount - UStartTime) / 1000), 2)
;---Check for Updates---
;------------------------------------------------
if(AutoUpdateCheck AND !UpdateAvailable){
Message = Checking for Updates
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
if(CheckForUpdates(GitReleasesAPIURL))
GuiControl,,UpdateAvailable, Uploader Update Available!
if(CheckForChromeUpdates(ChromeFilepath)){
GuiControl,,ChromeUpdateAvailable, Chrome Update Available!
ChromeUpdateAvailable := 1
}
}
; calculate run time and convert to seconds
URunTime2 := round(((A_TickCount - UStartTime) / 1000), 2)
Return
Return
@ -558,16 +533,17 @@ Return
; Open folder of the project
; Open folder of the project
OpenProjectFolder:
OpenProjectFolder:
if(FileExist(VideoFolderDir))
run, %VideoFolderDir%
run, %VideoFolderDir%
else,
msgbox, Cannot Open Folder as it no longer exists at:`n%VideoFolderDir%
Return
Return
ClearVideoLinks:
ClearVideoLinks:
FileDelete, %VideoLinksIniFile%
FileDelete, %VideoLinksIniFile%
Return
Return
OpenErrorLog:
run, %ErrorLoggingFilePath%
Return
ToggleTestingMode:
ToggleTestingMode:
ToggleTestingMode()
ToggleTestingMode()
@ -580,8 +556,15 @@ run, "%A_ScriptFullPath%" "LastPost"
Return
Return
OpenGiteaPage:
UncheckAllPlatforms:
run, https://freedomain.dev/yuriy/video-uploader
GuiControl,,Bitchute, 0
GuiControl,,Locals, 0
GuiControl,,OdyseeVideo, 0
GuiControl,,OdyseeAudio, 0
GuiControl,,Rumble, 0
GuiControl,,DailyMotion, 0
GuiControl,,Brighteon, 0
Return
Return
@ -632,78 +615,47 @@ UpdateScript()
; @todo: Save any changes made to the script before installing update
; @todo: Save any changes made to the script before installing update
Return
Return
UpdateChrome:
if(CheckForChromeUpdates = "")
Status := CheckForChromeUpdates(ChromeFilepath)
if(!status){
OnMessage(0x44, "OnMsgBoxConfirmChromiumOverwrite")
MsgBox 0x41, Already Up-to-Date, Yor current Chromium version is already up to date. `nDo you want to download and overwrite it?
OnMessage(0x44, "")
IfMsgBox OK, {
Return
} Else IfMsgBox Cancel, {
}
}
PostToDiscordAndTelegram:
Status := DownloadLatestChromium()
gosub, PostToDiscord
if(Status)
gosub, PostToTelegram
GuiControl,,ChromeUpdateAvailable, Chrome Up-to-Date
Return
Return
/*
/*
*/
*/
CreateDescriptionForSocialMedia(){
SplitText = Free Documentaries:
SocialMediaDescription := StrSplit(VideoDescription, SplitText)
SocialMediaDescription := SocialMediaDescription[1]
if(strlen(SocialMediaDescription) > 1400){
SocialMediaDescription := SubStr(SocialMediaDescription, 1, 1400)
SocialMediaDescription .= "..."
}
Return
}
; -------------------------------Upload Video Functionality-------------------------------
; -------------------------------Upload Video Functionality-------------------------------
StartScript:
StartScript:
WinGetPos, XPosition, YPosition, , , A
WinGetPos, XPosition, YPosition, , , A
IniWrite, %XPosition%, %SettingsIniFilepath%, General, XPosition
IniWrite, %XPosition%, %SettingsIniFilepath%, General, XPosition
IniWrite, %YPosition%, %SettingsIniFilepath%, General, YPosition
IniWrite, %YPosition%, %SettingsIniFilepath%, General, YPosition
Gui, Submit
Gui, Submit, NoHide
Gui, Destroy
; Double Check Files and Show Errors if there are any Issues
; In case the project files change between the time the gui was created and the Upload button is clicked
; ------------------------------------------------
(VideoFilepath = "")?(DoubleCheckErrorMessage .= "Video Filepath is BLANK`n"):()
(!FileExist(VideoFilepath))?(DoubleCheckErrorMessage .= "Video Filepath Points to a Non-Existing File`n"):()
(VideoThumbFilepath = "")?(DoubleCheckErrorMessage .= "Thumbnail Filepath is BLANK`n"):()
(!FileExist(VideoThumbFilepath))?(DoubleCheckErrorMessage .= "Thumbnail Filepath Points to a Non-Existing File`n"):()
if(DoubleCheckErrorMessage){
Message = Issue found when double checking files:`n%DoubleCheckErrorMessage%
SaveOrPostProgress(Message,PostType:="ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
; Save Testing Mode Info
Msgbox,4096,Error,%DoubleCheckErrorMessage%
;------------------------------------------------
Return
if(TestingMode){ ; save currently seelcted sites to ini file for next test
; IniWrite, %Streamanity%, %SettingsIniFilepath%, Testing, Streamanity
IniWrite, %BitChute%, %SettingsIniFilepath%, Testing, BitChute
IniWrite, %OdyseeVideo%, %SettingsIniFilepath%, Testing, OdyseeVideo
IniWrite, %OdyseeVideoThumb%, %SettingsIniFilepath%, Testing, OdyseeVideoThumb
IniWrite, %OdyseeAudio%, %SettingsIniFilepath%, Testing, OdyseeAudio
IniWrite, %OdyseeAudioThumb%, %SettingsIniFilepath%, Testing, OdyseeAudioThumb
IniWrite, %Rumble%, %SettingsIniFilepath%, Testing, Rumble
IniWrite, %Brighteon%, %SettingsIniFilepath%, Testing, Brighteon
IniWrite, %DailyMotion%, %SettingsIniFilepath%, Testing, DailyMotion
IniWrite, %Locals%, %SettingsIniFilepath%, Testing, Locals
IniWrite, %Telegram%, %SettingsIniFilepath%, Testing, Telegram
IniWrite, %Facebook%, %SettingsIniFilepath%, Testing, Facebook
}
}
; Destroy GUI after checking everything is working
Gui, Destroy
; Save Video Info
; Save Video Info
;------------------------------------------------
;------------------------------------------------
; if changes made, delete the original file and save the new content to it
; if changes made, delete the original file and save the new content to it
@ -739,22 +691,21 @@ if(VideoDescription != OriginalVideoDescription){
}
}
; Save Script Settings to File
; -------------------------------/Save Video Info-------------------------------
; ------------------------------------------------
; Save settings to config file
; Save settings to config file
IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, General, ShowTooltipProgress
IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, General, ShowTooltipProgress
IniWrite, %AutoUpdateCheck%, %SettingsIniFilepath%, General, AutoUpdateCheck
IniWrite, %AutoUpdateCheck%, %SettingsIniFilepath%, General, AutoUpdateCheck
IniWrite, %AutoLogin%, %SettingsIniFilepath%, General, AutoLogin
IniWrite, %AutoLogin%, %SettingsIniFilepath%, General, AutoLogin
IniWrite, %PingOnCompletion%, %SettingsIniFilepath%, General, PingOnCompletion
IniWrite, %ErrorLogToDiscord%, %SettingsIniFilepath%, %ScriptSettingsSection%, ErrorLogToDiscord
IniWrite, %DiscordPingOnCompletion%, %SettingsIniFilepath%, %ScriptSettingsSection%, DiscordPingOnCompletion
IniWrite, %KillLBRYAfterUpload%, %SettingsIniFilepath%, General, KillLBRYAfterUpload
IniWrite, %KillLBRYAfterUpload%, %SettingsIniFilepath%, General, KillLBRYAfterUpload
IniWrite, %ConfirmBeforeSubmit%, %SettingsIniFilepath%, %ScriptSettingsSection%, ConfirmBeforeSubmit
; Used by Post Scheduler, filepath changes between script updates
IniWrite, %A_ScriptFullPath%, %SettingsIniFilepath%, Filepaths, VideoUploaderFilepath
if(VideoFilepath = ""){
StartScheduledPost:
Msgbox,4096,Error,No Video Filepath Found.`nPlease Input Video Filepath to Upload a Video.
run, "%A_ScriptFullPath%" "LastPost"
ExitApp
}
; Format the LBRYURLSlug to be API Compatible
; Format the LBRYURLSlug to be API Compatible
if(LBRYURLSlug = "") ; if slug spot is blank, then set it to video title
if(LBRYURLSlug = "") ; if slug spot is blank, then set it to video title
@ -762,25 +713,22 @@ LBRYURLSlug := VideoTitle
LBRYURLSlug := LBRYCMDTextReplacement(LBRYURLSlug)
LBRYURLSlug := LBRYCMDTextReplacement(LBRYURLSlug)
; Save the LBRY URL Slug to .ini file in case it's needed later
; Save the LBRY URL Slug to .ini file in case it's needed later
IniWrite, %LBRYURLSlug%, %VideoLinksIniFile%, Misc, LBRYUrlSlug
; removed on 2024/06/24, generating the URL SLugh each run going forward
; IniWrite, %LBRYURLSlug%, %VideoLinksIniFile%, Misc, LBRYUrlSlug
IniWrite, %VideoThumbFilepath%, %VideoLinksIniFile%, Misc, VideoThumbFilepath
IniWrite, %VideoThumbFilepath%, %VideoLinksIniFile%, Misc, VideoThumbFilepath
IniWrite, %PodcastNumber%, %VideoLinksIniFile%, Misc, PodcastNumber
IniWrite, %PodcastNumber%, %VideoLinksIniFile%, Misc, PodcastNumber
IniWrite, %VideoThumbFilepath%, %VideoLinksIniFile%, Misc, VideoThumbFilepath
IniWrite, %VideoThumbFilepath%, %VideoLinksIniFile%, Misc, VideoThumbFilepath
; -------------------------------Log Info To Text-------------------------------
; -------------------------------Log Info To Text-------------------------------s
(Bitchute)?(PostedWebsites .= "Bitchute|") : ()
(Facebook = 1)?(PostedWebsites .= "Facebook|") : ()
(Locals)?(PostedWebsites .= "Locals|") : ()
(Bitchute = 1)?(PostedWebsites .= "Bitchute|") : ()
(Rumble)?(PostedWebsites .= "Rumble|") : ()
(Locals = 1)?(PostedWebsites .= "Locals|") : ()
(Brighteon)?(PostedWebsites .= "Brighteon|") : ()
(Rumble = 1)?(PostedWebsites .= "Rumble|") : ()
(DailyMotion)?(PostedWebsites .= "DailyMotion|") : ()
(Brighteon = 1)?(PostedWebsites .= "Brighteon|") : ()
(OdyseeVideo)?(PostedWebsites .= "OdyseeVideo|") : ()
; (Streamanity = 1)?(PostedWebsites .= "Streamanity|") : ()
(OdyseeAudio)?(PostedWebsites .= "OdyseeAudio|") : ()
(Telegram = 1)?(PostedWebsites .= "Telegram|") : ()
(DailyMotion = 1)?(PostedWebsites .= "DailyMotion|") : ()
(OdyseeVideo = 1)?(PostedWebsites .= "OdyseeVideo|") : ()
(OdyseeAudio = 1)?(PostedWebsites .= "OdyseeAudio|") : ()
; Log Basic info to the errorlogging file
; Log Basic info to the errorlogging file
@ -805,11 +753,17 @@ SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
Message := "TotalVideosUploaded: " TotalVideosUploaded
Message := "TotalVideosUploaded: " TotalVideosUploaded
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
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
; Convert Video Title and Description into javascript formatting for sending to pages through js instead of plain selenium
JSVideoTitle := FormatTextToJSText(VideoTitle)
JSVideoTitle := FormatTextToJSText(VideoTitle)
JSVideoDescription := FormatTextToJSText(VideoDescription)
JSVideoDescription := FormatTextToJSText(VideoDescription)
JSVideoSummary := FormatTextToJSText(VideoSummary)
JSVideoSummary := FormatTextToJSText(VideoSummary)
Message = JSVideoSummary:`n %JSVideoSummary%
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
; -------------------------------/Log Info To Text-------------------------------
; -------------------------------/Log Info To Text-------------------------------
@ -899,13 +853,10 @@ if(OdyseeAudio){
if(LocalsGrabURL){
if(LocalsGrabURL){
Gosub, LocalsGrabURL
Gosub, LocalsGrabURL
}
}
; // Upload to Sites
; // Upload to Sites
; ------------------------------------------------
; ------------------------------------------------
if(URLOfLastErrorPage){
if(URLOfLastErrorPage != ""){
Message = Activating Tab of last failed post.
Message = Activating Tab of last failed post.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
@ -921,7 +872,7 @@ else,
Message = All Videos Uploaded Successfully
Message = All Videos Uploaded Successfully
if(PingOnCompletion)
if(Discord PingOnCompletion)
Message = <@%DiscordUsernameID%>: %Message%
Message = <@%DiscordUsernameID%>: %Message%
else,
else,
Message = %Message%
Message = %Message%
@ -940,7 +891,6 @@ Gui, Destroy ; destroy GUI in case we're going from the main screen to results w
IniRead, MouseClicksSaved, %SettingsIniFilepath%, General, MouseClicksSaved, %A_Space%
IniRead, MouseClicksSaved, %SettingsIniFilepath%, General, MouseClicksSaved, %A_Space%
IniRead, TotalVideosUploaded, %SettingsIniFilepath%, General, TotalVideosUploaded, %A_Space%
IniRead, TotalVideosUploaded, %SettingsIniFilepath%, General, TotalVideosUploaded, %A_Space%
; IniRead, StreamanityURL, %VideoLinksIniFile%, URLs, StreamanityURL, %A_Space%
IniRead, BitChuteURL, %VideoLinksIniFile%, URLs, BitChuteURL, %A_Space%
IniRead, BitChuteURL, %VideoLinksIniFile%, URLs, BitChuteURL, %A_Space%
IniRead, OdyseeVideoURL, %VideoLinksIniFile%, URLs, OdyseeVideoURL, %A_Space%
IniRead, OdyseeVideoURL, %VideoLinksIniFile%, URLs, OdyseeVideoURL, %A_Space%
@ -955,7 +905,6 @@ OdyseeAudioThumb := StrReplace(OdyseeAudioThumb, "Thumb:", "")
IniRead, LocalsURL, %VideoLinksIniFile%, URLs, LocalsURL, %A_Space%
IniRead, LocalsURL, %VideoLinksIniFile%, URLs, LocalsURL, %A_Space%
IniRead, RumbleURL, %VideoLinksIniFile%, URLs, RumbleURL, %A_Space%
IniRead, RumbleURL, %VideoLinksIniFile%, URLs, RumbleURL, %A_Space%
IniRead, FacebookURL, %VideoLinksIniFile%, URLs, FacebookURL, %A_Space%
IniRead, BrighteonURL, %VideoLinksIniFile%, URLs, BrighteonURL, %A_Space%
IniRead, BrighteonURL, %VideoLinksIniFile%, URLs, BrighteonURL, %A_Space%
IniRead, DailyMotionURL, %VideoLinksIniFile%, URLs, DailyMotionURL, %A_Space%
IniRead, DailyMotionURL, %VideoLinksIniFile%, URLs, DailyMotionURL, %A_Space%
IniRead, PodcastNumber, %VideoLinksIniFile%, Misc, PodcastNumber, %A_Space%
IniRead, PodcastNumber, %VideoLinksIniFile%, Misc, PodcastNumber, %A_Space%
@ -978,12 +927,58 @@ if(PodcastNumber = "") {
; Show Results GUI Window
; Show Results GUI Window
; ------------------------------------------------
; ------------------------------------------------
#include %A_scriptDir%\Modules\GUI-Results-Window.ahk
gosub, SetGUIVariables
gosub, SetAndShowResultsGUI
SaveCurrentChromeVersionToIniFile()
SaveCurrentChromeVersionToIniFile()
Return
Return
; GoTo's
; ------------------------------------------------
SubmitScheduler:
Gui, Submit
; format and combine date and time
FormatTime, ScheduledDateOnly , %ScheduledDate%, yyyyMMdd
FormatTime, ScheduledTimeOnly , %ScheduledTime%, HHmmss
TimeStamp := ScheduledDateOnly . ScheduledTimeOnly
; create schedule post ini file
ScheduleFileFilepath = %A_scriptDir%/Scheduled-Posts
if(!FileExist(ScheduleFileFilepath)){
FileCreateDir, %ScheduleFileFilepath%
}
ScheduleFileFilepath = %ScheduleFileFilepath%\%TimeStamp%.ini
IniWrite, %TimeStamp%, %ScheduleFileFilepath%, Schedule-Info, Timestamp
IniWrite, %BodyTextFilePath%, %ScheduleFileFilepath%, Schedule-Info, ProjectFilepath
IniWrite, Video, %ScheduleFileFilepath%, Schedule-Info, PostType
IniWrite, %VideoTitle%, %ScheduleFileFilepath%, Schedule-Info, Title
; Generate variable with each of the checked ON sites
(BitChute)?(VideoSites .= "Bitchute" . "|"):()
(Locals)?(VideoSites .= "Locals" . "|"):()
(OdyseeVideo)?(VideoSites .= "OdyseeVideo" . "|"):()
(OdyseeAudio)?(VideoSites .= "OdyseeAudio" . "|"):()
(Brighteon)?(VideoSites .= "Brighteon" . "|"):()
(DailyMotion)?(VideoSites .= "DailyMotion" . "|"):()
(Rumble)?(VideoSites .= "Rumble" . "|"):()
IniWrite, %VideoSites%, %ScheduleFileFilepath%, Schedule-Info, Sites
if(!FileExist(PostSchedulerFilepath)){
gosub, UpdatePostScheduler
}
else,
run, %PostSchedulerFilepath%
Return
OpenLBRYBlobFilesFolder:
OpenLBRYBlobFilesFolder:
try,
try,
run, C:\Users\%A_UserName%\AppData\Local\lbry\lbrynet\blobfiles
run, C:\Users\%A_UserName%\AppData\Local\lbry\lbrynet\blobfiles
@ -996,7 +991,7 @@ StartSocialMediaPoster:
; IniRead, SocialMediaPosterFilepath, %SettingsIniFilepath%, General, FDRRadioUN, %A_Space%
; IniRead, SocialMediaPosterFilepath, %SettingsIniFilepath%, General, FDRRadioUN, %A_Space%
IniRead, SocialMediaPosterFilepath, %SettingsIniFilepath%, SocialMediaPoster, SocialMediaPosterFilepath, %A_Space%
IniRead, SocialMediaPosterFilepath, %SettingsIniFilepath%, SocialMediaPoster, SocialMediaPosterFilepath, %A_Space%
if(SocialMediaPosterFilepath = "" or !FileExist(SocialMediaPosterFilepath)){
if(! SocialMediaPosterFilepath or !FileExist(SocialMediaPosterFilepath)){
OnMessage(0x44, "OnMsgBoxSocialMediaPoster")
OnMessage(0x44, "OnMsgBoxSocialMediaPoster")
MsgBox 0x21, Filepath Not Found, Unable to find filepath for Social Media Poster`nWould you like to add it?
MsgBox 0x21, Filepath Not Found, Unable to find filepath for Social Media Poster`nWould you like to add it?
OnMessage(0x44, "")
OnMessage(0x44, "")
@ -1013,7 +1008,7 @@ if(SocialMediaPosterFilepath = "" or !FileExist(SocialMediaPosterFilepath)){
Return
Return
}
}
IniWrite, %SocialMediaPosterFilepath%, %SettingsIniFilepath%, SocialMediaPoster , SocialMediaPosterFilepath
IniWrite, %SocialMediaPosterFilepath%, %SettingsIniFilepath%, Filepaths , SocialMediaPosterFilepath
}
}
run, %SocialMediaPosterFilepath% "%VideoLinksIniFile%"
run, %SocialMediaPosterFilepath% "%VideoLinksIniFile%"
@ -1023,89 +1018,31 @@ if(SocialMediaPosterFilepath = "" or !FileExist(SocialMediaPosterFilepath)){
*/
*/
; Copy Info from GUI to Clipboard
; Copy Info to Clipboard based on the button clicked
; ------------------------------------------------
; ------------------------------------------------
; @todo: this can be converted into 1 gosub, with if/else statements based on the button clicked
CopyToClipboard:
Message = Copying %A_GuiControl% to Clipboard
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
(A_GuiControl = "Transcript URL")?(Clipboard := PodcastTranscriptURL):()
(A_GuiControl = "Bitchute")?(Clipboard := BitChuteURL):()
(A_GuiControl = "Brighteon")?(Clipboard := BrighteonURL):()
(A_GuiControl = "DailyMotion")?(Clipboard := DailyMotionURL):()
(A_GuiControl = "Odysee Video")?(Clipboard := OdyseeVideoURL):()
(A_GuiControl = "Odysee Audio")?(Clipboard := OdyseeAudioURL):()
(A_GuiControl = "Rumble")?(Clipboard := RumbleURL):()
(A_GuiControl = "Locals")?(Clipboard := LocalsURL):()
(A_GuiControl = "Unauthorized")?(Clipboard := UnauthorizedTVURL):()
(A_GuiControl = "Video Tags")?(Clipboard := VideoTags):()
(A_GuiControl = "Podcast Tags")?(Clipboard := PodcastTags):()
(A_GuiControl = "Description")?(Clipboard := VideoDescription):()
(A_GuiControl = "Summary")?(Clipboard := VideoSummary):()
CopyPodcastTranscriptURL:
Clipboard := PodcastTranscriptURL
Message := PodcastTranscriptURL . "`nCopied to Clipboard"
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyVideoTitle:
Clipboard := VideoTitle
SaveOrPostProgress(Message:=VideoTitle "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyBitChuteURL:
Clipboard := BitChuteURL
SaveOrPostProgress(Message:=BitChuteURL "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyBrighteonURL:
Clipboard := BrighteonURL
SaveOrPostProgress(Message:=BrighteonURL "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyDailyMotionURL:
Clipboard := DailyMotionURL
SaveOrPostProgress(Message:=DailyMotionURL "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyOdyseeVideoURL:
Clipboard := OdyseeVideoURL
SaveOrPostProgress(Message:=OdyseeVideoURL "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyOdyseeAudioURL:
Clipboard := OdyseeAudioURL
SaveOrPostProgress(Message:=OdyseeAudioURL "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
sleep, 1000
ToolTip
ToolTip
Return
Return
CopyRumbleURL:
Clipboard := RumbleURL
SaveOrPostProgress(Message:=RumbleURL "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyVideoTags:
Clipboard := VideoTags
SaveOrPostProgress(Message:=VideoTags "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyPodcastTags:
Clipboard := PodcastTags
SaveOrPostProgress(Message:=PodcastTags "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyVideoDescription:
Clipboard := VideoDescription
SaveOrPostProgress(Message:="Video Description`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
; @todo: Add thumbnail status to this
; @todo: Add thumbnail status to this
; @todo: add podcast tags to this
; @todo: add podcast tags to this
@ -1159,11 +1096,9 @@ run, "%A_ScriptFullPath%" "ShowResults"
ExitApp
ExitApp
; -----------------------------------------------
SendErrorLoggingThroughTelegram:
; GoSub Labels
msgbox, I don't do nothin atm
; -----------------------------------------------
Return
; Post-To-Telegram
; Post-To-Telegram
;------------------------------------------------
;------------------------------------------------
@ -1205,7 +1140,14 @@ Return
;------------------------------------------------
;------------------------------------------------
#Include %A_ScriptDir%\Modules\Podcast-Upload.ahk
#Include %A_ScriptDir%\Modules\Podcast-Upload.ahk
; Update Functionality
; Update Functionality
; ------------------------------------------------
; ------------------------------------------------
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Update-Functions.ahk
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Shared-GoTos.ahk
; Special Website Functions
; ------------------------------------------------
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Locals-Functions.ahk
; GUI Windows
; ------------------------------------------------
#include C:\Users\%A_Username%\Syncthing\Git\Freedomain-Video-Uploader\Modules\GUI-Main-Window.ahk