Reworked podcast tag parsing to be same as video tags, Added tag input limit to brighteon, small code cleanup
This commit is contained in:
@@ -584,8 +584,8 @@ Gui, Add, Edit, yp+0 x+%Marginspace% w%PodcastNumberEditWidth% h%EditBoxHeight%
|
||||
|
||||
; LBRY URL
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Text, x%Marginspace%,Video Tags
|
||||
Gui, Add, Text,x%ColumnOneHalfWidthXPos% yp+0,Podcast Tags
|
||||
Gui, Add, Text, x%Marginspace%,Video Tags (Comma Seperated)
|
||||
Gui, Add, Text,x%ColumnOneHalfWidthXPos% yp+0,Podcast Tags (Comma Seperated)
|
||||
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x%Marginspace% Y+5 w%EditBoxHalfWidths% h%EditBoxHeight% gUpdateVars vVideoTags, %VideoTags%
|
||||
@@ -1159,34 +1159,45 @@ JSVideoDescription := FormatTextToJSText(VideoDescription)
|
||||
|
||||
; -------------------------------/Log Info To Text-------------------------------
|
||||
|
||||
|
||||
; This should go somewhere appropriate
|
||||
; fwiw this function comes straight from the docs: https://www.autohotkey.com/docs/v2/Functions.htm#Variadic
|
||||
Join(sep, params*) {
|
||||
For index, param in params
|
||||
str .= param . sep
|
||||
return SubStr(str, 1, -StrLen(sep))
|
||||
}
|
||||
|
||||
; @todo: note: it would be better to replace accented chars w/ their pure latin equivalents but that seems a bit
|
||||
; beyond the scope of this change. here's a link talking about how to do that tho
|
||||
; https://www.autohotkey.com/boards/viewtopic.php?t=61626
|
||||
|
||||
; Create an array out of the keywords to be used in different places
|
||||
KeywordsArray := Array()
|
||||
For idx, val in StrSplit(VideoTags, ",") {
|
||||
VideoTagsArray := []
|
||||
PodcastTagsArray := []
|
||||
|
||||
; VIDEO Tags
|
||||
For index, val in StrSplit(VideoTags, ",") {
|
||||
; for each element in the split videotags array, trim leading & trailing spaces
|
||||
val := Trim(val)
|
||||
|
||||
; and remove any chars that are not a letter, number, or space (i = case-insensitive)
|
||||
; note: it would be better to replace accented chars w/ their pure latin equivalents but that seems a bit
|
||||
; beyond the scope of this change. here's a link talking about how to do that tho
|
||||
; https://www.autohotkey.com/boards/viewtopic.php?t=61626
|
||||
val := RegexReplace(val, "i)[^a-z0-9 ]", "")
|
||||
KeywordsArray.InsertAt(idx, val)
|
||||
VideoTagsArray.InsertAt(index, val)
|
||||
}
|
||||
|
||||
; PODCAST Tags
|
||||
For index, val in StrSplit(PodcastTags, ",") {
|
||||
; for each element in the split videotags array, trim leading & trailing spaces
|
||||
val := Trim(val)
|
||||
|
||||
; and remove any chars that are not a letter, number, or space (i = case-insensitive)
|
||||
val := RegexReplace(val, "i)[^a-z0-9 ]", "")
|
||||
PodcastTagsArray.InsertAt(index, val)
|
||||
}
|
||||
|
||||
|
||||
; update VideoTags with sanitized keywords list
|
||||
VideoTags := Join(",", KeywordsArray*)
|
||||
VideoTags := Join(",", VideoTagsArray*)
|
||||
|
||||
; Call each sub one by one, if errors occur then an upload will be stopped and the next upload will then proceed
|
||||
; update PodcastTags with sanitized keywords list
|
||||
PodcastTags := Join(",", PodcastTagsArray*)
|
||||
|
||||
|
||||
; Call each submodule one by one
|
||||
; if errors occur then an upload for that site will be stopped and the next upload will then proceed
|
||||
|
||||
if(Telegram)
|
||||
gosub, TelegramVideoUpload
|
||||
|
||||
|
||||
@@ -235,11 +235,19 @@ if(VideoThumbFilepath != "") {
|
||||
}
|
||||
|
||||
|
||||
; DevModeMsgBox(VideoTags)
|
||||
; Brighteon has a max of 25 for tags.
|
||||
if(VideoTagsArray.Length() > 25){
|
||||
Loop % 24 {
|
||||
BrighteonKeywords := VideoTagsArray[A_Index]
|
||||
}
|
||||
else,
|
||||
BrighteonKeywords := VideoTags
|
||||
}
|
||||
|
||||
TooltipThis("Inputting Keywords")
|
||||
Loop, 5 {
|
||||
XPath = //input[@id='keywords']
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(VideoTags) ;Sends Variable to an Xpath Item
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(BrighteonKeywords) ;Sends Variable to an Xpath Item
|
||||
catch e {
|
||||
Message = Error (E#2312)`nVideo Uploaded but Unable to Input Video Tags
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
|
||||
; -------------------------------Functions-------------------------------
|
||||
; https://www.autohotkey.com/docs/v2/Functions.htm#Variadic
|
||||
Join(sep, params*) {
|
||||
For index, param in params
|
||||
str .= param . sep
|
||||
return SubStr(str, 1, -StrLen(sep))
|
||||
}
|
||||
|
||||
|
||||
CheckLBRYProcess(){
|
||||
; Check if LBRY Process exists
|
||||
Process, Exist,LBRY.exe
|
||||
|
||||
Reference in New Issue
Block a user