Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c4b2eeea8e | |||
| 723dec3fac | |||
| c60a45445c | |||
| fa43716ebe | |||
| ef3cb41e9c | |||
| 777cfaa242 | |||
| dd7c85e22e | |||
| ca0b6ce1b7 |
@@ -46,6 +46,7 @@ UStartTime := A_TickCount ; start time
|
||||
#include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\StdOutToVar.ahk
|
||||
#include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Zip.ahk
|
||||
#include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\URLDownloadToVar.ahk
|
||||
#Include %A_ScriptDir%\Modules\Miscellaneous-Functions.ahk ; Misc functions for video uploading specifically
|
||||
|
||||
|
||||
;---Global Variables---
|
||||
@@ -80,7 +81,6 @@ global ErrorLoggingFilePath
|
||||
global ErrorLogVar
|
||||
ErrorLogVar :=
|
||||
|
||||
global ReuseTabs ; reuse tabs variable
|
||||
global DevMode
|
||||
|
||||
global LBRYNetFilepath
|
||||
@@ -140,7 +140,6 @@ IniRead, MouseClicksSaved, %SettingsIniFilepath%, General, MouseClicksSaved, 0
|
||||
IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1
|
||||
(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
|
||||
|
||||
IniRead, AutoUpdateCheck, %SettingsIniFilepath%, General, AutoUpdateCheck, 1
|
||||
(AutoUpdateCheck)?(AutoUpdateCheckCheckStatus := 1) : (AutoUpdateCheckCheckStatus := 0)
|
||||
@@ -267,6 +266,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%
|
||||
@@ -290,7 +295,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
|
||||
}
|
||||
}
|
||||
@@ -342,8 +347,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 = ""){
|
||||
@@ -371,7 +376,9 @@ 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%
|
||||
IniRead, UnauthorizedTVURL, %VideoLinksIniFile%, URLs, UnauthorizedTVURL, %A_Space%
|
||||
|
||||
|
||||
; MISC
|
||||
IniRead, ErrorLoggingFilePath, %VideoLinksIniFile%, Misc, ErrorLoggingFilePath, %A_Space%
|
||||
@@ -735,7 +742,6 @@ if(VideoDescription != OriginalVideoDescription){
|
||||
; -------------------------------/Save Video Info-------------------------------
|
||||
|
||||
; Save settings to config file
|
||||
IniWrite, %ReuseTabs%, %SettingsIniFilepath%, General, ReuseTabs
|
||||
IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, General, ShowTooltipProgress
|
||||
IniWrite, %AutoUpdateCheck%, %SettingsIniFilepath%, General, AutoUpdateCheck
|
||||
IniWrite, %AutoLogin%, %SettingsIniFilepath%, General, AutoLogin
|
||||
@@ -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-------------------------------
|
||||
|
||||
@@ -1019,9 +1026,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
|
||||
@@ -1101,7 +1109,8 @@ Return
|
||||
; @todo: Add thumbnail status to this
|
||||
; @todo: add podcast tags to this
|
||||
UpdateINI:
|
||||
IniWrite, %PodcastNumber%, %VideoLinksIniFile%, URLs, PodcastNumber
|
||||
IniWrite, %UnauthorizedTVURL%, %VideoLinksIniFile%, URLs, UnauthorizedTVURL
|
||||
IniWrite, %PodcastTranscriptURL%, %VideoLinksIniFile%, URLs, PodcastTranscriptURL
|
||||
IniWrite, %VideoTitle%, %VideoLinksIniFile%, Misc, VideoTitle
|
||||
IniWrite, %LocalsURL%, %VideoLinksIniFile%, URLs, LocalsURL
|
||||
IniWrite, %RumbleURL%, %VideoLinksIniFile%, URLs, RumbleURL
|
||||
@@ -1195,6 +1204,3 @@ Return
|
||||
;------------------------------------------------
|
||||
#Include %A_ScriptDir%\Modules\Podcast-Upload.ahk
|
||||
|
||||
; Miscellaneous-Functions
|
||||
;------------------------------------------------
|
||||
#Include %A_ScriptDir%\Modules\Miscellaneous-Functions.ahk
|
||||
|
||||
Submodule Lib/Freedomain-Posters-Shared-Functions updated: e32fe026e9...f625e782eb
@@ -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
|
||||
|
||||
@@ -8,7 +8,8 @@ Return
|
||||
|
||||
|
||||
JSBrighteonVideoDescription := FormatTextToJSText(VideoDescription)
|
||||
; Msgbox % "JSBrighteonVideoDescription: " JSBrighteonVideoDescription
|
||||
|
||||
|
||||
|
||||
; descriptions longer than 5k characters just fail to get input so trim them to below 5000 characters
|
||||
if(StrLen(VideoDescription) >= 5000){
|
||||
@@ -137,6 +138,25 @@ loop, 3 {
|
||||
}
|
||||
|
||||
|
||||
; input with js. Doesn't work in production, but does in the ConnectActiveTab script
|
||||
/*
|
||||
SaveOrPostProgress(Message:="Inputting title with JS",PostType:="Tooltip")
|
||||
|
||||
; Input Title of the Video
|
||||
js = document.querySelector("#name").value = "%JSVideoDescription%";
|
||||
driver.executeScript(JS) ;Execute Javascript
|
||||
|
||||
SaveOrPostProgress(Message:="Waiting 5 seconds to check if input was saved",PostType:="Tooltip")
|
||||
sleep, 5000
|
||||
|
||||
Xpath = //input[@id='name']
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.SPACE)
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.BACKSPACE) ;Sends Variable to an Xpath Item
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
; Input Title of the Video
|
||||
Xpath = //input[@id='name']
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(VideoTitle) ;Sends Variable to an Xpath Item
|
||||
@@ -166,9 +186,7 @@ loop, 3 {
|
||||
|
||||
TooltipThis("Inputting Video Description")
|
||||
|
||||
|
||||
|
||||
; Attempt to input video description a couple of times
|
||||
; Attempt to input video description multiple time in case Brighteon rejects the input
|
||||
Loop, 10 {
|
||||
if(A_index = 10){
|
||||
Message = Failed to input Video Description after 10 attempts.
|
||||
@@ -204,8 +222,8 @@ Loop, 10 {
|
||||
|
||||
sleep, 5000
|
||||
|
||||
|
||||
js = return document.querySelector("div[class='e-content e-lib e-keyboard'] p").innerText;
|
||||
; get text that was input into description box
|
||||
js = return document.querySelector("#richtexteditor_747903514_0rte-view").innerText;
|
||||
try Input_Description := driver.executeScript(JS) ;Execute Javascript
|
||||
|
||||
Input_DescriptionStrLen := StrLen(Input_Description)
|
||||
|
||||
@@ -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
|
||||
@@ -325,4 +325,32 @@ Gui, Show,, %FullScriptName% - Upload Settings - %BodyTextFilePath%
|
||||
ControlFocus, Edit4, %FullScriptName%
|
||||
ToolTip
|
||||
|
||||
|
||||
; calculate run time and convert to seconds
|
||||
URunTime1 := round(((A_TickCount - UStartTime) / 1000), 2)
|
||||
|
||||
;---Check for Updates---
|
||||
;------------------------------------------------
|
||||
if(AutoUpdateCheck AND !UpdateAvailable){
|
||||
Message = Checking for Updates
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
if(CheckForUpdates(GitReleasesAPIURL))
|
||||
GuiControl,,UpdateAvailable, Uploader Update Available!
|
||||
|
||||
if(CheckForChromeUpdates(ChromeFilepath)){
|
||||
GuiControl,,ChromeUpdateAvailable, Chrome Update Available!
|
||||
ChromeUpdateAvailable := 1
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
; calculate run time and convert to seconds
|
||||
URunTime2 := round(((A_TickCount - UStartTime) / 1000), 2)
|
||||
|
||||
Return
|
||||
|
||||
|
||||
|
||||
Return
|
||||
@@ -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
|
||||
@@ -41,6 +40,11 @@ Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths%, Locals
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vLocalsURL w%ResultEditBoxWidths% gUpdateVars, %LocalsURL%
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths%, Unauthorized
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vUnauthorizedTVURL w%ResultEditBoxWidths% gUpdateVars, %UnauthorizedTVURL%
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyVideoTags vVideoTagsEdit, Video Tags
|
||||
Gui, Font, Normal
|
||||
@@ -60,7 +64,7 @@ Gui, Font, s%GuiFontSize%
|
||||
Gui, Font, Bold
|
||||
|
||||
Gui, Add, Button, x%ResultEditBoxXPos% w%ResultEditBoxHalfWidths% gUpdateINI, Save Modified Links
|
||||
Gui, Add, Button, x+%MarginSpace% w%ResultEditBoxHalfWidths% gUploadPodcast, Upload Podcast
|
||||
Gui, Add, Button, x+%MarginSpace% w%ResultEditBoxHalfWidths% gUploadPodcast vUploadPodcast, Upload Podcast
|
||||
|
||||
Gui, Add, Button, x%ResultEditBoxXPos% y+%MarginSpace% w%ResultEditBoxThirdsWidths% gPostToDiscord vPostToDiscordButton, Post to Discord
|
||||
Gui, Add, Button, x+5 w%ResultEditBoxThirdsWidths% gPostToTelegram vPostToTelegramButton, Post to Telegram
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -216,6 +216,9 @@ Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength
|
||||
Xpath = //input[@id='url-rumble']
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=RumbleURL)
|
||||
|
||||
; Input Rumble URL
|
||||
Xpath = //input[@id='url-unauthorizedtv']
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=UnauthorizedTVURL)
|
||||
|
||||
; Soundcloud but actually LBRY Audio URL
|
||||
Xpath = //input[@id='url-lbry-audio']
|
||||
@@ -325,6 +328,9 @@ Sublime Indentation Reset
|
||||
Message = Input Complete! `nPlease Confirm and click Final "Save" Button on Podcast Page
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
; Change GUI button from "Upload Podcast"
|
||||
GuiControl,,UploadPodcast, Podcast Uploaded
|
||||
|
||||
sleep, 5000
|
||||
|
||||
CurrentSite :=
|
||||
|
||||
@@ -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,20 @@ 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 +79,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 +94,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.32
|
||||
Version=3.36
|
||||
Name=Freedomain Video Uploader
|
||||
|
||||
Reference in New Issue
Block a user