#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 Menu, Tray, Add, Show Results, DisplayResults Menu, Tray, Add, Open New Project, ReloadScript Menu, Tray, Add, Restart with Last Project, RetryUpload Menu, Tray, Default, Restart with Last Project global ScriptNameav global ScriptVersion global FullScriptName ScriptName = Freedomain Video Uploader ScriptVersion = 3.23 FullScriptName := ScriptName . " - " . ScriptVersion UStartTime := A_TickCount ; start time ; 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 #include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Zip.ahk #include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\URLDownloadToVar.ahk ;---ToDo--- ;------------------------------------------------ ; @todo: Update Locals Share link grabbing ; @todo: fix uploader saying there's been failures b/c there was no lbry audio upload ; @todo: finish telegram multi-message split functionality. ; @todo: add different icon when update is available ; @todo: fix telegram post getting cut off if too long instead of splitting into 2 ; @todo: let user make last minute changes to text before submitting to telegram and discord ; @todo: replace all .Attribute("innerText") with js ; @todo: Fix locals not grabbing url if a post is pinned ; @todo: Add an input box for sources in the new frontend ; @todo: Add login check for each website and ability to auto login ; @todo: ; add to statistics in statusbar - length of philosophy uploaded... total hours uploaded? ; @todo: Bitchute has a 5k char limit for description as well. split description to remove reocurring bits and Add freedomainpodcasts.com/podcast/# link if still not big enough ; @todo: Split long discord/telegram messages into multiple messages ; @todo: Redo Discord posting with "PostErrors" function from social media poster ; @todo: Save updates made to GUi text to .ini file on changes ; @todo: add a SaveDriverURL() next to each RETURN in the code so reusable tabs can be grouped together ;---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 ; global TotalTabLoops global ErrorLogVar ErrorLogVar := 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 Time_Between_Loops_Upload_Status = 15000 ; ; 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" ;---Script Settings--- ;------------------------------------------------ ; Checkbox Settings IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1 (ShowTooltipProgress)?(ShowTooltipProgressCheckStatus := 1) : (ShowTooltipProgressCheckStatus := 0) IniRead, XPosition, %SettingsIniFilepath%, General, XPosition, 0 IniRead, YPosition, %SettingsIniFilepath%, General, YPosition, 0 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 IniRead, MouseClicksSaved, %SettingsIniFilepath%, General, MouseClicksSaved, 0 ; Checkbox Settings IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1 (ShowTooltipProgress)?(ShowTooltipProgressCheckStatus := 1) : (ShowTooltipProgressCheckStatus := 0) ReuseTabs := 1 ; ReuseTabs is permanantly on. There is never a time where you want to create new tabs for every website IniRead, AutoUpdateCheck, %SettingsIniFilepath%, General, AutoUpdateCheck, 1 (AutoUpdateCheck)?(AutoUpdateCheckCheckStatus := 1) : (AutoUpdateCheckCheckStatus := 0) ; AutoLogin setting IniRead, AutoLogin, %SettingsIniFilepath%, General, AutoLogin, 1 (AutoUpdateCheck)?(AutoUpdateCheckCheckStatus := 1) : (AutoUpdateCheckCheckStatus := 0) IniRead, PingOnCompletion, %SettingsIniFilepath%, General, PingOnCompletion, 1 (PingOnCompletion)?(PingOnCompletionCheckStatus := 1) : (PingOnCompletionCheckStatus := 0) 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.`nPlease add user ID in settings.ini under: `n`n[General]`nDiscordUsernameID=`nOr Uncheck "Discord Ping on Completion" ; SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar") } } IniRead, KillLBRYAfterUpload, %SettingsIniFilepath%, General, KillLBRYAfterUpload, 1 (KillLBRYAfterUpload)?(=KillLBRYAfterUploadCheckStatus := 1) : (KillLBRYAfterUploadCheckStatus := 0) IniRead, DiscordErrorLoggingWebhookBotURL, %SettingsIniFilepath%, General, DiscordWebhookBotURL, %A_space% if(DiscordErrorLoggingWebhookBotURL = ""){ Message = DiscordErrorLoggingWebhookBotURL is blank. `nWill not be able to post error messages or upload status to discord.`nPlease add discord webhook URL in settings.ini under: `n`n[General]`DiscordErrorLoggingWebhookBotURL= SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") } ;---Auto Updater Settings--- ;------------------------------------------------ global GitReleasesAPIURL GitReleasesAPIURL = https://git.freedomainplaylists.com/api/v1/repos/yuriy/Freedomain-Video-Uploader/releases global GitReleasesLBRYKillerAPIURL GitReleasesLBRYKillerAPIURL = https://git.freedomainplaylists.com/api/v1/repos/yuriy/LBRY-Process-Killer/releases ;---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--- ;------------------------------------------------ ; 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 SaveOrPostProgress(Message:="Moving Old Version to Backups",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar") sleep, 2000 FileMove, %PassedParameter%, %BackupsFolder%\*, 1 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. } ToolTip } ; Change paramter to LastPost so last post gets automatically opened instead of user having to re-select the file again PassedParameter = LastPost } if(PassedParameter = "LastPost"){ IniRead, PassedParameter, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost, %A_Space% } if(PassedParameter = "ShowResults"){ IniRead, PassedParameter, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost, %A_Space% } PassedParameterLength := StrLen(PassedParameter) if(PassedParameterLength < 5 and !InStr(PassedParameter, ".exe")){ FileSelectFile, BodyTextFilePath,,%RootDirToStartIn%,Please Select ANY File Within the Project Folder if(ErrorLevel) Return } else, { SkipUpdateCheckThisRun := 1 BodyTextFilePath := PassedParameter } ; @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 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. Loop, files, %VideoFolderDir%\*.flac, 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 } } ; 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 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% } } ; Create a directory for errorlogging if this is the first time working on this project 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) (BitChuteURL != "")?(BitChuteCheckStatus := 0) : (BitChuteCheckStatus := 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 */ (RumbleURL != "")?(RumbleCheckStatus := 0) : (RumbleCheckStatus := 1) ; if user tried to upload to locals already and still needs to grab the url, check (LocalsURL = "LocalsUploadStartedNeedToGrabURL")?(LocalsCheckStatus := 1) : (LocalsCheckStatus := 0) (BrighteonURL != "")?(BrighteonCheckStatus := 0) : (BrighteonCheckStatus := 1) if(VideoFileSizeInMB > 6144){ VideoFileSizeOver6GB := 1 BrighteonCheckStatus := 0 } (DailyMotionURL != "")?(DailyMotionCheckStatus := 0) : (DailyMotionCheckStatus := 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% (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% (DailyMotion)?(DailyMotionCheckStatus := 1) : (DailyMotionCheckStatus := 0) IniRead, Locals, %SettingsIniFilepath%, Testing, Locals, %A_Space% (Locals)?(LocalsCheckStatus := 1) : (LocalsCheckStatus := 0) IniRead, Telegram, %SettingsIniFilepath%, Testing, Telegram, %A_Space% (Telegram)?(TelegramCheckStatus := 1) : (TelegramCheckStatus := 0) IniRead, Facebook, %SettingsIniFilepath%, Testing, Facebook, %A_Space% (Facebook)?(FacebookCheckStatus := 1) : (FacebookCheckStatus := 0) } if(PassedParameter = "ShowResults"){ goto, DisplayResults } ;---GUI Variables--- ;------------------------------------------------ GuiHeight = 800 GuiWidth = 1366 GuiFontSize = 10 ButtonHeights := 30 MarginSpace := 10 MarginSpaceDoubled := MarginSpace * 2 MarginSpaceTripled := MarginSpace * 3 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 ErrorLogEditBoxHeight := GuiHeight - (MarginSpace * 20) - (ButtonHeights * 2) 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 } ; @ TODO REMOVE ; LocalsGrabURL := 0 ; Locals := 0 ; -------------------------------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 if(NoOriginalVideoDescription) Gui, Add, Text,cRed y+%Marginspace% x%Marginspace%,Video Description else, Gui, Add, Text,y+%Marginspace% x%Marginspace%,Video Description: if(TestingMode) Gui, Add, Text,cRed yp+0 xp+150 ,TESTING MODE if(DevMode) Gui, Add, Text,cRed yp+0 xp+150 ,DEV MODE 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 Gui, Add,Text, yp+3 xp-310, (Platform Char. Limits: DM+Bitchute = 3K, Odysee,Brighteon = 5K) 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 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 } 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 ; if(DevMode) ; Gui, Add, Button, x%MarginSpace% w%EditBoxHalfWidths% y+25 h%MainButtonHeight% gCancelPost hwndIcon, Close ; else, ; Script Update Button if(UpdateAvailable){ Gui, Add, Button, w%EditBoxHalfWidths% x%MarginSpace% gUpdateScript vUpdateAvailable h%SecondaryButtonHeights% center,Uploader Update Available! ; GuiButtonIcon(Icon, "shell32.dll", 278, "s20 a1 r2") } else, { Gui, Add, Button, w%EditBoxHalfWidths% x%MarginSpace% gUpdateScript vUpdateAvailable h%SecondaryButtonHeights% center,Uploader Up-to-Date ; Gui, Add, Button, w%EditBoxHalfWidths% x+%Marginspace% vUpdateAvailable hwndIcon, Script is Up-to-Date ; GuiButtonIcon(Icon, "shell32.dll", 239, "s20 a1 r2") } ; Gui, Font, s20 ; Gui, Font, Bold Gui, Add, Button, x+%MarginSpace% w%EditBoxHalfWidths% h%SecondaryButtonHeights% gStartScript, UPLOAD Gui, Font, s%GuiFontSize% ; Chrome Update Button if(ChromeUpdateAvailable){ Gui, Add, Button, x%MarginSpace% w%EditBoxHalfWidths% y+%Marginspace% h%SecondaryButtonHeights% vChromeUpdateAvailable gUpdateChrome center,Chrome Update Available! } else, { Gui, Add, Button, x%MarginSpace% w%EditBoxHalfWidths% y+%Marginspace% h%SecondaryButtonHeights% vChromeUpdateAvailable gUpdateChrome center,Chrome Up-to-Date } ; 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 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 ; Settings Section Gui, Add, GroupBox,r5 y+0 x%PageTwoXStartPos% w%PageTwoGroupBoxWidth%,Settings Gui, Add, Checkbox, xp+10 yp+20 vAutoUpdateCheck gUpdateVars Checked%AutoUpdateCheckCheckStatus%, Auto Update Check Gui, Add, Checkbox, vShowTooltipProgress Checked%ShowTooltipProgressCheckStatus% gUpdateVars,Show Tooltip Progress Gui, Add, Checkbox, vKillLBRYAfterUpload Checked%KillLBRYAfterUploadCheckStatus%, Kill LBRY After Uploading Gui, Add, Checkbox, vAutoLogin gUpdateVars Checked%AutoLoginCheckStatus%, Try to Login Automatically Gui, Add, Checkbox, vPingOnCompletion gUpdateVars Checked%PingOnCompletionCheckStatus%, Discord Ping Upon Completion GroupBoxCheckboxPos := PageTwoXStartPos + MarginSpace ; -------------------------------PLATFORMS------------------------------- Gui, Add, GroupBox,r6 y+%MarginSpaceTripled% x%PageTwoXStartPos% w%PageTwoGroupBoxWidth%, Platforms ; Msgbox % "LocalsURL: " LocalsURL ; if(VideoFileSizeInMB < 1792) ; Gui, Add, Checkbox, x+%MarginSpaceDoubled% vFacebook Checked%FacebookCheckStatus%, Facebook Gui, Add, Checkbox, xp+10 yp+25 vBitChute Checked%BitChuteCheckStatus% gUpdateVars, BitChute if(LocalsURL = "LocalsUploadStartedNeedToGrabURL"){ ; msgbox, checking grab url Gui, Add, Checkbox, x+%MarginSpaceTripled% yp+0 vLocalsGrabURL Checked%LocalsCheckStatus% gUpdateVars, Locals (Grab URL) LocalsGrabURL := 1 Locals := 0 } else, { ; msgbox, checking locals Gui, Add, Checkbox, x+%MarginSpaceTripled% yp+0 vLocals Checked%LocalsCheckStatus% gUpdateVars, Locals LocalsGrabURL := 0 Locals := 1 } Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vOdyseeVideo Checked%OdyseeVideoCheckStatus% gUpdateVars, Odysee Video if(VideoFileSizeInMB < 50) Gui, Add, Checkbox, vTelegram x+%MarginSpaceTripled% yp+0 Checked%TelegramCheckStatus% gUpdateVars, Telegram (>50 MB) ; Gui, Add, Checkbox, x+%MarginSpace% vOdyseeVideoThumb Checked%OdyseeVideoThumbCheckStatus%,Thumbnail Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vOdyseeAudio Checked%OdyseeAudioCheckStatus% gUpdateVars, Odysee Audio ; Gui, Add, Checkbox, x+%MarginSpace% vOdyseeAudioThumb Checked%OdyseeAudioThumbCheckStatus%, Thumbnail Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vRumble Checked%RumbleCheckStatus% gUpdateVars, Rumble Gui, Add, Checkbox, vBrighteon y+%MarginSpace% Checked%BrighteonCheckStatus% gUpdateVars, Brighteon Gui, Add, Checkbox, vDailyMotion y+%MarginSpace% Checked%DailyMotionCheckStatus% gUpdateVars, DailyMotion ; Gui, Add, Checkbox, vStreamanity Checked%StreamanityCheckStatus%, Streamanity ; Gui, Font, s12 gui, Font, Bold Gui, Add, GroupBox, r6.5 y+%MarginSpaceTripled% vImageThumbnail x%PageTwoXStartPos% w%PageTwoGroupBoxWidth%,Thumbnail gui, Font, Normal Gui, Add, Picture, xp+10 yp+20 w%ThumbnailPreviewWidth% h-1, %VideoThumbFilepath% gui, Font, Normal gui, font, s7 Gui, Add, StatusBar,Center, Total Videos Uploaded: %TotalVideosUploaded% | Total Clicks Saved: %MouseClicksSaved% ; Show GUI to the user Gui, +Resize +MaximizeBox if(XPosition and YPosition) Gui, Show, x%XPosition% y%YPosition%, %FullScriptName% - Upload Settings - %BodyTextFilePath% else, Gui, Show,, %FullScriptName% - Upload Settings - %BodyTextFilePath% ControlFocus, Edit4, %FullScriptName% ToolTip ; Write current project to ini file for easy reloading IniWrite, %BodyTextFilePath%, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost URunTime1 := round(((A_TickCount - UStartTime) / 1000), 2) ;---Check for Updates--- ;------------------------------------------------ ; 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)) 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 ; -------------------------------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: run, https://git.freedomainplaylists.com/yuriy/Freedomain-Video-Uploader 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. `nPlease 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 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, { } } Status := DownloadLatestChromium() if(Status) GuiControl,,ChromeUpdateAvailable, Chrome Up-to-Dat Return /* */ ; 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 `nwhich the curent description exceeds.`nPlease 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 SubmitDescriptionForVideosChannel: Gui, Submit ; msgbox, submitted if(CurrentSocialMediaPosting = "Discord") Goto, SubmitDescriptionForDiscordVideosChannel if(CurrentSocialMediaPosting = "Telegram") Goto, SubmitDescriptionForTelegramVideosChannel if(CurrentSocialMediaPosting = "Telegram Video") goto, SubmitDescriptionForTelegramVideoUpload 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------------------------------- StartScript: WinGetPos, XPosition, YPosition, , , A IniWrite, %XPosition%, %SettingsIniFilepath%, General, XPosition IniWrite, %YPosition%, %SettingsIniFilepath%, General, YPosition Gui, Submit Gui, Destroy ; 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 } ; Save Video Info ;------------------------------------------------ ; if changes made, delete the original file and save the new content to it if(VideoTitle != OriginalVideoTitle){ VideoTitleFilepath = %VideoFolderDir%\title.txt FileDelete, %VideoTitleFilepath% FileAppend, %VideoTitle%, %VideoTitleFilepath% } if(VideoTags != OriginalVideoTags){ VideoTagsFilepath = %VideoFolderDir%\keywords.txt FileDelete, %VideoTagsFilepath% FileAppend, %VideoTags%, %VideoTagsFilepath% } if(PodcastTags != OriginalPodcastTags){ PodcastTagsFilepath = %VideoFolderDir%\keywords_podcast.txt FileDelete, %PodcastTagsFilepath% FileAppend, %PodcastTags%, %PodcastTagsFilepath% } if(VideoDescription != OriginalVideoDescription){ VideoBodyFilepath = %VideoFolderDir%\body.txt FileDelete, %VideoBodyFilepath% FileAppend, %VideoDescription%, %VideoBodyFilepath% } ; -------------------------------/Save Video Info------------------------------- ; 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 if(VideoFilepath = ""){ 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 if(LBRYURLSlug = "") ; if slug spot is blank, then set it to video title LBRYURLSlug := VideoTitle LBRYURLSlug := LBRYCMDTextReplacement(LBRYURLSlug) ; 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 ; -------------------------------Log Info To Text------------------------------- (Facebook = 1)?(PostedWebsites .= "Facebook|") : () (Bitchute = 1)?(PostedWebsites .= "Bitchute|") : () (Locals = 1)?(PostedWebsites .= "Locals|") : () (Rumble = 1)?(PostedWebsites .= "Rumble|") : () (Brighteon = 1)?(PostedWebsites .= "Brighteon|") : () ; (Streamanity = 1)?(PostedWebsites .= "Streamanity|") : () (Telegram = 1)?(PostedWebsites .= "Telegram|") : () (DailyMotion = 1)?(PostedWebsites .= "DailyMotion|") : () (OdyseeVideo = 1)?(PostedWebsites .= "OdyseeVideo|") : () (OdyseeAudio = 1)?(PostedWebsites .= "OdyseeAudio|") : () ; Log Basic info to the errorlogging file Message = %ScriptName% v%ScriptVersion%: Starting Upload `nFor: **%VideoTitle%**`nTo: %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") ; Convert Video Title and Description into javascript formatting for sending to pages through js instead of plain selenium JSVideoTitle := FormatTextToJSText(VideoTitle) JSVideoDescription := FormatTextToJSText(VideoDescription) ; -------------------------------/Log Info To Text------------------------------- ; Create an array out of the keywords to be used in different places VideoTags := StrReplace(VideoTags, ", ",",") VideoTags := StrReplace(VideoTags, " ,",",") VideoTags := StrReplace(VideoTags, " ",",") KeywordsArray := StrSplit(VideoTags,",") ; Call each sub one by one, if errors occur then an upload will be stopped and the next upload will then proceed if(Telegram) gosub, TelegramVideoUpload if(Locals) gosub, LocalsUpload if(BitChute) Gosub, BitChuteUpload if(OdyseeVideo){ LBRYUploadType := "Video" Gosub, LBRYVideoUpload } if(OdyseeAudio){ LBRYUploadType := "Audio" Gosub, LBRYAudioUpload } if(Rumble) Gosub, RumbleUpload if(Brighteon) Gosub, BrighteonUpload if(DailyMotion) Gosub, DailyMotionUpload ; grab the LBRY Video/Audio URLs if(OdyseeVideo){ LBRYUploadType := "Video" Gosub, LBRYGetURL } if(OdyseeAudio){ LBRYUploadType := "Audio" Gosub, LBRYGetURL } if(LocalsGrabURL){ Gosub, LocalsGrabURL } if(URLOfLastErrorPage != ""){ Message = Activating Tab of last failed post. SaveOrPostProgress(Message:=Message,PostType:="Tooltip") ; @todo: replaceme with working funciton to activate tab ; FindAndActivateTab(URLOfLastErrorPage) } CurrentSite := "" if(URLOfLastErrorPage) Message = Video Uploading Finished WITH Some Failures else, Message = All Videos Uploaded Successfully if(PingOnCompletion) Message = <@%DiscordUsernameID%>: %Message% else, Message = %Message% SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") DisplayResults: /* ; i forget why i have it get the window position here WinGetPos, XPosition, YPosition, , , A Msgbox % "XPosition: " XPosition "`n" "YPosition: " YPosition 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 } */ Tooltip ; Remove all tooltips Gui, Destroy ; destroy GUI in case we're going from the main screen to results without uploading. IniRead, MouseClicksSaved, %SettingsIniFilepath%, General, MouseClicksSaved, %A_Space% 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 Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vBitChuteURL w%ResultEditBoxWidths% gUpdateVars , %BitChuteURL% 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 Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vOdyseeVideoURL w%ResultEditBoxWidths% gUpdateVars, %OdyseeVideoURL% Gui, Font, Bold Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyOdyseeAudioURL, Odysee Audio Gui, Font, Normal Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vOdyseeAudioURL w%ResultEditBoxWidths% gUpdateVars , %OdyseeAudioURL% 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 Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyVideoTags vVideoTagsEdit, Video Tags 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 Gui, Add, Button, x%ResultEditBoxXPos% w%ResultEditBoxHalfWidths% gUpdateINI, Save Modified Links 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 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 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% 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% gui, font, Normal gui, font, s7 Gui, Add, StatusBar,, Total Videos Uploaded: %TotalVideosUploaded% | Total Clicks Saved: %MouseClicksSaved% Gui, +Resize +MaximizeBox OriginalVideoDescription := VideoDescription OriginalPodcastTags := PodcastTags if(XPosition and YPosition) Gui, Show,x%XPosition% y%YPosition%,%FullScriptName% - Upload Results else, Gui, Show,,%FullScriptName% - Upload Results SaveCurrentChromeVersionToIniFile() Return OpenLBRYBlobFilesFolder: try, run, C:\Users\%A_UserName%\AppData\Local\lbry\lbrynet\blobfiles catch e { msgbox, Unable to open lbrynet blobfiles folder. `nIs LBRY installed? } Return StartSocialMediaPoster: ; IniRead, SocialMediaPosterFilepath, %SettingsIniFilepath%, General, FDRRadioUN, %A_Space% IniRead, SocialMediaPosterFilepath, %SettingsIniFilepath%, SocialMediaPoster, SocialMediaPosterFilepath, %A_Space% if(SocialMediaPosterFilepath = "" or !FileExist(SocialMediaPosterFilepath)){ OnMessage(0x44, "OnMsgBoxSocialMediaPoster") MsgBox 0x21, Filepath Not Found, Unable to find filepath for Social Media Poster`nWould you like to add it? OnMessage(0x44, "") IfMsgBox OK, { FileSelectFile, SocialMediaPosterFilepath,,, Please Select Social Media Poster Filepath if(ErrorLevel) Return if(!InStr(SocialMediaPosterFilepath, ".exe")) Return } Else IfMsgBox Cancel, { Return } IniWrite, %SocialMediaPosterFilepath%, %SettingsIniFilepath%, SocialMediaPoster, SocialMediaPosterFilepath } run, %SocialMediaPosterFilepath% "%VideoLinksIniFile%" Return /* Sublime Indent Reset */ ; -------------------------------CopyThis------------------------------- CopyPodcastNumber: Clipboard := PodcastNumber SaveOrPostProgress(Message:=PodcastNumber "`nCopied to Clipboard",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 ToolTip 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 podcast tags to this UpdateINI: IniWrite, %PodcastNumber%, %VideoLinksIniFile%, URLs, PodcastNumber IniWrite, %VideoTitle%, %VideoLinksIniFile%, Misc, VideoTitle 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 ; LBRY/Odysee: 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]`nTelegramErrorLogBotToken=`nTelegramErrorLogBotChatID= } 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 } Message = ErrorLog was successfully uploaded to the FDRBotTesting Telegram Server.`nThank You! SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") sleep, 5000 ToolTip Return ; Post-To-Telegram ;------------------------------------------------ #Include %A_ScriptDir%\Modules\Post-To-Telegram.ahk ; Post-Video-To-Telegram ;------------------------------------------------ #Include %A_ScriptDir%\Modules\Post-Video-To-Telegram.ahk ; Post-To-Discord ;------------------------------------------------ #Include %A_ScriptDir%\Modules\Post-To-Discord.ahk ; BitChute ;------------------------------------------------ #Include %A_ScriptDir%\Modules\Bitchute-Upload.ahk ; Brighteon ;------------------------------------------------ #Include %A_ScriptDir%\Modules\Brighteon-Upload.ahk ; DailyMotion ;------------------------------------------------ #Include %A_ScriptDir%\Modules\DailyMotion-Upload.ahk ; LBRY ;------------------------------------------------ #Include %A_ScriptDir%\Modules\LBRY-Upload.ahk ; Rumble ;------------------------------------------------ #Include %A_ScriptDir%\Modules\Rumble-Upload.ahk ; Locals ;------------------------------------------------ #Include %A_ScriptDir%\Modules\Locals-Upload.ahk ; Podcast ;------------------------------------------------ #Include %A_ScriptDir%\Modules\Podcast-Upload.ahk ; Miscellaneous-Functions ;------------------------------------------------ #Include %A_ScriptDir%\Modules\Miscellaneous-Functions.ahk OnMsgBoxConfirmChromiumOverwrite() { DetectHiddenWindows, On Process, Exist If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) { ControlSetText Button1, Cancel ControlSetText Button2, Yes } }