2023-02-12 17:34:03 -05:00
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
#SingleInstance , Force
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
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
if ( InStr ( A_ScriptFullPath , " .ahk " ) ) {
try Menu , Tray , Icon , %A_ScriptDir% \Assets \FreedomainVideo . ico
}
PassedParameter = % 1 %
; Add menus to the toolbar icon
Menu , tray , NoStandard
Menu , Tray , Add , Exit , KillScript
Menu , Tray , Add , Pause , PauseScript
2023-09-17 13:27:36 -04:00
Menu , Tray , Add , Show Results , DisplayResults
2023-02-12 17:34:03 -05:00
Menu , Tray , Add , Open New Project , ReloadScript
Menu , Tray , Add , Restart with Last Project , RetryUpload
Menu , Tray , Default , Restart with Last Project
2023-12-07 21:12:20 -05:00
2023-10-22 00:06:55 -04:00
global ScriptNameav
2023-02-12 17:34:03 -05:00
global ScriptVersion
global FullScriptName
2023-07-28 10:56:46 -04:00
2023-12-19 15:48:33 -05:00
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
UStartTime := A_TickCount ; start time
2023-04-03 00:04:18 -04:00
2023-07-28 10:56:46 -04:00
; Included Files - 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 \Selenium - Functions . ahk
#Include %A_ScriptDir% \Lib \Freedomain - Posters - Shared - Functions \Chrome - Functions . ahk
#Include %A_ScriptDir% \Lib \Freedomain - Posters - Shared - Functions \Gitea - Functions . ahk
#Include %A_ScriptDir% \Lib \Freedomain - Posters - Shared - Functions \API - Functions . ahk
#Include %A_ScriptDir% \Lib \Freedomain - Posters - Shared - Functions \JSON . ahk
#Include %A_ScriptDir% \Lib \Freedomain - Posters - Shared - Functions \RunCMD . ahk
#include %A_ScriptDir% \Lib \Freedomain - Posters - Shared - Functions \StdOutToVar . ahk
2023-09-20 20:45:57 -04:00
#include %A_ScriptDir% \Lib \Freedomain - Posters - Shared - Functions \Zip . ahk
2023-10-22 00:06:55 -04:00
#include %A_ScriptDir% \Lib \Freedomain - Posters - Shared - Functions \URLDownloadToVar . ahk
2023-04-03 00:04:18 -04:00
2023-12-19 15:48:33 -05:00
2023-02-12 17:34:03 -05:00
;---Global Variables---
;------------------------------------------------
global LBRYResolveAPICommand
global LBRYPermanentURL
global VideoTitle
global VideoFilepath
global VideoThumbFilepath
global VideoTags
global VideoDescription
global SocialMediaDescription
global DiscordErrorLoggingWebhookBotURL
global DiscordVideosWebhookURL
global VideoFolderDir
global LogErrorsToMsgbox
; global LogErrorsToTextFile
global CurrentSite
global Driver
global DriverStatus
global ChromeProfile
global ShowTooltipProgressCheckStatus
global ShowTooltipProgress
global ErrorLogSummary
global DiscordParlerWebhookURL
global ErrorLoggingFilePath
2023-02-17 00:29:41 -05:00
; global TotalTabLoops
2023-02-12 17:34:03 -05:00
global ErrorLogVar
2023-02-18 13:12:18 -05:00
ErrorLogVar :=
2023-02-12 17:34:03 -05:00
global ReuseTabs ; reuse tabs variable
global DevMode
global LBRYNetFilepath
LBRYNetFilepath := " C:\Program Files\LBRY\resources\static\daemon\lbrynet.exe "
global Number_of_loops_to_Check_Upload_status
Number_of_loops_to_Check_Upload_status = 720
; 720 loops, at 5 seonds each = 3600 seconds (60 mins)
; number of seconds to wait between loops when checking video upload status
global Time_Between_Loops_Upload_Status
2023-09-20 23:18:26 -04:00
Time_Between_Loops_Upload_Status = 15000 ;
2023-02-12 17:34:03 -05:00
; loop Index number to check if video is stuck uploading
global Array_Index_Num_of_Upload_StatusChecks
Array_Index_Num_of_Upload_StatusChecks := [ 144 , 288 , 432 , 576 , 720 , 864 ]
; loop number that discord message gets sent off at to track upload progress
; 144 x 5 seconds = 12 minutes
; Check if Lib folder exists and create it if not
LibFolder := A_ScriptDir . " \Lib "
ErrorLoggingFolder := A_ScriptDir . " \Lib\ErrorLogging "
FileCreateDir , %ErrorLoggingFolder%
; Set filepaths for different files and folders
global SettingsIniFilepath
SettingsIniFilepath := A_ScriptDir . " \Settings.ini "
global ChangelogIniFilepath
ChangelogIniFilepath := A_ScriptDir . " \Lib\FreedomScriptsChangelogINI "
global ScriptSettingsSection
ScriptSettingsSection := " VideoUploader "
2023-12-19 15:48:33 -05:00
FileInstall , Version . ini , %A_ScriptDir% \Lib \Version . ini , 1
IniRead , ScriptVersion , %A_ScriptDir% \Lib \Version . ini , Video - Uploader , Version , 0.0
ScriptName = Freedomain Video Uploader
FullScriptName := ScriptName . " - " . ScriptVersion
2023-02-12 17:34:03 -05:00
;---Script Settings---
;------------------------------------------------
; Checkbox Settings
IniRead , ShowTooltipProgress , %SettingsIniFilepath% , General , ShowTooltipProgress , 1
( S h o w T o o l t i p P r o g r e s s ) ? ( S h o w T o o l t i p P r o g r e s s C h e c k S t a t u s : = 1 ) : ( S h o w T o o l t i p P r o g r e s s C h e c k S t a t u s : = 0 )
2023-09-21 20:50:06 -04:00
IniRead , XPosition , %SettingsIniFilepath% , General , XPosition , 0
IniRead , YPosition , %SettingsIniFilepath% , General , YPosition , 0
2023-02-12 17:34:03 -05:00
IniRead , RootDirToStartIn , %SettingsIniFilepath% , General , RootDirToStartIn
IniRead , LogErrorsToMsgbox , %SettingsIniFilepath% , General , LogErrorsToMsgbox , %A_Space%
IniRead , UpdateAvailable , %SettingsIniFilepath% , %ScriptSettingsSection% , UpdateAvailable , 0
IniRead , DevMode , %SettingsIniFilepath% , General , DevMode , 0
IniRead , TotalVideosUploaded , %SettingsIniFilepath% , General , TotalVideosUploaded , 0
2023-09-17 14:26:44 -04:00
IniRead , MouseClicksSaved , %SettingsIniFilepath% , General , MouseClicksSaved , 0
2023-02-12 17:34:03 -05:00
; Checkbox Settings
IniRead , ShowTooltipProgress , %SettingsIniFilepath% , General , ShowTooltipProgress , 1
( S h o w T o o l t i p P r o g r e s s ) ? ( S h o w T o o l t i p P r o g r e s s C h e c k S t a t u s : = 1 ) : ( S h o w T o o l t i p P r o g r e s s C h e c k S t a t u s : = 0 )
2023-09-17 14:26:44 -04:00
ReuseTabs := 1 ; ReuseTabs is permanantly on. There is never a time where you want to create new tabs for every website
2023-02-12 17:34:03 -05:00
IniRead , AutoUpdateCheck , %SettingsIniFilepath% , General , AutoUpdateCheck , 1
( A u t o U p d a t e C h e c k ) ? ( A u t o U p d a t e C h e c k C h e c k S t a t u s : = 1 ) : ( A u t o U p d a t e C h e c k C h e c k S t a t u s : = 0 )
2023-02-23 14:58:34 -05:00
; AutoLogin setting
IniRead , AutoLogin , %SettingsIniFilepath% , General , AutoLogin , 1
( A u t o U p d a t e C h e c k ) ? ( A u t o U p d a t e C h e c k C h e c k S t a t u s : = 1 ) : ( A u t o U p d a t e C h e c k C h e c k S t a t u s : = 0 )
2023-02-12 17:34:03 -05:00
IniRead , PingOnCompletion , %SettingsIniFilepath% , General , PingOnCompletion , 1
( P i n g O n C o m p l e t i o n ) ? ( P i n g O n C o m p l e t i o n C h e c k S t a t u s : = 1 ) : ( P i n g O n C o m p l e t i o n C h e c k S t a t u s : = 0 )
2023-02-28 18:41:06 -05:00
if ( PingOnCompletion ) {
IniRead , DiscordUsernameID , %SettingsIniFilepath% , General , DiscordUsernameID , %A_space%
if ( ! DiscordUsernameID ) {
Message = DiscordUsernameID is blank . Will not be able to ping to notify when uploads are complete . `n Please add user ID in settings . ini under : `n `n [ General ] `n DiscordUsernameID = `n Or Uncheck " Discord Ping on Completion "
; SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile")
SaveOrPostProgress ( Message := Message , PostType := " Tooltip,ErrorLoggingTextFile,ErrorSummaryVar " )
}
}
2023-02-12 17:34:03 -05:00
IniRead , KillLBRYAfterUpload , %SettingsIniFilepath% , General , KillLBRYAfterUpload , 1
( K i l l L B R Y A f t e r U p l o a d ) ? ( = K i l l L B R Y A f t e r U p l o a d C h e c k S t a t u s : = 1 ) : ( K i l l L B R Y A f t e r U p l o a d C h e c k S t a t u s : = 0 )
IniRead , DiscordErrorLoggingWebhookBotURL , %SettingsIniFilepath% , General , DiscordWebhookBotURL , %A_space%
if ( DiscordErrorLoggingWebhookBotURL = " " ) {
Message = DiscordErrorLoggingWebhookBotURL is blank . `n Will not be able to post error messages or upload status to discord . `n Please add discord webhook URL in settings . ini under : `n `n [ General ] ` DiscordErrorLoggingWebhookBotURL =
SaveOrPostProgress ( Message := Message , PostType := " ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging " )
}
2023-02-28 18:41:06 -05:00
2023-02-12 17:34:03 -05:00
;---Auto Updater Settings---
;------------------------------------------------
global GitReleasesAPIURL
2023-12-11 13:38:51 -05:00
GitReleasesAPIURL = https : / / freedomain . dev / api / v1 / repos / yuriy / Freedomain - Video - Uploader / releases
2023-02-12 17:34:03 -05:00
;---LBRY Settings---
;------------------------------------------------
IniRead , LBRYNewVideoStakeAmount , %SettingsIniFilepath% , General , LBRYNewVideoStakeAmount , %A_Space%
if ( LBRYNewVideoStakeAmount = " " ) {
LBRYNewVideoStakeAmount = 1.0
IniWrite , %LBRYNewVideoStakeAmount% , %SettingsIniFilepath% , General , LBRYNewVideoStakeAmount
}
IniRead , LBRYChannelID , %SettingsIniFilepath% , General , LBRYChannelID , %A_Space%
if ( LBRYChannelID = " " ) {
LBRYChannelID = b89ed227c49e726fcccf913bdc9dec4c8fec99c2
IniWrite , %LBRYChannelID% , %SettingsIniFilepath% , General , LBRYChannelID
}
;---Read Info From Project Files---
;------------------------------------------------
2023-02-15 03:35:35 -05:00
; 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
BackupsFolder = %LibFolder% \Backups \
; Msgbox % "BackupsFolder: " BackupsFolder
if ( ! FileExist ( BackupsFolder ) ) {
FileCreateDir , %BackupsFolder%
}
; move old version to backups folder, overwrite if name conflict
FileMove , %PassedParameter% , %BackupsFolder% \* , 1
if ( ErrorLevel ) { ; most likely because the old version hasn't finished exiting yet
2023-07-29 20:15:50 -04:00
SaveOrPostProgress ( Message := " Moving Old Version to Backups " , PostType := " Tooltip,ErrorLoggingTextFile,ErrorSummaryVar " )
2023-02-15 03:35:35 -05:00
sleep , 2000
FileMove , %PassedParameter% , %BackupsFolder% \* , 1
if ( ErrorLevel ) {
MsgBox , , Update Successful , Update was successful `, but unable to move old version to the Backups folder . `n Please move it or delete it manually .
}
ToolTip
}
2023-07-29 20:15:50 -04:00
; Change paramter to LastPost so last post gets automatically opened instead of user having to re-select the file again
PassedParameter = LastPost
2023-02-15 03:35:35 -05:00
}
2023-07-29 20:15:50 -04:00
if ( PassedParameter = " LastPost " ) {
IniRead , PassedParameter , %SettingsIniFilepath% , %ScriptSettingsSection% , LastPost , %A_Space%
}
if ( PassedParameter = " ShowResults " ) {
IniRead , PassedParameter , %SettingsIniFilepath% , %ScriptSettingsSection% , LastPost , %A_Space%
}
2023-02-15 03:35:35 -05:00
2023-02-12 17:34:03 -05:00
PassedParameterLength := StrLen ( PassedParameter )
2023-02-15 03:35:35 -05:00
if ( PassedParameterLength < 5 and ! InStr ( PassedParameter , " .exe " ) ) {
2023-02-12 17:34:03 -05:00
FileSelectFile , BodyTextFilePath , , %RootDirToStartIn% , Please Select ANY File Within the Project Folder
if ( ErrorLevel )
Return
}
else , {
SkipUpdateCheckThisRun := 1
BodyTextFilePath := PassedParameter
}
2023-07-28 10:16:40 -04:00
; @todo Do this with an array. Add all filepaths to array and then pull out the ones with the extension.
2023-02-12 17:34:03 -05:00
; get directory from the filepath grabbed
SplitPath , BodyTextFilePath , OutFileName , VideoFolderDir , OutExtension , OutNameNoExt , OutDrive
Loop , files , %VideoFolderDir% \* . * , F ; loop through the files in the directory
{ ; D = Directories, F = Files, R = Recursive
SplitPath , A_LoopFileFullPath , FileNameWExt , FileDir , FileExt , FileNameNoExt ,
if ( FileNameWExt = " title.txt " ) {
FileRead , VideoTitle , %A_LoopFileFullPath%
LBRYURLSlug := VideoTitle
OriginalVideoTitle := VideoTitle
OriginalLBRYURLSlug := LBRYURLSlug
}
if ( FileNameWExt = " body.txt " ) {
FileRead , VideoDescription , %A_LoopFileFullPath%
DescriptionCharCount := StrLen ( VideoDescription )
OriginalVideoDescription := VideoDescription
}
if ( FileNameWExt = " keywords.txt " ) {
FileRead , VideoTags , %A_LoopFileFullPath%
FileRead , PodcastTags , %A_LoopFileFullPath%
OriginalVideoTags := VideoTags
OriginalPodcastTags := PodcastTags
}
if ( FileNameWExt = " keywords_podcast.txt " ) {
FileRead , PodcastTags , %A_LoopFileFullPath%
OriginalPodcastTags := PodcastTags
}
if ( FileExt = " mp4 " ) {
VideoFilepath := A_LoopFileFullPath
SplitPath , A_LoopFileFullPath , , , , VideoFileNameNoExt
FileGetSize , VideoFileSizeInMB , %A_LoopFileFullPath% , M
}
if ( FileExt = " png " OR FileExt = " jpg " ) {
VideoThumbFilepath := A_LoopFileFullPath
}
}
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.
2023-09-21 20:50:06 -04:00
Loop , files , %VideoFolderDir% \* . flac , F ; loop through the files in the directory
2023-02-12 17:34:03 -05:00
{ ; D = Directories, F = Files, R = Recursive
SplitPath , A_LoopFileFullPath , FileNameWExt , FileDir , FileExt , FileNameNoExt
if ( FileNameNoExt = VideoFileNameNoExt ) {
WavAudioFilepath := A_LoopFileFullPath
}
}
2023-09-21 20:50:06 -04:00
; if no FLAC file, then loop through folder and select WAV file instead
if ( WavAudioFilepath = " " ) {
; 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% \* . WAV , F ; loop through the files in the directory
{ ; D = Directories, F = Files, R = Recursive
SplitPath , A_LoopFileFullPath , FileNameWExt , FileDir , FileExt , FileNameNoExt
if ( FileNameNoExt = VideoFileNameNoExt ) {
WavAudioFilepath := A_LoopFileFullPath
}
}
}
; Find the .mp3 podcast file
2023-02-12 17:34:03 -05:00
Loop , files , %VideoFolderDir% \* . mp3 , F ; loop through the files in the directory
{ ; D = Directories, F = Files, R = Recursive
SplitPath , A_LoopFileFullPath , FileNameWExt , FileDir , FileExt , FileNameNoExt
if ( FileNameNoExt = VideoFileNameNoExt ) {
MP3AudioFilepath := A_LoopFileFullPath
}
}
;---Read Info From Previous Run (If Any)---
;------------------------------------------------
; @todo: Figure out a way to do this with an array
VideoLinksIniFile = %VideoFolderDir% \VideoLinks . ini
if ( FileExist ( VideoLinksIniFile ) ) {
; IniRead, StreamanityURL, %VideoLinksIniFile%, URLs, StreamanityURL, %A_Space%
IniRead , BitChuteURL , %VideoLinksIniFile% , URLs , BitChuteURL , %A_Space%
; LBRY
IniRead , LBRYURLSlug , %VideoLinksIniFile% , Misc , LBRYURLSlug , %A_Space%
if ( LBRYURLSlug = " " ) {
LBRYURLSlug := OriginalLBRYURLSlug ; video title
}
; LBRY Video
IniRead , LBRYVideoURL , %VideoLinksIniFile% , URLs , LBRYVideoURL , %A_Space%
IniRead , LBRYVideoThumb , %VideoLinksIniFile% , Misc , LBRYVideoThumb , %A_Space%
IniRead , LBRYVideoPermanentURL , %VideoLinksIniFile% , URLs , LBRYVideoPermanentURL , %A_Space%
IniRead , OdyseeVideoURL , %VideoLinksIniFile% , URLs , OdyseeVideoURL , %A_Space%
IniRead , OdyseeVideoThumb , %VideoLinksIniFile% , Misc , OdyseeVideoThumb , %A_Space%
OdyseeVideoThumb := StrReplace ( OdyseeVideoThumb , " Thumb: " , " " )
; LBRY Audio
IniRead , LBRYAudioURL , %VideoLinksIniFile% , URLs , LBRYAudioURL , %A_Space%
IniRead , LBRYAudioThumb , %VideoLinksIniFile% , Misc , LBRYAudioThumb , %A_Space%
IniRead , LBRYAudioPermanentURL , %VideoLinksIniFile% , URLs , LBRYAudioPermanentURL , %A_Space%
IniRead , OdyseeAudioURL , %VideoLinksIniFile% , URLs , OdyseeAudioURL , %A_Space%
IniRead , OdyseeAudioThumb , %VideoLinksIniFile% , Misc , OdyseeAudioThumb , %A_Space%
OdyseeAudioThumb := StrReplace ( OdyseeAudioThumb , " Thumb: " , " " )
; Others
IniRead , RumbleURL , %VideoLinksIniFile% , URLs , RumbleURL , %A_Space%
IniRead , BrighteonURL , %VideoLinksIniFile% , URLs , BrighteonURL , %A_Space%
IniRead , DailyMotionURL , %VideoLinksIniFile% , URLs , DailyMotionURL , %A_Space%
IniRead , PodcastNumber , %VideoLinksIniFile% , Misc , PodcastNumber , %A_Space%
IniRead , LocalsURL , %VideoLinksIniFile% , URLs , LocalsURL , %A_Space%
IniRead , FacebookURL , %VideoLinksIniFile% , URLs , FacebookURL , %A_Space%
; MISC
IniRead , ErrorLoggingFilePath , %VideoLinksIniFile% , Misc , ErrorLoggingFilePath , %A_Space%
if ( VideoFileSizeInMB < 50 ) {
IniRead , Telegram , %VideoLinksIniFile% , Misc , Telegram , %A_Space%
}
}
2023-07-29 20:34:19 -04:00
; Create a directory for errorlogging if this is the first time working on this project
2023-02-12 17:34:03 -05:00
if ( ErrorLoggingFilePath = " " ) {
; DevModeMsgBox("generating filepath")
FormatTime , TodayDate , YYYYMMDDHH24MISS , yyyyMMdd_hhmmss
ErrorLoggingDirectory := ErrorLoggingFolder . " \ " . TodayDate . " _FVU "
FileCreateDir , %ErrorLoggingDirectory%
ErrorLoggingFilePath := ErrorLoggingFolder . " \ " . TodayDate . " _FVU\ErrorLogging.txt " ; Set locaiton where error logging text will go
; Write both filepaths to .ini file
IniWrite , %ErrorLoggingFilePath% , %VideoLinksIniFile% , Misc , ErrorLoggingFilePath
}
if ( PodcastNumber = " " ) {
PodcastNumber := StrSplit ( VideoFileNameNoExt , " _ " )
PodcastNumber := PodcastNumber [ 2 ]
}
; Set the checkmark status of each item based on the variable status
; (StreamanityURL != "")?(StreamanityCheckStatus := 0) : (StreamanityCheckStatus := 1)
( B i t C h u t e U R L ! = " " ) ? ( B i t C h u t e C h e c k S t a t u s : = 0 ) : ( B i t C h u t e C h e c k S t a t u s : = 1 )
( O d y s e e V i d e o U R L ! = " " ) ? ( O d y s e e V i d e o C h e c k S t a t u s : = 0 ) : ( O d y s e e V i d e o C h e c k S t a t u s : = 1 )
( O d y s e e V i d e o T h u m b ! = " " ) ? ( O d y s e e V i d e o T h u m b C h e c k S t a t u s : = 0 ) : ( O d y s e e V i d e o T h u m b C h e c k S t a t u s : = 0 )
OdyseeAudioThumbCheckStatus := 0
if ( OdyseeAudioURL OR WavAudioFilepath = " " )
OdyseeAudioCheckStatus := 0
/*
if ( OdyseeAudioThumb OR WavAudioFilepath = " " )
OdyseeAudioThumbCheckStatus := 0
* /
( R u m b l e U R L ! = " " ) ? ( R u m b l e C h e c k S t a t u s : = 0 ) : ( R u m b l e C h e c k S t a t u s : = 1 )
2023-02-17 00:29:41 -05:00
; if user tried to upload to locals already and still needs to grab the url, check
2023-10-22 00:06:55 -04:00
( L o c a l s U R L = " L o c a l s U p l o a d S t a r t e d N e e d T o G r a b U R L " ) ? ( L o c a l s C h e c k S t a t u s : = 1 ) : ( L o c a l s C h e c k S t a t u s : = 0 )
2023-02-12 17:34:03 -05:00
( B r i g h t e o n U R L ! = " " ) ? ( B r i g h t e o n C h e c k S t a t u s : = 0 ) : ( B r i g h t e o n C h e c k S t a t u s : = 1 )
if ( VideoFileSizeInMB > 6144 ) {
VideoFileSizeOver6GB := 1
BrighteonCheckStatus := 0
}
( D a i l y M o t i o n U R L ! = " " ) ? ( D a i l y M o t i o n C h e c k S t a t u s : = 0 ) : ( D a i l y M o t i o n C h e c k S t a t u s : = 1 )
FacebookCheckStatus := 0
TelegramCheckStatus := 0
;---Testing Mode Overrides---
;------------------------------------------------
IniRead , TestingMode , %SettingsIniFilepath% , General , TestingMode , 0
if ( TestingMode ) { ; 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%
( B i t C h u t e ) ? ( B i t C h u t e C h e c k S t a t u s : = 1 ) : ( B i t C h u t e C h e c k S t a t u s : = 0 )
IniRead , OdyseeVideo , %SettingsIniFilepath% , Testing , OdyseeVideo , %A_Space%
( O d y s e e V i d e o ) ? ( O d y s e e V i d e o C h e c k S t a t u s : = 1 ) : ( O d y s e e V i d e o C h e c k S t a t u s : = 0 )
IniRead , OdyseeVideoThumb , %SettingsIniFilepath% , Testing , OdyseeVideoThumb , %A_Space%
( O d y s e e V i d e o T h u m b ) ? ( O d y s e e V i d e o T h u m b C h e c k S t a t u s : = 1 ) : ( O d y s e e V i d e o T h u m b C h e c k S t a t u s : = 0 )
IniRead , OdyseeAudio , %SettingsIniFilepath% , Testing , OdyseeAudio , %A_Space%
( O d y s e e A u d i o ) ? ( O d y s e e A u d i o C h e c k S t a t u s : = 1 ) : ( O d y s e e A u d i o C h e c k S t a t u s : = 0 )
IniRead , OdyseeAudioThumb , %SettingsIniFilepath% , Testing , OdyseeAudioThumb , %A_Space%
( O d y s e e A u d i o T h u m b ) ? ( O d y s e e A u d i o T h u m b C h e c k S t a t u s : = 1 ) : ( O d y s e e A u d i o T h u m b C h e c k S t a t u s : = 0 )
IniRead , Rumble , %SettingsIniFilepath% , Testing , Rumble , %A_Space%
( R u m b l e ) ? ( R u m b l e C h e c k S t a t u s : = 1 ) : ( R u m b l e C h e c k S t a t u s : = 0 )
IniRead , Brighteon , %SettingsIniFilepath% , Testing , Brighteon , %A_Space%
( B r i g h t e o n ) ? ( B r i g h t e o n C h e c k S t a t u s : = 1 ) : ( B r i g h t e o n C h e c k S t a t u s : = 0 )
IniRead , DailyMotion , %SettingsIniFilepath% , Testing , DailyMotion , %A_Space%
( D a i l y M o t i o n ) ? ( D a i l y M o t i o n C h e c k S t a t u s : = 1 ) : ( D a i l y M o t i o n C h e c k S t a t u s : = 0 )
IniRead , Locals , %SettingsIniFilepath% , Testing , Locals , %A_Space%
( L o c a l s ) ? ( L o c a l s C h e c k S t a t u s : = 1 ) : ( L o c a l s C h e c k S t a t u s : = 0 )
IniRead , Telegram , %SettingsIniFilepath% , Testing , Telegram , %A_Space%
( T e l e g r a m ) ? ( T e l e g r a m C h e c k S t a t u s : = 1 ) : ( T e l e g r a m C h e c k S t a t u s : = 0 )
IniRead , Facebook , %SettingsIniFilepath% , Testing , Facebook , %A_Space%
( F a c e b o o k ) ? ( F a c e b o o k C h e c k S t a t u s : = 1 ) : ( F a c e b o o k C h e c k S t a t u s : = 0 )
}
if ( PassedParameter = " ShowResults " ) {
goto , DisplayResults
}
;---GUI Variables---
;------------------------------------------------
GuiHeight = 800
GuiWidth = 1366
GuiFontSize = 10
2023-02-18 13:12:18 -05:00
ButtonHeights := 30
2023-02-12 17:34:03 -05:00
MarginSpace := 10
MarginSpaceDoubled := MarginSpace * 2
2023-09-16 21:37:26 -04:00
MarginSpaceTripled := MarginSpace * 3
2023-02-12 17:34:03 -05:00
EditBoxWidths := ( GuiWidth / 100 ) * 60
EditBoxHalfWidths := ( EditBoxWidths / 2 ) - ( MarginSpace / 2 )
OdyseeURLSlugEditWidth := ( EditBoxHalfWidths / 4 ) * 3
PodcastNumberTextXPos := EditBoxHalfWidths + OdyseeURLSlugEditWidth + ( MarginSpace * 3 )
PodcastNumberEditWidth := ( EditBoxHalfWidths / 4 ) - MarginSpace
EditBoxOneFourthWidth := ( EditBoxWidths / 4 )
EditBoxThreeFourthsWidth := ( EditBoxWidths / 4 ) * 3
ColumnOneHalfWidthXPos := EditBoxHalfWidths + MarginSpaceDoubled
EditBoxThirdsWidths := ( EditBoxWidths / 3 ) - ( MarginSpace / 2 )
OdyseeURLSlugXPos := EditBoxHalfWidths + ( MarginSpace * 2 )
EditBoxFourthWidths := ( EditBoxWidths / 4 ) - ( MarginSpace - 2 )
VideoTagsTextXPos := EditBoxHalfWidths + ( MarginSpace * 2 )
; EditBoxHalfWidthsWithMargin := (EditBoxWidths / 2)
DescriptionCharCountXPos := EditBoxWidths - 40
PageTwoXStartPos := EditBoxWidths + 50
CopyButtonWidths := 150
ResultEditBoxXPos := CopyButtonWidths + MarginSpace + 5
ResultEditBoxWidths := EditBoxWidths - CopyButtonWidths
ResultEditBoxHalfWidths := ( ResultEditBoxWidths / 2 ) - ( MarginSpace / 2 )
ResultLBRYURLEditBoxWidthPieces := ( ResultEditBoxWidths / 4 )
ResultLBRYURLEditBoxWidths := ResultLBRYURLEditBoxWidthPieces * 3
ResultEditBoxThirdsWidths := ( ResultEditBoxWidths / 3 ) - ( MarginSpace / 3 )
ResultLBRYThumbEditBoxWidth := ResultLBRYURLEditBoxWidthPieces - 5
ErrorLogEditBoxXPos := ResultEditBoxWidths + CopyButtonWidths + 30
2023-02-18 13:12:18 -05:00
ErrorLogEditBoxHeight := GuiHeight - ( MarginSpace * 20 ) - ( ButtonHeights * 2 )
2023-02-12 17:34:03 -05:00
ErrorLogEditBoxWidth := GuiWidth - ErrorLogEditBoxXPos - ( MarginSpace * 12 )
ButtonWidths := 150
ButtonXPos := GuiWidth - ButtonWidths - 15
SubmitButtonYLocation := GuiHeight - 50
SubmitButtonXLocation := GuiWidth - 90
CancelButtonXLocation := GuiWidth - 180
EditBoxHeight := 25
ThumbnailPreviewWidth := 300
PageTwoGroupBoxWidth := ThumbnailPreviewWidth + 20
; Size of Description Edit Box and the location of the checkboxes underneath them
VideoDescriptionEditBoxHeight = 100
CheckboxesStartYPos := 630
FilePathEditBoxWidths := EditBoxWidths - MarginSpace - 70
SelectFileButtonWidths := 30
ButtonStartYPos := CheckboxesStartYPos + 10
MarginSquared := MarginSpace * 2
if ( DevMode ) {
MainButtonHeight := 30
SecondaryButtonHeights := 30
}
else , {
MainButtonHeight := 30
SecondaryButtonHeights := 35
}
2023-02-17 01:49:08 -05:00
2023-09-21 00:44:20 -04:00
; @ TODO REMOVE
; LocalsGrabURL := 0
; Locals := 0
2023-02-12 17:34:03 -05:00
; -------------------------------GUI-------------------------------
Gui , Font , s %GuiFontSize%
Gui , Margin , %MarginSpace% , %MarginSpace%
; Video Title
Gui , Font , Bold
Gui , Add , Text , , Show Title
Gui , Add , Text , x %ColumnOneHalfWidthXPos% yp + 0 , Odysee URL Slug
Gui , Add , Text , x %PodcastNumberTextXPos% yp + 0 , Podcast #
Gui , Font , Normal
Gui , Add , Edit , y + 5 x %MarginSpace% w %EditBoxHalfWidths% h %EditBoxHeight% gUpdateVars vVideoTitle , %VideoTitle%
Gui , Add , Edit , yp + 0 x + %Marginspace% w %OdyseeURLSlugEditWidth% h %EditBoxHeight% gUpdateVars vLBRYURLSlug , %LBRYURLSlug%
Gui , Add , Edit , yp + 0 x + %Marginspace% w %PodcastNumberEditWidth% h %EditBoxHeight% gUpdateVars vPodcastNumber , %PodcastNumber%
; LBRY URL
Gui , Font , Bold
Gui , Add , Text , x %Marginspace% , Video Tags
Gui , Add , Text , x %ColumnOneHalfWidthXPos% yp + 0 , Podcast Tags
Gui , Font , Normal
Gui , Add , Edit , x %Marginspace% Y + 5 w %EditBoxHalfWidths% h %EditBoxHeight% gUpdateVars vVideoTags , %VideoTags%
Gui , Add , Edit , yp + 0 x + %Marginspace% w %EditBoxHalfWidths% h %EditBoxHeight% gUpdateVars vPodcastTags , %PodcastTags%
; Video Description
Gui , Font , Bold
2023-09-20 20:45:57 -04:00
2023-02-12 17:34:03 -05:00
if ( NoOriginalVideoDescription )
Gui , Add , Text , cRed y + %Marginspace% x %Marginspace% , Video Description
else ,
Gui , Add , Text , y + %Marginspace% x %Marginspace% , Video Description :
2023-09-20 20:45:57 -04:00
if ( TestingMode )
Gui , Add , Text , cRed yp + 0 xp + 150 , TESTING MODE
if ( DevMode )
Gui , Add , Text , cRed yp + 0 xp + 150 , DEV MODE
2023-02-12 17:34:03 -05:00
Gui , Font , Normal
Gui , Add , Edit , x %Marginspace% y + 2 w %EditBoxWidths% h %VideoDescriptionEditBoxHeight% vVideoDescription gSubmitDescription , %VideoDescription%
gui , font , s8
Gui , font , Bold
if ( DescriptionCharCount > 3000 ) {
Gui , Add , Edit , cRed w50 h20 x %DescriptionCharCountXPos% y + 1 vDescriptionCharCount , %DescriptionCharCount%
}
else ,
Gui , Add , Edit , w50 h20 x %DescriptionCharCountXPos% y + 1 vDescriptionCharCount , %DescriptionCharCount%
Gui , Font , Normal
2023-07-29 20:15:50 -04:00
Gui , Add , Text , yp + 3 xp - 310 , ( Platform Char . Limits : DM + Bitchute = 3 K , Odysee , Brighteon = 5 K )
2023-02-12 17:34:03 -05:00
Gui , Font , s %GuiFontSize%
Gui , font , Bold
Gui , Add , GroupBox , r8 . 5 x %MarginSpace% yp + 10 w %EditBoxWidths% Center , Filepaths
; Video Filepath
Gui , Font , Bold
Gui , Add , Text , xp + 5 yp + 15 , Video Filepath
Gui , Font , Normal
Gui , Add , Edit , x %MarginSquared% y + 2 w %FilePathEditBoxWidths% h %EditBoxHeight% gUpdateVars vVideoFilepath , %VideoFilepath%
Gui , Add , Button , x + 5 yp + 0 h %EditBoxHeight% gSelectVideoFilepath , Select
; Video Thumbnail Filepath
Gui , Font , Bold
if ( NoOriginalVideoThumbFilepath )
Gui , Add , Text , x %MarginSquared% CRed y + 15 , Video Thumbnail Filepath
else ,
Gui , Add , Text , y + 15 x %MarginSquared% , Video Thumbnail Filepath
Gui , Font , Normal
Gui , Add , Edit , x %MarginSquared% y + 2 w %FilePathEditBoxWidths% h %EditBoxHeight% gUpdateVars vVideoThumbFilepath , %VideoThumbFilepath%
Gui , Add , Button , x + 5 yp + 0 h %EditBoxHeight% gSelectVideoThumbFilepath , Select
; WAV Audio File Filepath
Gui , Font , Bold
if ( WavAudioFilepath = " " )
Gui , Add , Text , cRed x %MarginSquared% y + 15 , WAV Filepath
2023-10-22 00:06:55 -04:00
else , { ; change text depending on if WAV or FLAC file
if ( InStr ( WavFilepath , " .flac " ) )
Gui , Add , Text , x %MarginSquared% y + 15 , FLAC Filepath
else ,
Gui , Add , Text , x %MarginSquared% y + 15 , WAV Filepath
}
2023-02-12 17:34:03 -05:00
Gui , Font , Normal
Gui , Add , Edit , x %MarginSquared% y + 2 w %FilePathEditBoxWidths% h %EditBoxHeight% gUpdateVars vWavAudioFilepath , %WavAudioFilepath%
Gui , Add , Button , x + 5 yp + 0 h %EditBoxHeight% gSelectWAVFilepath , Select
Gui , Font , Bold
if ( MP3AudioFilepath = " " )
Gui , Add , Text , cRed x %MarginSquared% y + 15 , Podcast MP3 Filepath
else ,
Gui , Add , Text , x %MarginSquared% y + 15 , Podcast MP3 Filepath
Gui , Font , Normal
Gui , Add , Edit , x %MarginSquared% y + 2 w %FilePathEditBoxWidths% h %EditBoxHeight% gUpdateVars vMP3AudioFilepath , %MP3AudioFilepath%
Gui , Add , Button , x + 5 yp + 0 h %EditBoxHeight% gSelectMP3Filepath , Select
; Submit Button
Gui , Font , s %GuiFontSize%
gui , Font , Bold
2023-04-03 00:04:18 -04:00
; if(DevMode)
; Gui, Add, Button, x%MarginSpace% w%EditBoxHalfWidths% y+25 h%MainButtonHeight% gCancelPost hwndIcon, Close
; else,
2023-09-16 21:37:26 -04:00
; Script Update Button
if ( UpdateAvailable ) {
2023-09-20 20:45:57 -04:00
Gui , Add , Button , w %EditBoxHalfWidths% x %MarginSpace% gUpdateScript vUpdateAvailable h %SecondaryButtonHeights% center , Uploader Update Available !
2023-09-16 21:37:26 -04:00
; GuiButtonIcon(Icon, "shell32.dll", 278, "s20 a1 r2")
}
else , {
2023-09-16 22:45:52 -04:00
Gui , Add , Button , w %EditBoxHalfWidths% x %MarginSpace% gUpdateScript vUpdateAvailable h %SecondaryButtonHeights% center , Uploader Up - to - Date
2023-09-16 21:37:26 -04:00
; Gui, Add, Button, w%EditBoxHalfWidths% x+%Marginspace% vUpdateAvailable hwndIcon, Script is Up-to-Date
; GuiButtonIcon(Icon, "shell32.dll", 239, "s20 a1 r2")
2023-02-12 17:34:03 -05:00
2023-09-16 21:37:26 -04:00
}
; Gui, Font, s20
; Gui, Font, Bold
Gui , Add , Button , x + %MarginSpace% w %EditBoxHalfWidths% h %SecondaryButtonHeights% gStartScript , UPLOAD
2023-02-12 17:34:03 -05:00
2023-09-16 21:37:26 -04:00
Gui , Font , s %GuiFontSize%
2023-02-12 17:34:03 -05:00
2023-09-16 21:37:26 -04:00
; Chrome Update Button
if ( ChromeUpdateAvailable ) {
2023-09-20 20:45:57 -04:00
Gui , Add , Button , x %MarginSpace% w %EditBoxHalfWidths% y + %Marginspace% h %SecondaryButtonHeights% vChromeUpdateAvailable gUpdateChrome center , Chrome Update Available !
2023-04-03 00:04:18 -04:00
}
else , {
2023-09-16 22:45:52 -04:00
Gui , Add , Button , x %MarginSpace% w %EditBoxHalfWidths% y + %Marginspace% h %SecondaryButtonHeights% vChromeUpdateAvailable gUpdateChrome center , Chrome Up - to - Date
2023-04-03 00:04:18 -04:00
}
2023-09-16 21:37:26 -04:00
; Gui, Add, Button, x%MarginSpace% w%EditBoxHalfWidths% y+25 h%MainButtonHeight% gCancelPost hwndIcon, Exit
; GuiButtonIcon(Icon, "imageres.dll",208, "s20 a1 r2")
if ( DevMode )
Gui , Add , Button , x + %MarginSpace% yp + 0 w %EditBoxFourthWidths% h %SecondaryButtonHeights% gDisplayResults , View Results
else ,
Gui , Add , Button , x + %MarginSpace% yp + 0 w %EditBoxFourthWidths% h %SecondaryButtonHeights% gDisplayResults , View Results
Gui , Add , Button , w %EditBoxFourthWidths% x + %Marginspace% h %SecondaryButtonHeights% gOpenProjectFolder , Open Project Folder
2023-02-12 17:34:03 -05:00
if ( DevMode ) {
Gui , Add , Button , x %MarginSpace% w %EditBoxFourthWidths% h30 y + 5 h %SecondaryButtonHeights% gOpenErrorLog , Open ErrorLog
Gui , Add , Button , x + %MarginSpace% w %EditBoxFourthWidths% h30 h %SecondaryButtonHeights% gClearVideoLinks , Clear VideoLinks
}
; -------------------------------Page 2 Side of Main GUI Window-------------------------------
LineSplitXPosition := PageTwoXStartPos - ( MarginSpace * 2 )
gui , add , text , x %LineSplitXPosition% y20 h500 0x11 ; 0x11 is a "line" ; refer to here: https://autohotkey.com/board/topic/50910-draw-line-gui/
; Thumbnail Preview
Gui , Font , Normal
gui , Font , s4
; Miscellaneous Settings
DevModToggleButton := PageTwoXStartPos + 160
Gui , Add , Button , x %DevModToggleButton% y5 w50 h10 gToggleDevMode , DevMode
Gui , Add , Button , x + 5 y5 w50 h10 gToggleTestingMode , Testing Mode
Gui , Add , Button , x + 5 y5 w50 h10 gOpenGiteaPage , Gitea
Gui , Font , s %GuiFontSize%
Gui , Font , Bold
2023-09-16 21:37:26 -04:00
2023-09-20 20:45:57 -04:00
; Settings Section
2023-02-12 17:34:03 -05:00
Gui , Add , GroupBox , r5 y + 0 x %PageTwoXStartPos% w %PageTwoGroupBoxWidth% , Settings
2023-07-29 20:34:19 -04:00
Gui , Add , Checkbox , xp + 10 yp + 20 vAutoUpdateCheck gUpdateVars Checked %AutoUpdateCheckCheckStatus% , Auto Update Check
2023-02-12 17:34:03 -05:00
Gui , Add , Checkbox , vShowTooltipProgress Checked %ShowTooltipProgressCheckStatus% gUpdateVars , Show Tooltip Progress
2023-07-29 20:34:19 -04:00
Gui , Add , Checkbox , vKillLBRYAfterUpload Checked %KillLBRYAfterUploadCheckStatus% , Kill LBRY After Uploading
2023-02-23 14:58:34 -05:00
Gui , Add , Checkbox , vAutoLogin gUpdateVars Checked %AutoLoginCheckStatus% , Try to Login Automatically
2023-07-29 20:34:19 -04:00
Gui , Add , Checkbox , vPingOnCompletion gUpdateVars Checked %PingOnCompletionCheckStatus% , Discord Ping Upon Completion
2023-02-12 17:34:03 -05:00
GroupBoxCheckboxPos := PageTwoXStartPos + MarginSpace
2023-02-17 00:29:41 -05:00
; -------------------------------PLATFORMS-------------------------------
2023-09-16 21:37:26 -04:00
Gui , Add , GroupBox , r6 y + %MarginSpaceTripled% x %PageTwoXStartPos% w %PageTwoGroupBoxWidth% , Platforms
2023-02-17 00:29:41 -05:00
; Msgbox % "LocalsURL: " LocalsURL
2023-09-16 21:37:26 -04:00
; if(VideoFileSizeInMB < 1792)
; Gui, Add, Checkbox, x+%MarginSpaceDoubled% vFacebook Checked%FacebookCheckStatus%, Facebook
2023-09-21 00:44:20 -04:00
Gui , Add , Checkbox , xp + 10 yp + 25 vBitChute Checked %BitChuteCheckStatus% gUpdateVars , BitChute
2023-09-16 21:37:26 -04:00
2023-12-07 21:12:20 -05:00
2023-02-17 00:29:41 -05:00
if ( LocalsURL = " LocalsUploadStartedNeedToGrabURL " ) {
2023-12-07 21:12:20 -05:00
; msgbox, checking grab url
2023-09-21 00:44:20 -04:00
Gui , Add , Checkbox , x + %MarginSpaceTripled% yp + 0 vLocalsGrabURL Checked %LocalsCheckStatus% gUpdateVars , Locals ( Grab URL )
2023-12-07 21:12:20 -05:00
LocalsGrabURL := 1
Locals := 0
2023-02-17 00:29:41 -05:00
}
else , {
2023-12-07 21:12:20 -05:00
; msgbox, checking locals
2023-09-21 00:44:20 -04:00
Gui , Add , Checkbox , x + %MarginSpaceTripled% yp + 0 vLocals Checked %LocalsCheckStatus% gUpdateVars , Locals
2023-12-07 21:12:20 -05:00
LocalsGrabURL := 0
Locals := 1
2023-02-17 00:29:41 -05:00
}
2023-02-12 17:34:03 -05:00
2023-10-22 00:06:55 -04:00
Gui , Add , Checkbox , x %GroupBoxCheckboxPos% y + %MarginSpace% vOdyseeVideo Checked %OdyseeVideoCheckStatus% gUpdateVars , Odysee Video
2023-02-12 17:34:03 -05:00
if ( VideoFileSizeInMB < 50 )
2023-10-22 00:06:55 -04:00
Gui , Add , Checkbox , vTelegram x + %MarginSpaceTripled% yp + 0 Checked %TelegramCheckStatus% gUpdateVars , Telegram ( > 50 MB )
2023-02-12 17:34:03 -05:00
; Gui, Add, Checkbox, x+%MarginSpace% vOdyseeVideoThumb Checked%OdyseeVideoThumbCheckStatus%,Thumbnail
2023-09-21 00:44:20 -04:00
Gui , Add , Checkbox , x %GroupBoxCheckboxPos% y + %MarginSpace% vOdyseeAudio Checked %OdyseeAudioCheckStatus% gUpdateVars , Odysee Audio
2023-02-12 17:34:03 -05:00
; Gui, Add, Checkbox, x+%MarginSpace% vOdyseeAudioThumb Checked%OdyseeAudioThumbCheckStatus%, Thumbnail
2023-09-21 00:44:20 -04:00
Gui , Add , Checkbox , x %GroupBoxCheckboxPos% y + %MarginSpace% vRumble Checked %RumbleCheckStatus% gUpdateVars , Rumble
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
Gui , Add , Checkbox , vBrighteon y + %MarginSpace% Checked %BrighteonCheckStatus% gUpdateVars , Brighteon
Gui , Add , Checkbox , vDailyMotion y + %MarginSpace% Checked %DailyMotionCheckStatus% gUpdateVars , DailyMotion
2023-02-12 17:34:03 -05:00
; Gui, Add, Checkbox, vStreamanity Checked%StreamanityCheckStatus%, Streamanity
; Gui, Font, s12
gui , Font , Bold
2023-09-16 21:37:26 -04:00
Gui , Add , GroupBox , r6 . 5 y + %MarginSpaceTripled% vImageThumbnail x %PageTwoXStartPos% w %PageTwoGroupBoxWidth% , Thumbnail
2023-02-12 17:34:03 -05:00
gui , Font , Normal
Gui , Add , Picture , xp + 10 yp + 20 w %ThumbnailPreviewWidth% h - 1 , %VideoThumbFilepath%
gui , Font , Normal
gui , font , s7
2023-09-17 14:26:44 -04:00
Gui , Add , StatusBar , Center , Total Videos Uploaded : %TotalVideosUploaded% | Total Clicks Saved : %MouseClicksSaved%
2023-02-12 17:34:03 -05:00
; Show GUI to the user
Gui , + Resize + MaximizeBox
2023-09-16 23:32:37 -04:00
if ( XPosition and YPosition )
Gui , Show , x %XPosition% y %YPosition% , %FullScriptName% - Upload Settings - %BodyTextFilePath%
else ,
2023-02-12 17:34:03 -05:00
Gui , Show , , %FullScriptName% - Upload Settings - %BodyTextFilePath%
2023-09-16 23:32:37 -04:00
2023-09-16 23:34:50 -04:00
ControlFocus , Edit4 , %FullScriptName%
2023-02-12 17:34:03 -05:00
ToolTip
; Write current project to ini file for easy reloading
IniWrite , %BodyTextFilePath% , %SettingsIniFilepath% , %ScriptSettingsSection% , LastPost
2023-04-03 00:04:18 -04:00
2023-09-16 23:32:37 -04:00
URunTime1 := round ( ( ( A_TickCount - UStartTime ) / 1000 ) , 2 )
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
;---Check for Updates---
2023-09-16 22:45:52 -04:00
;------------------------------------------------
; msgbox, checking for updates
if ( AutoUpdateCheck AND ! UpdateAvailable ) {
Message = Checking for Updates
SaveOrPostProgress ( Message := Message , PostType := " Tooltip,ErrorLoggingTextFile,DiscordErrorLogging " )
; DevModeMsgBox("checking for updates")
; msgbox, checkin for update
; DevModeMsgBox(GitReleasesAPIURL)
; UpdateAvailable :=
if ( CheckForUpdates ( GitReleasesAPIURL ) )
2023-09-20 20:45:57 -04:00
GuiControl , , UpdateAvailable , Uploader Update Available !
2023-09-16 22:45:52 -04:00
2023-09-20 20:45:57 -04:00
if ( CheckForChromeUpdates ( ChromeFilepath ) ) {
GuiControl , , ChromeUpdateAvailable , Chrome Update Available !
ChromeUpdateAvailable := 1
}
2023-09-16 22:45:52 -04:00
}
2023-09-16 23:32:37 -04:00
; calculate run time and convert to seconds
URunTime2 := round ( ( ( A_TickCount - UStartTime ) / 1000 ) , 2 )
2023-09-16 22:45:52 -04:00
2023-02-12 17:34:03 -05:00
Return
; -------------------------------GUI GoSubs-------------------------------
; Kill the script if user clicks on cancel button
KillScript:
; GuiClose:
ExitApp
Return
PauseScript:
Pause , Toggle
Return
CancelPost:
GuiClose:
; ExitApp
Gui , Submit ,
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
SubmitDescription:
Gui , Submit , NoHide
DescriptionCharCount := StrLen ( VideoDescription )
GuiControl , , DescriptionCharCount , %DescriptionCharCount%
Return
; Open folder of the project
OpenProjectFolder:
run , %VideoFolderDir%
Return
ClearVideoLinks:
FileDelete , %VideoLinksIniFile%
Return
OpenErrorLog:
run , %ErrorLoggingFilePath%
Return
ToggleTestingMode:
ToggleTestingMode ( )
run , " %A_ScriptFullPath% " " LastPost "
Return
ToggleDevMode:
ToggleDevMode ( )
run , " %A_ScriptFullPath% " " LastPost "
Return
OpenGiteaPage:
2023-12-11 13:38:51 -05:00
run , https : / / freedomain . dev / yuriy / video - uploader
2023-02-12 17:34:03 -05:00
Return
SelectVideoFilepath:
FileSelectFile , VideoFilepath , , %FileDir% , Select Video File
GuiControl , , VideoFilepath , %VideoFilepath%
Return
SelectWAVFilepath:
FileSelectFile , WavAudioFilepath , , %FileDir% , Select WAV File
GuiControl , , WavAudioFilepath , %WavAudioFilepath%
GuiControl , , OdyseeAudio , 1
GuiControl , , OdyseeAudioThumb , 1
Return
SelectMP3Filepath:
FileSelectFile , MP3AudioFilepath , , %FileDir% , Select MP3 File
if ( ! InStr ( MP3AudioFilepath , " .mp3 " ) ) {
msgbox , 4096 , Error , Selected File is not an . mp3 file . `n Please try again .
Return
}
GuiControl , , MP3AudioFilepath , %MP3AudioFilepath%
Return
SelectVideoThumbFilepath:
FileSelectFile , VideoThumbFilepath , , %FileDir% , Select Thumbnail File
if ( ! InStr ( VideoThumbFilepath , FileDir ) ) {
TimedToolTip ( " Thumbnail Copied to Project Folder " , , , 1000 )
SplitPath , VideoThumbFilepath , OutFileName , OutDir , OutExtension , OutNameNoExt , OutDrive
FileCopy , %VideoThumbFilepath% , %FileDir% \* , 1
VideoThumbFilepath = %FileDir% \%OutFileName%
; Msgbox % "VideoThumbFilepath: " VideoThumbFilepath
}
GuiControl , , VideoThumbFilepath , %VideoThumbFilepath%
; GuiControl,, ImageThumbnail,%VideoThumbFilepath%
Return
; Download updates from google drive and save it to the location of the script and then reload the script
UpdateScript:
UpdateScript ( )
; @todo: Save any changes made to the script before installing update
Return
2023-09-16 21:37:26 -04:00
UpdateChrome:
2023-12-04 21:16:11 -05:00
2023-09-20 20:45:57 -04:00
if ( CheckForChromeUpdates = " " )
Status := CheckForChromeUpdates ( ChromeFilepath )
2023-02-12 17:34:03 -05:00
2023-09-20 20:45:57 -04:00
if ( ! status ) {
OnMessage ( 0x44 , " OnMsgBoxConfirmChromiumOverwrite " )
MsgBox 0x41 , Already Up - to - Date , Yor current Chromium version is already up to date . `n Do you want to download and overwrite it ?
OnMessage ( 0x44 , " " )
2023-02-12 17:34:03 -05:00
2023-09-20 20:45:57 -04:00
IfMsgBox OK , {
Return
} Else IfMsgBox Cancel , {
2023-02-12 17:34:03 -05:00
2023-09-20 20:45:57 -04:00
}
}
2023-02-12 17:34:03 -05:00
2023-12-04 21:16:11 -05:00
Status := DownloadLatestChromium ( )
if ( Status )
GuiControl , , ChromeUpdateAvailable , Chrome Up - to - Dat
2023-02-12 17:34:03 -05:00
Return
2023-09-16 23:32:37 -04:00
2023-09-21 00:44:20 -04:00
/*
* /
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
; now defunt, safe to remove
CreateDescriptionForVideosPosting:
; msgbox, here
Gui , VideoDescriptionTrimmer : New ,
Gui , Font , s %GuiFontSize%
Gui , Add , Text , , Discord and Telegram have a maximum API post length of 2000 Characters `n which the curent description exceeds . `n Please Trim down the description and then click submit .
Gui , Font , s %GuiFontSize%
Gui , Add , Edit , w800 h500 gUpdateVars vVideoDescriptionForVideosChannel , %VideoDescription%
Gui , Add , Button , gSubmitDescriptionForVideosChannel , Submit
gui , Show , w820 , Video Description Trimmer
; msgbox
Return
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
SubmitDescriptionForVideosChannel:
Gui , Submit
; msgbox, submitted
if ( CurrentSocialMediaPosting = " Discord " )
Goto , SubmitDescriptionForDiscordVideosChannel
if ( CurrentSocialMediaPosting = " Telegram " )
Goto , SubmitDescriptionForTelegramVideosChannel
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
if ( CurrentSocialMediaPosting = " Telegram Video " )
goto , SubmitDescriptionForTelegramVideoUpload
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
Return
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
CreateDescriptionForSocialMedia ( ) {
SplitText = Free Documentaries :
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
SocialMediaDescription := StrSplit ( VideoDescription , SplitText )
SocialMediaDescription := SocialMediaDescription [ 1 ]
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
if ( strlen ( SocialMediaDescription ) > 1400 ) {
SocialMediaDescription := SubStr ( SocialMediaDescription , 1 , 1400 )
SocialMediaDescription .= " ... "
2023-09-20 20:45:57 -04:00
}
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
Return
}
; -------------------------------Upload Video Functionality-------------------------------
StartScript:
WinGetPos , XPosition , YPosition , , , A
IniWrite , %XPosition% , %SettingsIniFilepath% , General , XPosition
IniWrite , %YPosition% , %SettingsIniFilepath% , General , YPosition
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
Gui , Submit
Gui , Destroy
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
; Save Testing Mode Info
;------------------------------------------------
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
}
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
; Save Video Info
;------------------------------------------------
; if changes made, delete the original file and save the new content to it
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
if ( VideoTitle != OriginalVideoTitle ) {
VideoTitleFilepath = %VideoFolderDir% \title . txt
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
FileDelete , %VideoTitleFilepath%
FileAppend , %VideoTitle% , %VideoTitleFilepath%
}
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
if ( VideoTags != OriginalVideoTags ) {
VideoTagsFilepath = %VideoFolderDir% \keywords . txt
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
FileDelete , %VideoTagsFilepath%
FileAppend , %VideoTags% , %VideoTagsFilepath%
}
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
if ( PodcastTags != OriginalPodcastTags ) {
PodcastTagsFilepath = %VideoFolderDir% \keywords_podcast . txt
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
FileDelete , %PodcastTagsFilepath%
FileAppend , %PodcastTags% , %PodcastTagsFilepath%
}
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
if ( VideoDescription != OriginalVideoDescription ) {
VideoBodyFilepath = %VideoFolderDir% \body . txt
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
FileDelete , %VideoBodyFilepath%
FileAppend , %VideoDescription% , %VideoBodyFilepath%
}
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
; -------------------------------/Save Video Info-------------------------------
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
; Save settings to config file
IniWrite , %ReuseTabs% , %SettingsIniFilepath% , General , ReuseTabs
IniWrite , %ShowTooltipProgress% , %SettingsIniFilepath% , General , ShowTooltipProgress
IniWrite , %AutoUpdateCheck% , %SettingsIniFilepath% , General , AutoUpdateCheck
IniWrite , %AutoLogin% , %SettingsIniFilepath% , General , AutoLogin
IniWrite , %PingOnCompletion% , %SettingsIniFilepath% , General , PingOnCompletion
IniWrite , %KillLBRYAfterUpload% , %SettingsIniFilepath% , General , KillLBRYAfterUpload
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
if ( VideoFilepath = " " ) {
Msgbox , 4096 , Error , No Video Filepath Found . `n Please Input Video Filepath to Upload a Video .
run , " %A_ScriptFullPath% " " LastPost "
ExitApp
}
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
; Format the LBRYURLSlug to be API Compatible
if ( LBRYURLSlug = " " ) ; if slug spot is blank, then set it to video title
LBRYURLSlug := VideoTitle
LBRYURLSlug := LBRYCMDTextReplacement ( LBRYURLSlug )
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
; Save the LBRY URL Slug to .ini file in case it's needed later
IniWrite , %LBRYURLSlug% , %VideoLinksIniFile% , Misc , LBRYUrlSlug
IniWrite , %VideoThumbFilepath% , %VideoLinksIniFile% , Misc , VideoThumbFilepath
IniWrite , %PodcastNumber% , %VideoLinksIniFile% , Misc , PodcastNumber
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
; -------------------------------Log Info To Text-------------------------------
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
( F a c e b o o k = 1 ) ? ( P o s t e d W e b s i t e s . = " F a c e b o o k | " ) : ( )
( B i t c h u t e = 1 ) ? ( P o s t e d W e b s i t e s . = " B i t c h u t e | " ) : ( )
( L o c a l s = 1 ) ? ( P o s t e d W e b s i t e s . = " L o c a l s | " ) : ( )
( R u m b l e = 1 ) ? ( P o s t e d W e b s i t e s . = " R u m b l e | " ) : ( )
( B r i g h t e o n = 1 ) ? ( P o s t e d W e b s i t e s . = " B r i g h t e o n | " ) : ( )
; (Streamanity = 1)?(PostedWebsites .= "Streamanity|") : ()
( T e l e g r a m = 1 ) ? ( P o s t e d W e b s i t e s . = " T e l e g r a m | " ) : ( )
( D a i l y M o t i o n = 1 ) ? ( P o s t e d W e b s i t e s . = " D a i l y M o t i o n | " ) : ( )
( O d y s e e V i d e o = 1 ) ? ( P o s t e d W e b s i t e s . = " O d y s e e V i d e o | " ) : ( )
( O d y s e e A u d i o = 1 ) ? ( P o s t e d W e b s i t e s . = " O d y s e e A u d i o | " ) : ( )
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
; Log Basic info to the errorlogging file
Message = %ScriptName% v %ScriptVersion% : Starting Upload `n For : * * %VideoTitle% * * `n To : %PostedWebsites%
SaveOrPostProgress ( Message := Message , PostType := " Tooltip,ErrorLoggingTextFile,DiscordErrorLogging " )
Message := " VideoTitle: " VideoTitle
SaveOrPostProgress ( Message := Message , PostType := " ,ErrorLoggingTextFile " )
Message := " VideoDescription: `n " VideoDescription
SaveOrPostProgress ( Message := Message , PostType := " ,ErrorLoggingTextFile " )
Message := " VideoTags: " VideoTags
SaveOrPostProgress ( Message := Message , PostType := " ,ErrorLoggingTextFile " )
Message := " VideoFilepath: " VideoFilepath
SaveOrPostProgress ( Message := Message , PostType := " ,ErrorLoggingTextFile " )
Message := " VideoThumbFilepath: " VideoThumbFilepath
SaveOrPostProgress ( Message := Message , PostType := " ,ErrorLoggingTextFile " )
Message := " TotalVideosUploaded: " TotalVideosUploaded
SaveOrPostProgress ( Message := Message , PostType := " ,ErrorLoggingTextFile " )
2023-02-12 17:34:03 -05:00
2023-10-22 00:06:55 -04:00
; Convert Video Title and Description into javascript formatting for sending to pages through js instead of plain selenium
2023-09-21 00:44:20 -04:00
JSVideoTitle := FormatTextToJSText ( VideoTitle )
2023-10-22 00:06:55 -04:00
JSVideoDescription := FormatTextToJSText ( VideoDescription )
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
; -------------------------------/Log Info To Text-------------------------------
2023-02-12 17:34:03 -05:00
2024-01-02 13:04:08 -07:00
; This should go somewhere appropriate
; fwiw this function comes straight from the docs: https://www.autohotkey.com/docs/v2/Functions.htm#Variadic
Join ( sep , params * ) {
For index , param in params
str .= param . sep
return SubStr ( str , 1 , - StrLen ( sep ) )
}
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
; Create an array out of the keywords to be used in different places
2024-01-02 13:04:08 -07:00
KeywordsArray := Array ( )
For idx , val in StrSplit ( VideoTags , " , " ) {
; for each element in the split videotags array, trim leading & trailing spaces
val := Trim ( val )
; and remove any chars that are not a letter, number, or space (i = case-insensitive)
; note: it would be better to replace accented chars w/ their pure latin equivalents but that seems a bit
; beyond the scope of this change. here's a link talking about how to do that tho
; https://www.autohotkey.com/boards/viewtopic.php?t=61626
val := RegexReplace ( val , " i)[^a-z0-9 ] " , " " )
KeywordsArray . InsertAt ( idx , val )
}
; update VideoTags with sanitized keywords list
VideoTags := Join ( " , " , KeywordsArray * )
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
; Call each sub one by one, if errors occur then an upload will be stopped and the next upload will then proceed
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
if ( Telegram )
gosub , TelegramVideoUpload
2023-09-21 00:44:20 -04:00
2023-09-16 23:32:37 -04:00
if ( Locals )
gosub , LocalsUpload
if ( BitChute )
Gosub , BitChuteUpload
2023-02-12 17:34:03 -05:00
2023-07-29 20:15:50 -04:00
if ( OdyseeVideo ) {
LBRYUploadType := " Video "
Gosub , LBRYVideoUpload
}
2023-09-16 23:32:37 -04:00
2023-07-29 20:15:50 -04:00
if ( OdyseeAudio ) {
LBRYUploadType := " Audio "
Gosub , LBRYAudioUpload
}
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
if ( Rumble )
Gosub , RumbleUpload
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
if ( Brighteon )
Gosub , BrighteonUpload
if ( DailyMotion )
Gosub , DailyMotionUpload
2023-02-12 17:34:03 -05:00
2023-07-29 20:15:50 -04:00
; grab the LBRY Video/Audio URLs
if ( OdyseeVideo ) {
LBRYUploadType := " Video "
Gosub , LBRYGetURL
}
if ( OdyseeAudio ) {
LBRYUploadType := " Audio "
Gosub , LBRYGetURL
}
2023-02-12 17:34:03 -05:00
2023-09-21 00:44:20 -04:00
if ( LocalsGrabURL ) {
2023-09-16 23:32:37 -04:00
Gosub , LocalsGrabURL
}
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
if ( URLOfLastErrorPage != " " ) {
Message = Activating Tab of last failed post .
SaveOrPostProgress ( Message := Message , PostType := " Tooltip " )
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
; @todo: replaceme with working funciton to activate tab
; FindAndActivateTab(URLOfLastErrorPage)
2023-02-17 00:29:41 -05:00
}
2023-09-16 23:32:37 -04:00
CurrentSite := " "
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
if ( URLOfLastErrorPage )
2023-02-12 17:34:03 -05:00
Message = Video Uploading Finished WITH Some Failures
2023-09-16 23:32:37 -04:00
else ,
Message = All Videos Uploaded Successfully
2023-02-12 17:34:03 -05:00
if ( PingOnCompletion )
Message = < @ %DiscordUsernameID% > : %Message%
else ,
Message = %Message%
SaveOrPostProgress ( Message := Message , PostType := " Tooltip,ErrorLoggingTextFile,DiscordErrorLogging " )
DisplayResults:
2023-10-22 00:06:55 -04:00
/*
; i forget why i have it get the window position here
2023-09-21 20:50:06 -04:00
WinGetPos , XPosition , YPosition , , , A
2023-10-22 00:06:55 -04:00
Msgbox % " XPosition: " XPosition " `n " " YPosition: " YPosition
2023-09-21 20:50:06 -04:00
if ( XPosition > 0 and YPosition > 0 ) { ; if gui doesn't exist, both are set to -8
; Msgbox % "XPosition: " XPosition
; Msgbox % "YPosition: " YPosition
IniWrite , %XPosition% , %SettingsIniFilepath% , General , XPosition
IniWrite , %YPosition% , %SettingsIniFilepath% , General , YPosition
}
2023-10-22 00:06:55 -04:00
* /
2023-09-21 20:50:06 -04:00
2023-02-12 17:34:03 -05:00
Tooltip ; Remove all tooltips
2023-09-17 14:26:44 -04:00
Gui , Destroy ; destroy GUI in case we're going from the main screen to results without uploading.
IniRead , MouseClicksSaved , %SettingsIniFilepath% , General , MouseClicksSaved , %A_Space%
2023-02-12 17:34:03 -05:00
IniRead , TotalVideosUploaded , %SettingsIniFilepath% , General , TotalVideosUploaded , %A_Space%
; IniRead, StreamanityURL, %VideoLinksIniFile%, URLs, StreamanityURL, %A_Space%
IniRead , BitChuteURL , %VideoLinksIniFile% , URLs , BitChuteURL , %A_Space%
IniRead , OdyseeVideoURL , %VideoLinksIniFile% , URLs , OdyseeVideoURL , %A_Space%
IniRead , OdyseeVideoThumb , %VideoLinksIniFile% , Misc , OdyseeVideoThumb , %A_Space%
OdyseeVideoThumb := StrReplace ( OdyseeVideoThumb , " Thumb: " , " " )
IniRead , OdyseeAudioURL , %VideoLinksIniFile% , URLs , OdyseeAudioURL , %A_Space%
IniRead , OdyseeAudioThumb , %VideoLinksIniFile% , Misc , OdyseeAudioThumb , %A_Space%
OdyseeAudioThumb := StrReplace ( OdyseeAudioThumb , " Thumb: " , " " )
IniRead , LocalsURL , %VideoLinksIniFile% , URLs , LocalsURL , %A_Space%
IniRead , RumbleURL , %VideoLinksIniFile% , URLs , RumbleURL , %A_Space%
IniRead , FacebookURL , %VideoLinksIniFile% , URLs , FacebookURL , %A_Space%
IniRead , BrighteonURL , %VideoLinksIniFile% , URLs , BrighteonURL , %A_Space%
IniRead , DailyMotionURL , %VideoLinksIniFile% , URLs , DailyMotionURL , %A_Space%
IniRead , PodcastNumber , %VideoLinksIniFile% , Misc , PodcastNumber , %A_Space%
if ( PodcastNumber = " " ) {
SplitPath , VideoFilepath , , , , VideoNameNoExt
; Remove the FDR_#### from video title for LBRY URL
if ( InStr ( VideoNameNoExt , " FDR_ " ) ) {
FoundPos := InStr ( VideoNameNoExt , " _ " , , , 2 ) ; get position of second instance of an "_"
if ( FoundPos < 11 ) {
; FoundPos += 1
; Msgbox % "FoundPos: " FoundPos
PodcastNumber := SubStr ( VideoNameNoExt , 1 , FoundPos )
PodcastNumber := StrReplace ( PodcastNumber , " FDR " , " " )
PodcastNumber := StrReplace ( PodcastNumber , " _ " , " " )
; Msgbox % "PodcastNumber: " PodcastNumber
}
}
}
Gui , Font , s %GuiFontSize%
Gui , Font , Bold
; Gui, Add, Text,x10 y+10, Podcast #:
Gui , Add , Button , x10 y + %Marginspace% h %ButtonHeights% w %CopyButtonWidths% gCopyPodcastNumber , Podcast #
Gui , Font , Normal
Gui , Add , Edit , x + 5 yp + 0 h %ButtonHeights% w %ResultEditBoxWidths% gUpdateVars vPodcastNumber , %PodcastNumber%
Gui , Font , Bold
Gui , Add , Button , x10 y + %Marginspace% h %ButtonHeights% w %CopyButtonWidths% gCopyBitChuteURL , Bitchute
Gui , Font , Normal
2023-02-18 13:12:18 -05:00
Gui , Add , Edit , x + 5 yp + 0 h %ButtonHeights% vBitChuteURL w %ResultEditBoxWidths% gUpdateVars , %BitChuteURL%
2023-02-12 17:34:03 -05:00
Gui , Font , Bold
Gui , Add , Button , x10 y + %Marginspace% h %ButtonHeights% w %CopyButtonWidths% gCopyBrighteonURL , Brighteon
Gui , Font , Normal
Gui , Add , Edit , x + 5 yp + 0 h %ButtonHeights% vBrighteonURL w %ResultEditBoxWidths% gUpdateVars , %BrighteonURL%
Gui , Font , Bold
Gui , Add , Button , x10 y + 10 h %ButtonHeights% w %CopyButtonWidths% gCopyDailyMotionURL , DailyMotion
Gui , Font , Normal
Gui , Add , Edit , x + 5 yp + 0 h %ButtonHeights% vDailyMotionURL w %ResultEditBoxWidths% gUpdateVars , %DailyMotionURL%
Gui , Font , Bold
Gui , Add , Button , x10 y + 10 h %ButtonHeights% w %CopyButtonWidths% gCopyOdyseeVideoURL , Odysee Video
Gui , Font , Normal
2023-02-18 13:12:18 -05:00
Gui , Add , Edit , x + 5 yp + 0 h %ButtonHeights% vOdyseeVideoURL w %ResultEditBoxWidths% gUpdateVars , %OdyseeVideoURL%
2023-02-12 17:34:03 -05:00
Gui , Font , Bold
Gui , Add , Button , x10 y + 10 h %ButtonHeights% w %CopyButtonWidths% gCopyOdyseeAudioURL , Odysee Audio
Gui , Font , Normal
2023-02-18 13:12:18 -05:00
Gui , Add , Edit , x + 5 yp + 0 h %ButtonHeights% vOdyseeAudioURL w %ResultEditBoxWidths% gUpdateVars , %OdyseeAudioURL%
2023-02-12 17:34:03 -05:00
Gui , Font , Bold
Gui , Add , Button , x10 y + 10 h %ButtonHeights% w %CopyButtonWidths% gCopyRumbleURL , Rumble
Gui , Font , Normal
Gui , Add , Edit , x + 5 yp + 0 h %ButtonHeights% vRumbleURL w %ResultEditBoxWidths% gUpdateVars , %RumbleURL%
Gui , Font , Bold
Gui , Add , Button , x10 y + 10 h %ButtonHeights% w %CopyButtonWidths% , Locals
Gui , Font , Normal
Gui , Add , Edit , x + 5 yp + 0 h %ButtonHeights% vLocalsURL w %ResultEditBoxWidths% gUpdateVars , %LocalsURL%
Gui , Font , Bold
2023-09-16 23:34:50 -04:00
Gui , Add , Button , x10 y + 10 h %ButtonHeights% w %CopyButtonWidths% gCopyVideoTags vVideoTagsEdit , Video Tags
2023-02-12 17:34:03 -05:00
Gui , Font , Normal
Gui , Add , Edit , x + 5 yp + 0 h %ButtonHeights% vVideoTags w %ResultEditBoxWidths% gUpdateVars , %VideoTags%
Gui , Font , Bold
Gui , Add , Button , x10 y + 10 h %ButtonHeights% w %CopyButtonWidths% gCopyPodcastTags , Podcast Tags
Gui , Font , Normal
Gui , Add , Edit , x + 5 yp + 0 h %ButtonHeights% vPodcasttags w %ResultEditBoxWidths% gUpdateVars , %Podcasttags%
Gui , Font , Bold
Gui , Add , Button , x %Marginspace% y + 10 h %ButtonHeights% w %CopyButtonWidths% gCopyVideoDescription , Description
Gui , Font , Normal
Gui , Add , Edit , x + 5 yp + 0 h50 vVideoDescription w %ResultEditBoxWidths% gUpdateVars , %VideoDescription%
Gui , Font , s %GuiFontSize%
Gui , Font , Bold
2023-09-17 13:27:36 -04:00
Gui , Add , Button , x %ResultEditBoxXPos% w %ResultEditBoxHalfWidths% gUpdateINI , Save Modified Links
2023-02-12 17:34:03 -05:00
Gui , Add , Button , x + %MarginSpace% w %ResultEditBoxHalfWidths% gUploadPodcast , Upload Podcast
Gui , Add , Button , x %ResultEditBoxXPos% y + %MarginSpace% w %ResultEditBoxThirdsWidths% gPostToDiscord vPostToDiscordButton , Post to Discord
Gui , Add , Button , x + 5 w %ResultEditBoxThirdsWidths% gPostToTelegram vPostToTelegramButton , Post to Telegram
Gui , Add , Button , x + 5 w %ResultEditBoxThirdsWidths% gStartSocialMediaPoster , Start Social Media Poster
2023-09-17 13:27:36 -04:00
Gui , Font , Bold
Gui , Add , Button , x %ResultEditBoxXPos% y + %MarginSpace% w %ResultEditBoxHalfWidths% gSendErrorLoggingThroughTelegram , Send Errorlog Through Telegram
Gui , Add , Button , x + %MarginSpace% w %ResultEditBoxHalfWidths% gRetryUpload , Try Failed Again
2023-02-12 17:34:03 -05:00
Gui , Add , Button , x %ResultEditBoxXPos% w %ResultEditBoxHalfWidths% gOpenLBRYBlobFilesFolder %ButtonWidths% , Open LBRY Blob Files Folder
Gui , Add , Button , x + %MarginSpace% w %ResultEditBoxHalfWidths% gCancelPost %ButtonWidths% , Close
; Gui, Add, Button, x+%MarginSpace% w%ResultEditBoxHalfWidths% gKillScript %ButtonWidths% , Close
; gui, Add, Text, y+10
Gui , Font , s %GuiFontSize%
2023-02-18 13:12:18 -05:00
Gui , Add , Button , x %ErrorLogEditBoxXPos% w %ErrorLogEditBoxWidth% y %MarginSpace% h %ButtonHeights% , Error Log
Gui , Add , Edit , x %ErrorLogEditBoxXPos% h %ErrorLogEditBoxHeight% w %ErrorLogEditBoxWidth% y + 10 , %ErrorLogVar%
2023-02-12 17:34:03 -05:00
gui , font , Normal
gui , font , s7
2023-09-17 14:26:44 -04:00
Gui , Add , StatusBar , , Total Videos Uploaded : %TotalVideosUploaded% | Total Clicks Saved : %MouseClicksSaved%
2023-02-12 17:34:03 -05:00
Gui , + Resize + MaximizeBox
OriginalVideoDescription := VideoDescription
OriginalPodcastTags := PodcastTags
2023-09-21 00:44:20 -04:00
if ( XPosition and YPosition )
Gui , Show , x %XPosition% y %YPosition% , %FullScriptName% - Upload Results
else ,
2023-02-12 17:34:03 -05:00
Gui , Show , , %FullScriptName% - Upload Results
SaveCurrentChromeVersionToIniFile ( )
Return
OpenLBRYBlobFilesFolder:
2023-09-16 23:32:37 -04:00
try ,
2023-02-12 17:34:03 -05:00
run , C : \Users \%A_UserName% \AppData \Local \lbry \lbrynet \blobfiles
2023-09-16 23:32:37 -04:00
catch e {
msgbox , Unable to open lbrynet blobfiles folder . `n Is LBRY installed ?
}
2023-02-12 17:34:03 -05:00
Return
StartSocialMediaPoster:
; IniRead, SocialMediaPosterFilepath, %SettingsIniFilepath%, General, FDRRadioUN, %A_Space%
IniRead , SocialMediaPosterFilepath , %SettingsIniFilepath% , SocialMediaPoster , SocialMediaPosterFilepath , %A_Space%
if ( SocialMediaPosterFilepath = " " or ! FileExist ( SocialMediaPosterFilepath ) ) {
OnMessage ( 0x44 , " OnMsgBoxSocialMediaPoster " )
2023-09-20 20:45:57 -04:00
MsgBox 0x21 , Filepath Not Found , Unable to find filepath for Social Media Poster `n Would you like to add it ?
2023-02-12 17:34:03 -05:00
OnMessage ( 0x44 , " " )
IfMsgBox OK , {
2023-09-16 23:32:37 -04:00
FileSelectFile , SocialMediaPosterFilepath , , , Please Select Social Media Poster Filepath
2023-02-12 17:34:03 -05:00
if ( ErrorLevel )
Return
2023-09-20 20:45:57 -04:00
if ( ! InStr ( SocialMediaPosterFilepath , " .exe " ) )
Return
2023-02-12 17:34:03 -05:00
} Else IfMsgBox Cancel , {
Return
}
2023-09-20 20:56:25 -04:00
IniWrite , %SocialMediaPosterFilepath% , %SettingsIniFilepath% , SocialMediaPoster , SocialMediaPosterFilepath
2023-02-12 17:34:03 -05:00
}
run , %SocialMediaPosterFilepath% " %VideoLinksIniFile% "
Return
2023-09-16 23:32:37 -04:00
/*
2023-09-17 14:26:44 -04:00
Sublime Indent Reset
2023-09-16 23:32:37 -04:00
* /
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
; -------------------------------CopyThis-------------------------------
CopyPodcastNumber:
Clipboard := PodcastNumber
SaveOrPostProgress ( Message := PodcastNumber " `n Copied to Clipboard " , PostType := " Tooltip,ErrorLoggingTextFile " )
sleep , 1000
ToolTip
Return
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
CopyVideoTitle:
Clipboard := VideoTitle
SaveOrPostProgress ( Message := VideoTitle " `n Copied to Clipboard " , PostType := " Tooltip,ErrorLoggingTextFile " )
sleep , 1000
ToolTip
Return
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
CopyBitChuteURL:
Clipboard := BitChuteURL
SaveOrPostProgress ( Message := BitChuteURL " `n Copied to Clipboard " , PostType := " Tooltip,ErrorLoggingTextFile " )
sleep , 1000
ToolTip
Return
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
CopyBrighteonURL:
Clipboard := BrighteonURL
SaveOrPostProgress ( Message := BrighteonURL " `n Copied to Clipboard " , PostType := " Tooltip,ErrorLoggingTextFile " )
sleep , 1000
ToolTip
Return
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
CopyDailyMotionURL:
Clipboard := DailyMotionURL
SaveOrPostProgress ( Message := DailyMotionURL " `n Copied to Clipboard " , PostType := " Tooltip,ErrorLoggingTextFile " )
sleep , 1000
ToolTip
Return
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
CopyOdyseeVideoURL:
Clipboard := OdyseeVideoURL
SaveOrPostProgress ( Message := OdyseeVideoURL " `n Copied to Clipboard " , PostType := " Tooltip,ErrorLoggingTextFile " )
sleep , 1000
ToolTip
Return
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
CopyOdyseeAudioURL:
Clipboard := OdyseeAudioURL
SaveOrPostProgress ( Message := OdyseeAudioURL " `n Copied to Clipboard " , PostType := " Tooltip,ErrorLoggingTextFile " )
sleep , 1000
ToolTip
Return
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
CopyRumbleURL:
Clipboard := RumbleURL
SaveOrPostProgress ( Message := RumbleURL " `n Copied to Clipboard " , PostType := " Tooltip,ErrorLoggingTextFile " )
sleep , 1000
ToolTip
Return
2023-02-12 17:34:03 -05:00
CopyVideoTags:
Clipboard := VideoTags
SaveOrPostProgress ( Message := VideoTags " `n Copied to Clipboard " , PostType := " Tooltip,ErrorLoggingTextFile " )
sleep , 1000
ToolTip
Return
CopyPodcastTags:
Clipboard := PodcastTags
SaveOrPostProgress ( Message := PodcastTags " `n Copied 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 podcast tags to this
UpdateINI:
IniWrite , %PodcastNumber% , %VideoLinksIniFile% , URLs , PodcastNumber
IniWrite , %VideoTitle% , %VideoLinksIniFile% , Misc , VideoTitle
2023-09-16 23:32:37 -04:00
IniWrite , %LocalsURL% , %VideoLinksIniFile% , URLs , LocalsURL
IniWrite , %RumbleURL% , %VideoLinksIniFile% , URLs , RumbleURL
IniWrite , %DailyMotionURL% , %VideoLinksIniFile% , URLs , DailyMotionURL
IniWrite , %BrighteonURL% , %VideoLinksIniFile% , URLs , BrighteonURL
IniWrite , %BitChuteURL% , %VideoLinksIniFile% , URLs , BitChuteURL
2023-02-12 17:34:03 -05:00
2023-09-16 23:32:37 -04:00
; LBRY/Odysee:
2023-02-12 17:34:03 -05:00
IniWrite , %LBRYVideoURL% , %VideoLinksIniFile% , URLs , LBRYVideoURL
IniWrite , %LBRYAudioURL% , %VideoLinksIniFile% , URLs , LBRYAudioURL
IniWrite , %OdyseeVideoURL% , %VideoLinksIniFile% , URLs , OdyseeVideoURL
OdyseeVideoThumb := StrReplace ( OdyseeVideoThumb , " Thumb: " , " " )
IniWrite , %OdyseeVideoThumb% , %VideoLinksIniFile% , Misc , OdyseeVideoThumb
IniWrite , %OdyseeAudioURL% , %VideoLinksIniFile% , URLs , OdyseeAudioURL
OdyseeAudioThumb := StrReplace ( OdyseeAudioThumb , " Thumb: " , " " )
IniWrite , %OdyseeAudioThumb% , %VideoLinksIniFile% , Misc , OdyseeAudioThumb
if ( VideoDescription != OriginalVideoDescription ) {
VideoBodyFilepath = %VideoFolderDir% \body . txt
FileDelete , %VideoBodyFilepath%
FileAppend , %VideoDescription% , %VideoBodyFilepath%
}
if ( PodcastTags != OriginalPodcastTags ) {
PodcastTagsFilepath = %VideoFolderDir% \keywords_podcast . txt
FileDelete , %PodcastTagsFilepath%
FileAppend , %PodcastTags% , %PodcastTagsFilepath%
}
msgbox , 4096 , Updated ! , VideoLinks . ini file updated with any edits that you 've made . `n `n %VideoLinksIniFile%
Return
RetryUpload:
run , " %A_ScriptFullPath% " " LastPost "
ExitApp
ReloadToResults:
run , " %A_ScriptFullPath% " " ShowResults "
ExitApp
SendErrorLoggingThroughTelegram:
Message = Uploading Errorlog to FDRBotTesting Telegram Server .
SaveOrPostProgress ( Message := Message , PostType := " Tooltip,ErrorLoggingTextFile,DiscordErrorLogging " )
; Credentials to FDRBotTesting Channel
IniRead , TelegramErrorLogBotToken , %SettingsIniFilepath% , General , TelegramErrorLogBotToken , %A_Space%
IniRead , TelegramErrorLogBotChatID , %SettingsIniFilepath% , General , TelegramErrorLogBotChatID , %A_Space%
if ( TelegramErrorLogBotToken = " " or TelegramErrorLogBotChatID = " " ) {
Message = TelegramErrorLogBotToken and / or TelegramErrorLogBotChatID are blank . Please add them to Settings . ini under : `n `n [ General ] `n TelegramErrorLogBotToken = `n TelegramErrorLogBotChatID =
}
Status := SendTelegramFile ( TelegramErrorLogBotToken , TelegramErrorLogBotChatID , ErrorLoggingFilePath , caption := " " )
if ( InStr ( Status , " error_code " ) ) {
Message = Telegram Post Failed due to an API Issue . Error was saved to ErrorLogging file . Please send it manually .
SaveOrPostProgress ( Message := Message , PostType := " Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging " )
; SaveOrPostProgress(Message:=Status,PostType:=",ErrorLoggingTextFile")
Message = Telegram Error : %Status%
SaveOrPostProgress ( Message := Message , PostType := " Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging " )
ToolTip
Return
}
2023-09-16 23:32:37 -04:00
2023-02-12 17:34:03 -05:00
Message = ErrorLog was successfully uploaded to the FDRBotTesting Telegram Server . `n Thank You !
SaveOrPostProgress ( Message := Message , PostType := " Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging " )
sleep , 5000
ToolTip
Return
2023-09-16 21:37:26 -04:00
; Post-To-Telegram
;------------------------------------------------
#Include %A_ScriptDir% \Modules \Post - To - Telegram . ahk
2023-09-16 23:32:37 -04:00
; Post-Video-To-Telegram
;------------------------------------------------
#Include %A_ScriptDir% \Modules \Post - Video - To - Telegram . ahk
2023-09-16 21:37:26 -04:00
; Post-To-Discord
;------------------------------------------------
#Include %A_ScriptDir% \Modules \Post - To - Discord . ahk
2023-08-20 00:08:15 -04:00
; BitChute
;------------------------------------------------
#Include %A_ScriptDir% \Modules \Bitchute - Upload . ahk
2023-02-17 00:29:41 -05:00
2023-08-20 00:08:15 -04:00
; Brighteon
;------------------------------------------------
#Include %A_ScriptDir% \Modules \Brighteon - Upload . ahk
2023-02-17 00:29:41 -05:00
2023-08-20 00:08:15 -04:00
; DailyMotion
;------------------------------------------------
#Include %A_ScriptDir% \Modules \DailyMotion - Upload . ahk
2023-02-17 00:29:41 -05:00
2023-08-20 00:08:15 -04:00
; LBRY
;------------------------------------------------
#Include %A_ScriptDir% \Modules \LBRY - Upload . ahk
2023-02-17 00:29:41 -05:00
2023-08-20 00:08:15 -04:00
; Rumble
;------------------------------------------------
#Include %A_ScriptDir% \Modules \Rumble - Upload . ahk
2023-02-17 00:29:41 -05:00
2023-08-20 00:08:15 -04:00
; Locals
;------------------------------------------------
#Include %A_ScriptDir% \Modules \Locals - Upload . ahk
2023-02-17 00:29:41 -05:00
2023-08-20 00:08:15 -04:00
; Podcast
;------------------------------------------------
#Include %A_ScriptDir% \Modules \Podcast - Upload . ahk
2023-02-17 00:29:41 -05:00
2023-08-20 00:08:15 -04:00
; Miscellaneous-Functions
2023-02-12 17:34:03 -05:00
;------------------------------------------------
2023-08-20 00:08:15 -04:00
#Include %A_ScriptDir% \Modules \Miscellaneous - Functions . ahk
2023-09-20 20:45:57 -04:00
2023-09-21 00:44:20 -04:00
OnMsgBoxConfirmChromiumOverwrite ( ) {
DetectHiddenWindows , On
Process , Exist
If ( WinExist ( " ahk_class #32770 ahk_pid " . ErrorLevel ) ) {
ControlSetText Button1 , Cancel
ControlSetText Button2 , Yes
2023-09-20 20:45:57 -04:00
}
2023-09-21 00:44:20 -04:00
}