fixed grabbing Locals Video Share Link

main
Yuriy 3 months ago
parent 6639c907c9
commit 5f63640185

@ -296,9 +296,9 @@ Loop % VideoTitleArray.Length(){
; 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
; RegExMatch(VideoTitle, "ms)\b\S+(?CFindLongestWordInString)\b(?R)", m)
; LongestWordInVideoTitle := longestWord
; Msgbox % "LongestWordInVideoTitle: " LongestWordInVideoTitle
; MsgBox, Longest word: %longestWord%`, #%wordLength%
@ -307,9 +307,23 @@ Msgbox % "LongestWordInVideoTitle: " LongestWordInVideoTitle
; Grab Video Share Link From Page Source
; ------------------------------------------------
ShareLink := GrabLocalsPostURLUsingTitle(VideoTitle)
if(!InStr(ShareLink, "https")){
Message = Couldn't find Video Share link in the first 10 posts. Is the video possibly still uploading?
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Msgbox % "ShareLink: " ShareLink
; Msgbox % "LocalsVideoURL: " LocalsVideoURL
; Iterate over the last couple of posts, find the post with the title that contains the Longest word from the uploaded video
; And grab the share URL for it
/*
Message = Looking for - %LongestWordInVideoTitle% - within first 7 posts in order to grab share URL
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@ -366,6 +380,7 @@ loop, 7 {
ShareLink :=
}
*/
if(ShareLink = ""){
Message = Video was published succsessfully, but failed to grab Share Link.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")

@ -55,7 +55,7 @@ if((StrLen(VideoTitle) + StrLen(VideoDescription) + StrLen(Message)) > 2000){
else,
DiscordVideoDescription := VideoDescription
Message := "**" . VideoTitle . "**" . "`n" . DiscordVideoDescription . "`n" . Message
Message := "**" . VideoTitle . "**" . "`n" . Message . "`n" . DiscordVideoDescription
Status := UploadImageToDiscord(DiscordVideosWebhookURL, Message, VideoThumbFilepath)
Message = API Response:`n%Status%

Loading…
Cancel
Save