Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b1a7fb3326 | |||
|
e04a6b8d11
|
|||
| 199fbc1b78 | |||
| 9c52c6ec8d | |||
| 959a81bf98 | |||
| ce9f8a9885 | |||
| 71c4093bd9 | |||
| ba33d479ac | |||
| da34b98324 | |||
| 9e76ace3c3 | |||
| fd0b620e23 | |||
| c7924f7cc7 | |||
| 8b43ddc8be | |||
| dbdefc5a95 | |||
| 613f9d222a |
|
Before Width: | Height: | Size: 302 KiB After Width: | Height: | Size: 302 KiB |
164
Compile and Release.ahk
Normal file
164
Compile and Release.ahk
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
;---ENVIRONMENT---------------------------------------------------------------------
|
||||||
|
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
|
||||||
|
;#Warn ; Enable warnings to assist with detecting common errors.
|
||||||
|
;DetectHiddenWindows, On
|
||||||
|
#SingleInstance, Force
|
||||||
|
DetectHiddenWindows, ON
|
||||||
|
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
|
||||||
|
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
|
||||||
|
;SetKeyDelay, 500
|
||||||
|
CoordMode, ToolTip, Screen
|
||||||
|
CoordMode, Mouse, Screen
|
||||||
|
; #NoTrayIcon
|
||||||
|
; Menu, Tray, Icon, RMScriptManager.ico
|
||||||
|
|
||||||
|
;---Notes/Extra Info/#Includes------------------------------------------------------
|
||||||
|
#Include, %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\WindowCredentialManager.ahk
|
||||||
|
|
||||||
|
;---VARIABLES-----------------------------------------------------------------------
|
||||||
|
ProgramName = Freedomain Video Uploader
|
||||||
|
ExeProgramName = %ProgramName%.exe
|
||||||
|
AHKFilepath = %A_ScriptDir%\%ProgramName%.ahk
|
||||||
|
Exefilepath = %A_ScriptDir%\%ProgramName%.exe
|
||||||
|
icopath = %A_ScriptDir%\Assets\Icon.ico
|
||||||
|
VersionIniFP = %A_ScriptDir%\Version.ini
|
||||||
|
|
||||||
|
; Generate a new errorlog text file each run
|
||||||
|
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
|
||||||
|
ErrorLogFilepath = %A_ScriptDir%\Lib\ErrorLogging\Compiler_%TodayDate%.txt
|
||||||
|
|
||||||
|
|
||||||
|
; Read Credential token from Windows Credential Manager using WindowCredentialManager.ahk
|
||||||
|
cred := CredRead("FDR-Gitea-Token")
|
||||||
|
GiteaToken := Cred.Password
|
||||||
|
|
||||||
|
; Info for Creating the Release with Gitea-CreateRelease.ps1
|
||||||
|
CreateReleasePS1Filepath = %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Gitea-CreateRelease.ps1
|
||||||
|
CreateReleaseAPIURL = https://freedomain.dev/api/v1/repos/yuriy/video-uploader/releases?token=%GiteaToken%
|
||||||
|
|
||||||
|
; Info for Attaching exe file to release using Gitea-AttachAssetToRelease.ps1
|
||||||
|
AttachAssetToReleasePS1Filepath = %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Gitea-AttachAssetToRelease.ps1
|
||||||
|
AttachAssetToReleaseAPIURL = https://freedomain.dev/api/v1/repos/yuriy/video-uploader/releases
|
||||||
|
|
||||||
|
;---\VARIABLES-----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; Compile to .exe
|
||||||
|
; ------------------------------------------------
|
||||||
|
; Bump the version number in the version.ini file
|
||||||
|
IniRead, VersionNumber, %VersionIniFP%, Video-Uploader, Version, 0.0 ; , Filename, Section, Key [, Default]
|
||||||
|
VersionNumber += .01
|
||||||
|
VersionNumber := SubStr(VersionNumber, 1, 4)
|
||||||
|
IniWrite, %VersionNumber%, %VersionIniFP%,Video-Uploader, Version
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; Kill any active intances of the uploaders so the .exe file can be overwriten by the compilation
|
||||||
|
process, close, %ExeProgramName%
|
||||||
|
|
||||||
|
sleep, 500
|
||||||
|
|
||||||
|
; Delete the .exe file so it can be repalced
|
||||||
|
if(FileExist(Exefilepath)){
|
||||||
|
FileDelete, %Exefilepath%
|
||||||
|
if(ErrorLevel){
|
||||||
|
msgbox, failed to delete Exe file. Please delete manually and re-run the compiler.
|
||||||
|
ExitApp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
; check if file exists and if not, give user error and stop
|
||||||
|
if(!FileExist(AHKFilepath)){
|
||||||
|
msgbox, %AHKFilepath% does not exist`nExiting
|
||||||
|
ExitApp
|
||||||
|
}
|
||||||
|
|
||||||
|
; check if file exists and if not, give user error and stop
|
||||||
|
if(!FileExist(icopath)){
|
||||||
|
msgbox, %icopath% does not exist`nExiting
|
||||||
|
ExitApp
|
||||||
|
}
|
||||||
|
|
||||||
|
; 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%"
|
||||||
|
Results := RunCMD(Command)
|
||||||
|
LogToErrorLogFile(Results, ErrorLogFilepath)
|
||||||
|
|
||||||
|
if(!InStr(Results, "Successfully")){
|
||||||
|
Msgbox, Error, Compilation failed with the following error:`n`n%Results%
|
||||||
|
ExitApp
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; Create new Release on Gitea using Gitea-CreateRelease.ps1
|
||||||
|
; ------------------------------------------------
|
||||||
|
InputBox, ReleaseBody, Release Body, Please Input Text to be used in the Release Body
|
||||||
|
|
||||||
|
ReleaseName := VersionNumber
|
||||||
|
ReleaseTag := VersionNumber
|
||||||
|
|
||||||
|
; Strings with spaces in them need to be surrounted by a single quote and double quote, eg: "'spaced string'"
|
||||||
|
Command = Powershell "%CreateReleasePS1Filepath%" "%CreateReleaseAPIURL%" "%ReleaseName%" "%ReleaseTag%" "'%ReleaseBody%'"
|
||||||
|
|
||||||
|
Message = PowerShell Command to Create Release:`n%Command%
|
||||||
|
LogToErrorLogFile(Message, ErrorLogFilepath)
|
||||||
|
|
||||||
|
Results := RunCMD(Command)
|
||||||
|
Message = API Returned:`n%Results%
|
||||||
|
LogToErrorLogFile(Message, ErrorLogFilepath)
|
||||||
|
|
||||||
|
|
||||||
|
; Pull out the release ID Number, needed for attaching a file to the release
|
||||||
|
SplitText = @{id=
|
||||||
|
SplitText2 = `;
|
||||||
|
ReleaseID := StrSplit(Results, SplitText)[2]
|
||||||
|
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%
|
||||||
|
LogToErrorLogFile(Message, ErrorLogFilepath)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; Attach .exe File to Release using Gitea-AttachAssetToRelease.ps1
|
||||||
|
; ------------------------------------------------
|
||||||
|
AttachAssetToReleaseAPIURL = %AttachAssetToReleaseAPIURL%/%ReleaseID%/assets
|
||||||
|
|
||||||
|
; 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%'"
|
||||||
|
LogToErrorLogFile(Command, ErrorLogFilepath)
|
||||||
|
|
||||||
|
Results := RunCMD(Command)
|
||||||
|
Message = API Returned: %Results%
|
||||||
|
LogToErrorLogFile(Message, ErrorLogFilepath)
|
||||||
|
|
||||||
|
|
||||||
|
ExitApp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;---FUNCTIONS-----------------------------------------------------------------------
|
||||||
|
LogToErrorLogFile(Text, TextFileFilepath){
|
||||||
|
FileAppend, `n%Text%`n, %TextFileFilepath%
|
||||||
|
}
|
||||||
@@ -14,22 +14,8 @@ CoordMode, Mouse, Screen
|
|||||||
|
|
||||||
;---Notes/Extra Info/#Includes------------------------------------------------------
|
;---Notes/Extra Info/#Includes------------------------------------------------------
|
||||||
|
|
||||||
; msgbox
|
|
||||||
;---VARIABLES-----------------------------------------------------------------------
|
;---VARIABLES-----------------------------------------------------------------------
|
||||||
/*ScriptToCompile = %1%
|
|
||||||
CompileType = %2% ; Testing OR Production
|
|
||||||
if(CompileType = "")
|
|
||||||
CompileType = Testing
|
|
||||||
; Msgbox % "CompileType: " CompileType
|
|
||||||
if(ScriptToCompile = "")
|
|
||||||
ExitApp
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
; Msgbox % "ScriptToCompile: " ScriptToCompile
|
|
||||||
ScriptToCompile = SocialMediaPoster
|
|
||||||
; ScriptToCompile = ScriptUpdater
|
|
||||||
;---MAIN SCRIPT---------------------------------------------------------------------
|
;---MAIN SCRIPT---------------------------------------------------------------------
|
||||||
|
|
||||||
AHKFilepath = %A_ScriptDir%\Freedomain Video Uploader.ahk
|
AHKFilepath = %A_ScriptDir%\Freedomain Video Uploader.ahk
|
||||||
@@ -77,9 +63,6 @@ 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%""
|
||||||
|
|
||||||
|
|
||||||
; OldNotify(ScriptToCompile,"Compiled Successfully",5)
|
|
||||||
; sleep, 5000
|
|
||||||
ExitApp
|
ExitApp
|
||||||
|
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ DetectHiddenWindows, ON ; used for finding Running .ahk scripts
|
|||||||
; Only Set tool tray icon if this is the source .ahk script.
|
; Only Set tool tray icon if this is the source .ahk script.
|
||||||
; The .exe has the icon compiled into it
|
; The .exe has the icon compiled into it
|
||||||
if(InStr(A_ScriptFullPath, ".ahk")){
|
if(InStr(A_ScriptFullPath, ".ahk")){
|
||||||
try Menu, Tray, Icon, %A_ScriptDir%\Assets\FreedomainVideo.ico
|
try Menu, Tray, Icon, %A_ScriptDir%\Assets\Icon.ico
|
||||||
}
|
}
|
||||||
|
|
||||||
; Parameter passed in to script
|
; Parameter passed in to script
|
||||||
@@ -40,7 +40,7 @@ Menu, Tray, Default, Restart with Last Project
|
|||||||
; Track how long sections of code take to run
|
; Track how long sections of code take to run
|
||||||
UStartTime := A_TickCount ; start time
|
UStartTime := A_TickCount ; start time
|
||||||
|
|
||||||
; Included FIles and Libraries
|
; Included Files and Libraries
|
||||||
; ------------------------------------------------
|
; ------------------------------------------------
|
||||||
; These have to be included at the top for the Global variables to get registered early
|
; These have to be included at the top for the Global variables to get registered early
|
||||||
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\General-Functions.ahk
|
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\General-Functions.ahk
|
||||||
@@ -87,6 +87,7 @@ ErrorLogVar :=
|
|||||||
|
|
||||||
global DevMode
|
global DevMode
|
||||||
|
|
||||||
|
; @todo: this can be hardcoded into the lbry functions as it never changes
|
||||||
global LBRYNetFilepath
|
global LBRYNetFilepath
|
||||||
LBRYNetFilepath := "C:\Program Files\LBRY\resources\static\daemon\lbrynet.exe"
|
LBRYNetFilepath := "C:\Program Files\LBRY\resources\static\daemon\lbrynet.exe"
|
||||||
|
|
||||||
@@ -106,7 +107,8 @@ Array_Index_Num_of_Upload_StatusChecks := [144,288,432, 576,720,864]
|
|||||||
|
|
||||||
; Check if Lib folder exists and create it if not
|
; Check if Lib folder exists and create it if not
|
||||||
LibFolder := A_ScriptDir . "\Lib"
|
LibFolder := A_ScriptDir . "\Lib"
|
||||||
ErrorLoggingFolder := A_ScriptDir . "\Lib\ErrorLogging"
|
ErrorLoggingFolder := A_ScriptDir . "\Lib\ErrorLogging"
|
||||||
|
if(!FileExist(ErrorLoggingFolder))
|
||||||
FileCreateDir, %ErrorLoggingFolder%
|
FileCreateDir, %ErrorLoggingFolder%
|
||||||
|
|
||||||
; Set filepaths for different files and folders
|
; Set filepaths for different files and folders
|
||||||
@@ -192,11 +194,6 @@ PostSchedulerGitReleasesAPIURL = https://freedomain.dev/api/v1/repos/yuriy/post-
|
|||||||
IniRead, PostSchedulerVersion, %SettingsIniFilepath%, Freedomain Post Scheduler, Version, 0.0
|
IniRead, PostSchedulerVersion, %SettingsIniFilepath%, Freedomain Post Scheduler, Version, 0.0
|
||||||
IniRead, PostSchedulerFilepath, %SettingsIniFilepath%, Filepaths, PostScheduler, %A_Space%
|
IniRead, PostSchedulerFilepath, %SettingsIniFilepath%, Filepaths, PostScheduler, %A_Space%
|
||||||
|
|
||||||
|
|
||||||
; Msgbox % "PostSchedulerVersion: " PostSchedulerVersion
|
|
||||||
; IniRead, OutputVar, Filename, Section, Key [, Default]
|
|
||||||
|
|
||||||
|
|
||||||
;---LBRY Settings---
|
;---LBRY Settings---
|
||||||
;------------------------------------------------
|
;------------------------------------------------
|
||||||
IniRead, LBRYNewVideoStakeAmount, %SettingsIniFilepath%, General, LBRYNewVideoStakeAmount, 1.0
|
IniRead, LBRYNewVideoStakeAmount, %SettingsIniFilepath%, General, LBRYNewVideoStakeAmount, 1.0
|
||||||
@@ -224,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,19 +400,18 @@ if(FileExist(VideoLinksIniFile)){
|
|||||||
IniRead, UnauthorizedTVURL, %VideoLinksIniFile%, URLs, UnauthorizedTVURL, %A_Space%
|
IniRead, UnauthorizedTVURL, %VideoLinksIniFile%, URLs, UnauthorizedTVURL, %A_Space%
|
||||||
|
|
||||||
|
|
||||||
; MISC
|
; Misc Info
|
||||||
|
; ------------------------------------------------
|
||||||
IniRead, ErrorLoggingFilePath, %VideoLinksIniFile%, Misc, ErrorLoggingFilePath, %A_Space%
|
IniRead, ErrorLoggingFilePath, %VideoLinksIniFile%, Misc, ErrorLoggingFilePath, %A_Space%
|
||||||
|
|
||||||
; I don't remember why I added this, commenting this out on 2024/06/22 for now
|
; Double check that the file still exists on the system. if set var to blank so new file can be generated
|
||||||
; IniRead, TempVideoThumbFilepath, %VideoLinksIniFile%, Misc, VideoThumbFilepath, %A_Space%
|
if(!FileExist(ErrorLoggingFilePath)){
|
||||||
/* if(TempVideoThumbFilepath){ ; if Video Thumbnail was saved in last run, overwrite variable path that was grabbed in the file loop above
|
ErrorLoggingFilePath :=
|
||||||
VideoThumbFilepath := TempVideoThumbFilepath
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
; Create a directory for errorlogging if this is the first time working on this project
|
; Create a directory for errorlogging if this is the first time working on this project
|
||||||
if(ErrorLoggingFilePath = ""){
|
if(ErrorLoggingFilePath = ""){
|
||||||
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
|
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
|
||||||
@@ -458,7 +454,6 @@ if(VideoFileSizeInMB > 6144){
|
|||||||
|
|
||||||
; Brighteon will fail if video does not have one of the following aspect ratios
|
; Brighteon will fail if video does not have one of the following aspect ratios
|
||||||
BrighteonAcceptedAspectRatios := ["4:3","3:4","16:9","9:16"]
|
BrighteonAcceptedAspectRatios := ["4:3","3:4","16:9","9:16"]
|
||||||
; Msgbox % "VideoAspectRatio: " VideoAspectRatio
|
|
||||||
VideoHasBrighteonCompatibleAspectRatio := HasVal(BrighteonAcceptedAspectRatios, VideoAspectRatio)
|
VideoHasBrighteonCompatibleAspectRatio := HasVal(BrighteonAcceptedAspectRatios, VideoAspectRatio)
|
||||||
|
|
||||||
|
|
||||||
@@ -560,16 +555,6 @@ ToggleDevMode()
|
|||||||
run, "%A_ScriptFullPath%" "LastPost"
|
run, "%A_ScriptFullPath%" "LastPost"
|
||||||
Return
|
Return
|
||||||
|
|
||||||
/*
|
|
||||||
OpenGiteaPage:
|
|
||||||
run, https://freedomain.dev/yuriy/video-uploader
|
|
||||||
Return
|
|
||||||
|
|
||||||
OpenErrorLog:
|
|
||||||
run, %ErrorLoggingFilePath%
|
|
||||||
Return
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
UncheckAllPlatforms:
|
UncheckAllPlatforms:
|
||||||
GuiControl,,Bitchute, 0
|
GuiControl,,Bitchute, 0
|
||||||
@@ -630,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
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -642,11 +634,25 @@ IniWrite, %YPosition%, %SettingsIniFilepath%, General, YPosition
|
|||||||
|
|
||||||
Gui, Submit, NoHide
|
Gui, Submit, NoHide
|
||||||
|
|
||||||
if(VideoFilepath = ""){
|
|
||||||
Msgbox,4096,Error,No Video Filepath Found.`nPlease Input Video Filepath to Upload a Video.
|
; Double Check Files and Show Errors if there are any Issues
|
||||||
|
; In case the project files change between the time the gui was created and the Upload button is clicked
|
||||||
|
; ------------------------------------------------
|
||||||
|
(VideoFilepath = "")?(DoubleCheckErrorMessage .= "Video Filepath is BLANK`n"):()
|
||||||
|
(!FileExist(VideoFilepath))?(DoubleCheckErrorMessage .= "Video Filepath Points to a Non-Existing File`n"):()
|
||||||
|
|
||||||
|
(VideoThumbFilepath = "")?(DoubleCheckErrorMessage .= "Thumbnail Filepath is BLANK`n"):()
|
||||||
|
(!FileExist(VideoThumbFilepath))?(DoubleCheckErrorMessage .= "Thumbnail Filepath Points to a Non-Existing File`n"):()
|
||||||
|
|
||||||
|
if(DoubleCheckErrorMessage){
|
||||||
|
Message = Issue found when double checking files:`n%DoubleCheckErrorMessage%
|
||||||
|
SaveOrPostProgress(Message,PostType:="ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
|
||||||
|
Msgbox,4096,Error,%DoubleCheckErrorMessage%
|
||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
; Destroy GUI after checking everything is working
|
; Destroy GUI after checking everything is working
|
||||||
Gui, Destroy
|
Gui, Destroy
|
||||||
|
|
||||||
@@ -1012,7 +1018,7 @@ if(!SocialMediaPosterFilepath or !FileExist(SocialMediaPosterFilepath)){
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
; Copy Info from GUI to Clipboard
|
; Copy Info to Clipboard based on the button clicked
|
||||||
; ------------------------------------------------
|
; ------------------------------------------------
|
||||||
CopyToClipboard:
|
CopyToClipboard:
|
||||||
|
|
||||||
@@ -1090,11 +1096,9 @@ run, "%A_ScriptFullPath%" "ShowResults"
|
|||||||
ExitApp
|
ExitApp
|
||||||
|
|
||||||
|
|
||||||
|
; -----------------------------------------------
|
||||||
SendErrorLoggingThroughTelegram:
|
; GoSub Labels
|
||||||
msgbox, I don't do nothin atm
|
; -----------------------------------------------
|
||||||
Return
|
|
||||||
|
|
||||||
|
|
||||||
; Post-To-Telegram
|
; Post-To-Telegram
|
||||||
;------------------------------------------------
|
;------------------------------------------------
|
||||||
|
|||||||
Submodule Lib/Freedomain-Posters-Shared-Functions updated: 62e8afebb8...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)
|
||||||
|
|||||||
@@ -1,7 +1,15 @@
|
|||||||
PostToDiscord:
|
PostToDiscord:
|
||||||
;------------------------------------------------
|
;------------------------------------------------
|
||||||
|
CurrentSite := "Discord"
|
||||||
|
|
||||||
|
if(!FileExist(VideoThumbFilepath)){
|
||||||
|
Message = Post Aborted.`nVideo Thumbnail not found at:`n%VideoThumbFilepath%
|
||||||
|
SaveOrPostProgress(Message,PostType:="ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
MsgBox 0x10,, %Message%
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
CurrentSocialMediaPosting := "Discord"
|
|
||||||
Message = Posting Video Links to Discord
|
Message = Posting Video Links to Discord
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
|
||||||
@@ -15,15 +23,17 @@ 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")
|
||||||
|
|
||||||
; check the status of the Bitchute URL to see if it's done processing
|
; check the status of the Bitchute URL to see if it's done processing
|
||||||
; shows "404 - Page not found" on page if not
|
; shows "404 - Page not found" on page if not
|
||||||
|
if(BitChuteURL){
|
||||||
if(!InStr(URLDownloadToVar(BitChuteURL), "404 - Page not found")){
|
if(!InStr(URLDownloadToVar(BitChuteURL), "404 - Page not found")){
|
||||||
if(BitChuteURL != "")
|
if(BitChuteURL != "")
|
||||||
VideoLinks .= "[BitChute](<" . BitChuteURL . ">) \| "
|
VideoLinks .= "[BitChute](<" . BitChuteURL . ">) \| "
|
||||||
@@ -32,9 +42,12 @@ else, {
|
|||||||
LogMessage = Bitchute URL skipped, URL Currently leads to: 404 - page not found
|
LogMessage = Bitchute URL skipped, URL Currently leads to: 404 - page not found
|
||||||
SaveOrPostProgress(Message:=LogMessage,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
SaveOrPostProgress(Message:=LogMessage,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
; check the status of the Brighteon URL to see if it's done processing
|
; check the status of the Brighteon URL to see if it's done processing
|
||||||
; shows "404 - Page not found" on page if not
|
; shows "404 - Page not found" on page if not
|
||||||
|
if(BrighteonURL){
|
||||||
if(!InStr(URLDownloadToVar(BrighteonURL), "SELECTED IS NOT CURRENTLY AVAILABLE")){
|
if(!InStr(URLDownloadToVar(BrighteonURL), "SELECTED IS NOT CURRENTLY AVAILABLE")){
|
||||||
if(BrighteonURL != "")
|
if(BrighteonURL != "")
|
||||||
VideoLinks .= "[Brighteon](<" . BrighteonURL . ">) \| "
|
VideoLinks .= "[Brighteon](<" . BrighteonURL . ">) \| "
|
||||||
@@ -43,7 +56,7 @@ else, {
|
|||||||
ErrorLogMsg = Brighteon URL skipped, URL Currently leads to: 404 - page not found
|
ErrorLogMsg = Brighteon URL skipped, URL Currently leads to: 404 - page not found
|
||||||
SaveOrPostProgress(Message:=ErrorLogMsg,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
SaveOrPostProgress(Message:=ErrorLogMsg,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(OdyseeVideoURL != "")
|
if(OdyseeVideoURL != "")
|
||||||
VideoLinks .= "[Odysee](<" . OdyseeVideoURL . ">) \| "
|
VideoLinks .= "[Odysee](<" . OdyseeVideoURL . ">) \| "
|
||||||
@@ -63,9 +76,6 @@ VideoLinks .= "[Video Transcript](<" . PodcastTranscriptURL . ">) \| "
|
|||||||
if(PodcastNumber != "")
|
if(PodcastNumber != "")
|
||||||
VideoLinks .= "[FDRPodcasts](<" . "https://fdrpodcasts.com/" . PodcastNumber . ">) \| "
|
VideoLinks .= "[FDRPodcasts](<" . "https://fdrpodcasts.com/" . PodcastNumber . ">) \| "
|
||||||
|
|
||||||
|
|
||||||
; 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){
|
||||||
|
|
||||||
@@ -76,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%
|
||||||
@@ -84,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
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
PostToTelegram:
|
PostToTelegram:
|
||||||
;------------------------------------------------
|
;------------------------------------------------
|
||||||
CurrentSocialMediaPosting := "Telegram"
|
CurrentSite := "Telegram"
|
||||||
|
|
||||||
|
if(!FileExist(VideoThumbFilepath)){
|
||||||
|
Message = Post Aborted.`nVideo Thumbnail not found at:`n%VideoThumbFilepath%
|
||||||
|
SaveOrPostProgress(Message,PostType:="ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
MsgBox 0x10,, %Message%
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Message = Posting Video Links to Telegram
|
Message = Posting Video Links to Telegram
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
@@ -15,61 +23,47 @@ if(TelegramBotToken = "" Or TelegramBotChatID =""){
|
|||||||
Message = TelegramBotToken or TelegramBotChatID is missing from %SettingsIniFilepath%. `nPlease input them and click the button again.
|
Message = TelegramBotToken or TelegramBotChatID is missing from %SettingsIniFilepath%. `nPlease input them and click the button again.
|
||||||
msgbox, 4096, Error!, %Message%
|
msgbox, 4096, Error!, %Message%
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
; Msgbox, 4096, Error!, TelegramBotToken or TelegramBotChatID is missing from %SettingsIniFilepath%. `nPlease input them and rerun the script.
|
|
||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
; If description is longer than 2k chars, then API will error out. goto section that will allow user to edit video description to shorten it for posting
|
|
||||||
if(StrLen(SocialMediaDescription) > 2000 AND VideoDescriptionForVideosChannel = ""){
|
|
||||||
goto, CreateDescriptionForVideosPosting
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
if(SocialMediaDescription = ""){
|
|
||||||
CreateDescriptionForSocialMedia()
|
|
||||||
}
|
|
||||||
if(SocialMediaDescription > 1000){ ; Telegram has a 1024 char media caption capacity
|
|
||||||
SocialMediaDescription := SubStr(SocialMediaDescription, 1, 500)
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
; @todo: split telegram message into multiple posts
|
|
||||||
|
|
||||||
|
|
||||||
SubmitDescriptionForTelegramVideosChannel:
|
|
||||||
TelegramVideoTitle := ASCIISTRReplace(VideoTitle)
|
TelegramVideoTitle := ASCIISTRReplace(VideoTitle)
|
||||||
TelegramVideoTitle := "*" . TelegramVideoTitle . "*"
|
TelegramVideoTitle := "*" . TelegramVideoTitle . "*"
|
||||||
|
|
||||||
TelegramBodymessage := ASCIISTRReplace(VideoDescription)
|
TelegramBodymessage := ASCIISTRReplace(VideoDescription)
|
||||||
|
|
||||||
|
; Variables
|
||||||
LineBreakChar = `%0A ; Used for API
|
LineBreakChar = `%0A ; Used for API
|
||||||
|
VideoLinks :=
|
||||||
|
|
||||||
|
|
||||||
|
; Create the Hyperlinks for each Platform
|
||||||
|
; ------------------------------------------------
|
||||||
; check the status of the Bitchute URL to see if it's done processing
|
; check the status of the Bitchute URL to see if it's done processing
|
||||||
; shows "404 - Page not found" on page if not
|
; shows "404 - Page not found" on page if not
|
||||||
if(!InStr(URLDownloadToVar(BitChuteURL), "404 - Page not found")){
|
if(BitChuteURL){
|
||||||
if(BitChuteURL != "")
|
if(!InStr(URLDownloadToVar(BitChuteURL), "404 - Page not found")){
|
||||||
VideoLinks .= "[BitChute](" . BitChuteURL . ") \| "
|
if(BitChuteURL != "")
|
||||||
|
VideoLinks .= "[BitChute](" . BitChuteURL . ") \| "
|
||||||
|
}
|
||||||
|
else, {
|
||||||
|
LogMessage = Bitchute URL skipped, URL Currently leads to: 404 - page not found
|
||||||
|
SaveOrPostProgress(Message:=LogMessage,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else, {
|
|
||||||
LogMessage = Bitchute URL skipped, URL Currently leads to: 404 - page not found
|
|
||||||
SaveOrPostProgress(Message:=LogMessage,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
; check the status of the Brighteon URL to see if it's done processing
|
; check the status of the Brighteon URL to see if it's done processing
|
||||||
; shows "404 - Page not found" on page if not
|
; shows "404 - Page not found" on page if not
|
||||||
if(!InStr(URLDownloadToVar(BrighteonURL), "SELECTED IS NOT CURRENTLY AVAILABLE")){
|
if(BrighteonURL){
|
||||||
if(BrighteonURL != "")
|
if(!InStr(URLDownloadToVar(BrighteonURL), "SELECTED IS NOT CURRENTLY AVAILABLE")){
|
||||||
VideoLinks .= "[Brighteon](" . BrighteonURL . ") \| "
|
if(BrighteonURL != "")
|
||||||
|
VideoLinks .= "[Brighteon](" . BrighteonURL . ") \| "
|
||||||
|
}
|
||||||
|
else, {
|
||||||
|
LogMessage = Brighteon URL skipped, URL Currently leads to: 404 - page not found
|
||||||
|
SaveOrPostProgress(Message:=LogMessage,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else, {
|
|
||||||
LogMessage = Brighteon URL skipped, URL Currently leads to: 404 - page not found
|
|
||||||
SaveOrPostProgress(Message:=LogMessage,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(OdyseeVideoURL != "")
|
if(OdyseeVideoURL != "")
|
||||||
VideoLinks .= "[Odysee](" . OdyseeVideoURL . ") \| "
|
VideoLinks .= "[Odysee](" . OdyseeVideoURL . ") \| "
|
||||||
@@ -83,10 +77,6 @@ VideoLinks .= "[Rumble](" . RumbleURL . ") \| "
|
|||||||
if(DailyMotionURL != "")
|
if(DailyMotionURL != "")
|
||||||
VideoLinks .= "[DailyMotion](" . DailyMotionURL . ") \| "
|
VideoLinks .= "[DailyMotion](" . DailyMotionURL . ") \| "
|
||||||
|
|
||||||
/*if(PodcastTranscriptURL != "")
|
|
||||||
VideoLinks .= "[Video Transcript](" . PodcastTranscriptURL . ") \| "
|
|
||||||
|
|
||||||
*/
|
|
||||||
if(PodcastNumber != "")
|
if(PodcastNumber != "")
|
||||||
VideoLinks .= "[FDRPodcasts](" . "https://fdrpodcasts.com/" . PodcastNumber . ") \| "
|
VideoLinks .= "[FDRPodcasts](" . "https://fdrpodcasts.com/" . PodcastNumber . ") \| "
|
||||||
|
|
||||||
@@ -94,94 +84,92 @@ VideoLinks .= "[FDRPodcasts](" . "https://fdrpodcasts.com/" . PodcastNumber . ")
|
|||||||
TelegramMessage := TelegramVideoTitle . "`n" . TelegramBodymessage . "`n" . VideoLinks
|
TelegramMessage := TelegramVideoTitle . "`n" . TelegramBodymessage . "`n" . VideoLinks
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
StrLenOfMessageAndVideoLinks := StrLen(TelegramVideoTitle) + StrLen(TelegramBodymessage) + StrLen(VideoLinks)
|
StrLenOfMessageAndVideoLinks := StrLen(TelegramVideoTitle) + StrLen(TelegramBodymessage) + StrLen(VideoLinks)
|
||||||
; DevModeMsgBox(StrLenOfMessageAndVideoLinks)
|
|
||||||
|
|
||||||
|
|
||||||
; If Length of Title, Video Links and Message is less than 1024 characters:
|
; If Length of Title, Video Links and Message is less than 1024 characters:
|
||||||
; ------------------------------------------------
|
; ------------------------------------------------
|
||||||
if(StrLenOfMessageAndVideoLinks < 1024) {
|
if(StrLenOfMessageAndVideoLinks < 1024) {
|
||||||
|
Message = Sending Post as One Message
|
||||||
|
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramMessage ) ; you could add more options; compare the Telegram API docs
|
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramMessage ) ; you could add more options; compare the Telegram API docs
|
||||||
|
|
||||||
; Output returned data to ErrorLog File
|
|
||||||
Message = API Response:`n%Status%
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
|
||||||
|
|
||||||
if(InStr(Status, "error_code")){
|
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.
|
Message = Telegram Post Failed Due To An Api Issue. Please See Errorlog For More Info.
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
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
|
|
||||||
}
|
}
|
||||||
|
Message = API Response:`n%Status% ; Output returned data to ErrorLog File
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
; If Title, Links and Message are longer than 1024, but less than 4096, split into 2 pieces: sendphoto and sendmessage
|
; If Title, Links and Message are longer than 1024, but less than 4096, split into 2 pieces: sendphoto and sendmessage
|
||||||
; ------------------------------------------------
|
; ------------------------------------------------
|
||||||
if(StrLenOfMessageAndVideoLinks < 4096){
|
if(StrLenOfMessageAndVideoLinks < 4096){
|
||||||
|
Message = Sending Post as Two Messages
|
||||||
|
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
; Photo and Video Title go into SendPhoto
|
; Photo and Video Title go into SendPhoto
|
||||||
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
|
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
|
||||||
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
|
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
|
||||||
; Output returned data to ErrorLog File
|
if(InStr(Status, "error_code")){
|
||||||
Message = API Response:`n%Status%
|
Message = Telegram Post Failed Due To An Api Issue. Please See Errorlog For More Info.
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
}
|
||||||
|
Message = API Response:`n%Status% ; Output returned data to ErrorLog File
|
||||||
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
||||||
|
|
||||||
|
|
||||||
; Video Description goes into TelegramMessage
|
; Video Description goes into TelegramMessage
|
||||||
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessage)
|
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessage)
|
||||||
; Output returned data to ErrorLog File
|
if(InStr(Status, "error_code")){
|
||||||
Message = API Response:`n%Status%
|
Message = Telegram Post Failed Due To An Api Issue. Please See Errorlog For More Info.
|
||||||
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
|
||||||
|
|
||||||
} 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]
|
|
||||||
|
|
||||||
|
|
||||||
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := Description)
|
|
||||||
; Output returned data to ErrorLog File
|
|
||||||
Message = API Response:`n%Status%
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
|
||||||
|
|
||||||
; Clipboard := Description
|
|
||||||
; msgbox % Description
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Message = API Response:`n%Status% ; Output returned data to ErrorLog File
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
||||||
|
|
||||||
; SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile")
|
}
|
||||||
Message = Video Links Posted to Telegram Successfully
|
else, {
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
; If Title, links and message are longer than 4096 chars, we need to split them into multiple messages
|
||||||
GuiControl,, PostToTelegramButton, Telegram - Posted Successfully
|
; ------------------------------------------------
|
||||||
|
Message = Sending Post as Multiple Messages
|
||||||
|
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
|
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
|
||||||
|
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
|
||||||
|
if(InStr(Status, "error_code")){
|
||||||
|
Message = Telegram Post Failed Due To An Api Issue. Please See Errorlog For More Info.
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
}
|
||||||
|
Message = API Response:`n%Status% ; Output returned data to ErrorLog File
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
||||||
|
|
||||||
|
; 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)
|
||||||
|
|
||||||
|
|
||||||
; sleep, 2000
|
; go through array and post each chunk as new message
|
||||||
|
Loop % VideoDescriptionChunks.Length(){
|
||||||
|
; ArrayItem := ARRAY[A_Index]
|
||||||
|
Description := VideoDescriptionChunks[A_Index]
|
||||||
|
|
||||||
|
|
||||||
ToolTip
|
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := Description)
|
||||||
CurrentSite :=
|
if(InStr(Status, "error_code")){
|
||||||
Return
|
Message = Telegram Post Failed Due To An Api Issue. Please See Errorlog For More Info.
|
||||||
; -------------------------------/Telegram-------------------------------
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
}
|
||||||
|
Message = API Response:`n%Status% ; Output returned data to ErrorLog File
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Message = Video Links Posted to Telegram Successfully
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
GuiControl,, PostToDiscordTelegramButton, Telegram - Posted Successfully
|
||||||
|
|
||||||
|
ToolTip
|
||||||
|
CurrentSite :=
|
||||||
|
Return
|
||||||
|
; -------------------------------/Telegram-------------------------------
|
||||||
|
|||||||
@@ -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]
|
Return
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
; //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
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
# Supported Platforms
|
# Supported Platforms
|
||||||
| Platform | Upload Type |
|
| Platform | Upload Type |
|
||||||
|--|--|--|
|
|--|--|
|
||||||
| Locals | Video Upload w/Selenium |
|
| Locals | Video Upload w/Selenium |
|
||||||
| Bitchute | Video Upload w/Selenium |
|
| Bitchute | Video Upload w/Selenium |
|
||||||
| Rumble | Video Upload w/Selenium |
|
| Rumble | Video Upload w/Selenium |
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
[Video-Uploader]
|
[Video-Uploader]
|
||||||
Version=3.41
|
Version=3.53
|
||||||
Name=Freedomain Video Uploader
|
Name=Freedomain Video Uploader
|
||||||
|
|||||||
Reference in New Issue
Block a user