10 Commits

7 changed files with 445 additions and 264 deletions

4
.gitignore vendored
View File

@@ -2,6 +2,10 @@ Settings.ini
VideoLinks.ini VideoLinks.ini
body.txt body.txt
**/ErrorLogging **/ErrorLogging
**/chrome-win64
**/Downloads
**/Chromedriver-Mover.exe
**/ChromedriverMover.ini
**/Test Videos **/Test Videos
**/Backups **/Backups
**/Debug **/Debug

View File

@@ -24,14 +24,15 @@ Menu, Tray, Add, Restart with Last Project, RetryUpload
Menu, Tray, Default, Restart with Last Project Menu, Tray, Default, Restart with Last Project
global ScriptName
global ScriptNameav
global ScriptVersion global ScriptVersion
global FullScriptName global FullScriptName
ScriptName = Freedomain Video Uploader ScriptName = Freedomain Video Uploader
ScriptVersion = 3.21 ScriptVersion = 3.25
FullScriptName := ScriptName . " - " . ScriptVersion FullScriptName := ScriptName . " - " . ScriptVersion
@@ -47,6 +48,7 @@ UStartTime := A_TickCount ; start time
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\RunCMD.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\StdOutToVar.ahk
#include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Zip.ahk #include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Zip.ahk
#include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\URLDownloadToVar.ahk
;---ToDo--- ;---ToDo---
@@ -109,7 +111,7 @@ Number_of_loops_to_Check_Upload_status = 720
; number of seconds to wait between loops when checking video upload status ; number of seconds to wait between loops when checking video upload status
global Time_Between_Loops_Upload_Status global Time_Between_Loops_Upload_Status
Time_Between_Loops_Upload_Status = 5000 Time_Between_Loops_Upload_Status = 15000 ;
; loop Index number to check if video is stuck uploading ; loop Index number to check if video is stuck uploading
global Array_Index_Num_of_Upload_StatusChecks global Array_Index_Num_of_Upload_StatusChecks
@@ -139,8 +141,8 @@ ScriptSettingsSection := "VideoUploader"
IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1 IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1
(ShowTooltipProgress)?(ShowTooltipProgressCheckStatus := 1) : (ShowTooltipProgressCheckStatus := 0) (ShowTooltipProgress)?(ShowTooltipProgressCheckStatus := 1) : (ShowTooltipProgressCheckStatus := 0)
IniRead, XPosition, %SettingsIniFilepath%, General, XPosition IniRead, XPosition, %SettingsIniFilepath%, General, XPosition, 0
IniRead, YPosition, %SettingsIniFilepath%, General, YPosition IniRead, YPosition, %SettingsIniFilepath%, General, YPosition, 0
IniRead, RootDirToStartIn, %SettingsIniFilepath%, General, RootDirToStartIn IniRead, RootDirToStartIn, %SettingsIniFilepath%, General, RootDirToStartIn
IniRead, LogErrorsToMsgbox, %SettingsIniFilepath%, General, LogErrorsToMsgbox, %A_Space% IniRead, LogErrorsToMsgbox, %SettingsIniFilepath%, General, LogErrorsToMsgbox, %A_Space%
@@ -313,7 +315,7 @@ if(VideoDescription = ""){
} }
; Loop through the folder again to find the correct .WAV audio file as Stef has multiple in there and we need the .mp4 file to be found first so we know what to look for file name wise. ; Loop through the folder again to find the correct .WAV audio file as Stef has multiple in there and we need the .mp4 file to be found first so we know what to look for file name wise.
Loop, files, %VideoFolderDir%\*.WAV, F ; loop through the files in the directory Loop, files, %VideoFolderDir%\*.flac, F ; loop through the files in the directory
{ ; D = Directories, F = Files, R = Recursive { ; D = Directories, F = Files, R = Recursive
SplitPath, A_LoopFileFullPath, FileNameWExt, FileDir, FileExt, FileNameNoExt SplitPath, A_LoopFileFullPath, FileNameWExt, FileDir, FileExt, FileNameNoExt
@@ -322,7 +324,21 @@ Loop, files, %VideoFolderDir%\*.WAV, F ; loop through the files in the direct
} }
} }
; 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. ; 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 Loop, files, %VideoFolderDir%\*.mp3, F ; loop through the files in the directory
{ ; D = Directories, F = Files, R = Recursive { ; D = Directories, F = Files, R = Recursive
SplitPath, A_LoopFileFullPath, FileNameWExt, FileDir, FileExt, FileNameNoExt SplitPath, A_LoopFileFullPath, FileNameWExt, FileDir, FileExt, FileNameNoExt
@@ -556,6 +572,13 @@ else, {
} }
; @ TODO REMOVE
; LocalsGrabURL := 0
; Locals := 0
; -------------------------------GUI------------------------------- ; -------------------------------GUI-------------------------------
Gui, Font, s%GuiFontSize% Gui, Font, s%GuiFontSize%
@@ -633,8 +656,12 @@ Gui, Add, Button, x+5 yp+0 h%EditBoxHeight% gSelectVideoThumbFilepath, Select
Gui, Font, Bold Gui, Font, Bold
if(WavAudioFilepath = "") if(WavAudioFilepath = "")
Gui, Add, Text,cRed x%MarginSquared% y+15,WAV Filepath Gui, Add, Text,cRed x%MarginSquared% y+15,WAV Filepath
else, else, { ; change text depending on if WAV or FLAC file
Gui, Add, Text,x%MarginSquared% y+15,WAV Filepath 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, Font, Normal
Gui, Add, Edit, x%MarginSquared% y+2 w%FilePathEditBoxWidths% h%EditBoxHeight% gUpdateVars vWavAudioFilepath,%WavAudioFilepath% 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, Add, Button, x+5 yp+0 h%EditBoxHeight% gSelectWAVFilepath, Select
@@ -738,28 +765,36 @@ 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) ; msgbox, checking grab url
Gui, Add, Checkbox, x+%MarginSpaceTripled% yp+0 vLocalsGrabURL Checked%LocalsCheckStatus% gUpdateVars, Locals (Grab URL)
LocalsGrabURL := 1
Locals := 0
} }
else, { else, {
Gui, Add, Checkbox, x+%MarginSpaceTripled% yp+0 vLocals Checked%LocalsCheckStatus%, Locals ; 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) if(VideoFileSizeInMB < 50)
Gui, Add, Checkbox, vTelegram x+%MarginSpaceDoubled% Checked%TelegramCheckStatus%, Telegram Gui, Add, Checkbox, vTelegram x+%MarginSpaceTripled% yp+0 Checked%TelegramCheckStatus% gUpdateVars, Telegram (>50 MB)
Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vOdyseeVideo Checked%OdyseeVideoCheckStatus%, 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
@@ -911,7 +946,6 @@ SelectVideoThumbFilepath:
FileSelectFile, VideoThumbFilepath,, %FileDir%, Select Thumbnail File FileSelectFile, VideoThumbFilepath,, %FileDir%, Select Thumbnail File
if(!InStr(VideoThumbFilepath, FileDir)){ if(!InStr(VideoThumbFilepath, FileDir)){
; ToolTip, Thumbnail Copied to Project Folder, 850, 0
TimedToolTip("Thumbnail Copied to Project Folder",,,1000) TimedToolTip("Thumbnail Copied to Project Folder",,,1000)
SplitPath, VideoThumbFilepath, OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive SplitPath, VideoThumbFilepath, OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive
FileCopy, %VideoThumbFilepath%, %FileDir%\*,1 FileCopy, %VideoThumbFilepath%, %FileDir%\*,1
@@ -933,6 +967,7 @@ Return
UpdateChrome: UpdateChrome:
if(CheckForChromeUpdates = "") if(CheckForChromeUpdates = "")
Status := CheckForChromeUpdates(ChromeFilepath) Status := CheckForChromeUpdates(ChromeFilepath)
@@ -949,41 +984,46 @@ if(!status){
} }
DownloadLatestChromium() Status := DownloadLatestChromium()
if(Status)
GuiControl,,ChromeUpdateAvailable, Chrome Up-to-Dat
Return Return
; now defunt, safe to remove /*
CreateDescriptionForVideosPosting: */
; msgbox, here
Gui, VideoDescriptionTrimmer:New, ; now defunt, safe to remove
Gui, Font, s%GuiFontSize% CreateDescriptionForVideosPosting:
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. ; msgbox, here
Gui, Font, s%GuiFontSize% Gui, VideoDescriptionTrimmer:New,
Gui, Add, Edit, w800 h500 gUpdateVars vVideoDescriptionForVideosChannel, %VideoDescription% Gui, Font, s%GuiFontSize%
Gui, Add, Button, gSubmitDescriptionForVideosChannel, Submit 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, Show,w820, Video Description Trimmer Gui, Font, s%GuiFontSize%
; msgbox Gui, Add, Edit, w800 h500 gUpdateVars vVideoDescriptionForVideosChannel, %VideoDescription%
Return Gui, Add, Button, gSubmitDescriptionForVideosChannel, Submit
gui, Show,w820, Video Description Trimmer
; msgbox
Return
SubmitDescriptionForVideosChannel: SubmitDescriptionForVideosChannel:
Gui, Submit Gui, Submit
; msgbox, submitted ; msgbox, submitted
if(CurrentSocialMediaPosting = "Discord") if(CurrentSocialMediaPosting = "Discord")
Goto, SubmitDescriptionForDiscordVideosChannel Goto, SubmitDescriptionForDiscordVideosChannel
if(CurrentSocialMediaPosting = "Telegram") if(CurrentSocialMediaPosting = "Telegram")
Goto, SubmitDescriptionForTelegramVideosChannel Goto, SubmitDescriptionForTelegramVideosChannel
if(CurrentSocialMediaPosting = "Telegram Video") if(CurrentSocialMediaPosting = "Telegram Video")
goto, SubmitDescriptionForTelegramVideoUpload goto, SubmitDescriptionForTelegramVideoUpload
Return Return
CreateDescriptionForSocialMedia(){ CreateDescriptionForSocialMedia(){
SplitText = Free Documentaries: SplitText = Free Documentaries:
SocialMediaDescription := StrSplit(VideoDescription, SplitText) SocialMediaDescription := StrSplit(VideoDescription, SplitText)
@@ -995,22 +1035,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,140 +1063,133 @@ 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 Title and Description into javascript formatting for sending to pages through js instead of plain selenium
JSVideoDescription := FormatTextToJSText(VideoDescription) JSVideoTitle := FormatTextToJSText(VideoTitle)
JSVideoTitle := FormatTextToJSText(VideoTitle) JSVideoDescription := FormatTextToJSText(VideoDescription)
; -------------------------------/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
/*
if(Facebook)
gosub, FacebookUpload
*/
/*
*/
if(Telegram) if(Telegram)
gosub, TelegramVideoUpload gosub, TelegramVideoUpload
if(Locals) if(Locals)
gosub, LocalsUpload gosub, LocalsUpload
@@ -1198,7 +1231,7 @@ if(OdyseeAudio){
Gosub, LBRYGetURL Gosub, LBRYGetURL
} }
if(LocalsGrabURL OR LocalsURL = "LocalsUploadStartedNeedToGrabURL"){ if(LocalsGrabURL){
Gosub, LocalsGrabURL Gosub, LocalsGrabURL
} }
@@ -1228,6 +1261,25 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,Disc
DisplayResults: 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 Tooltip ; Remove all tooltips
Gui, Destroy ; destroy GUI in case we're going from the main screen to results without uploading. Gui, Destroy ; destroy GUI in case we're going from the main screen to results without uploading.
@@ -1359,6 +1411,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 +1685,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
} }
} }

View File

@@ -36,12 +36,12 @@ if(LoggedOutStatus){
try driver.FindElementByXPath(Xpath).click() try driver.FindElementByXPath(Xpath).click()
Xpath = //input[@placeholder='Enter password'] Xpath = //input[@placeholder='Enter password']
driver.FindElementByXPath(Xpath).click() try driver.FindElementByXPath(Xpath).click()
js = document.querySelector("button[type='submit']").click(); js = document.querySelector("button[type='submit']").click();
driver.executeScript(js) driver.executeScript(js)
driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
sleep, 1000 sleep, 1000
; Do a double check to make sure that login worked ; Do a double check to make sure that login worked
@@ -284,6 +284,25 @@ catch e {
} }
; Disable Monetization Checkbox
Message = Disabling Monetization Checkbox
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = //*[@id="advertising_instream_blocked"]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to click on Monetization slider with xpath, trying with full xpath
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = /html/body/div/div[2]/div/div[3]/div/div/div[2]/div[2]/div/div/div/div[4]/div/button
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to click on Monetization slider with full xpath, sleeping for 5 seconds so user can manually uncheck it.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
}
/* /*
; Disable monitization for video ; Disable monitization for video
SaveOrPostProgress(Message:="Unchecking monetizaton checkbox",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Unchecking monetizaton checkbox",PostType:="Tooltip,ErrorLoggingTextFile")

View File

@@ -57,7 +57,7 @@ if(DevMode){
Return Return
} }
} }
/*
Message = Inputting Title Message = Inputting Title
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@@ -69,6 +69,45 @@ if(DevMode){
} }
sleep, 1000 sleep, 1000
*/
TooltipThis("Inputting Title")
Loop, 5 { ; Attempt to input video description a couple of times
if(A_index = 5){
; Clipboard := VideoDescription
Message = Failed to input Video Title
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
js = document.querySelector("#title").value = "%JSVideoTitle%"; ; Send content through javascript (Great for getting around emoji chrome limitaitons)
try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
; msgbox
; try driver.findElementsByName("body").item[1].SendKeys(driver.Keys.SPACE)
; driver.findElementsByID("ELEMENTID").item[1].SendKeys(driver.Keys.ENTER)
; msgbox
jsCheck = return document.querySelector("#title").value; ; Send content through javascript (Great for getting around emoji chrome limitaitons)
try VideoTitle := driver.executeScript(jsCheck) ;Executes a Javascript on the webpage, mostly used for buttons.
; try Description := driver.findElementsByName("body").item[1].Attribute("value") ;XPath: ID=site-title & span tag
if(VideoTitle != "")
Break
sleep, 2000
}
/*Xpath = //textarea[@id='body'] /*Xpath = //textarea[@id='body']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=VideoDescription) Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=VideoDescription)
@@ -108,7 +147,7 @@ Loop, 5 { ; Attempt to input video description a couple of times
sleep, 2000 sleep, 2000
} }
SaveOrPostProgress(Message:="Waiting Video to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile") ; SaveOrPostProgress(Message:="Waiting Video to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
Message = Uploading Video File Message = Uploading Video File
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //div[@class='uploadvideo-wrapper']//input[@name='Filedata'] Xpath = //div[@class='uploadvideo-wrapper']//input[@name='Filedata']
@@ -148,7 +187,7 @@ if(AutoSubmitstatus = "0"){
} }
DevModeMsgBox("autosubmit status -1 string here") ; DevModeMsgBox("autosubmit status -1 string here")
; msgbox % AutoSubmitstatus = "-1" ; msgbox % AutoSubmitstatus = "-1"
if(AutoSubmitstatus = "-1"){ ; if checked YES if(AutoSubmitstatus = "-1"){ ; if checked YES
@@ -199,6 +238,9 @@ if(AutoSubmitstatus = "-1"){ ; if checked YES
; LocalsTabURL := SaveDriverURL() ; LocalsTabURL := SaveDriverURL()
; Set variable so that URL gets grabbed later in the upload
LocalsGrabURL := 1
Return Return
} }
Return Return
@@ -214,7 +256,7 @@ Return
;--------------LocalsGrabURL---------------------------------- ;--------------LocalsGrabURL----------------------------------
LocalsGrabURL: LocalsGrabURL:
CurrentSite := Locals CurrentSite := "Locals"
SaveOrPostProgress(Message:="Navigating to Locals Feed to grab URL",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:="Navigating to Locals Feed to grab URL",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") ; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@@ -254,28 +296,67 @@ Return
js = return document.querySelector("a[class='btn']").innerText; js = return document.querySelector("a[class='btn']").innerText;
try, status := driver.executeScript(js) try, status := driver.executeScript(js)
if(status){ if(status){
Message = Video was uploaded but Locals saved it as a draft instead of instantly publishing it. Please go to the Locals Page and Retrieve Draft and manually Publish it. Message = Video is in Draft Mode. Publishing.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,DiscordErrorLogging")
; video is in draft mode, we need to confirm the title and then publish it.
; click Retrieve draft button
js = document.querySelector("a[class='btn']").click()
try, driver.executeScript(js)
js = return document.querySelector("#title").value
try LocalsDraftTitle := driver.executeScript(JS)
if(LocalsDraftTitle != VideoTitle){
Message = Failed to Grab URL. Locals Draft Title does not Match video Title:`nVideo Title: %VideoTitle%`nLocals Draft Title: %LocalsDraftTitle%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
}
; otherwise we are good to publish video
Xpath = (//button[@name='submitPost'])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to click Publish button on saved Draft
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
sleep, 2000
} }
/*
; Get word that's longer than 4 characters in video title ; Get word that's longer than 4 characters in video title
VideoTitleArray := StrSplit(VideoTitle, " ") VideoTitleArray := StrSplit(VideoTitle, " ")
; Iterate from 1 to the end of the array: ; Iterate from 1 to the end of the array:
Loop % VideoTitleArray.Length(){ Loop % VideoTitleArray.Length(){
VideoTitleFirstWord := VideoTitleArray[A_Index] LongestWordInVideoTitle := VideoTitleArray[A_Index]
VideoTitleFirstWord := StrReplace(VideoTitleFirstWord, "_","-") LongestWordInVideoTitle := StrReplace(LongestWordInVideoTitle, "_","-")
if(StrLen(VideoTitleFirstWord) > 4) if(StrLen(LongestWordInVideoTitle) > 4)
Break Break
; MsgBox % VideoTitleArray[A_Index]
} }
*/
; get longest word in video title to use for grabbing the share link from the raw page
RegExMatch(VideoTitle, "ms)\b\S+(?CFindLongestWordInString)\b(?R)", m)
LongestWordInVideoTitle := longestWord
; Msgbox % "LongestWordInVideoTitle: " LongestWordInVideoTitle
; MsgBox, Longest word: %longestWord%`, #%wordLength%
loop, 7 { loop, 7 {
ElementIndexNum := A_index - 1 ElementIndexNum := A_index - 1
Message = ElementIndexNum: %ElementIndexNum% Message = ElementIndexNum: %ElementIndexNum%
@@ -287,18 +368,16 @@ loop, 7 {
try outerHTML := driver.executeScript(jsCheck) try outerHTML := driver.executeScript(jsCheck)
if(DevMode){ if(DevMode){
Message = Looking for VideoTitleFirstWord: %VideoTitleFirstWord% `nwithin outerHTML Message = Looking for LongestWordInVideoTitle: %LongestWordInVideoTitle% `nwithin outerHTML: %outerHTML%
DevModeMsgBox(message) DevModeMsgBox(message)
Clipboard := outerHTML Clipboard := message
DevModeMsgBox(outerHTML) ; DevModeMsgBox(outerHTML)
} }
if(InStr(OuterHTML,LongestWordInVideoTitle)){
; msgbox % "outerHTML: " . outerHTML
if(InStr(OuterHTML,VideoTitleFirstWord)){
; @todo replace with regex ; @todo replace with regex
Message = %VideoTitleFirstWord% is in`n`n %OuterHTML% Message = %LongestWordInVideoTitle% is in`n`n %OuterHTML%
DevModeMsgBox(Message) DevModeMsgBox(Message)
Message = Found at at index: %A_index% Message = Found at at index: %A_index%
@@ -328,14 +407,21 @@ loop, 7 {
ShareLink := ShareLink :=
} }
DevModeMsgBox(ShareLink) if(ShareLink = ""){
Message = Video was published succsessfully, but failed to grab Share Link.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
; DevModeMsgBox(ShareLink)
; ShareLink := "Successful" ; ShareLink := "Successful"
Message = Upload Complete: %ShareLink% Message = Upload Complete: %ShareLink%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
DevModeMsgBox(ShareLink)
IniWrite, %ShareLink%, %VideoLinksIniFile%, URLs, LocalsURL IniWrite, %ShareLink%, %VideoLinksIniFile%, URLs, LocalsURL
AddToTotalVideosUploadedCount() AddToTotalVideosUploadedCount()
@@ -500,22 +586,22 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
VideoTitleArray := StrSplit(VideoTitle, " ") VideoTitleArray := StrSplit(VideoTitle, " ")
; Iterate from 1 to the end of the array: ; Iterate from 1 to the end of the array:
Loop % VideoTitleArray.Length(){ Loop % VideoTitleArray.Length(){
VideoTitleFirstWord := VideoTitleArray[A_Index] LongestWordInVideoTitle := VideoTitleArray[A_Index]
VideoTitleFirstWord := StrReplace(VideoTitleFirstWord, "_","-") LongestWordInVideoTitle := StrReplace(LongestWordInVideoTitle, "_","-")
if(StrLen(VideoTitleFirstWord) > 4) if(StrLen(LongestWordInVideoTitle) > 4)
Break Break
; MsgBox % VideoTitleArray[A_Index] ; MsgBox % VideoTitleArray[A_Index]
} }
; DevModeMsgBox(VideoTitleFirstWord) ; DevModeMsgBox(LongestWordInVideoTitle)
; Message = VideoTitleFirstWord: %VideoTitleFirstWord% ; Message = LongestWordInVideoTitle: %LongestWordInVideoTitle%
; SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile") ; SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
; VideoTitleFirstWord := VideoTitleFirstWord[1] ; LongestWordInVideoTitle := LongestWordInVideoTitle[1]
; Msgbox % "VideoTitleFirstWord: " VideoTitleFirstWord ; Msgbox % "LongestWordInVideoTitle: " LongestWordInVideoTitle
/* ; Format the post title to remove all spaces and special characters to match with Locals Post /* ; Format the post title to remove all spaces and special characters to match with Locals Post
ShareLinkFormatted := StrReplace(VideoTitle, " ", "-") ShareLinkFormatted := StrReplace(VideoTitle, " ", "-")
@@ -547,9 +633,9 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
; msgbox % "outerHTML: " . outerHTML ; msgbox % "outerHTML: " . outerHTML
if(InStr(OuterHTML,VideoTitleFirstWord)){ if(InStr(OuterHTML,LongestWordInVideoTitle)){
Message = %VideoTitleFirstWord% is in %OuterHTML% Message = %LongestWordInVideoTitle% is in %OuterHTML%
; DevModeMsgBox(Message) ; DevModeMsgBox(Message)
; MsgBox, found match at %A_index% ; MsgBox, found match at %A_index%

View File

@@ -235,3 +235,19 @@ Check_For_Stuck_Video_Upload(Index_Number, Upload_Status){
ProgressStatusArray.Push(Upload_Status) ; append current status to array ProgressStatusArray.Push(Upload_Status) ; append current status to array
} }
} ; end of func } ; end of func
; Find the longest word in a string of words
FindLongestWordInString(m, calloutNumber, pos, haystack, pattern){
Global wordLength, longestWord
len := StrLen(m)
If ( len > wordLength )
{
wordLength := len
longestWord := m
; MsgBox, %m%
}
}

View File

@@ -266,7 +266,7 @@ try pagehtml := driver.pagesource
Loop, %LengthOfArrayOfPodcastTags% { Loop, %LengthOfArrayOfPodcastTags% {
Tag := ArrayOfPodcastTags[A_Index] ; find value from position in array Tag := ArrayOfPodcastTags[A_Index] ; find value from position in array
SpanID = title">%Tag%</span></div></li><li><div id="_easyui_tree_ SpanID = title">%Tag%</span></div></li><li><div id="tagIDs_easyui_tree_
if(InStr(pagehtml, SpanID)){ ; if tag found in page, do this if(InStr(pagehtml, SpanID)){ ; if tag found in page, do this
number := StrSplit(pagehtml, SpanID) number := StrSplit(pagehtml, SpanID)
@@ -289,7 +289,7 @@ Loop, %LengthOfArrayOfPodcastTags% {
Continue Continue
} }
Xpath = //div[@id='_easyui_tree_%number%']//span[@class='tree-checkbox tree-checkbox0'] Xpath = //div[@id='_easyui_tree_4025_%number%']//span[@class='tree-checkbox tree-checkbox0']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
} }