Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dbdefc5a95 | |||
| 613f9d222a |
125
Compile and Release.ahk
Normal file
125
Compile and Release.ahk
Normal 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-----------------------------------------------------------------------
|
||||
@@ -14,22 +14,8 @@ 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
|
||||
@@ -77,9 +63,6 @@ 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
|
||||
|
||||
|
||||
@@ -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
|
||||
; shows "404 - Page not found" on page if not
|
||||
if(BitChuteURL){
|
||||
if(!InStr(URLDownloadToVar(BitChuteURL), "404 - Page not found")){
|
||||
if(BitChuteURL != "")
|
||||
VideoLinks .= "[BitChute](<" . BitChuteURL . ">) \| "
|
||||
@@ -32,9 +33,12 @@ 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
|
||||
; 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 . ">) \| "
|
||||
@@ -43,7 +47,7 @@ else, {
|
||||
ErrorLogMsg = Brighteon URL skipped, URL Currently leads to: 404 - page not found
|
||||
SaveOrPostProgress(Message:=ErrorLogMsg,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(OdyseeVideoURL != "")
|
||||
VideoLinks .= "[Odysee](<" . OdyseeVideoURL . ">) \| "
|
||||
@@ -63,6 +67,9 @@ VideoLinks .= "[Video Transcript](<" . PodcastTranscriptURL . ">) \| "
|
||||
if(PodcastNumber != "")
|
||||
VideoLinks .= "[FDRPodcasts](<" . "https://fdrpodcasts.com/" . PodcastNumber . ">) \| "
|
||||
|
||||
Clipboard := VideoLinks
|
||||
Msgbox % "VideoLinks: " VideoLinks
|
||||
|
||||
|
||||
; StrLenOfDiscordMessage :=
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ LineBreakChar = `%0A ; Used for API
|
||||
|
||||
; 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 . ") \| "
|
||||
@@ -57,10 +58,11 @@ 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
|
||||
; 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 . ") \| "
|
||||
@@ -69,7 +71,7 @@ else, {
|
||||
LogMessage = Brighteon URL skipped, URL Currently leads to: 404 - page not found
|
||||
SaveOrPostProgress(Message:=LogMessage,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(OdyseeVideoURL != "")
|
||||
VideoLinks .= "[Odysee](" . OdyseeVideoURL . ") \| "
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
[Video-Uploader]
|
||||
Version=3.41
|
||||
Version=3.43
|
||||
Name=Freedomain Video Uploader
|
||||
APIURL=
|
||||
Reference in New Issue
Block a user