13 Commits
3.32 ... 3.37

13 changed files with 221 additions and 431 deletions

View File

@@ -46,6 +46,8 @@ UStartTime := A_TickCount ; start time
#include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\StdOutToVar.ahk #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\Zip.ahk
#include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\URLDownloadToVar.ahk #include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\URLDownloadToVar.ahk
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Miscellaneous-Functions.ahk ; Misc functions for video uploading specifically
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\LBRY-Functions.ahk ; LBRY Specific Functions
;---Global Variables--- ;---Global Variables---
@@ -80,7 +82,6 @@ global ErrorLoggingFilePath
global ErrorLogVar global ErrorLogVar
ErrorLogVar := ErrorLogVar :=
global ReuseTabs ; reuse tabs variable
global DevMode global DevMode
global LBRYNetFilepath global LBRYNetFilepath
@@ -140,7 +141,6 @@ IniRead, MouseClicksSaved, %SettingsIniFilepath%, General, MouseClicksSaved, 0
IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1 IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1
(ShowTooltipProgress)?(ShowTooltipProgressCheckStatus := 1) : (ShowTooltipProgressCheckStatus := 0) (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 IniRead, AutoUpdateCheck, %SettingsIniFilepath%, General, AutoUpdateCheck, 1
(AutoUpdateCheck)?(AutoUpdateCheckCheckStatus := 1) : (AutoUpdateCheckCheckStatus := 0) (AutoUpdateCheck)?(AutoUpdateCheckCheckStatus := 1) : (AutoUpdateCheckCheckStatus := 0)
@@ -267,6 +267,12 @@ Loop, files, %VideoFolderDir%\*.*, F ; loop through the files in the director
OriginalVideoDescription := VideoDescription OriginalVideoDescription := VideoDescription
} }
if(FileNameWExt = "summary.txt"){
FileRead, VideoSummary, %A_LoopFileFullPath%
; DescriptionCharCount := StrLen(VideoDescription)
OriginalVideoSummary := VideoSummary
}
if(FileNameWExt = "keywords.txt"){ if(FileNameWExt = "keywords.txt"){
FileRead, VideoTags, %A_LoopFileFullPath% FileRead, VideoTags, %A_LoopFileFullPath%
FileRead, PodcastTags, %A_LoopFileFullPath% FileRead, PodcastTags, %A_LoopFileFullPath%
@@ -290,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 VideoThumbFilepath := A_LoopFileFullPath
} }
} }
@@ -342,8 +348,8 @@ Loop, files, %VideoFolderDir%\*.mp3, F ; loop through the files in the direct
VideoLinksIniFile = %VideoFolderDir%\VideoLinks.ini VideoLinksIniFile = %VideoFolderDir%\VideoLinks.ini
if(FileExist(VideoLinksIniFile)){ if(FileExist(VideoLinksIniFile)){
; IniRead, StreamanityURL, %VideoLinksIniFile%, URLs, StreamanityURL, %A_Space%
IniRead, BitChuteURL, %VideoLinksIniFile%, URLs, BitChuteURL, %A_Space% IniRead, BitChuteURL, %VideoLinksIniFile%, URLs, BitChuteURL, %A_Space%
; LBRY ; LBRY
IniRead, LBRYURLSlug, %VideoLinksIniFile%, Misc, LBRYURLSlug, %A_Space% IniRead, LBRYURLSlug, %VideoLinksIniFile%, Misc, LBRYURLSlug, %A_Space%
if(LBRYURLSlug = ""){ if(LBRYURLSlug = ""){
@@ -371,7 +377,9 @@ if(FileExist(VideoLinksIniFile)){
IniRead, DailyMotionURL, %VideoLinksIniFile%, URLs, DailyMotionURL, %A_Space% IniRead, DailyMotionURL, %VideoLinksIniFile%, URLs, DailyMotionURL, %A_Space%
IniRead, PodcastNumber, %VideoLinksIniFile%, Misc, PodcastNumber, %A_Space% IniRead, PodcastNumber, %VideoLinksIniFile%, Misc, PodcastNumber, %A_Space%
IniRead, LocalsURL, %VideoLinksIniFile%, URLs, LocalsURL, %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 ; MISC
IniRead, ErrorLoggingFilePath, %VideoLinksIniFile%, Misc, ErrorLoggingFilePath, %A_Space% IniRead, ErrorLoggingFilePath, %VideoLinksIniFile%, Misc, ErrorLoggingFilePath, %A_Space%
@@ -645,7 +653,7 @@ if(!status){
Status := DownloadLatestChromium() Status := DownloadLatestChromium()
if(Status) if(Status)
GuiControl,,ChromeUpdateAvailable, Chrome Up-to-Dat GuiControl,,ChromeUpdateAvailable, Chrome Up-to-Date
Return Return
@@ -735,7 +743,6 @@ if(VideoDescription != OriginalVideoDescription){
; -------------------------------/Save Video Info------------------------------- ; -------------------------------/Save Video Info-------------------------------
; Save settings to config file ; Save settings to config file
IniWrite, %ReuseTabs%, %SettingsIniFilepath%, General, ReuseTabs
IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, General, ShowTooltipProgress IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, General, ShowTooltipProgress
IniWrite, %AutoUpdateCheck%, %SettingsIniFilepath%, General, AutoUpdateCheck IniWrite, %AutoUpdateCheck%, %SettingsIniFilepath%, General, AutoUpdateCheck
IniWrite, %AutoLogin%, %SettingsIniFilepath%, General, AutoLogin IniWrite, %AutoLogin%, %SettingsIniFilepath%, General, AutoLogin
@@ -777,7 +784,7 @@ IniWrite, %VideoThumbFilepath%, %VideoLinksIniFile%, Misc, VideoThumbFilepath
; Log Basic info to the errorlogging file ; 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") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Message := "VideoTitle: " VideoTitle Message := "VideoTitle: " VideoTitle
@@ -801,6 +808,7 @@ SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
; Convert Video Title and Description into javascript formatting for sending to pages through js instead of plain selenium ; Convert Video Title and Description into javascript formatting for sending to pages through js instead of plain selenium
JSVideoTitle := FormatTextToJSText(VideoTitle) JSVideoTitle := FormatTextToJSText(VideoTitle)
JSVideoDescription := FormatTextToJSText(VideoDescription) JSVideoDescription := FormatTextToJSText(VideoDescription)
JSVideoSummary := FormatTextToJSText(VideoSummary)
; -------------------------------/Log Info To Text------------------------------- ; -------------------------------/Log Info To Text-------------------------------
@@ -1019,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 ; @todo: this can be converted into 1 gosub, with if/else statements based on the button clicked
CopyPodcastNumber: CopyPodcastTranscriptURL:
Clipboard := PodcastNumber Clipboard := PodcastTranscriptURL
SaveOrPostProgress(Message:=PodcastNumber "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile") Message := PodcastTranscriptURL . "`nCopied to Clipboard"
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000 sleep, 1000
ToolTip ToolTip
Return Return
@@ -1101,7 +1110,8 @@ Return
; @todo: Add thumbnail status to this ; @todo: Add thumbnail status to this
; @todo: add podcast tags to this ; @todo: add podcast tags to this
UpdateINI: UpdateINI:
IniWrite, %PodcastNumber%, %VideoLinksIniFile%, URLs, PodcastNumber IniWrite, %UnauthorizedTVURL%, %VideoLinksIniFile%, URLs, UnauthorizedTVURL
IniWrite, %PodcastTranscriptURL%, %VideoLinksIniFile%, URLs, PodcastTranscriptURL
IniWrite, %VideoTitle%, %VideoLinksIniFile%, Misc, VideoTitle IniWrite, %VideoTitle%, %VideoLinksIniFile%, Misc, VideoTitle
IniWrite, %LocalsURL%, %VideoLinksIniFile%, URLs, LocalsURL IniWrite, %LocalsURL%, %VideoLinksIniFile%, URLs, LocalsURL
IniWrite, %RumbleURL%, %VideoLinksIniFile%, URLs, RumbleURL IniWrite, %RumbleURL%, %VideoLinksIniFile%, URLs, RumbleURL
@@ -1195,6 +1205,7 @@ Return
;------------------------------------------------ ;------------------------------------------------
#Include %A_ScriptDir%\Modules\Podcast-Upload.ahk #Include %A_ScriptDir%\Modules\Podcast-Upload.ahk
; Miscellaneous-Functions
;------------------------------------------------ ; Update Functionality
#Include %A_ScriptDir%\Modules\Miscellaneous-Functions.ahk ; ------------------------------------------------
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Update-Functions.ahk

View File

@@ -124,11 +124,15 @@ Loop, 10 { ; Attempt to input video description a couple of times
Message = Inputting Tags Message = Inputting Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; Convert tags into #hasthtags ; Get first 3 tags from Video Tags array
Loop, 3 { 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) ; input Search Terms (Tags)
Xpath = //input[@placeholder='Search Terms'] Xpath = //input[@placeholder='Search Terms']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=BitchuteTags) 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") 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 ; Upload Thumbnail
Message = Attaching Thumbnail Message = Attaching Thumbnail

View File

@@ -8,7 +8,8 @@ Return
JSBrighteonVideoDescription := FormatTextToJSText(VideoDescription) JSBrighteonVideoDescription := FormatTextToJSText(VideoDescription)
; Msgbox % "JSBrighteonVideoDescription: " JSBrighteonVideoDescription
; descriptions longer than 5k characters just fail to get input so trim them to below 5000 characters ; descriptions longer than 5k characters just fail to get input so trim them to below 5000 characters
if(StrLen(VideoDescription) >= 5000){ if(StrLen(VideoDescription) >= 5000){
@@ -112,6 +113,10 @@ try driver.FindElementByXPath(Xpath).click()
CheckForAlerts() CheckForAlerts()
if(BrighteonUploadAttempt){
Sleep, 2000
}
Message = Uploading Video Message = Uploading Video
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Upload Video ; Upload Video
@@ -133,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 ; Input Title of the Video
Xpath = //input[@id='name'] Xpath = //input[@id='name']
try driver.FindElementByXPath(Xpath).SendKeys(VideoTitle) ;Sends Variable to an Xpath Item try driver.FindElementByXPath(Xpath).SendKeys(VideoTitle) ;Sends Variable to an Xpath Item
@@ -162,13 +186,24 @@ loop, 3 {
TooltipThis("Inputting Video Description") TooltipThis("Inputting Video Description")
; Attempt to input video description multiple time in case Brighteon rejects the input
; Attempt to input video description a couple of times
Loop, 10 { Loop, 10 {
if(A_index = 10){ if(A_index = 10){
Message = Failed to input Video Description after 10 attempts. Message = Failed to input Video Description after 10 attempts.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
if(!BrighteonUploadAttempt){
Message = Re-Trying Entire Upload
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
BrighteonUploadAttempt := 2
goto, BrighteonUpload
}
Message = Brighteon Upload Failed after 2 seperate individual attempts. Please try uploading manually and report any errors.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
} }
@@ -187,8 +222,8 @@ Loop, 10 {
sleep, 5000 sleep, 5000
; get text that was input into description box
js = return document.querySelector("div[class='e-content e-lib e-keyboard'] p").innerText; js = return document.querySelector("#richtexteditor_747903514_0rte-view").innerText;
try Input_Description := driver.executeScript(JS) ;Execute Javascript try Input_Description := driver.executeScript(JS) ;Execute Javascript
Input_DescriptionStrLen := StrLen(Input_Description) Input_DescriptionStrLen := StrLen(Input_Description)
@@ -218,9 +253,9 @@ if(VideoThumbFilepath != "") {
; Brighteon has a max of 25 for tags. ; Brighteon has a max of 25 for tags.
if(VideoTagsArray.Length() > 25){ if(ArrayOfVideoTags.Length() > 25){
Loop % 24 { Loop % 24 {
BrighteonKeywords := VideoTagsArray[A_Index] BrighteonKeywords := ArrayOfVideoTags[A_Index]
} }
} }
else, else,

View File

@@ -30,7 +30,7 @@ EditBoxFourthWidths := (EditBoxWidths / 4) - (MarginSpace - 2)
VideoTagsTextXPos := EditBoxHalfWidths + (MarginSpace * 2) VideoTagsTextXPos := EditBoxHalfWidths + (MarginSpace * 2)
; EditBoxHalfWidthsWithMargin := (EditBoxWidths / 2) ; EditBoxHalfWidthsWithMargin := (EditBoxWidths / 2)
DescriptionCharCountXPos := EditBoxWidths - 40 DescriptionCharCountXPos := EditBoxHalfWidths - 40
PageTwoXStartPos := EditBoxWidths + 50 PageTwoXStartPos := EditBoxWidths + 50
@@ -114,36 +114,30 @@ Gui, Font, Normal
Gui, Add, Edit, x%Marginspace% Y+5 w%EditBoxHalfWidths% h%EditBoxHeight% gUpdateVars vVideoTags, %VideoTags% Gui, Add, Edit, x%Marginspace% Y+5 w%EditBoxHalfWidths% h%EditBoxHeight% gUpdateVars vVideoTags, %VideoTags%
Gui, Add, Edit, yp+0 x+%Marginspace% w%EditBoxHalfWidths% h%EditBoxHeight% gUpdateVars vPodcastTags, %PodcastTags% Gui, Add, Edit, yp+0 x+%Marginspace% w%EditBoxHalfWidths% h%EditBoxHeight% gUpdateVars vPodcastTags, %PodcastTags%
; Description/Summary Headers
; Video Description
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Text,y+%Marginspace% x%Marginspace%,Description
if(NoOriginalVideoDescription) Gui, Add, Text,yp+0 x%ColumnOneHalfWidthXPos%,Summary
Gui, Add, Text,cRed y+%Marginspace% x%Marginspace%,Video Description
else, Gui, Font, Normal
Gui, Add, Text,y+%Marginspace% x%Marginspace%,Video Description: ; Video Description edit box
Gui, Add, Edit,x%Marginspace% y+5 w%EditBoxHalfWidths% h%VideoDescriptionEditBoxHeight% vVideoDescription gSubmitDescription,%VideoDescription%
; Video Summary Edit Box
if(TestingMode) Gui, Add, Edit,x%ColumnOneHalfWidthXPos% yp+0 w%EditBoxHalfWidths% h%VideoDescriptionEditBoxHeight% vVideoSummary gUpdateVars,%VideoSummary%
Gui, Add, Text,cRed yp+0 xp+150 ,TESTING MODE
if(DevMode)
Gui, Add, Text,cRed yp+0 xp+150 ,DEV MODE
Gui, Font, Normal Gui, Font, Normal
Gui, Add, Edit,x%Marginspace% y+2 w%EditBoxWidths% h%VideoDescriptionEditBoxHeight% vVideoDescription gSubmitDescription,%VideoDescription%
gui, font, s8 gui, font, s8
Gui, font, Bold Gui, Add, Edit, x%Marginspace% y+5 vDescriptionCharCount, %DescriptionCharCount%
if(DescriptionCharCount > 3000){ Gui, Add,Text, yp+4 x+%MarginSpace%,Limits: DM+Bitchute = 3K, Odysee, Brighteon = 5K
Gui, Add, Edit,cRed w50 h20 x%DescriptionCharCountXPos% y+1 vDescriptionCharCount, %DescriptionCharCount% ; Gui, font, Bold
}
else,
Gui, Add, Edit, w50 h20 x%DescriptionCharCountXPos% y+1 vDescriptionCharCount, %DescriptionCharCount%
Gui, Font, Normal
Gui, Add,Text, yp+3 xp-310, (Platform Char. Limits: DM+Bitchute = 3K, Odysee,Brighteon = 5K)
Gui, Font, s%GuiFontSize% Gui, Font, s%GuiFontSize%
Gui, font, Bold Gui, font, Bold
Gui, Add, GroupBox,r8.5 x%MarginSpace% yp+10 w%EditBoxWidths% Center, Filepaths
Gui, Add, GroupBox,r8.5 x%MarginSpace% y+10 w%EditBoxWidths% Center, Filepaths
; Video Filepath ; Video Filepath
Gui, Font, Bold Gui, Font, Bold
@@ -259,7 +253,7 @@ Gui, Font, Bold
; Settings Section ; Settings Section
Gui, Add, GroupBox,r5 y+0 x%PageTwoXStartPos% w%PageTwoGroupBoxWidth%,Settings 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, 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, vKillLBRYAfterUpload Checked%KillLBRYAfterUploadCheckStatus%, Kill LBRY After Uploading
Gui, Add, Checkbox, vAutoLogin gUpdateVars Checked%AutoLoginCheckStatus%, Try to Login Automatically Gui, Add, Checkbox, vAutoLogin gUpdateVars Checked%AutoLoginCheckStatus%, Try to Login Automatically
Gui, Add, Checkbox, vPingOnCompletion gUpdateVars Checked%PingOnCompletionCheckStatus%, Discord Ping Upon Completion Gui, Add, Checkbox, vPingOnCompletion gUpdateVars Checked%PingOnCompletionCheckStatus%, Discord Ping Upon Completion
@@ -292,9 +286,6 @@ else, {
Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vOdyseeVideo Checked%OdyseeVideoCheckStatus% gUpdateVars, Odysee Video Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vOdyseeVideo Checked%OdyseeVideoCheckStatus% gUpdateVars, Odysee Video
if(VideoFileSizeInMB < 50)
Gui, Add, Checkbox, vTelegram x+%MarginSpaceTripled% yp+0 Checked%TelegramCheckStatus% gUpdateVars, Telegram (>50 MB)
; Gui, Add, Checkbox, x+%MarginSpace% vOdyseeVideoThumb Checked%OdyseeVideoThumbCheckStatus%,Thumbnail ; Gui, Add, Checkbox, x+%MarginSpace% vOdyseeVideoThumb Checked%OdyseeVideoThumbCheckStatus%,Thumbnail
Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vOdyseeAudio Checked%OdyseeAudioCheckStatus% gUpdateVars, Odysee Audio Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vOdyseeAudio Checked%OdyseeAudioCheckStatus% gUpdateVars, Odysee Audio
@@ -334,4 +325,19 @@ Gui, Show,, %FullScriptName% - Upload Settings - %BodyTextFilePath%
ControlFocus, Edit4, %FullScriptName% ControlFocus, Edit4, %FullScriptName%
ToolTip ToolTip
Return
; calculate run time and convert to seconds
URunTime1 := round(((A_TickCount - UStartTime) / 1000), 2)
;---Check for Updates---
;------------------------------------------------
if(AutoUpdateCheck AND !UpdateAvailable){
SetTimer, CheckForUpdates, -1000
}
; calculate run time and convert to seconds
URunTime2 := round(((A_TickCount - UStartTime) / 1000), 2)
Return

View File

@@ -1,10 +1,9 @@
Gui, Font, s%GuiFontSize% Gui, Font, s%GuiFontSize%
Gui, Font, Bold Gui, Font, Bold
; Gui, Add, Text,x10 y+10, Podcast #: Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyPodcastTranscriptURL,Transcript URL
Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyPodcastNumber, Podcast #
Gui, Font, Normal 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, Font, Bold
Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyBitChuteURL, Bitchute 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, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vLocalsURL w%ResultEditBoxWidths% gUpdateVars, %LocalsURL% 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, Font, Bold
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyVideoTags vVideoTagsEdit, Video Tags Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyVideoTags vVideoTagsEdit, Video Tags
Gui, Font, Normal Gui, Font, Normal
@@ -60,7 +64,7 @@ Gui, Font, s%GuiFontSize%
Gui, Font, Bold Gui, Font, Bold
Gui, Add, Button, x%ResultEditBoxXPos% w%ResultEditBoxHalfWidths% gUpdateINI, Save Modified Links 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%ResultEditBoxXPos% y+%MarginSpace% w%ResultEditBoxThirdsWidths% gPostToDiscord vPostToDiscordButton, Post to Discord
Gui, Add, Button, x+5 w%ResultEditBoxThirdsWidths% gPostToTelegram vPostToTelegramButton, Post to Telegram Gui, Add, Button, x+5 w%ResultEditBoxThirdsWidths% gPostToTelegram vPostToTelegramButton, Post to Telegram

View File

@@ -1,271 +0,0 @@
; -------------------------------Functions-------------------------------
OnMsgBoxConfirmChromiumOverwrite() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
ControlSetText Button1, Cancel
ControlSetText Button2, Yes
}
}
; 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
if(ErrorLevel = 0) ; if doesn't exist
{
Message = Not Running. Starting up LBRY.exe
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
LBRYExeFilepath = C:\Program Files\LBRY\LBRY.exe
if(!FileExist(LBRYExeFilepath)){
Message = Failed to Find LBRY.exe executable. LBRY not installed?
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Message = Checking LBRY daemon_settings.yml file for Odysee Wallet Servers
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile,DiscordErrorLogging")
FileRead, daemon_settingsFileContent, C:\Users\%A_UserName%\AppData\Local\lbry\lbrynet\daemon_settings.yml
if(!InStr(daemon_settingsFileContent, "a-hub1.odysee.com")){
Message = Odysee wallet server is not in daemon_settings.yml. Replacing File with required settings.
SaveOrPostProgress(Message:=Message,PostType:=",DiscordErrorLogging")
LBRYDaemonSettingsFP = C:\Users\%A_UserName%\AppData\Local\lbry\lbrynet\daemon_settings.yml
LBRYDaemonSettingsBackupFP = C:\Users\%A_UserName%\AppData\Local\lbry\lbrynet\daemon_settings_BU.yml
; Msgbox % "daemon_settingsText: " daemon_settingsText
FileMove, %LBRYDaemonSettingsFP%, %LBRYDaemonSettingsBackupFP%, 1 ; Dest [, Flag (1 = overwrite)]
UrlDownloadToFile, https://freedomain.dev/yuriy/video-uploader/raw/branch/main/Assets/daemon_settings.yml , %LBRYDaemonSettingsFP%
sleep, 1000
if(!FileExist(LBRYDaemonSettingsFP)){
Message = Failed to download the custom daemon_settings.yml file from git. Restoring Original File
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile,DiscordErrorLogging")
FileMove,%LBRYDaemonSettingsBackupFP%,%LBRYDaemonSettingsFP%, 1
}
}
try run, "%LBRYExeFilepath%"
Message = Waiting 1 Minute for LBRY to start up
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
Sleep, 60000 ; 1 minute
Process, Exist,LBRY.exe
if(ErrorLevel = 0) ; if doesn't exist
{
Message = Failed to Start LBRY.exe after 60 seconds of waiting
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
WinMinimize, LBRY
}
Return
}
GetPermanentLBRYURL(UploadResult){
SingleQuotationmark = "
UploadResult := StrSplit(UploadResult, "`n") ; split results by new line
; Iterate through the array of the results
Loop % UploadResult.Length() {
PermanentURL := UploadResult[A_Index]
if(InStr(PermanentURL, "permanent_url"))
Break
}
; Starting Result: "permanent_url": "lbry://Test-Video-161-Numbered#c9ad9afe54c7178d6f870b59bbe129aef8efc3ff",
PermanentURL := StrSplit(PermanentURL, "lbry:")
PermanentURL := "lbry:" . PermanentURL[2]
PermanentURL := StrReplace(PermanentURL, ",", "")
PermanentURL := StrReplace(PermanentURL, SingleQuotationmark, "")
PermanentURL := StrReplace(PermanentURL, "`n", "")
PermanentURL := StrReplace(PermanentURL, "`r", "")
; End Result lbry://Test-Video-161-Numbered#c9ad9afe54c7178d6f870b59bbe129aef8efc3ff
Return PermanentURL
}
GetLBRYCanonicalURL(LBRYJSONObject){ ; input json string
; ResolveURL := StrSplit(LBRYResolveAPICommand, "lbry://")
; ResolveURL := "lbry://" . ResolveURL[2]
; StrReplace(Haystack, SearchText [, ReplaceText, OutputVarCount, Limit := -1])
LBRYPermanentURLJsonOBJ := StrReplace(LBRYJSONObject, LBRYPermanentURL, "LBRYPermanentURL")
; clipboard := LBRYPermanentURLJsonOBJ
; DevModeMsgBox(LBRYPermanentURLJsonOBJ)
try parsed := JSON.Load(LBRYPermanentURLJsonOBJ)
try LBRYCanonicalURL := parsed.LBRYPermanentURL.canonical_url
; DevModeMsgBox(LBRYCanonicalURL)
if(LBRYCanonicalURL = ""){
Return "" ; return blank
}
; otherwise return the LBRY url
LBRYCanonicalURL := StrReplace(LBRYCanonicalURL, "lbry://", "https://lbry.tv/")
Return LBRYCanonicalURL
}
LBRYCMDTextReplacement(LBRYURLSlug){
SingleQUote = "
LBRYURLSlug := StrReplace(LBRYURLSlug, " ", "_") ; replace all spaces with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, ":", "_") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, ",", "_") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "?", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "!", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "`;", "_") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "/", "_") ; replace all colons with dashes
; LBRYURLSlug := StrReplace(LBRYURLSlug, "?", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "<", "_") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, ">", "_") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, SingleQUote, "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "'", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "=", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, ";", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, ")", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "(", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "___", "_") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "__", "_") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "__", "_") ; replace all colons with dashes
Return LBRYURLSlug
}
GetLBRYAPIErrorFromString(UploadResult){
UploadResultArray := StrSplit(UploadResult, "message")
LBRYAPIError := UploadResultArray[2]
; LBRYAPIErrorStrLen := StrLen(LBRYAPIError)
; LBRYAPIErrorStrToTrim := LBRYAPIErrorStrLen - 3
; Msgbox % "LBRYAPIErrorStrToTrim: " LBRYAPIErrorStrToTrim
LBRYAPIError := SubStr(LBRYAPIError, 4)
LBRYAPIError := StrReplace(LBRYAPIError, "}", "")
; Msgbox % "LBRYAPIError: " LBRYAPIError
Return LBRYAPIError
}
LogErrorToTextFile(Error){
/* if(LogErrorsToTextFile != 1)
Return
*/
ErrorLoggingFile := VideoFolderDir . "\" . "ErrorLogging.txt"
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
text =
(
---------------%TodayDate%---------------
%CurrentSite%: %Error%
)
if(LogErrorsToMsgbox)
Msgbox % "Text: " Text
FileAppend, %Text%, %ErrorLoggingFile%
} ; End of Function
/*
*/
AddToTotalVideosUploadedCount(){
; IniRead, TotalVideosUploaded, %SettingsIniFilepath%, General, TotalVideosUploaded, %A_Space%
TotalVideosUploaded += 1
; IniWrite, %TotalVideosUploaded%, %SettingsIniFilepath%, General, TotalVideosUploaded
}
OnMsgBoxPodcastFinish() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
WinMove,, 0
}
}
OnMsgBoxSocialMediaPoster() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
ControlSetText Button1, Yes
ControlSetText Button2, Not Now
}
}
Check_For_Stuck_Video_Upload(Index_Number, Upload_Status){
if(A_index = 1){ ; Create a blank array
ProgressStatusArray := []
Return
}
Message = Upload Status: %Upload_Status%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
; if we reached the last loop number:
if(A_index = %Number_of_loops_to_Check_Upload_status%){
Message = Upload Most Likely Failed: Video Hasn't Finished Uploading after 1 hour.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return "Failed"
}
; If progress is still the same after a ten minute interval then error out
if(HasVal(Array_Index_Num_of_Upload_StatusChecks, A_index)){ ; if current index is in Array of index numbers to check status during
; Send a notification message of upload status
Message = Upload Status: %Upload_Status%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; if current upload_status is in the array of values that are updated every 10 mins
if(HasVal(ProgressStatusArray, Upload_Status)){
Message = Upload Failed (E#4508)`nUpload Stuck at same point for 10 minutes. Stuck Status: %ProgressStatus%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return "Failed"
}
ProgressStatusArray.Push(Upload_Status) ; append current status to array
}
} ; end of func
; Find the longest word in a string of words
FindLongestWordInString(m, calloutNumber, pos, haystack, pattern){
Global wordLength, longestWord
len := StrLen(m)
If ( len > wordLength )
{
wordLength := len
longestWord := m
; MsgBox, %m%
}
}

View File

@@ -216,6 +216,9 @@ Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength
Xpath = //input[@id='url-rumble'] Xpath = //input[@id='url-rumble']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=RumbleURL) 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 ; Soundcloud but actually LBRY Audio URL
Xpath = //input[@id='url-lbry-audio'] Xpath = //input[@id='url-lbry-audio']
@@ -248,8 +251,12 @@ Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000
JSVideoDescription := FormatTextToJSText(VideoDescription) JSVideoDescription := FormatTextToJSText(VideoDescription)
js = document.getElementById('description').value = "%JSVideoDescription%"; js = document.getElementById('description').value = "%JSVideoDescription%";
try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons. try driver.executeScript(js)
if(VideoSummary){
js = document.getElementById('summary').value = "%JSVideoSummary%";
try driver.executeScript(js)
}
Message = Inputting Tags Message = Inputting Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@@ -321,6 +328,9 @@ Sublime Indentation Reset
Message = Input Complete! `nPlease Confirm and click Final "Save" Button on Podcast Page Message = Input Complete! `nPlease Confirm and click Final "Save" Button on Podcast Page
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Change GUI button from "Upload Podcast"
GuiControl,,UploadPodcast, Podcast Uploaded
sleep, 5000 sleep, 5000
CurrentSite := CurrentSite :=

View File

@@ -25,13 +25,10 @@ if(SocialMediaDescription = ""){
CreateDescriptionForSocialMedia() CreateDescriptionForSocialMedia()
} }
; Msgbox % "SocialMediaDescription: " SocialMediaDescription
SubmitDescriptionForDiscordVideosChannel: SubmitDescriptionForDiscordVideosChannel:
Message := "**" . VideoTitle . "**" . "`n" . SocialMediaDescription . "`n" Message := "**" . VideoTitle . "**" . "`n" . SocialMediaDescription . "`n"
; https://stackoverflow.com/questions/63160401/how-to-create-hyperlink-in-discord-in-an-embed-in-general ; https://stackoverflow.com/questions/63160401/how-to-create-hyperlink-in-discord-in-an-embed-in-general
; Do this with an array!!
;
if(BitChuteURL != "") if(BitChuteURL != "")
Message .= "[BitChute](<" . BitChuteURL . ">) \| " Message .= "[BitChute](<" . BitChuteURL . ">) \| "
@@ -44,23 +41,18 @@ Message .= "[Odysee](<" . OdyseeVideoURL . ">) \| "
if(OdyseeAudioURL != "") if(OdyseeAudioURL != "")
Message .= "[Odysee (Audio)](<" . OdyseeAudioURL . ">) \| " Message .= "[Odysee (Audio)](<" . OdyseeAudioURL . ">) \| "
/*
if(OdyseeVideoURL != "")
Message .= "[Odysee](<" . OdyseeVideoURL . ") \| "
if(OdyseeAudioURL != "")
Message .= "[Odysee Audio](<" . OdyseeAudioURL . ") \| "
*/
if(RumbleURL != "") if(RumbleURL != "")
Message .= "[Rumble](<" . RumbleURL . ">) \| " Message .= "[Rumble](<" . RumbleURL . ">) \| "
/*if(StreamanityURL != "" AND InStr(StreamanityURL, "streamanity.com"))
Message .= "[Streamanity](<" . StreamanityURL . ">) \| "
*/
if(DailyMotionURL != "") 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) UploadImageToDiscord(DiscordVideosWebhookURL, Message, VideoThumbFilepath)

View File

@@ -56,24 +56,20 @@ VideoLinks .= "[Odysee](" . OdyseeVideoURL . ") \| "
if(OdyseeAudioURL != "") if(OdyseeAudioURL != "")
VideoLinks .= "[Odysee \(Audio\)](" . OdyseeAudioURL . ") \| " VideoLinks .= "[Odysee \(Audio\)](" . OdyseeAudioURL . ") \| "
/*
if(OdyseeVideoURL != "")
VideoLinks .= "[Odysee](" . OdyseeVideoURL . ") \| "
if(OdyseeAudioURL != "")
VideoLinks .= "[Odysee Audio](" . OdyseeAudioURL . ") \| "
*/
if(RumbleURL != "") if(RumbleURL != "")
VideoLinks .= "[Rumble](" . RumbleURL . ") \| " VideoLinks .= "[Rumble](" . RumbleURL . ") \| "
/*
if(InStr(StreamanityURL, "https://streamanity.com/video/"))
VideoLinks .= "[Streamanity](" . StreamanityURL . ") \| "
*/
if(DailyMotionURL != "") if(DailyMotionURL != "")
VideoLinks .= "[DailyMotion](" . DailyMotionURL . ") \| " VideoLinks .= "[DailyMotion](" . DailyMotionURL . ") \| "
/*if(PodcastTranscriptURL != "")
VideoLinks .= "[Video Transcript](" . PodcastTranscriptURL . ") \| "
*/
if(PodcastNumber != "")
VideoLinks .= "[FDRPodcasts](" . "https://fdrpodcasts.com/" . PodcastNumber . ") \| "
TelegramMessage := TelegramVideoTitle . "`n" . TelegramBodymessage . "`n" . VideoLinks TelegramMessage := TelegramVideoTitle . "`n" . TelegramBodymessage . "`n" . VideoLinks
@@ -83,86 +79,73 @@ StrLenOfMessageAndVideoLinks := StrLen(TelegramVideoTitle) + StrLen(TelegramBody
; DevModeMsgBox(StrLenOfMessageAndVideoLinks) ; DevModeMsgBox(StrLenOfMessageAndVideoLinks)
if(StrLenOfMessageAndVideoLinks > 1024){ ; If Length of Title, Video Links and Message is less than 1024 characters:
; Telegram SendMessage is limited to 4096 characters ; ------------------------------------------------
if(StrLenOfMessageAndVideoLinks < 4096){ ; split into sendphoto and 1 sendmessage if(StrLenOfMessageAndVideoLinks < 1024) {
; DevModeMsgBox("Less than 4096 chars") Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramMessage ) ; you could add more options; compare the Telegram API docs
; Photo and Video Title go into SendPhoto if(InStr(Status, "error_code")){
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks Message = Telegram Post Failed due to an API Issue. Error was saved to ErrorLogging file. Please send it to Yuriy.
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
; Video Description goes into TelegramMessage
Status2 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessage)
} ; split into 2 SendMessages ; SaveOrPostProgress(Message:=Status,PostType:=",ErrorLoggingTextFile")
else if (StrLenOfMessageAndVideoLinks > 4096 AND StrLenOfMessageAndVideoLinks < 8192){ ; Split into 2 parts Message = Telegram Error: %Status%
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
TelegramBodymessagePiece := SubStr(TelegramBodymessage, 1, 4096) ToolTip
Status2 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece) Return
}
}
TelegramBodymessagePiece := SubStr(TelegramBodymessage, 4097, 8192)
Status3 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece)
} ; split into 3 sendMessages ; If Title, Links and Message are longer than 1024, but less than 4096, split into 2 pieces: sendphoto and sendmessage
else if (StrLenOfMessageAndVideoLinks > 8192 AND StrLenOfMessageAndVideoLinks < 12288){ ; Split into 3 parts ; ------------------------------------------------
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks if(StrLenOfMessageAndVideoLinks < 4096){
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
TelegramBodymessagePiece := SubStr(TelegramBodymessage, 1, 4096) ; Photo and Video Title go into SendPhoto
msgbox % StrLen(TelegramBodymessagePiece) TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
Status2 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece) 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
; 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)
; 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
}
TelegramBodymessagePiece := SubStr(TelegramBodymessage, 4097, 8192) }
msgbox % StrLen(TelegramBodymessagePiece)
DevModeMsgBox(TelegramBodymessagePiece)
Status3 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece)
; TelegramBodymessagePiece := SubStr(TelegramBodymessage, 8193, 12288) ; SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile")
; Status3 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece) Message = Video Links Posted to Telegram Successfully
} SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
GuiControl,, PostToTelegramButton, Telegram - Posted Successfully
} else, { ; if less than 1024 characters, send normally ; sleep, 2000
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.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Status,PostType:=",ErrorLoggingTextFile")
Message = Telegram Error: %Status%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
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") ToolTip
CurrentSite :=
; SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile") Return
Message = Video Links Posted to Telegram Successfully ; -------------------------------/Telegram-------------------------------
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
GuiControl,, PostToTelegramButton, Telegram - Posted Successfully
; sleep, 2000
ToolTip
CurrentSite :=
Return
; -------------------------------/Telegram-------------------------------

0
New Text File.txt Normal file
View File

View File

@@ -71,6 +71,15 @@ You can select a different file in the main window if the auto selection does no
`*.jpg` or `*.png` file which will be the thumbnail for your video/podcast<br> `*.jpg` or `*.png` file which will be the thumbnail for your video/podcast<br>
# LBRY Desktop Application `daemon_settings.yml`
Due to LBRY being discontinued, the default daemon_settings that come with the LBRY Desktop application might no longer work for you due to the servers being offline.
To fix this, add the Odysee server to the top of the list of `lbryum_servers` in the following file: `C:\Users\YOURUSERNAMEHERE\AppData\Local\lbry\lbrynet\daemon_settings.yml`
```
lbryum_servers:
- a-hub1.odysee.com:50001
- spv11.lbry.com:50001
- spv19.lbry.com:50001
```
# Uncaught Errors # Uncaught Errors

View File

@@ -1,3 +1,3 @@
[Video-Uploader] [Video-Uploader]
Version=3.31 Version=3.36
Name=Freedomain Video Uploader Name=Freedomain Video Uploader