fixed bug where locals would upload even when checkbox was unchecked

pull/2/head
Yuriy 1 year ago
parent 5052713c55
commit 45b27311d4

@ -411,7 +411,7 @@ OdyseeAudioThumbCheckStatus := 0
*/ */
(RumbleURL != "")?(RumbleCheckStatus := 0) : (RumbleCheckStatus := 1) (RumbleURL != "")?(RumbleCheckStatus := 0) : (RumbleCheckStatus := 1)
; if user tried to upload to locals already and still needs to grab the url, check ; if user tried to upload to locals already and still needs to grab the url, check
(LocalsURL = "LocalsUploadStartedNeedToGrabURL")?(LocalsCheckStatus := 1) : (LocalsCheckStatus := 0) (LocalsURL = "LocalsUploadStartedNeedToGrabURL")?(LocalsCheckStatus := 0) : (LocalsCheckStatus := 0)
(BrighteonURL != "")?(BrighteonCheckStatus := 0) : (BrighteonCheckStatus := 1) (BrighteonURL != "")?(BrighteonCheckStatus := 0) : (BrighteonCheckStatus := 1)
if(VideoFileSizeInMB > 6144){ if(VideoFileSizeInMB > 6144){
VideoFileSizeOver6GB := 1 VideoFileSizeOver6GB := 1
@ -556,6 +556,13 @@ else, {
} }
; @ TODO REMOVE
; LocalsGrabURL := 0
; Locals := 0
; -------------------------------GUI------------------------------- ; -------------------------------GUI-------------------------------
Gui, Font, s%GuiFontSize% Gui, Font, s%GuiFontSize%
@ -738,28 +745,28 @@ Gui, Add, GroupBox,r6 y+%MarginSpaceTripled% x%PageTwoXStartPos% w%PageTwoGroupB
; if(VideoFileSizeInMB < 1792) ; if(VideoFileSizeInMB < 1792)
; Gui, Add, Checkbox, x+%MarginSpaceDoubled% vFacebook Checked%FacebookCheckStatus%, Facebook ; Gui, Add, Checkbox, x+%MarginSpaceDoubled% vFacebook Checked%FacebookCheckStatus%, Facebook
Gui, Add, Checkbox, xp+10 yp+25 vBitChute Checked%BitChuteCheckStatus%, BitChute Gui, Add, Checkbox, xp+10 yp+25 vBitChute Checked%BitChuteCheckStatus% gUpdateVars, BitChute
if(LocalsURL = "LocalsUploadStartedNeedToGrabURL"){ if(LocalsURL = "LocalsUploadStartedNeedToGrabURL"){
Gui, Add, Checkbox, x+%MarginSpaceTripled% yp+0 vLocalsGrabURL Checked%LocalsCheckStatus%, Locals (Grab URL) Gui, Add, Checkbox, x+%MarginSpaceTripled% yp+0 vLocalsGrabURL Checked%LocalsCheckStatus% gUpdateVars, Locals (Grab URL)
} }
else, { else, {
Gui, Add, Checkbox, x+%MarginSpaceTripled% yp+0 vLocals Checked%LocalsCheckStatus%, Locals Gui, Add, Checkbox, x+%MarginSpaceTripled% yp+0 vLocals Checked%LocalsCheckStatus% gUpdateVars, Locals
} }
if(VideoFileSizeInMB < 50) if(VideoFileSizeInMB < 50)
Gui, Add, Checkbox, vTelegram x+%MarginSpaceDoubled% Checked%TelegramCheckStatus%, Telegram Gui, Add, Checkbox, vTelegram x+%MarginSpaceDoubled% Checked%TelegramCheckStatus% gUpdateVars, Telegram
Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vOdyseeVideo Checked%OdyseeVideoCheckStatus%, Odysee Video Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vOdyseeVideo Checked%OdyseeVideoCheckStatus% gUpdateVars, Odysee Video
; Gui, Add, Checkbox, x+%MarginSpace% vOdyseeVideoThumb Checked%OdyseeVideoThumbCheckStatus%,Thumbnail ; Gui, Add, Checkbox, x+%MarginSpace% vOdyseeVideoThumb Checked%OdyseeVideoThumbCheckStatus%,Thumbnail
Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vOdyseeAudio Checked%OdyseeAudioCheckStatus%, Odysee Audio 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+%MarginSpace% vOdyseeAudioThumb Checked%OdyseeAudioThumbCheckStatus%, Thumbnail
Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vRumble Checked%RumbleCheckStatus%, Rumble Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vRumble Checked%RumbleCheckStatus% gUpdateVars, Rumble
Gui, Add, Checkbox, vBrighteon y+%MarginSpace% Checked%BrighteonCheckStatus%, Brighteon Gui, Add, Checkbox, vBrighteon y+%MarginSpace% Checked%BrighteonCheckStatus% gUpdateVars, Brighteon
Gui, Add, Checkbox, vDailyMotion y+%MarginSpace% Checked%DailyMotionCheckStatus%, DailyMotion Gui, Add, Checkbox, vDailyMotion y+%MarginSpace% Checked%DailyMotionCheckStatus% gUpdateVars, DailyMotion
; Gui, Add, Checkbox, vStreamanity Checked%StreamanityCheckStatus%, Streamanity ; Gui, Add, Checkbox, vStreamanity Checked%StreamanityCheckStatus%, Streamanity
; Gui, Font, s12 ; Gui, Font, s12
@ -949,201 +956,204 @@ if(!status){
} }
DownloadLatestChromium() DownloadLatestChromium()
Return 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
; 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") SubmitDescriptionForVideosChannel:
goto, SubmitDescriptionForTelegramVideoUpload Gui, Submit
; msgbox, submitted
if(CurrentSocialMediaPosting = "Discord")
Goto, SubmitDescriptionForDiscordVideosChannel
if(CurrentSocialMediaPosting = "Telegram")
Goto, SubmitDescriptionForTelegramVideosChannel
Return if(CurrentSocialMediaPosting = "Telegram Video")
goto, SubmitDescriptionForTelegramVideoUpload
Return
CreateDescriptionForSocialMedia(){
SplitText = Free Documentaries:
SocialMediaDescription := StrSplit(VideoDescription, SplitText) CreateDescriptionForSocialMedia(){
SocialMediaDescription := SocialMediaDescription[1] SplitText = Free Documentaries:
if(strlen(SocialMediaDescription) > 1400){ SocialMediaDescription := StrSplit(VideoDescription, SplitText)
SocialMediaDescription := SubStr(SocialMediaDescription, 1, 1400) SocialMediaDescription := SocialMediaDescription[1]
SocialMediaDescription .= "..."
}
Return if(strlen(SocialMediaDescription) > 1400){
} SocialMediaDescription := SubStr(SocialMediaDescription, 1, 1400)
; -------------------------------Upload Video Functionality------------------------------- SocialMediaDescription .= "..."
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 Return
;------------------------------------------------ }
; if changes made, delete the original file and save the new content to it ; -------------------------------Upload Video Functionality-------------------------------
StartScript:
WinGetPos, XPosition, YPosition, , , A
IniWrite, %XPosition%, %SettingsIniFilepath%, General, XPosition
IniWrite, %YPosition%, %SettingsIniFilepath%, General, YPosition
if(VideoTitle != OriginalVideoTitle){ Gui, Submit
VideoTitleFilepath = %VideoFolderDir%\title.txt Gui, Destroy
FileDelete, %VideoTitleFilepath%
FileAppend, %VideoTitle%, %VideoTitleFilepath%
}
if(VideoTags != OriginalVideoTags){
VideoTagsFilepath = %VideoFolderDir%\keywords.txt
FileDelete, %VideoTagsFilepath% ; Save Testing Mode Info
FileAppend, %VideoTags%, %VideoTagsFilepath% ;------------------------------------------------
} 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(PodcastTags != OriginalPodcastTags){ if(VideoTitle != OriginalVideoTitle){
PodcastTagsFilepath = %VideoFolderDir%\keywords_podcast.txt VideoTitleFilepath = %VideoFolderDir%\title.txt
FileDelete, %PodcastTagsFilepath% FileDelete, %VideoTitleFilepath%
FileAppend, %PodcastTags%, %PodcastTagsFilepath% FileAppend, %VideoTitle%, %VideoTitleFilepath%
} }
if(VideoDescription != OriginalVideoDescription){
VideoBodyFilepath = %VideoFolderDir%\body.txt
FileDelete, %VideoBodyFilepath% if(VideoTags != OriginalVideoTags){
FileAppend, %VideoDescription%, %VideoBodyFilepath% VideoTagsFilepath = %VideoFolderDir%\keywords.txt
}
FileDelete, %VideoTagsFilepath%
FileAppend, %VideoTags%, %VideoTagsFilepath%
}
; -------------------------------/Save Video Info------------------------------- if(PodcastTags != OriginalPodcastTags){
PodcastTagsFilepath = %VideoFolderDir%\keywords_podcast.txt
; Save settings to config file FileDelete, %PodcastTagsFilepath%
IniWrite, %ReuseTabs%, %SettingsIniFilepath%, General, ReuseTabs FileAppend, %PodcastTags%, %PodcastTagsFilepath%
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(VideoDescription != OriginalVideoDescription){
VideoBodyFilepath = %VideoFolderDir%\body.txt
if(VideoFilepath = ""){ FileDelete, %VideoBodyFilepath%
Msgbox,4096,Error,No Video Filepath Found.`nPlease Input Video Filepath to Upload a Video. FileAppend, %VideoDescription%, %VideoBodyFilepath%
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
; -------------------------------/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
; -------------------------------Log Info To Text-------------------------------
(Facebook = 1)?(PostedWebsites .= "Facebook|") : () if(VideoFilepath = ""){
(Bitchute = 1)?(PostedWebsites .= "Bitchute|") : () Msgbox,4096,Error,No Video Filepath Found.`nPlease Input Video Filepath to Upload a Video.
(Locals = 1)?(PostedWebsites .= "Locals|") : () run, "%A_ScriptFullPath%" "LastPost"
(Rumble = 1)?(PostedWebsites .= "Rumble|") : () ExitApp
(Brighteon = 1)?(PostedWebsites .= "Brighteon|") : () }
; (Streamanity = 1)?(PostedWebsites .= "Streamanity|") : ()
(Telegram = 1)?(PostedWebsites .= "Telegram|") : ()
(DailyMotion = 1)?(PostedWebsites .= "DailyMotion|") : ()
(OdyseeVideo = 1)?(PostedWebsites .= "OdyseeVideo|") : ()
(OdyseeAudio = 1)?(PostedWebsites .= "OdyseeAudio|") : ()
; 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)
; Log Basic info to the errorlogging file ; Save the LBRY URL Slug to .ini file in case it's needed later
Message = %ScriptName% v%ScriptVersion%: Starting Upload `nFor: **%VideoTitle%**`nTo: %PostedWebsites% IniWrite, %LBRYURLSlug%, %VideoLinksIniFile%, Misc, LBRYUrlSlug
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") IniWrite, %VideoThumbFilepath%, %VideoLinksIniFile%, Misc, VideoThumbFilepath
IniWrite, %PodcastNumber%, %VideoLinksIniFile%, Misc, PodcastNumber
Message := "VideoTitle: " VideoTitle
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
Message := "VideoDescription: `n" VideoDescription
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
Message := "VideoTags: " VideoTags ; -------------------------------Log Info To Text-------------------------------
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
Message := "VideoFilepath: " VideoFilepath (Facebook = 1)?(PostedWebsites .= "Facebook|") : ()
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile") (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|") : ()
Message := "VideoThumbFilepath: " VideoThumbFilepath
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
Message := "TotalVideosUploaded: " TotalVideosUploaded ; Log Basic info to the errorlogging file
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile") 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 Description into javascript text format for sending to selenium ; Convert Video Description into javascript text format for sending to selenium
JSVideoDescription := FormatTextToJSText(VideoDescription) JSVideoDescription := FormatTextToJSText(VideoDescription)
JSVideoTitle := FormatTextToJSText(VideoTitle) JSVideoTitle := FormatTextToJSText(VideoTitle)
; -------------------------------/Log Info To Text------------------------------- ; -------------------------------/Log Info To Text-------------------------------
; Create an array out of the keywords to be used in different places ; Create an array out of the keywords to be used in different places
VideoTags := StrReplace(VideoTags, ", ",",") VideoTags := StrReplace(VideoTags, ", ",",")
VideoTags := StrReplace(VideoTags, " ,",",") VideoTags := StrReplace(VideoTags, " ,",",")
VideoTags := StrReplace(VideoTags, " ",",") VideoTags := StrReplace(VideoTags, " ",",")
KeywordsArray := StrSplit(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 ; Call each sub one by one, if errors occur then an upload will be stopped and the next upload will then proceed
/* /*
@ -1157,6 +1167,7 @@ if(Facebook)
if(Telegram) if(Telegram)
gosub, TelegramVideoUpload gosub, TelegramVideoUpload
if(Locals) if(Locals)
gosub, LocalsUpload gosub, LocalsUpload
@ -1198,7 +1209,7 @@ if(OdyseeAudio){
Gosub, LBRYGetURL Gosub, LBRYGetURL
} }
if(LocalsGrabURL OR LocalsURL = "LocalsUploadStartedNeedToGrabURL"){ if(LocalsGrabURL){
Gosub, LocalsGrabURL Gosub, LocalsGrabURL
} }
@ -1359,6 +1370,10 @@ Gui, +Resize +MaximizeBox
OriginalVideoDescription := VideoDescription OriginalVideoDescription := VideoDescription
OriginalPodcastTags := PodcastTags OriginalPodcastTags := PodcastTags
if(XPosition and YPosition)
Gui, Show,x%XPosition% y%YPosition%,%FullScriptName% - Upload Results
else,
Gui, Show,,%FullScriptName% - Upload Results Gui, Show,,%FullScriptName% - Upload Results
SaveCurrentChromeVersionToIniFile() SaveCurrentChromeVersionToIniFile()
@ -1629,11 +1644,11 @@ Return
OnMsgBoxConfirmChromiumOverwrite() { OnMsgBoxConfirmChromiumOverwrite() {
DetectHiddenWindows, On DetectHiddenWindows, On
Process, Exist Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) { If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
ControlSetText Button1, Cancel ControlSetText Button1, Cancel
ControlSetText Button2, Yes ControlSetText Button2, Yes
}
} }
}

Loading…
Cancel
Save