Compare commits
7 Commits
3.5
...
b1a7fb3326
| Author | SHA1 | Date | |
|---|---|---|---|
| b1a7fb3326 | |||
|
e04a6b8d11
|
|||
| 199fbc1b78 | |||
| 9c52c6ec8d | |||
| 959a81bf98 | |||
| ce9f8a9885 | |||
| 71c4093bd9 |
@@ -25,7 +25,7 @@ VersionIniFP = %A_ScriptDir%\Version.ini
|
|||||||
|
|
||||||
; Generate a new errorlog text file each run
|
; Generate a new errorlog text file each run
|
||||||
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
|
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
|
||||||
ErrorLogTextFile = %A_ScriptDir%\Lib\ErrorLogging\Compiler_%TodayDate%.txt
|
ErrorLogFilepath = %A_ScriptDir%\Lib\ErrorLogging\Compiler_%TodayDate%.txt
|
||||||
|
|
||||||
|
|
||||||
; Read Credential token from Windows Credential Manager using WindowCredentialManager.ahk
|
; Read Credential token from Windows Credential Manager using WindowCredentialManager.ahk
|
||||||
@@ -83,7 +83,7 @@ if(!FileExist(icopath)){
|
|||||||
; run, %comspec% /c ""C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%""
|
; run, %comspec% /c ""C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%""
|
||||||
Command = "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%"
|
Command = "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%"
|
||||||
Results := RunCMD(Command)
|
Results := RunCMD(Command)
|
||||||
LogToErrorLogFile(Results, ErrorLogTextFile)
|
LogToErrorLogFile(Results, ErrorLogFilepath)
|
||||||
|
|
||||||
if(!InStr(Results, "Successfully")){
|
if(!InStr(Results, "Successfully")){
|
||||||
Msgbox, Error, Compilation failed with the following error:`n`n%Results%
|
Msgbox, Error, Compilation failed with the following error:`n`n%Results%
|
||||||
@@ -104,10 +104,11 @@ ReleaseTag := VersionNumber
|
|||||||
Command = Powershell "%CreateReleasePS1Filepath%" "%CreateReleaseAPIURL%" "%ReleaseName%" "%ReleaseTag%" "'%ReleaseBody%'"
|
Command = Powershell "%CreateReleasePS1Filepath%" "%CreateReleaseAPIURL%" "%ReleaseName%" "%ReleaseTag%" "'%ReleaseBody%'"
|
||||||
|
|
||||||
Message = PowerShell Command to Create Release:`n%Command%
|
Message = PowerShell Command to Create Release:`n%Command%
|
||||||
LogToErrorLogFile(Message, ErrorLogTextFile)
|
LogToErrorLogFile(Message, ErrorLogFilepath)
|
||||||
|
|
||||||
Results := RunCMD(Command)
|
Results := RunCMD(Command)
|
||||||
LogToErrorLogFile(Results, ErrorLogTextFile)
|
Message = API Returned:`n%Results%
|
||||||
|
LogToErrorLogFile(Message, ErrorLogFilepath)
|
||||||
|
|
||||||
|
|
||||||
; Pull out the release ID Number, needed for attaching a file to the release
|
; Pull out the release ID Number, needed for attaching a file to the release
|
||||||
@@ -116,8 +117,15 @@ SplitText2 = `;
|
|||||||
ReleaseID := StrSplit(Results, SplitText)[2]
|
ReleaseID := StrSplit(Results, SplitText)[2]
|
||||||
ReleaseID := StrSplit(ReleaseID, SplitText2)[1]
|
ReleaseID := StrSplit(ReleaseID, SplitText2)[1]
|
||||||
|
|
||||||
|
if(ReleaseID = ""){
|
||||||
|
Message = Failed to Grab Release ID`nPlease See Errorlog for Details:`n%ErrorLogFilepath%
|
||||||
|
LogToErrorLogFile(Message, ErrorLogFilepath)
|
||||||
|
Msgbox, %Message%
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
Message = ReleaseID: %ReleaseID%
|
Message = ReleaseID: %ReleaseID%
|
||||||
LogToErrorLogFile(Message, ErrorLogTextFile)
|
LogToErrorLogFile(Message, ErrorLogFilepath)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -129,10 +137,11 @@ AttachAssetToReleaseAPIURL = %AttachAssetToReleaseAPIURL%/%ReleaseID%/assets
|
|||||||
|
|
||||||
; Strings with spaces in them need to be surrounted by a single quote and double quote, eg: "'spaced string'"
|
; Strings with spaces in them need to be surrounted by a single quote and double quote, eg: "'spaced string'"
|
||||||
Command = Powershell "%AttachAssetToReleasePS1Filepath%" "%AttachAssetToReleaseAPIURL%" "%GiteaToken%" "'%ExeProgramName%'" "'%Exefilepath%'"
|
Command = Powershell "%AttachAssetToReleasePS1Filepath%" "%AttachAssetToReleaseAPIURL%" "%GiteaToken%" "'%ExeProgramName%'" "'%Exefilepath%'"
|
||||||
LogToErrorLogFile(Command, ErrorLogTextFile)
|
LogToErrorLogFile(Command, ErrorLogFilepath)
|
||||||
|
|
||||||
Results := RunCMD(Command)
|
Results := RunCMD(Command)
|
||||||
LogToErrorLogFile(Results, ErrorLogTextFile)
|
Message = API Returned: %Results%
|
||||||
|
LogToErrorLogFile(Message, ErrorLogFilepath)
|
||||||
|
|
||||||
|
|
||||||
ExitApp
|
ExitApp
|
||||||
@@ -151,5 +160,5 @@ ExitApp
|
|||||||
|
|
||||||
;---FUNCTIONS-----------------------------------------------------------------------
|
;---FUNCTIONS-----------------------------------------------------------------------
|
||||||
LogToErrorLogFile(Text, TextFileFilepath){
|
LogToErrorLogFile(Text, TextFileFilepath){
|
||||||
FileAppend, %Text%`n, %TextFileFilepath%
|
FileAppend, `n%Text%`n, %TextFileFilepath%
|
||||||
}
|
}
|
||||||
@@ -221,7 +221,7 @@ if(InStr(PassedInArgument1_Filepath,ScriptName) and InStr(PassedInArgument1_File
|
|||||||
; move old version to backups folder, overwrite if name conflict
|
; move old version to backups folder, overwrite if name conflict
|
||||||
FileDelete, %PassedInArgument1_Filepath%
|
FileDelete, %PassedInArgument1_Filepath%
|
||||||
if(ErrorLevel){ ; most likely because the old version hasn't finished exiting yet
|
if(ErrorLevel){ ; most likely because the old version hasn't finished exiting yet
|
||||||
SaveOrPostProgress(Message:="Moving Old Version to Backups",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar")
|
SaveOrPostProgress(Message:="Failed to Delete Old Program Version",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar")
|
||||||
sleep, 2000
|
sleep, 2000
|
||||||
FileDelete, %PassedInArgument1_Filepath%
|
FileDelete, %PassedInArgument1_Filepath%
|
||||||
if(ErrorLevel){
|
if(ErrorLevel){
|
||||||
@@ -403,10 +403,10 @@ if(FileExist(VideoLinksIniFile)){
|
|||||||
; Misc Info
|
; Misc Info
|
||||||
; ------------------------------------------------
|
; ------------------------------------------------
|
||||||
IniRead, ErrorLoggingFilePath, %VideoLinksIniFile%, Misc, ErrorLoggingFilePath, %A_Space%
|
IniRead, ErrorLoggingFilePath, %VideoLinksIniFile%, Misc, ErrorLoggingFilePath, %A_Space%
|
||||||
; Double check that the file/directory exists and create if not
|
|
||||||
SplitPath, ErrorLoggingFilePath,, ErrorLogDir
|
; Double check that the file still exists on the system. if set var to blank so new file can be generated
|
||||||
if(!FileExist(ErrorLogDir)){
|
if(!FileExist(ErrorLoggingFilePath)){
|
||||||
FileCreateDir, %ErrorLogDir%
|
ErrorLoggingFilePath :=
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -615,6 +615,13 @@ UpdateScript()
|
|||||||
; @todo: Save any changes made to the script before installing update
|
; @todo: Save any changes made to the script before installing update
|
||||||
Return
|
Return
|
||||||
|
|
||||||
|
|
||||||
|
PostToDiscordAndTelegram:
|
||||||
|
gosub, PostToDiscord
|
||||||
|
gosub, PostToTelegram
|
||||||
|
Return
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
Submodule Lib/Freedomain-Posters-Shared-Functions updated: 670b97d6b1...95bda715cb
@@ -461,8 +461,8 @@ Gui, Add, Button, x+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButto
|
|||||||
Gui, Add, Button, x+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gRetryUpload, Try Failed Again
|
Gui, Add, Button, x+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gRetryUpload, Try Failed Again
|
||||||
|
|
||||||
|
|
||||||
Gui, Add, Button, x%MarginSize% y+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gPostToDiscord vPostToDiscordButton, Post to Discord
|
Gui, Add, Button, x%MarginSize% y+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gPostToDiscordAndTelegram vPostToDiscordTelegramButton, Post to Discord/Telegram
|
||||||
Gui, Add, Button, x+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gPostToTelegram vPostToTelegramButton, Post to Telegram
|
; Gui, Add, Button, x+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gPostToTelegram vPostToTelegramButton, Post to Telegram
|
||||||
Gui, Add, Button, x+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gStartSocialMediaPoster, Start Social Media Poster
|
Gui, Add, Button, x+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gStartSocialMediaPoster, Start Social Media Poster
|
||||||
|
|
||||||
; Row 3
|
; Row 3
|
||||||
|
|||||||
@@ -122,10 +122,13 @@ if(Status){
|
|||||||
|
|
||||||
; make sure the "Notify Users" checkbox is selected
|
; make sure the "Notify Users" checkbox is selected
|
||||||
Xpath = (//input[contains(@name,'is_do_promo')])[1]
|
Xpath = (//input[contains(@name,'is_do_promo')])[1]
|
||||||
|
ClickXpath = //input[@name='is_do_promo']//parent::*
|
||||||
|
|
||||||
try, Status := driver.findelementbyxpath(Xpath).isSelected()
|
try, Status := driver.findelementbyxpath(Xpath).isSelected()
|
||||||
if(Status = 0){
|
if(Status = 0){
|
||||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=1000)
|
Status := Selenium_LoopToClickXpath(Xpath:=ClickXpath,NumOfLoops:=1,SleepLength:=1000)
|
||||||
|
|
||||||
|
; Check Again if the checkbox is checked ON (-1)
|
||||||
try, Status := driver.findelementbyxpath(Xpath).isSelected()
|
try, Status := driver.findelementbyxpath(Xpath).isSelected()
|
||||||
if(Status = "0"){
|
if(Status = "0"){
|
||||||
Message = Failed to Check ON the Notify Users Checkbox
|
Message = Failed to Check ON the Notify Users Checkbox
|
||||||
@@ -133,6 +136,8 @@ if(Status = 0){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DevModeMsgBox("notify user option checked?")
|
||||||
|
|
||||||
; check if the "Auto Submit Post" checkbox is checked, and if not check it
|
; check if the "Auto Submit Post" checkbox is checked, and if not check it
|
||||||
js = return document.querySelector("#autosubmit_enabled").checked;
|
js = return document.querySelector("#autosubmit_enabled").checked;
|
||||||
try AutoSubmitstatus := driver.executeScript(js)
|
try AutoSubmitstatus := driver.executeScript(js)
|
||||||
|
|||||||
@@ -23,9 +23,10 @@ if(DiscordVideosWebhookURL = ""){
|
|||||||
}
|
}
|
||||||
; 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
|
||||||
|
|
||||||
|
; clear out variables in case the button is clicked twice
|
||||||
VideoLinks :=
|
VideoLinks :=
|
||||||
|
Message :=
|
||||||
|
DiscordVideoDescription :=
|
||||||
|
|
||||||
TooltipMessage = Checking Bitchute and Brighteon URL for Processing Status
|
TooltipMessage = Checking Bitchute and Brighteon URL for Processing Status
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
@@ -75,12 +76,6 @@ VideoLinks .= "[Video Transcript](<" . PodcastTranscriptURL . ">) \| "
|
|||||||
if(PodcastNumber != "")
|
if(PodcastNumber != "")
|
||||||
VideoLinks .= "[FDRPodcasts](<" . "https://fdrpodcasts.com/" . PodcastNumber . ">) \| "
|
VideoLinks .= "[FDRPodcasts](<" . "https://fdrpodcasts.com/" . PodcastNumber . ">) \| "
|
||||||
|
|
||||||
Clipboard := VideoLinks
|
|
||||||
Msgbox % "VideoLinks: " VideoLinks
|
|
||||||
|
|
||||||
|
|
||||||
; StrLenOfDiscordMessage :=
|
|
||||||
|
|
||||||
; trim the video description if Title + Body + Links is longer than 2000 chars
|
; trim the video description if Title + Body + Links is longer than 2000 chars
|
||||||
if((StrLen(VideoTitle) + StrLen(VideoDescription) + StrLen(VideoLinks)) > 2000){
|
if((StrLen(VideoTitle) + StrLen(VideoDescription) + StrLen(VideoLinks)) > 2000){
|
||||||
|
|
||||||
@@ -91,7 +86,9 @@ if((StrLen(VideoTitle) + StrLen(VideoDescription) + StrLen(VideoLinks)) > 2000){
|
|||||||
else,
|
else,
|
||||||
DiscordVideoDescription := VideoDescription
|
DiscordVideoDescription := VideoDescription
|
||||||
|
|
||||||
Message := "**" . VideoTitle . "**" . "`n" . VideoLinks . "`n" . DiscordVideoDescription
|
Message = VideoLinks variable contents:
|
||||||
|
|
||||||
|
Message := "**" . VideoTitle . "**" . "`n" . DiscordVideoDescription . "`n`n" . VideoLinks
|
||||||
|
|
||||||
Status := UploadImageToDiscord(DiscordVideosWebhookURL, Message, VideoThumbFilepath)
|
Status := UploadImageToDiscord(DiscordVideosWebhookURL, Message, VideoThumbFilepath)
|
||||||
Message = API Response:`n%Status%
|
Message = API Response:`n%Status%
|
||||||
@@ -99,7 +96,7 @@ SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile")
|
|||||||
|
|
||||||
|
|
||||||
SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile")
|
SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
GuiControl,, PostToDiscordButton, Discord - Posted Successfully
|
GuiControl,, PostToDiscordTelegramButton, Discord - Posted Successfully
|
||||||
|
|
||||||
sleep, 2000
|
sleep, 2000
|
||||||
ToolTip
|
ToolTip
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ else, {
|
|||||||
|
|
||||||
Message = Video Links Posted to Telegram Successfully
|
Message = Video Links Posted to Telegram Successfully
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
GuiControl,, PostToTelegramButton, Telegram - Posted Successfully
|
GuiControl,, PostToDiscordTelegramButton, Telegram - Posted Successfully
|
||||||
|
|
||||||
ToolTip
|
ToolTip
|
||||||
CurrentSite :=
|
CurrentSite :=
|
||||||
|
|||||||
@@ -124,51 +124,32 @@ Loop, 5 { ; Attempt to input video description a couple of times
|
|||||||
Xpath = (//input[@placeholder='- Primary category -'])[1]
|
Xpath = (//input[@placeholder='- Primary category -'])[1]
|
||||||
try, driver.FindElementByXPath(Xpath).SendKeys("Podcasts").SendKeys(driver.Keys.ENTER)
|
try, driver.FindElementByXPath(Xpath).SendKeys("Podcasts").SendKeys(driver.Keys.ENTER)
|
||||||
|
|
||||||
|
/*
|
||||||
|
; Skip the channel selection for now
|
||||||
|
; Rumble now has a "Set this channel as default" checkbox
|
||||||
|
|
||||||
Message = Selecting Channel
|
Message = Selecting Channel
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
|
; Get list of channels and select the second one in the list
|
||||||
|
; First is the user profile
|
||||||
|
; Second is the Normal Channel
|
||||||
|
|
||||||
; @todo replace with regex
|
Xpath = (//fieldset[@id='channelId'])[1]
|
||||||
js = return document.querySelector("#channelId").innerHTML;
|
Try Channels := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
|
||||||
try, ChannelIDNumber := driver.executeScript(js)
|
UploadChannelName := StrSplit(Channels, "`n")[2]
|
||||||
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
|
|
||||||
ChannelIDNumber := StrSplit(ChannelIDNumber, "option value=")
|
|
||||||
|
|
||||||
ChannelIDNumber := ChannelIDNumber[3]
|
if(!UploadChannelName){
|
||||||
SingleQuote = "
|
Message = Failed to Grab Upload Channel Name
|
||||||
ChannelIDNumber := StrSplit(ChannelIDNumber, "data-private")
|
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
ChannelIDNumber := ChannelIDNumber[1]
|
|
||||||
ChannelIDNumber := StrReplace(ChannelIDNumber, SingleQuote, "")
|
|
||||||
ChannelIDNumber := StrReplace(ChannelIDNumber, " ", "")
|
|
||||||
|
|
||||||
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
|
|
||||||
|
|
||||||
|
|
||||||
; js = return document.querySelector("#channelId").value;
|
|
||||||
; try, ChannelIDNumber := driver.executeScript(js)
|
|
||||||
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
|
|
||||||
if(ChannelIDNumber = ""){
|
|
||||||
Message = ChannelIDNumber is blank. Unable to select Upload Channel
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
||||||
SaveDriverURLOFErrorPage()
|
|
||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
; //option[@value='762377'] ; freedomain
|
Xpath = (//label[normalize-space()='%UploadChannelName%'])[1]
|
||||||
Xpath = //option[@value='%ChannelIDNumber%']
|
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||||
try driver.FindElementByXPath(Xpath).click()
|
|
||||||
catch e {
|
|
||||||
Message = Failed to click on Channel using %ChannelIDNumber%.
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
||||||
SaveDriverURLOFErrorPage()
|
|
||||||
Return
|
|
||||||
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
||||||
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
; Input Tags
|
; Input Tags
|
||||||
Message = Inputting Tags
|
Message = Inputting Tags
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
[Video-Uploader]
|
[Video-Uploader]
|
||||||
Version=3.49
|
Version=3.53
|
||||||
Name=Freedomain Video Uploader
|
Name=Freedomain Video Uploader
|
||||||
APIURL=
|
|
||||||
|
|||||||
Reference in New Issue
Block a user