code cleanup, added statistic for number of mouse clicks made by selenium

pull/2/head
Yuriy 1 year ago
parent 0142031362
commit f66ada0635

@ -52,22 +52,16 @@ UStartTime := A_TickCount ; start time
;---ToDo--- ;---ToDo---
;------------------------------------------------ ;------------------------------------------------
; @todo: Update Locals Share link grabbing ; @todo: Update Locals Share link grabbing
; @todo: finish show results functionality on line 430
; @todo: fix uploader saying there's been failures b/c there was no lbry audio upload ; @todo: fix uploader saying there's been failures b/c there was no lbry audio upload
; @todo: finish telegram multi-message split functionality. ; @todo: finish telegram multi-message split functionality.
; @todo: add different icon when update is available ; @todo: add different icon when update is available
; @todo: fix telegram post getting cut off if too long instead of splitting into 2 ; @todo: fix telegram post getting cut off if too long instead of splitting into 2
; @todo: fix ping always saying that there was failures
; @todo: let user make last minute changes to text before submitting to telegram and discord ; @todo: let user make last minute changes to text before submitting to telegram and discord
; @todo: replace all .Attribute("innerText") with js ; @todo: replace all .Attribute("innerText") with js
; @todo: Fix locals not grabbing url if a post is pinned ; @todo: Fix locals not grabbing url if a post is pinned
; @todo: Add an input box for sources in the new frontend ; @todo: Add an input box for sources in the new frontend
; @todo: Fix bitchute title getting input twice
; @todo: Add login check for each website and ability to auto login ; @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: ; add to statistics in statusbar - length of philosophy uploaded... total hours uploaded?
; @todo: add support for unauthorized.tv
; @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: 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: Split long discord/telegram messages into multiple messages
; @todo: Redo Discord posting with "PostErrors" function from social media poster ; @todo: Redo Discord posting with "PostErrors" function from social media poster
@ -145,11 +139,6 @@ ScriptSettingsSection := "VideoUploader"
IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1 IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1
(ShowTooltipProgress)?(ShowTooltipProgressCheckStatus := 1) : (ShowTooltipProgressCheckStatus := 0) (ShowTooltipProgress)?(ShowTooltipProgressCheckStatus := 1) : (ShowTooltipProgressCheckStatus := 0)
; Message = Reading Settings from .ini files
; ToolTip, reading settings
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
IniRead, XPosition, %SettingsIniFilepath%, General, XPosition IniRead, XPosition, %SettingsIniFilepath%, General, XPosition
IniRead, YPosition, %SettingsIniFilepath%, General, YPosition IniRead, YPosition, %SettingsIniFilepath%, General, YPosition
@ -157,22 +146,15 @@ IniRead, YPosition, %SettingsIniFilepath%, General, YPosition
IniRead, RootDirToStartIn, %SettingsIniFilepath%, General, RootDirToStartIn IniRead, RootDirToStartIn, %SettingsIniFilepath%, General, RootDirToStartIn
IniRead, LogErrorsToMsgbox, %SettingsIniFilepath%, General, LogErrorsToMsgbox, %A_Space% IniRead, LogErrorsToMsgbox, %SettingsIniFilepath%, General, LogErrorsToMsgbox, %A_Space%
IniRead, UpdateAvailable, %SettingsIniFilepath%, %ScriptSettingsSection%, UpdateAvailable, 0 IniRead, UpdateAvailable, %SettingsIniFilepath%, %ScriptSettingsSection%, UpdateAvailable, 0
; Msgbox % "SettingsIniFilepath: " SettingsIniFilepath
; Msgbox % "UpdateAvailable: " UpdateAvailable
IniRead, DevMode, %SettingsIniFilepath%, General, DevMode, 0 IniRead, DevMode, %SettingsIniFilepath%, General, DevMode, 0
IniRead, TotalVideosUploaded, %SettingsIniFilepath%, General, TotalVideosUploaded, 0 IniRead, TotalVideosUploaded, %SettingsIniFilepath%, General, TotalVideosUploaded, 0
IniRead, MouseClicksSaved, %SettingsIniFilepath%, General, MouseClicksSaved, 0
; Checkbox Settings ; Checkbox Settings
IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1 IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1
(ShowTooltipProgress)?(ShowTooltipProgressCheckStatus := 1) : (ShowTooltipProgressCheckStatus := 0) (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
@todo delete later
IniRead, ReuseTabs, %SettingsIniFilepath%, General, ReuseTabs, 1
(ReuseTabs)?(ReuseTabsCheckStatus := 1) : (ReuseTabsCheckStatus := 0)
*/
; ReuseTabs is permanantly on. There is never a time where you want to create new tabs for every website
ReuseTabs := 1
IniRead, AutoUpdateCheck, %SettingsIniFilepath%, General, AutoUpdateCheck, 1 IniRead, AutoUpdateCheck, %SettingsIniFilepath%, General, AutoUpdateCheck, 1
(AutoUpdateCheck)?(AutoUpdateCheckCheckStatus := 1) : (AutoUpdateCheckCheckStatus := 0) (AutoUpdateCheck)?(AutoUpdateCheckCheckStatus := 1) : (AutoUpdateCheckCheckStatus := 0)
@ -491,10 +473,9 @@ if(DevMode){
; Menu, Tray, Add, Reload to Results, ReloadToResults ; Menu, Tray, Add, Reload to Results, ReloadToResults
} }
; Msgbox % "PassedParameter: " PassedParameter
; Msgbox % "PassedParameter: " PassedParameter
if(PassedParameter = "ShowResults"){ if(PassedParameter = "ShowResults"){
msgbox, we are showing results
goto, DisplayResults goto, DisplayResults
} }
@ -815,8 +796,8 @@ Gui, Add, Picture, xp+10 yp+20 w%ThumbnailPreviewWidth% h-1, %VideoThumbFilepath
gui, Font, Normal gui, Font, Normal
gui, font, s7 gui, font, s7
Gui, Add, StatusBar,Center, Total Videos Uploaded: %TotalVideosUploaded% Gui, Add, StatusBar,Center, Total Videos Uploaded: %TotalVideosUploaded% | Total Clicks Saved: %MouseClicksSaved%
; SB_SetText("There are " . RowCount . " rows selected.")
; Show GUI to the user ; Show GUI to the user
Gui, +Resize +MaximizeBox Gui, +Resize +MaximizeBox
@ -827,16 +808,8 @@ else,
Gui, Show,, %FullScriptName% - Upload Settings - %BodyTextFilePath% Gui, Show,, %FullScriptName% - Upload Settings - %BodyTextFilePath%
ControlFocus, Edit4, %FullScriptName% ControlFocus, Edit4, %FullScriptName%
ToolTip ToolTip
; Gui, Maximize
; Gui, Show, w%GuiWidth% h%GuiHeight%, %ScriptName%
if(SkipToDBInfo){
gui, submit
goto, DisplayResults
}
; Write current project to ini file for easy reloading ; Write current project to ini file for easy reloading
IniWrite, %BodyTextFilePath%, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost IniWrite, %BodyTextFilePath%, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost
@ -866,11 +839,6 @@ if(AutoUpdateCheck AND !UpdateAvailable){
; calculate run time and convert to seconds ; calculate run time and convert to seconds
URunTime2 := round(((A_TickCount - UStartTime) / 1000), 2) URunTime2 := round(((A_TickCount - UStartTime) / 1000), 2)
; Msgbox % "URunTime1: " URunTime1
; Msgbox % "URunTime2: " URunTime2
; Msgbox % "URunTime: " URunTime
Return Return
; -------------------------------GUI GoSubs------------------------------- ; -------------------------------GUI GoSubs-------------------------------
@ -1293,9 +1261,12 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,Disc
DisplayResults: DisplayResults:
Gui, Destroy
; @todo: Add a way to check if uploads finished with or without errors
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.
IniRead, MouseClicksSaved, %SettingsIniFilepath%, General, MouseClicksSaved, %A_Space%
IniRead, TotalVideosUploaded, %SettingsIniFilepath%, General, TotalVideosUploaded, %A_Space% IniRead, TotalVideosUploaded, %SettingsIniFilepath%, General, TotalVideosUploaded, %A_Space%
; IniRead, StreamanityURL, %VideoLinksIniFile%, URLs, StreamanityURL, %A_Space% ; IniRead, StreamanityURL, %VideoLinksIniFile%, URLs, StreamanityURL, %A_Space%
IniRead, BitChuteURL, %VideoLinksIniFile%, URLs, BitChuteURL, %A_Space% IniRead, BitChuteURL, %VideoLinksIniFile%, URLs, BitChuteURL, %A_Space%
@ -1339,63 +1310,37 @@ Gui, Font, Bold
Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyPodcastNumber, Podcast # Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyPodcastNumber, Podcast #
Gui, Font, Normal Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% w%ResultEditBoxWidths% gUpdateVars vPodcastNumber, %PodcastNumber% Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% w%ResultEditBoxWidths% gUpdateVars vPodcastNumber, %PodcastNumber%
; Gui, Add, Edit, x+5 h200 w200, This is some text that goes here!
; Gui, Add, Text,x10 y+20, Title:
; Gui, Font, Bold
; Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyVideoTitle, Title
; Gui, Font, Normal
; Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% w%ResultEditBoxWidths% gUpdateVars vVideoTitle, %VideoTitle%
; Gui, Add, Button, x+1 w20, Copy Title
; Gui, Add, Text,x10 y+20, Bitchute:
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyBitChuteURL, Bitchute Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyBitChuteURL, Bitchute
Gui, Font, Normal Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vBitChuteURL w%ResultEditBoxWidths% gUpdateVars , %BitChuteURL% Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vBitChuteURL w%ResultEditBoxWidths% gUpdateVars , %BitChuteURL%
; Gui, Add, Edit, x+5 yp+0 w%ResultLBRYThumbEditBoxWidth% gUpdateVars, Facebook: %FacebookURL%
; Gui, Add, Button, x+1 w20, Copy BitChute
; Gui, Add, Text,x10 y+20, Brighteon:
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyBrighteonURL, Brighteon Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyBrighteonURL, Brighteon
Gui, Font, Normal Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vBrighteonURL w%ResultEditBoxWidths% gUpdateVars , %BrighteonURL% Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vBrighteonURL w%ResultEditBoxWidths% gUpdateVars , %BrighteonURL%
; Gui, Add, Text,x10 y+20, DailyMotion:
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyDailyMotionURL, DailyMotion Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyDailyMotionURL, DailyMotion
Gui, Font, Normal Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vDailyMotionURL w%ResultEditBoxWidths% gUpdateVars , %DailyMotionURL% Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vDailyMotionURL w%ResultEditBoxWidths% gUpdateVars , %DailyMotionURL%
; Gui, Add, Text,x10 y+20, Odysee:
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyOdyseeVideoURL, Odysee Video Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyOdyseeVideoURL, Odysee Video
Gui, Font, Normal Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vOdyseeVideoURL w%ResultEditBoxWidths% gUpdateVars, %OdyseeVideoURL% Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vOdyseeVideoURL w%ResultEditBoxWidths% gUpdateVars, %OdyseeVideoURL%
; Gui, Add, Button, x+5 yp+0, Thumb
; Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vOdyseeVideoThumb w%ResultLBRYThumbEditBoxWidth% gUpdateVars, Thumb: %OdyseeVideoThumb%
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyOdyseeAudioURL, Odysee Audio Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyOdyseeAudioURL, Odysee Audio
Gui, Font, Normal Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vOdyseeAudioURL w%ResultEditBoxWidths% gUpdateVars , %OdyseeAudioURL% Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vOdyseeAudioURL w%ResultEditBoxWidths% gUpdateVars , %OdyseeAudioURL%
; Gui, Add, Button, x+5 yp+0, Thumb
; Gui, Add, Edit, x+5 yp+0 vOdyseeAudioThumb w%ResultLBRYThumbEditBoxWidth% gUpdateVars, Thumb: %OdyseeAudioThumb%
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyRumbleURL, Rumble Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyRumbleURL, Rumble
Gui, Font, Normal Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vRumbleURL w%ResultEditBoxWidths% gUpdateVars , %RumbleURL% 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% gCopyStreamanityURL, Streamanity
Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vStreamanityURL w%ResultEditBoxWidths% gUpdateVars , %StreamanityURL%
*/
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths%, Locals Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths%, Locals
Gui, Font, Normal Gui, Font, Normal
@ -1426,12 +1371,10 @@ Gui, Add, Button, x%ResultEditBoxXPos% y+%MarginSpace% w%ResultEditBoxThirdsWidt
Gui, Add, Button, x+5 w%ResultEditBoxThirdsWidths% gPostToTelegram vPostToTelegramButton, Post to Telegram 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, Add, Button, x+5 w%ResultEditBoxThirdsWidths% gStartSocialMediaPoster, Start Social Media Poster
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Button, x%ResultEditBoxXPos% y+%MarginSpace% w%ResultEditBoxHalfWidths%gSendErrorLoggingThroughTelegram, Send Errorlog Through Telegram 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+%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%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% gCancelPost %ButtonWidths% , Close
; Gui, Add, Button, x+%MarginSpace% w%ResultEditBoxHalfWidths% gKillScript %ButtonWidths% , Close ; Gui, Add, Button, x+%MarginSpace% w%ResultEditBoxHalfWidths% gKillScript %ButtonWidths% , Close
@ -1443,7 +1386,7 @@ Gui, Add, Edit,x%ErrorLogEditBoxXPos% h%ErrorLogEditBoxHeight% w%ErrorLogEditBox
gui, font, Normal gui, font, Normal
gui, font, s7 gui, font, s7
Gui, Add, StatusBar,, Total Videos Uploaded: %TotalVideosUploaded% Gui, Add, StatusBar,, Total Videos Uploaded: %TotalVideosUploaded% | Total Clicks Saved: %MouseClicksSaved%
Gui, +Resize +MaximizeBox Gui, +Resize +MaximizeBox
OriginalVideoDescription := VideoDescription OriginalVideoDescription := VideoDescription
@ -1495,7 +1438,7 @@ if(SocialMediaPosterFilepath = "" or !FileExist(SocialMediaPosterFilepath)){
Return Return
/* /*
Indent Reset Sublime Indent Reset
*/ */
; -------------------------------CopyThis------------------------------- ; -------------------------------CopyThis-------------------------------
@ -1556,14 +1499,7 @@ sleep, 1000
ToolTip ToolTip
Return Return
/*CopyStreamanityURL:
Clipboard := StreamanityURL
SaveOrPostProgress(Message:=StreamanityURL "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
*/
CopyVideoTags: CopyVideoTags:
Clipboard := VideoTags Clipboard := VideoTags
SaveOrPostProgress(Message:=VideoTags "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=VideoTags "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")

@ -1 +1 @@
Subproject commit 1c000184df1a048998e0a68f1698d3f6499f1c28 Subproject commit ca7145fa8258665bfb4ee6615467ee042e58fe34

@ -171,13 +171,13 @@ LogErrorToTextFile(Error){
FileAppend, %Text%, %ErrorLoggingFile% FileAppend, %Text%, %ErrorLoggingFile%
} ; End of Function } ; End of Function
/*
*/
SaveDriverURL()
AddToTotalVideosUploadedCount(){ AddToTotalVideosUploadedCount(){
IniRead, TotalVideosUploaded, %SettingsIniFilepath%, General, TotalVideosUploaded, %A_Space% ; IniRead, TotalVideosUploaded, %SettingsIniFilepath%, General, TotalVideosUploaded, %A_Space%
TotalVideosUploaded += 1 TotalVideosUploaded += 1
IniWrite, %TotalVideosUploaded%, %SettingsIniFilepath%, General, TotalVideosUploaded ; IniWrite, %TotalVideosUploaded%, %SettingsIniFilepath%, General, TotalVideosUploaded
} }

Loading…
Cancel
Save