Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 777cfaa242 |
@@ -296,7 +296,7 @@ Loop, files, %VideoFolderDir%\*.*, F ; loop through the files in the director
|
||||
|
||||
}
|
||||
|
||||
if(FileExt = "png" OR FileExt = "jpg"){
|
||||
if(FileExt = "png" OR FileExt = "jpg" OR FileExt = "jpeg"){
|
||||
VideoThumbFilepath := A_LoopFileFullPath
|
||||
}
|
||||
}
|
||||
@@ -348,8 +348,8 @@ Loop, files, %VideoFolderDir%\*.mp3, F ; loop through the files in the direct
|
||||
VideoLinksIniFile = %VideoFolderDir%\VideoLinks.ini
|
||||
|
||||
if(FileExist(VideoLinksIniFile)){
|
||||
; IniRead, StreamanityURL, %VideoLinksIniFile%, URLs, StreamanityURL, %A_Space%
|
||||
IniRead, BitChuteURL, %VideoLinksIniFile%, URLs, BitChuteURL, %A_Space%
|
||||
|
||||
; LBRY
|
||||
IniRead, LBRYURLSlug, %VideoLinksIniFile%, Misc, LBRYURLSlug, %A_Space%
|
||||
if(LBRYURLSlug = ""){
|
||||
@@ -377,7 +377,8 @@ if(FileExist(VideoLinksIniFile)){
|
||||
IniRead, DailyMotionURL, %VideoLinksIniFile%, URLs, DailyMotionURL, %A_Space%
|
||||
IniRead, PodcastNumber, %VideoLinksIniFile%, Misc, PodcastNumber, %A_Space%
|
||||
IniRead, LocalsURL, %VideoLinksIniFile%, URLs, LocalsURL, %A_Space%
|
||||
IniRead, FacebookURL, %VideoLinksIniFile%, URLs, FacebookURL, %A_Space%
|
||||
IniRead, PodcastTranscriptURL, %VideoLinksIniFile%, URLs, PodcastTranscriptURL, %A_Space%
|
||||
|
||||
|
||||
; MISC
|
||||
IniRead, ErrorLoggingFilePath, %VideoLinksIniFile%, Misc, ErrorLoggingFilePath, %A_Space%
|
||||
@@ -1026,9 +1027,10 @@ if(SocialMediaPosterFilepath = "" or !FileExist(SocialMediaPosterFilepath)){
|
||||
; ------------------------------------------------
|
||||
; @todo: this can be converted into 1 gosub, with if/else statements based on the button clicked
|
||||
|
||||
CopyPodcastNumber:
|
||||
Clipboard := PodcastNumber
|
||||
SaveOrPostProgress(Message:=PodcastNumber "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
CopyPodcastTranscriptURL:
|
||||
Clipboard := PodcastTranscriptURL
|
||||
Message := PodcastTranscriptURL . "`nCopied to Clipboard"
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
sleep, 1000
|
||||
ToolTip
|
||||
Return
|
||||
@@ -1108,7 +1110,7 @@ Return
|
||||
; @todo: Add thumbnail status to this
|
||||
; @todo: add podcast tags to this
|
||||
UpdateINI:
|
||||
IniWrite, %PodcastNumber%, %VideoLinksIniFile%, URLs, PodcastNumber
|
||||
IniWrite, %PodcastTranscriptURL%, %VideoLinksIniFile%, URLs, PodcastTranscriptURL
|
||||
IniWrite, %VideoTitle%, %VideoLinksIniFile%, Misc, VideoTitle
|
||||
IniWrite, %LocalsURL%, %VideoLinksIniFile%, URLs, LocalsURL
|
||||
IniWrite, %RumbleURL%, %VideoLinksIniFile%, URLs, RumbleURL
|
||||
|
||||
@@ -253,7 +253,7 @@ Gui, Font, Bold
|
||||
; Settings Section
|
||||
Gui, Add, GroupBox,r5 y+0 x%PageTwoXStartPos% w%PageTwoGroupBoxWidth%,Settings
|
||||
Gui, Add, Checkbox, xp+10 yp+20 vAutoUpdateCheck gUpdateVars Checked%AutoUpdateCheckCheckStatus%, Auto Update Check
|
||||
Gui, Add, Checkbox, vShowTooltipProgress Checked%ShowTooltipProgressCheckStatus% gUpdateVars,Show Tooltip Progress
|
||||
Gui, Add, Checkbox, vShowTooltipProgress Checked%ShowTooltipProgressCheckStatus% gUpdateVars,Show Tooltip of Actions
|
||||
Gui, Add, Checkbox, vKillLBRYAfterUpload Checked%KillLBRYAfterUploadCheckStatus%, Kill LBRY After Uploading
|
||||
Gui, Add, Checkbox, vAutoLogin gUpdateVars Checked%AutoLoginCheckStatus%, Try to Login Automatically
|
||||
Gui, Add, Checkbox, vPingOnCompletion gUpdateVars Checked%PingOnCompletionCheckStatus%, Discord Ping Upon Completion
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
Gui, Font, s%GuiFontSize%
|
||||
Gui, Font, Bold
|
||||
; Gui, Add, Text,x10 y+10, Podcast #:
|
||||
Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyPodcastNumber, Podcast #
|
||||
Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyPodcastTranscriptURL,Transcript URL
|
||||
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 vPodcastTranscriptURL, %PodcastTranscriptURL%
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyBitChuteURL, Bitchute
|
||||
|
||||
@@ -254,9 +254,10 @@ Check_For_Stuck_Video_Upload(Index_Number, Upload_Status){
|
||||
}
|
||||
} ; end of func
|
||||
|
||||
|
||||
/*
|
||||
*/
|
||||
; Find the longest word in a string of words
|
||||
FindLongestWordInString(m, calloutNumber, pos, haystack, pattern){
|
||||
FindLongestWordInString(m, calloutNumber, pos, haystack, pattern){
|
||||
Global wordLength, longestWord
|
||||
|
||||
len := StrLen(m)
|
||||
@@ -268,4 +269,39 @@ Check_For_Stuck_Video_Upload(Index_Number, Upload_Status){
|
||||
|
||||
; MsgBox, %m%
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
; Split a long string into multiple pieces based on the string lengtht you want and return an array with all strings
|
||||
SplitStringWithSentences(text, maxChunkSize) {
|
||||
sentences := StrSplit(text, "\. ") ; split at period with space after it
|
||||
|
||||
currentChunk := ""
|
||||
chunks := []
|
||||
|
||||
Loop, % sentences.Length()
|
||||
{
|
||||
sentence := sentences[A_Index]
|
||||
CurrentChunkAndSentence := currentChunk . sentence
|
||||
; Msgbox % "CurrentChunkAndSentence: " CurrentChunkAndSentence
|
||||
; msgbox % StrLen(CurrentChunkAndSentence)
|
||||
|
||||
if (StrLen(CurrentChunkAndSentence) <= maxChunkSize)
|
||||
{
|
||||
currentChunk .= sentence . "\. "
|
||||
}
|
||||
else
|
||||
{
|
||||
chunks.Push(currentChunk)
|
||||
currentChunk := sentence . "\. "
|
||||
}
|
||||
}
|
||||
|
||||
if (currentChunk != "")
|
||||
chunks.Push(currentChunk)
|
||||
|
||||
return chunks
|
||||
}
|
||||
|
||||
|
||||
@@ -25,13 +25,10 @@ if(SocialMediaDescription = ""){
|
||||
CreateDescriptionForSocialMedia()
|
||||
}
|
||||
|
||||
; Msgbox % "SocialMediaDescription: " SocialMediaDescription
|
||||
|
||||
SubmitDescriptionForDiscordVideosChannel:
|
||||
Message := "**" . VideoTitle . "**" . "`n" . SocialMediaDescription . "`n"
|
||||
; https://stackoverflow.com/questions/63160401/how-to-create-hyperlink-in-discord-in-an-embed-in-general
|
||||
; Do this with an array!!
|
||||
;
|
||||
|
||||
if(BitChuteURL != "")
|
||||
Message .= "[BitChute](<" . BitChuteURL . ">) \| "
|
||||
@@ -44,23 +41,18 @@ Message .= "[Odysee](<" . OdyseeVideoURL . ">) \| "
|
||||
|
||||
if(OdyseeAudioURL != "")
|
||||
Message .= "[Odysee (Audio)](<" . OdyseeAudioURL . ">) \| "
|
||||
/*
|
||||
if(OdyseeVideoURL != "")
|
||||
Message .= "[Odysee](<" . OdyseeVideoURL . ") \| "
|
||||
|
||||
if(OdyseeAudioURL != "")
|
||||
Message .= "[Odysee Audio](<" . OdyseeAudioURL . ") \| "
|
||||
|
||||
*/
|
||||
if(RumbleURL != "")
|
||||
Message .= "[Rumble](<" . RumbleURL . ">) \| "
|
||||
|
||||
/*if(StreamanityURL != "" AND InStr(StreamanityURL, "streamanity.com"))
|
||||
Message .= "[Streamanity](<" . StreamanityURL . ">) \| "
|
||||
|
||||
*/
|
||||
if(DailyMotionURL != "")
|
||||
Message .= "[DailyMotion](<" . DailyMotionURL . ">)"
|
||||
Message .= "[DailyMotion](<" . DailyMotionURL . ">) \| "
|
||||
|
||||
if(PodcastTranscriptURL != "")
|
||||
Message .= "[Video Transcript](<" . PodcastTranscriptURL . ">) \| "
|
||||
|
||||
if(PodcastNumber != "")
|
||||
Message .= "[FDRPodcasts](<" . "https://fdrpodcasts.com/" . PodcastNumber . ">) \| "
|
||||
|
||||
|
||||
UploadImageToDiscord(DiscordVideosWebhookURL, Message, VideoThumbFilepath)
|
||||
|
||||
@@ -56,24 +56,19 @@ VideoLinks .= "[Odysee](" . OdyseeVideoURL . ") \| "
|
||||
|
||||
if(OdyseeAudioURL != "")
|
||||
VideoLinks .= "[Odysee \(Audio\)](" . OdyseeAudioURL . ") \| "
|
||||
/*
|
||||
if(OdyseeVideoURL != "")
|
||||
VideoLinks .= "[Odysee](" . OdyseeVideoURL . ") \| "
|
||||
|
||||
if(OdyseeAudioURL != "")
|
||||
VideoLinks .= "[Odysee Audio](" . OdyseeAudioURL . ") \| "
|
||||
|
||||
*/
|
||||
if(RumbleURL != "")
|
||||
VideoLinks .= "[Rumble](" . RumbleURL . ") \| "
|
||||
/*
|
||||
if(InStr(StreamanityURL, "https://streamanity.com/video/"))
|
||||
VideoLinks .= "[Streamanity](" . StreamanityURL . ") \| "
|
||||
|
||||
*/
|
||||
if(DailyMotionURL != "")
|
||||
VideoLinks .= "[DailyMotion](" . DailyMotionURL . ") \| "
|
||||
|
||||
if(PodcastTranscriptURL != "")
|
||||
VideoLinks .= "[Video Transcript](" . PodcastTranscriptURL . ") \| "
|
||||
|
||||
if(PodcastNumber != "")
|
||||
VideoLinks .= "[FDRPodcasts](" . "https://fdrpodcasts.com/" . PodcastNumber . ") \| "
|
||||
|
||||
|
||||
TelegramMessage := TelegramVideoTitle . "`n" . TelegramBodymessage . "`n" . VideoLinks
|
||||
|
||||
@@ -83,50 +78,9 @@ StrLenOfMessageAndVideoLinks := StrLen(TelegramVideoTitle) + StrLen(TelegramBody
|
||||
; DevModeMsgBox(StrLenOfMessageAndVideoLinks)
|
||||
|
||||
|
||||
if(StrLenOfMessageAndVideoLinks > 1024){
|
||||
; Telegram SendMessage is limited to 4096 characters
|
||||
if(StrLenOfMessageAndVideoLinks < 4096){ ; split into sendphoto and 1 sendmessage
|
||||
; DevModeMsgBox("Less than 4096 chars")
|
||||
; Photo and Video Title go into SendPhoto
|
||||
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
|
||||
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
|
||||
|
||||
; Video Description goes into TelegramMessage
|
||||
Status2 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessage)
|
||||
|
||||
} ; split into 2 SendMessages
|
||||
else if (StrLenOfMessageAndVideoLinks > 4096 AND StrLenOfMessageAndVideoLinks < 8192){ ; Split into 2 parts
|
||||
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
|
||||
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
|
||||
|
||||
TelegramBodymessagePiece := SubStr(TelegramBodymessage, 1, 4096)
|
||||
Status2 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece)
|
||||
|
||||
TelegramBodymessagePiece := SubStr(TelegramBodymessage, 4097, 8192)
|
||||
Status3 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece)
|
||||
|
||||
} ; split into 3 sendMessages
|
||||
else if (StrLenOfMessageAndVideoLinks > 8192 AND StrLenOfMessageAndVideoLinks < 12288){ ; Split into 3 parts
|
||||
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
|
||||
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
|
||||
|
||||
TelegramBodymessagePiece := SubStr(TelegramBodymessage, 1, 4096)
|
||||
msgbox % StrLen(TelegramBodymessagePiece)
|
||||
Status2 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece)
|
||||
|
||||
|
||||
|
||||
TelegramBodymessagePiece := SubStr(TelegramBodymessage, 4097, 8192)
|
||||
msgbox % StrLen(TelegramBodymessagePiece)
|
||||
DevModeMsgBox(TelegramBodymessagePiece)
|
||||
Status3 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece)
|
||||
|
||||
; TelegramBodymessagePiece := SubStr(TelegramBodymessage, 8193, 12288)
|
||||
; Status3 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece)
|
||||
}
|
||||
|
||||
|
||||
} else, { ; if less than 1024 characters, send normally
|
||||
; If Length of Title, Video Links and Message is less than 1024 characters:
|
||||
; ------------------------------------------------
|
||||
if(StrLenOfMessageAndVideoLinks < 1024) {
|
||||
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramMessage ) ; you could add more options; compare the Telegram API docs
|
||||
if(InStr(Status, "error_code")){
|
||||
Message = Telegram Post Failed due to an API Issue. Error was saved to ErrorLogging file. Please send it to Yuriy.
|
||||
@@ -139,30 +93,58 @@ if(StrLenOfMessageAndVideoLinks > 1024){
|
||||
ToolTip
|
||||
Return
|
||||
}
|
||||
|
||||
}
|
||||
; Msgbox % "SizeOfCaption: " SizeOfCaption
|
||||
; SizeOfCaption := SizeOfCaption +
|
||||
; Message .= VideoLinks
|
||||
; msgbox % StrLen(VideoLinks)
|
||||
|
||||
; Message := StrReplace(Message, "`n", LineBreakChar) ; replace all new line characters with the global charater
|
||||
|
||||
; msgbox % StrLen(Message)
|
||||
}
|
||||
|
||||
|
||||
; SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordVideos")
|
||||
; If Title, Links and Message are longer than 1024, but less than 4096, split into 2 pieces: sendphoto and sendmessage
|
||||
; ------------------------------------------------
|
||||
if(StrLenOfMessageAndVideoLinks < 4096){
|
||||
|
||||
; SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
Message = Video Links Posted to Telegram Successfully
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
GuiControl,, PostToTelegramButton, Telegram - Posted Successfully
|
||||
; Photo and Video Title go into SendPhoto
|
||||
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
|
||||
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
|
||||
|
||||
; Video Description goes into TelegramMessage
|
||||
Status2 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessage)
|
||||
|
||||
} else, {
|
||||
; If Title, links and message are longer than 4096 chars, we need to split them into multiple messages
|
||||
; ------------------------------------------------
|
||||
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
|
||||
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
|
||||
|
||||
|
||||
; sleep, 2000
|
||||
; Split the Description into 4096 character chunks while preserving sentences
|
||||
; Used 4095 because a ". " has to be put in at the end of the chunk.
|
||||
VideoDescriptionChunks := SplitStringWithSentences(TelegramBodymessage, 4094)
|
||||
|
||||
|
||||
ToolTip
|
||||
CurrentSite :=
|
||||
Return
|
||||
; -------------------------------/Telegram-------------------------------
|
||||
; go through array and post each chunk as new message
|
||||
Loop % VideoDescriptionChunks.Length(){
|
||||
; ArrayItem := ARRAY[A_Index]
|
||||
Description := VideoDescriptionChunks[A_Index]
|
||||
|
||||
|
||||
SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := Description)
|
||||
; Clipboard := Description
|
||||
; msgbox % Description
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
; SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
Message = Video Links Posted to Telegram Successfully
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
GuiControl,, PostToTelegramButton, Telegram - Posted Successfully
|
||||
|
||||
|
||||
; sleep, 2000
|
||||
|
||||
|
||||
ToolTip
|
||||
CurrentSite :=
|
||||
Return
|
||||
; -------------------------------/Telegram-------------------------------
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
[Video-Uploader]
|
||||
Version=3.33
|
||||
Version=3.34
|
||||
Name=Freedomain Video Uploader
|
||||
|
||||
Reference in New Issue
Block a user