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,41 +956,44 @@ 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(){ CreateDescriptionForSocialMedia(){
SplitText = Free Documentaries: SplitText = Free Documentaries:
SocialMediaDescription := StrSplit(VideoDescription, SplitText) SocialMediaDescription := StrSplit(VideoDescription, SplitText)
@ -995,22 +1005,22 @@ DownloadLatestChromium()
} }
Return Return
} }
; -------------------------------Upload Video Functionality------------------------------- ; -------------------------------Upload Video Functionality-------------------------------
StartScript: StartScript:
WinGetPos, XPosition, YPosition, , , A WinGetPos, XPosition, YPosition, , , A
IniWrite, %XPosition%, %SettingsIniFilepath%, General, XPosition IniWrite, %XPosition%, %SettingsIniFilepath%, General, XPosition
IniWrite, %YPosition%, %SettingsIniFilepath%, General, YPosition IniWrite, %YPosition%, %SettingsIniFilepath%, General, YPosition
Gui, Submit Gui, Submit
Gui, Destroy Gui, Destroy
; Save Testing Mode Info ; Save Testing Mode Info
;------------------------------------------------ ;------------------------------------------------
if(TestingMode){ ; save currently seelcted sites to ini file for next test if(TestingMode){ ; save currently seelcted sites to ini file for next test
; IniWrite, %Streamanity%, %SettingsIniFilepath%, Testing, Streamanity ; IniWrite, %Streamanity%, %SettingsIniFilepath%, Testing, Streamanity
IniWrite, %BitChute%, %SettingsIniFilepath%, Testing, BitChute IniWrite, %BitChute%, %SettingsIniFilepath%, Testing, BitChute
IniWrite, %OdyseeVideo%, %SettingsIniFilepath%, Testing, OdyseeVideo IniWrite, %OdyseeVideo%, %SettingsIniFilepath%, Testing, OdyseeVideo
@ -1023,127 +1033,127 @@ DownloadLatestChromium()
IniWrite, %Locals%, %SettingsIniFilepath%, Testing, Locals IniWrite, %Locals%, %SettingsIniFilepath%, Testing, Locals
IniWrite, %Telegram%, %SettingsIniFilepath%, Testing, Telegram IniWrite, %Telegram%, %SettingsIniFilepath%, Testing, Telegram
IniWrite, %Facebook%, %SettingsIniFilepath%, Testing, Facebook IniWrite, %Facebook%, %SettingsIniFilepath%, Testing, Facebook
} }
; Save Video Info ; Save Video Info
;------------------------------------------------ ;------------------------------------------------
; if changes made, delete the original file and save the new content to it ; if changes made, delete the original file and save the new content to it
if(VideoTitle != OriginalVideoTitle){ if(VideoTitle != OriginalVideoTitle){
VideoTitleFilepath = %VideoFolderDir%\title.txt VideoTitleFilepath = %VideoFolderDir%\title.txt
FileDelete, %VideoTitleFilepath% FileDelete, %VideoTitleFilepath%
FileAppend, %VideoTitle%, %VideoTitleFilepath% FileAppend, %VideoTitle%, %VideoTitleFilepath%
} }
if(VideoTags != OriginalVideoTags){ if(VideoTags != OriginalVideoTags){
VideoTagsFilepath = %VideoFolderDir%\keywords.txt VideoTagsFilepath = %VideoFolderDir%\keywords.txt
FileDelete, %VideoTagsFilepath% FileDelete, %VideoTagsFilepath%
FileAppend, %VideoTags%, %VideoTagsFilepath% FileAppend, %VideoTags%, %VideoTagsFilepath%
} }
if(PodcastTags != OriginalPodcastTags){ if(PodcastTags != OriginalPodcastTags){
PodcastTagsFilepath = %VideoFolderDir%\keywords_podcast.txt PodcastTagsFilepath = %VideoFolderDir%\keywords_podcast.txt
FileDelete, %PodcastTagsFilepath% FileDelete, %PodcastTagsFilepath%
FileAppend, %PodcastTags%, %PodcastTagsFilepath% FileAppend, %PodcastTags%, %PodcastTagsFilepath%
} }
if(VideoDescription != OriginalVideoDescription){ if(VideoDescription != OriginalVideoDescription){
VideoBodyFilepath = %VideoFolderDir%\body.txt VideoBodyFilepath = %VideoFolderDir%\body.txt
FileDelete, %VideoBodyFilepath% FileDelete, %VideoBodyFilepath%
FileAppend, %VideoDescription%, %VideoBodyFilepath% FileAppend, %VideoDescription%, %VideoBodyFilepath%
} }
; -------------------------------/Save Video Info------------------------------- ; -------------------------------/Save Video Info-------------------------------
; Save settings to config file ; Save settings to config file
IniWrite, %ReuseTabs%, %SettingsIniFilepath%, General, ReuseTabs IniWrite, %ReuseTabs%, %SettingsIniFilepath%, General, ReuseTabs
IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, General, ShowTooltipProgress IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, General, ShowTooltipProgress
IniWrite, %AutoUpdateCheck%, %SettingsIniFilepath%, General, AutoUpdateCheck IniWrite, %AutoUpdateCheck%, %SettingsIniFilepath%, General, AutoUpdateCheck
IniWrite, %AutoLogin%, %SettingsIniFilepath%, General, AutoLogin IniWrite, %AutoLogin%, %SettingsIniFilepath%, General, AutoLogin
IniWrite, %PingOnCompletion%, %SettingsIniFilepath%, General, PingOnCompletion IniWrite, %PingOnCompletion%, %SettingsIniFilepath%, General, PingOnCompletion
IniWrite, %KillLBRYAfterUpload%, %SettingsIniFilepath%, General, KillLBRYAfterUpload IniWrite, %KillLBRYAfterUpload%, %SettingsIniFilepath%, General, KillLBRYAfterUpload
if(VideoFilepath = ""){ if(VideoFilepath = ""){
Msgbox,4096,Error,No Video Filepath Found.`nPlease Input Video Filepath to Upload a Video. Msgbox,4096,Error,No Video Filepath Found.`nPlease Input Video Filepath to Upload a Video.
run, "%A_ScriptFullPath%" "LastPost" run, "%A_ScriptFullPath%" "LastPost"
ExitApp ExitApp
} }
; Format the LBRYURLSlug to be API Compatible ; Format the LBRYURLSlug to be API Compatible
if(LBRYURLSlug = "") ; if slug spot is blank, then set it to video title if(LBRYURLSlug = "") ; if slug spot is blank, then set it to video title
LBRYURLSlug := VideoTitle LBRYURLSlug := VideoTitle
LBRYURLSlug := LBRYCMDTextReplacement(LBRYURLSlug) LBRYURLSlug := LBRYCMDTextReplacement(LBRYURLSlug)
; Save the LBRY URL Slug to .ini file in case it's needed later ; Save the LBRY URL Slug to .ini file in case it's needed later
IniWrite, %LBRYURLSlug%, %VideoLinksIniFile%, Misc, LBRYUrlSlug IniWrite, %LBRYURLSlug%, %VideoLinksIniFile%, Misc, LBRYUrlSlug
IniWrite, %VideoThumbFilepath%, %VideoLinksIniFile%, Misc, VideoThumbFilepath IniWrite, %VideoThumbFilepath%, %VideoLinksIniFile%, Misc, VideoThumbFilepath
IniWrite, %PodcastNumber%, %VideoLinksIniFile%, Misc, PodcastNumber IniWrite, %PodcastNumber%, %VideoLinksIniFile%, Misc, PodcastNumber
; -------------------------------Log Info To Text------------------------------- ; -------------------------------Log Info To Text-------------------------------
(Facebook = 1)?(PostedWebsites .= "Facebook|") : () (Facebook = 1)?(PostedWebsites .= "Facebook|") : ()
(Bitchute = 1)?(PostedWebsites .= "Bitchute|") : () (Bitchute = 1)?(PostedWebsites .= "Bitchute|") : ()
(Locals = 1)?(PostedWebsites .= "Locals|") : () (Locals = 1)?(PostedWebsites .= "Locals|") : ()
(Rumble = 1)?(PostedWebsites .= "Rumble|") : () (Rumble = 1)?(PostedWebsites .= "Rumble|") : ()
(Brighteon = 1)?(PostedWebsites .= "Brighteon|") : () (Brighteon = 1)?(PostedWebsites .= "Brighteon|") : ()
; (Streamanity = 1)?(PostedWebsites .= "Streamanity|") : () ; (Streamanity = 1)?(PostedWebsites .= "Streamanity|") : ()
(Telegram = 1)?(PostedWebsites .= "Telegram|") : () (Telegram = 1)?(PostedWebsites .= "Telegram|") : ()
(DailyMotion = 1)?(PostedWebsites .= "DailyMotion|") : () (DailyMotion = 1)?(PostedWebsites .= "DailyMotion|") : ()
(OdyseeVideo = 1)?(PostedWebsites .= "OdyseeVideo|") : () (OdyseeVideo = 1)?(PostedWebsites .= "OdyseeVideo|") : ()
(OdyseeAudio = 1)?(PostedWebsites .= "OdyseeAudio|") : () (OdyseeAudio = 1)?(PostedWebsites .= "OdyseeAudio|") : ()
; Log Basic info to the errorlogging file ; Log Basic info to the errorlogging file
Message = %ScriptName% v%ScriptVersion%: Starting Upload `nFor: **%VideoTitle%**`nTo: %PostedWebsites% Message = %ScriptName% v%ScriptVersion%: Starting Upload `nFor: **%VideoTitle%**`nTo: %PostedWebsites%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Message := "VideoTitle: " VideoTitle Message := "VideoTitle: " VideoTitle
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
Message := "VideoDescription: `n" VideoDescription Message := "VideoDescription: `n" VideoDescription
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
Message := "VideoTags: " VideoTags Message := "VideoTags: " VideoTags
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
Message := "VideoFilepath: " VideoFilepath Message := "VideoFilepath: " VideoFilepath
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
Message := "VideoThumbFilepath: " VideoThumbFilepath Message := "VideoThumbFilepath: " VideoThumbFilepath
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
Message := "TotalVideosUploaded: " TotalVideosUploaded Message := "TotalVideosUploaded: " TotalVideosUploaded
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile") 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