From ca0b6ce1b793763848af4fdd49e63b10d3dd4bab Mon Sep 17 00:00:00 2001 From: yuriy Date: Sat, 27 Jan 2024 18:46:58 -0500 Subject: [PATCH] added double check to Bitchute tag input --- Freedomain Video Uploader.ahk | 9 ++++++++- Modules/Bitchute-Upload.ahk | 15 +++++++++++++-- Version.ini | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Freedomain Video Uploader.ahk b/Freedomain Video Uploader.ahk index b17e4d5..0dd99c6 100644 --- a/Freedomain Video Uploader.ahk +++ b/Freedomain Video Uploader.ahk @@ -267,6 +267,12 @@ Loop, files, %VideoFolderDir%\*.*, F ; loop through the files in the director OriginalVideoDescription := VideoDescription } + if(FileNameWExt = "summary.txt"){ + FileRead, VideoSummary, %A_LoopFileFullPath% + ; DescriptionCharCount := StrLen(VideoDescription) + OriginalVideoSummary := VideoSummary + } + if(FileNameWExt = "keywords.txt"){ FileRead, VideoTags, %A_LoopFileFullPath% FileRead, PodcastTags, %A_LoopFileFullPath% @@ -777,7 +783,7 @@ IniWrite, %VideoThumbFilepath%, %VideoLinksIniFile%, Misc, VideoThumbFilepath ; Log Basic info to the errorlogging file -Message = %ScriptName% v%ScriptVersion%: Starting Upload `nFor: **%VideoTitle%**`nTo: %PostedWebsites% +Message = Starting Upload with %ScriptName% v%ScriptVersion%:`nFor: **%VideoTitle%**`nTo: %PostedWebsites% SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") Message := "VideoTitle: " VideoTitle @@ -801,6 +807,7 @@ SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile") ; Convert Video Title and Description into javascript formatting for sending to pages through js instead of plain selenium JSVideoTitle := FormatTextToJSText(VideoTitle) JSVideoDescription := FormatTextToJSText(VideoDescription) +JSVideoSummary := FormatTextToJSText(VideoSummary) ; -------------------------------/Log Info To Text------------------------------- diff --git a/Modules/Bitchute-Upload.ahk b/Modules/Bitchute-Upload.ahk index 9f92e74..bca1531 100644 --- a/Modules/Bitchute-Upload.ahk +++ b/Modules/Bitchute-Upload.ahk @@ -124,11 +124,15 @@ Loop, 10 { ; Attempt to input video description a couple of times Message = Inputting Tags SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") -; Convert tags into #hasthtags +; Get first 3 tags from Video Tags array Loop, 3 { - BitchuteTags .= VideoTagsArray[A_Index] . " " + BitchuteTags .= ArrayOfVideoTags[A_Index] . " " } +Message = Inputting Tags: %BitchuteTags% +SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") + + ; input Search Terms (Tags) Xpath = //input[@placeholder='Search Terms'] Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=BitchuteTags) @@ -137,6 +141,13 @@ Message = Failed to input search terms (tags) SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") } +js = return document.querySelector("#hashtags").value; +try CurrentHashTagValue := driver.executeScript(JS) ;Execute Javascript +if(CurrentHashTagValue = ""){ + Message = Tags that got input into page: %CurrentHashTagValue% + SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") +} + ; Upload Thumbnail Message = Attaching Thumbnail diff --git a/Version.ini b/Version.ini index 51f413c..836e2e7 100644 --- a/Version.ini +++ b/Version.ini @@ -1,3 +1,3 @@ [Video-Uploader] -Version=3.32 +Version=3.33 Name=Freedomain Video Uploader