Compare commits

..

No commits in common. 'main' and '3.40' have entirely different histories.
main ... 3.40

Before

Width:  |  Height:  |  Size: 302 KiB

After

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 KiB

@ -14,8 +14,22 @@ CoordMode, Mouse, Screen
;---Notes/Extra Info/#Includes------------------------------------------------------
; msgbox
;---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---------------------------------------------------------------------
AHKFilepath = %A_ScriptDir%\Freedomain Video Uploader.ahk
@ -63,6 +77,9 @@ if(!FileExist(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

@ -1,164 +0,0 @@
;---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%
}

@ -11,7 +11,7 @@ DetectHiddenWindows, ON ; used for finding Running .ahk scripts
; Only Set tool tray icon if this is the source .ahk script.
; The .exe has the icon compiled into it
if(InStr(A_ScriptFullPath, ".ahk")){
try Menu, Tray, Icon, %A_ScriptDir%\Assets\Icon.ico
try Menu, Tray, Icon, %A_ScriptDir%\Assets\FreedomainVideo.ico
}
; 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
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
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\General-Functions.ahk
@ -87,7 +87,6 @@ ErrorLogVar :=
global DevMode
; @todo: this can be hardcoded into the lbry functions as it never changes
global LBRYNetFilepath
LBRYNetFilepath := "C:\Program Files\LBRY\resources\static\daemon\lbrynet.exe"
@ -107,8 +106,7 @@ Array_Index_Num_of_Upload_StatusChecks := [144,288,432, 576,720,864]
; Check if Lib folder exists and create it if not
LibFolder := A_ScriptDir . "\Lib"
ErrorLoggingFolder := A_ScriptDir . "\Lib\ErrorLogging"
if(!FileExist(ErrorLoggingFolder))
ErrorLoggingFolder := A_ScriptDir . "\Lib\ErrorLogging"
FileCreateDir, %ErrorLoggingFolder%
; Set filepaths for different files and folders
@ -194,6 +192,11 @@ PostSchedulerGitReleasesAPIURL = https://freedomain.dev/api/v1/repos/yuriy/post-
IniRead, PostSchedulerVersion, %SettingsIniFilepath%, Freedomain Post Scheduler, Version, 0.0
IniRead, PostSchedulerFilepath, %SettingsIniFilepath%, Filepaths, PostScheduler, %A_Space%
; Msgbox % "PostSchedulerVersion: " PostSchedulerVersion
; IniRead, OutputVar, Filename, Section, Key [, Default]
;---LBRY Settings---
;------------------------------------------------
IniRead, LBRYNewVideoStakeAmount, %SettingsIniFilepath%, General, LBRYNewVideoStakeAmount, 1.0
@ -221,7 +224,7 @@ if(InStr(PassedInArgument1_Filepath,ScriptName) and InStr(PassedInArgument1_File
; move old version to backups folder, overwrite if name conflict
FileDelete, %PassedInArgument1_Filepath%
if(ErrorLevel){ ; most likely because the old version hasn't finished exiting yet
SaveOrPostProgress(Message:="Failed to Delete Old Program Version",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar")
SaveOrPostProgress(Message:="Moving Old Version to Backups",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar")
sleep, 2000
FileDelete, %PassedInArgument1_Filepath%
if(ErrorLevel){
@ -272,12 +275,9 @@ Loop, files, %VideoFolderDir%\*.*, F ; loop through the files in the director
if(FileNameWExt = "title.txt"){
FileRead, VideoTitle, %A_LoopFileFullPath%
; Generate the LBRY URL Slug on each startup in case Title changes between runs
LBRYURLSlug := VideoTitle
LBRYURLSlug := LBRYCMDTextReplacement(LBRYURLSlug)
OriginalVideoTitle := VideoTitle
OriginalLBRYURLSlug := LBRYURLSlug
}
if(FileNameWExt = "body.txt"){
@ -310,14 +310,8 @@ Loop, files, %VideoFolderDir%\*.*, F ; loop through the files in the director
FileGetSize, VideoFileSizeInMB, %A_LoopFileFullPath%, M
VideoInfoObj := Filexpro(VideoFilepath,
, "System.Video.TotalBitrate"
, "System.Video.FrameHeight"
, "System.Video.FrameWidth" )
try, VideoTotalBitrate := VideoInfoObj["System.Video.TotalBitrate"]
try, VideoHeight := VideoInfoObj["System.Video.FrameHeight"]
try, VideoWidth := VideoInfoObj["System.Video.FrameWidth"]
VideoAspectRatio := getAspectRatio(VideoWidth, VideoHeight)
, "System.Video.TotalBitrate" )
VideoTotalBitrate := VideoInfoObj["System.Video.TotalBitrate"]
}
@ -361,8 +355,6 @@ Loop, files, %VideoFolderDir%\*.mp3, F ; loop through the files in the direct
}
;---Read Info From Previous Run And Set Upload Options---
;--------------------------------------------------------
VideoLinksIniFile = %VideoFolderDir%\VideoLinks.ini
@ -371,9 +363,10 @@ if(FileExist(VideoLinksIniFile)){
IniRead, BitChuteURL, %VideoLinksIniFile%, URLs, BitChuteURL, %A_Space%
; LBRY
; removed on 2024/06/24, let's regenerate the slug each time in case the video file changes between runs
; IniRead, LBRYURLSlug, %VideoLinksIniFile%, Misc, LBRYURLSlug, %A_Space%
IniRead, LBRYURLSlug, %VideoLinksIniFile%, Misc, LBRYURLSlug, %A_Space%
if(LBRYURLSlug = ""){
LBRYURLSlug := OriginalLBRYURLSlug ; video title
}
; LBRY Video
IniRead, LBRYVideoURL, %VideoLinksIniFile%, URLs, LBRYVideoURL, %A_Space%
IniRead, LBRYVideoThumb, %VideoLinksIniFile%, Misc, LBRYVideoThumb, %A_Space%
@ -400,17 +393,18 @@ if(FileExist(VideoLinksIniFile)){
IniRead, UnauthorizedTVURL, %VideoLinksIniFile%, URLs, UnauthorizedTVURL, %A_Space%
; Misc Info
; ------------------------------------------------
; MISC
IniRead, ErrorLoggingFilePath, %VideoLinksIniFile%, Misc, ErrorLoggingFilePath, %A_Space%
; Double check that the file still exists on the system. if set var to blank so new file can be generated
if(!FileExist(ErrorLoggingFilePath)){
ErrorLoggingFilePath :=
IniRead, TempVideoThumbFilepath, %VideoLinksIniFile%, Misc, VideoThumbFilepath, %A_Space%
if(TempVideoThumbFilepath){ ; if Video Thumbnail was saved in last run, overwrite variable path that was grabbed in the file loop above
VideoThumbFilepath := TempVideoThumbFilepath
}
}
if(VideoFileSizeInMB < 50){
IniRead, Telegram, %VideoLinksIniFile%, Misc, Telegram, %A_Space%
}
}
; Create a directory for errorlogging if this is the first time working on this project
if(ErrorLoggingFilePath = ""){
@ -452,10 +446,6 @@ if(VideoFileSizeInMB > 6144){
Brighteon := 0
}
; Brighteon will fail if video does not have one of the following aspect ratios
BrighteonAcceptedAspectRatios := ["4:3","3:4","16:9","9:16"]
VideoHasBrighteonCompatibleAspectRatio := HasVal(BrighteonAcceptedAspectRatios, VideoAspectRatio)
; Override Website statuses if this is a schedule post based on Argument3
; ------------------------------------------------
@ -555,6 +545,16 @@ ToggleDevMode()
run, "%A_ScriptFullPath%" "LastPost"
Return
/*
OpenGiteaPage:
run, https://freedomain.dev/yuriy/video-uploader
Return
OpenErrorLog:
run, %ErrorLoggingFilePath%
Return
*/
UncheckAllPlatforms:
GuiControl,,Bitchute, 0
@ -615,13 +615,6 @@ UpdateScript()
; @todo: Save any changes made to the script before installing update
Return
PostToDiscordAndTelegram:
gosub, PostToDiscord
gosub, PostToTelegram
Return
/*
*/
@ -634,25 +627,11 @@ IniWrite, %YPosition%, %SettingsIniFilepath%, General, YPosition
Gui, Submit, NoHide
; 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%
if(VideoFilepath = ""){
Msgbox,4096,Error,No Video Filepath Found.`nPlease Input Video Filepath to Upload a Video.
Return
}
; Destroy GUI after checking everything is working
Gui, Destroy
@ -713,8 +692,7 @@ LBRYURLSlug := VideoTitle
LBRYURLSlug := LBRYCMDTextReplacement(LBRYURLSlug)
; Save the LBRY URL Slug to .ini file in case it's needed later
; removed on 2024/06/24, generating the URL SLugh each run going forward
; IniWrite, %LBRYURLSlug%, %VideoLinksIniFile%, Misc, LBRYUrlSlug
IniWrite, %LBRYURLSlug%, %VideoLinksIniFile%, Misc, LBRYUrlSlug
IniWrite, %VideoThumbFilepath%, %VideoLinksIniFile%, Misc, VideoThumbFilepath
IniWrite, %PodcastNumber%, %VideoLinksIniFile%, Misc, PodcastNumber
IniWrite, %VideoThumbFilepath%, %VideoLinksIniFile%, Misc, VideoThumbFilepath
@ -753,17 +731,11 @@ SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
Message := "TotalVideosUploaded: " TotalVideosUploaded
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
Message := "Video Information:`n VideoTotalBitrate:" . VideoTotalBitrate . "`nVideoAspectRatio:" . VideoAspectRatio
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Convert Video Title and Description into javascript formatting for sending to pages through js instead of plain selenium
JSVideoTitle := FormatTextToJSText(VideoTitle)
JSVideoDescription := FormatTextToJSText(VideoDescription)
JSVideoSummary := FormatTextToJSText(VideoSummary)
Message = JSVideoSummary:`n %JSVideoSummary%
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
; -------------------------------/Log Info To Text-------------------------------
@ -853,9 +825,10 @@ if(OdyseeAudio){
if(LocalsGrabURL){
Gosub, LocalsGrabURL
}
; // Upload to Sites
; ------------------------------------------------
if(URLOfLastErrorPage){
Message = Activating Tab of last failed post.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
@ -930,6 +903,7 @@ if(PodcastNumber = "") {
gosub, SetGUIVariables
gosub, SetAndShowResultsGUI
; #include %A_scriptDir%\Modules\GUI-Results-Window.ahk
SaveCurrentChromeVersionToIniFile()
@ -1018,32 +992,90 @@ if(!SocialMediaPosterFilepath or !FileExist(SocialMediaPosterFilepath)){
*/
; Copy Info to Clipboard based on the button clicked
; Copy Info from GUI to Clipboard
; ------------------------------------------------
CopyToClipboard:
Message = Copying %A_GuiControl% to Clipboard
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
(A_GuiControl = "Transcript URL")?(Clipboard := PodcastTranscriptURL):()
(A_GuiControl = "Bitchute")?(Clipboard := BitChuteURL):()
(A_GuiControl = "Brighteon")?(Clipboard := BrighteonURL):()
(A_GuiControl = "DailyMotion")?(Clipboard := DailyMotionURL):()
(A_GuiControl = "Odysee Video")?(Clipboard := OdyseeVideoURL):()
(A_GuiControl = "Odysee Audio")?(Clipboard := OdyseeAudioURL):()
(A_GuiControl = "Rumble")?(Clipboard := RumbleURL):()
(A_GuiControl = "Locals")?(Clipboard := LocalsURL):()
(A_GuiControl = "Unauthorized")?(Clipboard := UnauthorizedTVURL):()
(A_GuiControl = "Video Tags")?(Clipboard := VideoTags):()
(A_GuiControl = "Podcast Tags")?(Clipboard := PodcastTags):()
(A_GuiControl = "Description")?(Clipboard := VideoDescription):()
(A_GuiControl = "Summary")?(Clipboard := VideoSummary):()
; @todo: this can be converted into 1 gosub, with if/else statements based on the button clicked
CopyPodcastTranscriptURL:
Clipboard := PodcastTranscriptURL
Message := PodcastTranscriptURL . "`nCopied to Clipboard"
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyVideoTitle:
Clipboard := VideoTitle
SaveOrPostProgress(Message:=VideoTitle "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyBitChuteURL:
Clipboard := BitChuteURL
SaveOrPostProgress(Message:=BitChuteURL "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyBrighteonURL:
Clipboard := BrighteonURL
SaveOrPostProgress(Message:=BrighteonURL "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyDailyMotionURL:
Clipboard := DailyMotionURL
SaveOrPostProgress(Message:=DailyMotionURL "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyOdyseeVideoURL:
Clipboard := OdyseeVideoURL
SaveOrPostProgress(Message:=OdyseeVideoURL "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyOdyseeAudioURL:
Clipboard := OdyseeAudioURL
SaveOrPostProgress(Message:=OdyseeAudioURL "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyRumbleURL:
Clipboard := RumbleURL
SaveOrPostProgress(Message:=RumbleURL "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyVideoTags:
Clipboard := VideoTags
SaveOrPostProgress(Message:=VideoTags "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyPodcastTags:
Clipboard := PodcastTags
SaveOrPostProgress(Message:=PodcastTags "`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
CopyVideoDescription:
Clipboard := VideoDescription
SaveOrPostProgress(Message:="Video Description`nCopied to Clipboard",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
ToolTip
Return
; @todo: Add thumbnail status to this
; @todo: add podcast tags to this
UpdateINI:
@ -1096,9 +1128,11 @@ run, "%A_ScriptFullPath%" "ShowResults"
ExitApp
; -----------------------------------------------
; GoSub Labels
; -----------------------------------------------
SendErrorLoggingThroughTelegram:
msgbox, I don't do nothin atm
Return
; Post-To-Telegram
;------------------------------------------------

@ -1 +1 @@
Subproject commit 95bda715cb2bf2d9dd062e37e61d2dd0a281fcc3
Subproject commit e654611bf3780c5a38ab700517fd34b6de78ebe2

@ -6,24 +6,13 @@ Message = Starting Upload
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Status := NavigateFromBaseURLTo("https://www.bitchute.com/")
Status := NavigateFromBaseURLTo("https://www.bitchute.com/myupload", "BitChute Video Uploader")
if(Status)
Return
Message = Checking Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = (//div[normalize-space()='Sign in'])[1]
try LoginStatus := driver.findelementbyxpath(Xpath).Attribute("innerText")
if(LoginStatus = "Sign In"){
Message = Logged out. Trying to Log Back In
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
/*
try TabUrl := driver.url
if(InStr(TabUrl, "/accounts/login/")){
if(AutoLogin){
@ -46,33 +35,10 @@ if(InStr(TabUrl, "/accounts/login/")){
}
}
*/
CheckForAlerts()
if(BitchuteUploadUploadURL = "")
{
; click on video upload icon so dropdown menu appears
Xpath = (//i[normalize-space()='video_call'])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; grab upload url from dropdown menu
Xpath = (//a[@id='id_upload_video'])[1]
UploadURL := GetHTMLValueFromXpathOuterHTML(XPATH, "href")
if(!InStr(UploadURL, "https")){
Message = Failed to Grab Upload Page URL from Home Page
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
UploadURL := StrReplace(UploadURL, "api.bitchute", "old.bitchute")
}
try, driver.Get(UploadURL) ;Open selected URL
try, driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
Message = Inputting Title
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@ -164,15 +130,15 @@ Loop, 3 {
}
Message = Inputting Tags: %BitchuteTags%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
; input Search Terms (Tags)
Xpath = //input[@placeholder='Search Terms']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=BitchuteTags)
if(Status){
Message = Failed to input search terms (tags)
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Message = Failed to input search terms (tags)
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
js = return document.querySelector("#hashtags").value;
@ -320,10 +286,9 @@ if(VideoHref = ""){
Return
}
BitChuteURL := "https://old.bitchute.com/" . VideoHref
BitChuteURL := "https://www.bitchute.com/" . VideoHref
BitChuteURL := StrReplace(BitchuteURL, "//video", "/video")
; navigate to video page
try driver.Get(BitChuteURL) ;Open selected URL
driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
@ -350,9 +315,6 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,Disc
Xpath = //button[normalize-space()='Save']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
BitChuteURL := StrReplace(BitchuteURL, "old.", "")
Message = Upload Complete:`n%BitChuteURL%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
IniWrite, %BitChuteURL%, %VideoLinksIniFile%, URLs, BitChuteURL

@ -279,15 +279,10 @@ Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSize% vOdyseeAudio Checked%O
Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSize% vRumble Checked%Rumble% gUpdateVars, Rumble
; Brighteon Does not accept videos lower than 300kbps or that don't have the appropriate aspect ratio
if(VideoTotalBitrate < 300000 OR !VideoHasBrighteonCompatibleAspectRatio){
if(!VideoHasBrighteonCompatibleAspectRatio)
Gui, Add, Checkbox, cRed vBrighteon y+%MarginSize% Checked0 gUpdateVars, Brighteon (Aspect Ratio is %VideoAspectRatio%)
else,
Gui, Add, Checkbox, cRed vBrighteon y+%MarginSize% Checked0 gUpdateVars, Brighteon (Bitrate Below 300kbps)
}
if(VideoTotalBitrate > 300000)
Gui, Add, Checkbox, vBrighteon y+%MarginSize% Checked%Brighteon% gUpdateVars, Brighteon
else,{
Gui, Add, Checkbox, vBrighteon y+%MarginSize% Checked%Brighteon% gUpdateVars, Brighteon
Gui, Add, Checkbox, cRed vBrighteon y+%MarginSize% Checked0 gUpdateVars, Brighteon (Bitrate Below 300kbps)
}
Gui, Add, Checkbox, vDailyMotion y+%MarginSize% Checked%DailyMotion% gUpdateVars, DailyMotion
@ -364,67 +359,67 @@ Gosub, SetGUIVariables
Gui, Font, s%GuiFontSize%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+%MarginSize% h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard,Transcript URL
Gui, Add, Button, x%MarginSize% y+%MarginSize% h%ButtonHeights% w%CopyButtonWidths% gCopyPodcastTranscriptURL,Transcript URL
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% w%ResultEditBoxWidth% gUpdateVars vPodcastTranscriptURL, %PodcastTranscriptURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+%MarginSize% h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Bitchute
Gui, Add, Button, x%MarginSize% y+%MarginSize% h%ButtonHeights% w%CopyButtonWidths% gCopyBitChuteURL, Bitchute
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vBitChuteURL w%ResultEditBoxWidth% gUpdateVars , %BitChuteURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+%MarginSize% h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Brighteon
Gui, Add, Button, x%MarginSize% y+%MarginSize% h%ButtonHeights% w%CopyButtonWidths% gCopyBrighteonURL, Brighteon
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vBrighteonURL w%ResultEditBoxWidth% gUpdateVars , %BrighteonURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, DailyMotion
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyDailyMotionURL, DailyMotion
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vDailyMotionURL w%ResultEditBoxWidth% gUpdateVars , %DailyMotionURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Odysee Video
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyOdyseeVideoURL, Odysee Video
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vOdyseeVideoURL w%ResultEditBoxWidth% gUpdateVars, %OdyseeVideoURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Odysee Audio
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyOdyseeAudioURL, Odysee Audio
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vOdyseeAudioURL w%ResultEditBoxWidth% gUpdateVars , %OdyseeAudioURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Rumble
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyRumbleURL, Rumble
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vRumbleURL w%ResultEditBoxWidth% gUpdateVars , %RumbleURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Locals
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths%, Locals
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vLocalsURL w%ResultEditBoxWidth% gUpdateVars, %LocalsURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Unauthorized
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths%, Unauthorized
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vUnauthorizedTVURL w%ResultEditBoxWidth% gUpdateVars, %UnauthorizedTVURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Video Tags
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyVideoTags vVideoTagsEdit, Video Tags
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vVideoTags w%ResultEditBoxWidth% gUpdateVars , %VideoTags%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Podcast Tags
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyPodcastTags, Podcast Tags
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vPodcasttags w%ResultEditBoxWidth% gUpdateVars , %Podcasttags%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Description
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyVideoDescription, Description
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vVideoDescription w%ResultEditBoxWidth% gUpdateVars , %VideoDescription%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Summary
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyVideoDescription, Summary
Gui, Font, Normal
Gui, Font, Normal
@ -461,8 +456,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% 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% y+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gPostToDiscord vPostToDiscordButton, Post to Discord
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
; Row 3

@ -122,17 +122,15 @@ if(Status){
; make sure the "Notify Users" checkbox is selected
Xpath = (//input[contains(@name,'is_do_promo')])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=1000)
try, Status := driver.findelementbyxpath(Xpath).isSelected()
if(Status = 0){
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=1000)
try, Status := driver.findelementbyxpath(Xpath).isSelected()
if(Status = "0"){
Message = Failed to Check ON the Notify Users Checkbox
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
if(Status = "0"){
Message = Failed to Check ON the Notify Users Checkbox
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
; check if the "Auto Submit Post" checkbox is checked, and if not check it
js = return document.querySelector("#autosubmit_enabled").checked;
try AutoSubmitstatus := driver.executeScript(js)

@ -247,11 +247,9 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //textarea[@id='description']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; Format text JS
; Input Description
JSVideoDescription := FormatTextToJSText(VideoDescription)
JSVideoSummary := FormatTextToJSText(VideoSummary)
; Input Description
js = document.getElementById('description').value = "%JSVideoDescription%";
try driver.executeScript(js)
@ -333,7 +331,7 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Change GUI button from "Upload Podcast"
GuiControl,,UploadPodcast, Podcast Uploaded
; sleep, 5000
sleep, 5000
CurrentSite :=
ToolTip

@ -1,15 +1,7 @@
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
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@ -23,72 +15,47 @@ if(DiscordVideosWebhookURL = ""){
}
; 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 :=
Message :=
DiscordVideoDescription :=
TooltipMessage = Checking Bitchute and Brighteon URL for Processing Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Message :=
; check the status of the Bitchute URL to see if it's done processing
; shows "404 - Page not found" on page if not
if(BitChuteURL){
if(!InStr(URLDownloadToVar(BitChuteURL), "404 - Page not found")){
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")
}
}
if(BitChuteURL != "")
Message .= "[BitChute](<" . BitChuteURL . ">) \| "
; check the status of the Brighteon URL to see if it's done processing
; shows "404 - Page not found" on page if not
if(BrighteonURL){
if(!InStr(URLDownloadToVar(BrighteonURL), "SELECTED IS NOT CURRENTLY AVAILABLE")){
if(BrighteonURL != "")
VideoLinks .= "[Brighteon](<" . BrighteonURL . ">) \| "
}
else, {
ErrorLogMsg = Brighteon URL skipped, URL Currently leads to: 404 - page not found
SaveOrPostProgress(Message:=ErrorLogMsg,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
}
if(BrighteonURL != "")
Message .= "[Brighteon](<" . BrighteonURL . ">) \| "
if(OdyseeVideoURL != "")
VideoLinks .= "[Odysee](<" . OdyseeVideoURL . ">) \| "
Message .= "[Odysee](<" . OdyseeVideoURL . ">) \| "
if(OdyseeAudioURL != "")
VideoLinks .= "[Odysee (Audio)](<" . OdyseeAudioURL . ">) \| "
Message .= "[Odysee (Audio)](<" . OdyseeAudioURL . ">) \| "
if(RumbleURL != "")
VideoLinks .= "[Rumble](<" . RumbleURL . ">) \| "
Message .= "[Rumble](<" . RumbleURL . ">) \| "
if(DailyMotionURL != "")
VideoLinks .= "[DailyMotion](<" . DailyMotionURL . ">) \| "
Message .= "[DailyMotion](<" . DailyMotionURL . ">) \| "
if(PodcastTranscriptURL != "")
VideoLinks .= "[Video Transcript](<" . PodcastTranscriptURL . ">) \| "
Message .= "[Video Transcript](<" . PodcastTranscriptURL . ">) \| "
if(PodcastNumber != "")
VideoLinks .= "[FDRPodcasts](<" . "https://fdrpodcasts.com/" . PodcastNumber . ">) \| "
Message .= "[FDRPodcasts](<" . "https://fdrpodcasts.com/" . PodcastNumber . ">) \| "
; StrLenOfDiscordMessage :=
; 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(Message)) > 2000){
DiscordAPICharsLeft := 2000 - StrLen(VideoTitle) - StrLen(VideoLinks) - 15
DiscordAPICharsLeft := 2000 - StrLen(VideoTitle) - StrLen(Message) - 15
DiscordVideoDescription := SubStr(VideoDescription, 1, DiscordAPICharsLeft) . "..."
}
else,
DiscordVideoDescription := VideoDescription
Message = VideoLinks variable contents:
Message := "**" . VideoTitle . "**" . "`n" . DiscordVideoDescription . "`n`n" . VideoLinks
Message := "**" . VideoTitle . "**" . "`n" . Message . "`n" . DiscordVideoDescription
Status := UploadImageToDiscord(DiscordVideosWebhookURL, Message, VideoThumbFilepath)
Message = API Response:`n%Status%
@ -96,7 +63,7 @@ SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile")
SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile")
GuiControl,, PostToDiscordTelegramButton, Discord - Posted Successfully
GuiControl,, PostToDiscordButton, Discord - Posted Successfully
sleep, 2000
ToolTip

@ -1,14 +1,6 @@
PostToTelegram:
;------------------------------------------------
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
}
CurrentSocialMediaPosting := "Telegram"
Message = Posting Video Links to Telegram
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@ -23,47 +15,41 @@ if(TelegramBotToken = "" Or TelegramBotChatID =""){
Message = TelegramBotToken or TelegramBotChatID is missing from %SettingsIniFilepath%. `nPlease input them and click the button again.
msgbox, 4096, Error!, %Message%
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
}
/*
; 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 := "*" . TelegramVideoTitle . "*"
TelegramBodymessage := ASCIISTRReplace(VideoDescription)
; Variables
LineBreakChar = `%0A ; Used for API
VideoLinks :=
LineBreakChar = `%0A ; Used for API
; Create the Hyperlinks for each Platform
; ------------------------------------------------
; check the status of the Bitchute URL to see if it's done processing
; shows "404 - Page not found" on page if not
if(BitChuteURL){
if(!InStr(URLDownloadToVar(BitChuteURL), "404 - Page not found")){
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")
}
}
if(BitChuteURL != "")
VideoLinks .= "[BitChute](" . BitChuteURL . ") \| "
; check the status of the Brighteon URL to see if it's done processing
; shows "404 - Page not found" on page if not
if(BrighteonURL){
if(!InStr(URLDownloadToVar(BrighteonURL), "SELECTED IS NOT CURRENTLY AVAILABLE")){
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")
}
}
if(BrighteonURL != "")
VideoLinks .= "[Brighteon](" . BrighteonURL . ") \| "
if(OdyseeVideoURL != "")
VideoLinks .= "[Odysee](" . OdyseeVideoURL . ") \| "
@ -77,6 +63,10 @@ VideoLinks .= "[Rumble](" . RumbleURL . ") \| "
if(DailyMotionURL != "")
VideoLinks .= "[DailyMotion](" . DailyMotionURL . ") \| "
/*if(PodcastTranscriptURL != "")
VideoLinks .= "[Video Transcript](" . PodcastTranscriptURL . ") \| "
*/
if(PodcastNumber != "")
VideoLinks .= "[FDRPodcasts](" . "https://fdrpodcasts.com/" . PodcastNumber . ") \| "
@ -84,92 +74,94 @@ VideoLinks .= "[FDRPodcasts](" . "https://fdrpodcasts.com/" . PodcastNumber . ")
TelegramMessage := TelegramVideoTitle . "`n" . TelegramBodymessage . "`n" . VideoLinks
StrLenOfMessageAndVideoLinks := StrLen(TelegramVideoTitle) + StrLen(TelegramBodymessage) + StrLen(VideoLinks)
; DevModeMsgBox(StrLenOfMessageAndVideoLinks)
; If Length of Title, Video Links and Message is less than 1024 characters:
; ------------------------------------------------
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
; Output returned data to ErrorLog File
Message = API Response:`n%Status%
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
if(InStr(Status, "error_code")){
Message = Telegram Post Failed Due To An Api Issue. Please See Errorlog For More Info.
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
}
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(StrLenOfMessageAndVideoLinks < 4096){
Message = Sending Post as Two Messages
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Photo and Video Title go into SendPhoto
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
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
; Output returned data to ErrorLog File
Message = API Response:`n%Status%
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
; Video Description goes into TelegramMessage
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessage)
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
; Output returned data to ErrorLog File
Message = API Response:`n%Status%
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
}
else, {
; If Title, links and message are longer than 4096 chars, we need to split them into multiple messages
; ------------------------------------------------
Message = Sending Post as Multiple Messages
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile")
} 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
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)
; 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]
; 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
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := Description)
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")
}
}
Message = Video Links Posted to Telegram Successfully
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
GuiControl,, PostToDiscordTelegramButton, Telegram - Posted Successfully
; SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile")
Message = Video Links Posted to Telegram Successfully
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
GuiControl,, PostToTelegramButton, Telegram - Posted Successfully
ToolTip
CurrentSite :=
Return
; -------------------------------/Telegram-------------------------------
; sleep, 2000
ToolTip
CurrentSite :=
Return
; -------------------------------/Telegram-------------------------------

@ -124,32 +124,51 @@ Loop, 5 { ; Attempt to input video description a couple of times
Xpath = (//input[@placeholder='- Primary category -'])[1]
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
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
Xpath = (//fieldset[@id='channelId'])[1]
Try Channels := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
UploadChannelName := StrSplit(Channels, "`n")[2]
; @todo replace with regex
js = return document.querySelector("#channelId").innerHTML;
try, ChannelIDNumber := driver.executeScript(js)
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
ChannelIDNumber := StrSplit(ChannelIDNumber, "option value=")
if(!UploadChannelName){
Message = Failed to Grab Upload Channel Name
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
ChannelIDNumber := ChannelIDNumber[3]
SingleQuote = "
ChannelIDNumber := StrSplit(ChannelIDNumber, "data-private")
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
}
Xpath = (//label[normalize-space()='%UploadChannelName%'])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; //option[@value='762377'] ; freedomain
Xpath = //option[@value='%ChannelIDNumber%']
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
Message = Inputting Tags

@ -1,28 +1,16 @@
# Automated Video and Podcast Uploading to Multiple Sites using Autohotkey, Selenium, and Platform APIs
![Alt text](Assets/Screenshots/MainScreen_v341.png "Screenshot of Main and Results Window")
# Supported Platforms
| Platform | Upload Type |
|--|--|
| Locals | Video Upload w/Selenium |
| Bitchute | Video Upload w/Selenium |
| Rumble | Video Upload w/Selenium |
| DailyMotion | Video Upload w/Selenium |
| Brighteon | Video Upload w/Selenium |
| Odysee | Video + Audio Upload w/LBRY API |
| FDRPodcasts | Podcast w/Selenium |
| Discord | Announcement w/API |
| Telegram | Announcement w/API |
## Other Features
- Install Uploader Updates from Gitea automatically
- Install Chrome Updates from chromium.org automatically
- Schedule Posts for a later date & time
- Log Errors to a Discord Channel using webhook
- Discord Ping on Upload Completion
- Setting to confirm an upload before it's published
- Setting to show Tooltip progress at top of the screen showing current action being executed
# Freedomain-Video-Uploader
Video Uploader written for the [Freedomain Philosophy Show](https://freedomain.com/)
![Alt text](Assets/Screenshots/Screenshot_Main_Results.png "Screenshot of Main and Results Window")
## Features
Automated posting to the following media platform using either the Platform's API or Selenium Chrome automation.
|**Locals**|**Bitchute**|**Rumble**|**DailyMotion**|**Brighteon**|**Odysee**
|--|--|--|--|--|--|
|Selenium|Selenium|Selenium|Selenium|Selenium|LBRY API
# Installation
1. Install .Net Framework 3.5
@ -40,11 +28,14 @@
- When run, the Uploader will automatically create the folders and files it requires in the same directory it's run from.
# Using Portable Version of Chrome
Using Selenium with a portable `Chrome for Testing` version of Chrome is the preferred way of uploading as it gives you full control over chrome and chromedriver updates and when to install them.
- When running the uploader for the first time, you will be notified that `Chrome for Testing` was not found and that you can download it by clicking the `Chrome Up to Date` button. This will automatically get the latest version of Chrome and download + extract it to the the `\lib\` folder. It will also download the appropriate `chromedriver.exe` file for that version and prompt you for admin permission to move it to `C:\Program Files\SeleniumBasic\chromedriver.exe`.
Using a portable version of Chrome will give you full control over chrome and chromedriver updates.
# Windows Defender False Positive
Windows Defender will sometimes flag the compiled .exe version as a false positive. The easiest way to get around this is to whitelist the directory the folder where you're keeping the Uploader files in. To do this, open up `Windows Powershell` as Administrator and run the following command: `Add-MpPreference -ExclusionPath "PATHTOTHEFOLDER"`, eg: `Add-MpPreference -ExclusionPath "C:\Users\yuriy\Downloads\VideoUploader"`
The Uploader will check for a portable version of Chrome first, before defaulting to the system installation
1. To use a portable version of Chrome, download the latest version Chrome version that has a chromedriver from [Chrome-for-Testing](https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone-with-downloads.json), extract the `chrome-win64.zip` file and move the extracted folder to the `\Lib\` directory:
The resulting chrome filepath should be `..\Freedomain-Video-Uploader-Folder\Lib\chrome-win64\chrome.exe`
2. Download the `win64` chromedriver for the same version and move it to `C:\Program Files\SeleniumBasic\chromedriver.exe`
# Settings File
The Uploader reads & saves its settings to a `settings.ini` file, All customization, including custom profile URLs are stored here.
@ -81,8 +72,8 @@ You can select a different file in the main window if the auto selection does no
# LBRY Desktop Application `daemon_settings.yml`
Due to the LBRY Video Platform 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` [Source](https://www.reddit.com/r/lbry/comments/11zwtmj/is_lbry_down/)
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
@ -101,13 +92,7 @@ I have done my best to catch any possible errors that might pop up and write fun
2. `git clone` the project and then either run the `Compile Uploader to EXE.ahk` autohotkey script to automatically compile, or start up the AHK compiler that comes installed with Autohotkey and select the `Freedomain Video Uploader.ahk` and `\Assets\FreedomainVideo.ico` icon.
# Helper Tools
The following tools will be automatically downloaded from Gitea as needed in order to do the following actions.
# Extra Tools
## LBRY-Process-Killer
Program that continuously reads the lbrynet.log for when your videos are fully uploaded/seeded to lbry and then kills the LBRY process. This can be be disabled using the `Kill LBRY after Uploading` checkbox on the main screen
## Post Scheduler
Program that continually checks the `Scheduled Posts` folder and automatically starts the Uploader with the specific video/post at the specified scheduled time.
##
Autohotkey script that continuously reads the lbrynet.log for when your videos are fully uploaded/seeded to lbry and then kills the LBRY process.

@ -1,3 +1,3 @@
[Video-Uploader]
Version=3.53
Version=3.39
Name=Freedomain Video Uploader

Loading…
Cancel
Save