3 Commits
3.42 ... 3.46

Author SHA1 Message Date
dbdefc5a95 Initial version of Release Automation 2024-07-02 15:14:56 -04:00
613f9d222a Fixed errorout when bitchute or brighteon URLs missing 2024-07-02 15:10:21 -04:00
f3817cb9f9 fixed bitchute URL missing solidus 2024-07-01 13:10:48 -04:00
6 changed files with 141 additions and 22 deletions

125
Compile and Release.ahk Normal file
View File

@@ -0,0 +1,125 @@
;---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------------------------------------------------------
; [IniFile]
; FileNameOfAHKScripttoCompile=
; ICOFileName=
;---VARIABLES-----------------------------------------------------------------------
;---MAIN SCRIPT---------------------------------------------------------------------
AHKFilepath = %A_ScriptDir%\Freedomain Video Uploader.ahk
Exefilepath = %A_ScriptDir%\Freedomain Video Uploader.exe
icopath = %A_ScriptDir%\Assets\FreedomainVideo.ico
VersionIniFP = %A_ScriptDir%\Version.ini
; 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)
; Msgbox % "VersionNumber: " VersionNumber
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, Freedomain Video Uploader.exe
sleep, 1000
; 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
}
}
if(!FileExist(AHKFilepath)){
msgbox, %AHKFilepath% does not exist`nExiting
ExitApp
}
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%""
InputBox, ReleaseBody, Release Body, Please Input Release Body,
cred := CredRead("FDR-Gitea-Token")
GiteaToken := Cred.Password
; Info for Creating the Release with Gitea-CreateRelease.ps1
PS1Filepath = %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Gitea-CreateRelease.ps1
APIURL = https://freedomain.dev/api/v1/repos/yuriy/video-uploader/releases?token=%GiteaToken%
ReleaseName := VersionNumber
ReleaseTag := VersionNumber
; ReleaseBody := "-Fixed Item 1--Fixed Item 2--Fixed Item 3"
Command = Powershell "%PS1Filepath%" "%APIURL%" "%ReleaseName%" "%ReleaseTag%" "%ReleaseBody%"
Clipboard := Command
Msgbox % "Command: " Command
Returned := RunCMD(Command)
Clipboard := Returned
Msgbox % "Returned: " Returned
; Pull out the relead ID Number, used for uploading attachmenets
SplitText = @{id=
SplitText2 = `;
ReleaseID := StrSplit(Returned, SplitText)[2]
ReleaseID := StrSplit(ReleaseID, SplitText2)[1]
Clipboard := ReleaseID
Msgbox % "ReleaseID: " ReleaseID
; runcmd()
ExitApp
;---FUNCTIONS-----------------------------------------------------------------------

View File

@@ -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

View File

@@ -321,7 +321,8 @@ if(VideoHref = ""){
} }
BitChuteURL := "https://old.bitchute.com/" . VideoHref BitChuteURL := "https://old.bitchute.com/" . VideoHref
BitChuteURL := StrReplace(BitchuteURL, "//", "/") BitChuteURL := StrReplace(BitchuteURL, "//video", "/video")
; navigate to video page ; navigate to video page
try driver.Get(BitChuteURL) ;Open selected URL try driver.Get(BitChuteURL) ;Open selected URL

View File

@@ -24,6 +24,7 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,Disc
; 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 +33,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 +47,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,6 +67,9 @@ VideoLinks .= "[Video Transcript](<" . PodcastTranscriptURL . ">) \| "
if(PodcastNumber != "") if(PodcastNumber != "")
VideoLinks .= "[FDRPodcasts](<" . "https://fdrpodcasts.com/" . PodcastNumber . ">) \| " VideoLinks .= "[FDRPodcasts](<" . "https://fdrpodcasts.com/" . PodcastNumber . ">) \| "
Clipboard := VideoLinks
Msgbox % "VideoLinks: " VideoLinks
; StrLenOfDiscordMessage := ; StrLenOfDiscordMessage :=

View File

@@ -49,6 +49,7 @@ LineBreakChar = `%0A ; Used for API
; 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 . ") \| "
@@ -57,10 +58,11 @@ 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 . ") \| "
@@ -69,7 +71,7 @@ else, {
LogMessage = Brighteon URL skipped, URL Currently leads to: 404 - page not found LogMessage = Brighteon URL skipped, URL Currently leads to: 404 - page not found
SaveOrPostProgress(Message:=LogMessage,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=LogMessage,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
} }
}
if(OdyseeVideoURL != "") if(OdyseeVideoURL != "")
VideoLinks .= "[Odysee](" . OdyseeVideoURL . ") \| " VideoLinks .= "[Odysee](" . OdyseeVideoURL . ") \| "

View File

@@ -1,3 +1,4 @@
[Video-Uploader] [Video-Uploader]
Version=3.41 Version=3.43
Name=Freedomain Video Uploader Name=Freedomain Video Uploader
APIURL=