Compare commits
42 Commits
Author | SHA1 | Date |
---|---|---|
Yuriy | 199fbc1b78 | 4 weeks ago |
Yuriy | 9c52c6ec8d | 4 weeks ago |
Yuriy | 959a81bf98 | 2 months ago |
Yuriy | ce9f8a9885 | 4 months ago |
Yuriy | 71c4093bd9 | 4 months ago |
Yuriy | ba33d479ac | 4 months ago |
Yuriy | da34b98324 | 4 months ago |
Yuriy | 9e76ace3c3 | 4 months ago |
Yuriy | fd0b620e23 | 4 months ago |
Yuriy | c7924f7cc7 | 4 months ago |
Yuriy | 8b43ddc8be | 4 months ago |
Yuriy | dbdefc5a95 | 4 months ago |
Yuriy | 613f9d222a | 4 months ago |
Yuriy | f3817cb9f9 | 4 months ago |
Yuriy | 478f8f769e | 4 months ago |
Yuriy | 1b856287df | 4 months ago |
Yuriy | 45e2d2b0f0 | 5 months ago |
Yuriy | 76d410e4d3 | 5 months ago |
Yuriy | ee21a03d55 | 5 months ago |
Yuriy | 540a688733 | 5 months ago |
Yuriy | be75660548 | 5 months ago |
Yuriy | 9f1388160c | 5 months ago |
Yuriy | 4ce82bde6a | 5 months ago |
Yuriy | d1e471bd26 | 5 months ago |
Yuriy | f5ffe32766 | 5 months ago |
Yuriy | dcd947b136 | 5 months ago |
Yuriy | 4476bfdda6 | 5 months ago |
Yuriy | 5f63640185 | 5 months ago |
Yuriy | 6639c907c9 | 5 months ago |
Yuriy | 3492ecccee | 5 months ago |
Yuriy | 38a579c486 | 5 months ago |
Yuriy | 4beb83caa6 | 5 months ago |
Yuriy | b98ae5e190 | 5 months ago |
Yuriy | ba0bf308b4 | 5 months ago |
Yuriy | 58d80bd084 | 6 months ago |
Yuriy | 8b1a8d407c | 6 months ago |
Yuriy | b59bfbe2cf | 6 months ago |
Yuriy | c4b2eeea8e | 7 months ago |
Yuriy | 723dec3fac | 7 months ago |
Yuriy | c60a45445c | 7 months ago |
Yuriy | fa43716ebe | 7 months ago |
Yuriy | ef3cb41e9c | 7 months ago |
Before Width: | Height: | Size: 302 KiB After Width: | Height: | Size: 302 KiB |
Binary file not shown.
After Width: | Height: | Size: 406 KiB |
@ -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%
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
||||
Subproject commit e32fe026e952738a1ebda7cf81c626d0528fa660
|
||||
Subproject commit 95bda715cb2bf2d9dd062e37e61d2dd0a281fcc3
|
@ -1,93 +0,0 @@
|
||||
|
||||
Gui, Font, s%GuiFontSize%
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyPodcastTranscriptURL,Transcript URL
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% w%ResultEditBoxWidths% gUpdateVars vPodcastTranscriptURL, %PodcastTranscriptURL%
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyBitChuteURL, Bitchute
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vBitChuteURL w%ResultEditBoxWidths% gUpdateVars , %BitChuteURL%
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyBrighteonURL, Brighteon
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vBrighteonURL w%ResultEditBoxWidths% gUpdateVars , %BrighteonURL%
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyDailyMotionURL, DailyMotion
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vDailyMotionURL w%ResultEditBoxWidths% gUpdateVars , %DailyMotionURL%
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyOdyseeVideoURL, Odysee Video
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vOdyseeVideoURL w%ResultEditBoxWidths% gUpdateVars, %OdyseeVideoURL%
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyOdyseeAudioURL, Odysee Audio
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vOdyseeAudioURL w%ResultEditBoxWidths% gUpdateVars , %OdyseeAudioURL%
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyRumbleURL, Rumble
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vRumbleURL w%ResultEditBoxWidths% gUpdateVars , %RumbleURL%
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths%, Locals
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vLocalsURL w%ResultEditBoxWidths% gUpdateVars, %LocalsURL%
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyVideoTags vVideoTagsEdit, Video Tags
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vVideoTags w%ResultEditBoxWidths% gUpdateVars , %VideoTags%
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyPodcastTags, Podcast Tags
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vPodcasttags w%ResultEditBoxWidths% gUpdateVars , %Podcasttags%
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x%Marginspace% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyVideoDescription, Description
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x+5 yp+0 h50 vVideoDescription w%ResultEditBoxWidths% gUpdateVars , %VideoDescription%
|
||||
|
||||
Gui, Font, s%GuiFontSize%
|
||||
Gui, Font, Bold
|
||||
|
||||
Gui, Add, Button, x%ResultEditBoxXPos% w%ResultEditBoxHalfWidths% gUpdateINI, Save Modified Links
|
||||
Gui, Add, Button, x+%MarginSpace% w%ResultEditBoxHalfWidths% gUploadPodcast, Upload Podcast
|
||||
|
||||
Gui, Add, Button, x%ResultEditBoxXPos% y+%MarginSpace% w%ResultEditBoxThirdsWidths% gPostToDiscord vPostToDiscordButton, Post to Discord
|
||||
Gui, Add, Button, x+5 w%ResultEditBoxThirdsWidths% gPostToTelegram vPostToTelegramButton, Post to Telegram
|
||||
Gui, Add, Button, x+5 w%ResultEditBoxThirdsWidths% gStartSocialMediaPoster, Start Social Media Poster
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Button, x%ResultEditBoxXPos% y+%MarginSpace% w%ResultEditBoxHalfWidths% gSendErrorLoggingThroughTelegram,
|
||||
Gui, Add, Button, x+%MarginSpace% w%ResultEditBoxHalfWidths% gRetryUpload, Try Failed Again
|
||||
|
||||
Gui, Add, Button, x%ResultEditBoxXPos% w%ResultEditBoxHalfWidths% gOpenLBRYBlobFilesFolder %ButtonWidths% , Open LBRY Blob Files Folder
|
||||
Gui, Add, Button, x+%MarginSpace% w%ResultEditBoxHalfWidths% gCancelPost %ButtonWidths% , Close
|
||||
; Gui, Add, Button, x+%MarginSpace% w%ResultEditBoxHalfWidths% gKillScript %ButtonWidths% , Close
|
||||
; gui, Add, Text, y+10
|
||||
|
||||
Gui, Font, s%GuiFontSize%
|
||||
Gui, Add, Button, x%ErrorLogEditBoxXPos% w%ErrorLogEditBoxWidth% y%MarginSpace% h%ButtonHeights%, Error Log
|
||||
Gui, Add, Edit,x%ErrorLogEditBoxXPos% h%ErrorLogEditBoxHeight% w%ErrorLogEditBoxWidth% y+10, %ErrorLogVar%
|
||||
|
||||
gui, font, Normal
|
||||
gui, font, s7
|
||||
Gui, Add, StatusBar,, Total Videos Uploaded: %TotalVideosUploaded% | Total Clicks Saved: %MouseClicksSaved%
|
||||
Gui, +Resize +MaximizeBox
|
||||
|
||||
OriginalVideoDescription := VideoDescription
|
||||
OriginalPodcastTags := PodcastTags
|
||||
|
||||
|
||||
if(XPosition and YPosition)
|
||||
Gui, Show,x%XPosition% y%YPosition%,%FullScriptName% - Upload Results
|
||||
else,
|
||||
Gui, Show,,%FullScriptName% - Upload Results
|
@ -1,307 +0,0 @@
|
||||
|
||||
; -------------------------------Functions-------------------------------
|
||||
|
||||
OnMsgBoxConfirmChromiumOverwrite() {
|
||||
DetectHiddenWindows, On
|
||||
Process, Exist
|
||||
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
|
||||
ControlSetText Button1, Cancel
|
||||
ControlSetText Button2, Yes
|
||||
}
|
||||
}
|
||||
|
||||
; https://www.autohotkey.com/docs/v2/Functions.htm#Variadic
|
||||
Join(sep, params*) {
|
||||
For index, param in params
|
||||
str .= param . sep
|
||||
return SubStr(str, 1, -StrLen(sep))
|
||||
}
|
||||
|
||||
|
||||
CheckLBRYProcess(){
|
||||
; Check if LBRY Process exists
|
||||
Process, Exist,LBRY.exe
|
||||
if(ErrorLevel = 0) ; if doesn't exist
|
||||
{
|
||||
Message = Not Running. Starting up LBRY.exe
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
LBRYExeFilepath = C:\Program Files\LBRY\LBRY.exe
|
||||
if(!FileExist(LBRYExeFilepath)){
|
||||
Message = Failed to Find LBRY.exe executable. LBRY not installed?
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
|
||||
Message = Checking LBRY daemon_settings.yml file for Odysee Wallet Servers
|
||||
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
FileRead, daemon_settingsFileContent, C:\Users\%A_UserName%\AppData\Local\lbry\lbrynet\daemon_settings.yml
|
||||
|
||||
if(!InStr(daemon_settingsFileContent, "a-hub1.odysee.com")){
|
||||
Message = Odysee wallet server is not in daemon_settings.yml. Replacing File with required settings.
|
||||
SaveOrPostProgress(Message:=Message,PostType:=",DiscordErrorLogging")
|
||||
|
||||
LBRYDaemonSettingsFP = C:\Users\%A_UserName%\AppData\Local\lbry\lbrynet\daemon_settings.yml
|
||||
LBRYDaemonSettingsBackupFP = C:\Users\%A_UserName%\AppData\Local\lbry\lbrynet\daemon_settings_BU.yml
|
||||
|
||||
|
||||
; Msgbox % "daemon_settingsText: " daemon_settingsText
|
||||
FileMove, %LBRYDaemonSettingsFP%, %LBRYDaemonSettingsBackupFP%, 1 ; Dest [, Flag (1 = overwrite)]
|
||||
|
||||
UrlDownloadToFile, https://freedomain.dev/yuriy/video-uploader/raw/branch/main/Assets/daemon_settings.yml , %LBRYDaemonSettingsFP%
|
||||
|
||||
sleep, 1000
|
||||
|
||||
if(!FileExist(LBRYDaemonSettingsFP)){
|
||||
Message = Failed to download the custom daemon_settings.yml file from git. Restoring Original File
|
||||
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
FileMove,%LBRYDaemonSettingsBackupFP%,%LBRYDaemonSettingsFP%, 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try run, "%LBRYExeFilepath%"
|
||||
Message = Waiting 1 Minute for LBRY to start up
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
|
||||
Sleep, 60000 ; 1 minute
|
||||
|
||||
Process, Exist,LBRY.exe
|
||||
if(ErrorLevel = 0) ; if doesn't exist
|
||||
{
|
||||
Message = Failed to Start LBRY.exe after 60 seconds of waiting
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
WinMinimize, LBRY
|
||||
}
|
||||
Return
|
||||
}
|
||||
|
||||
|
||||
GetPermanentLBRYURL(UploadResult){
|
||||
SingleQuotationmark = "
|
||||
|
||||
UploadResult := StrSplit(UploadResult, "`n") ; split results by new line
|
||||
|
||||
; Iterate through the array of the results
|
||||
Loop % UploadResult.Length() {
|
||||
PermanentURL := UploadResult[A_Index]
|
||||
if(InStr(PermanentURL, "permanent_url"))
|
||||
Break
|
||||
}
|
||||
|
||||
; Starting Result: "permanent_url": "lbry://Test-Video-161-Numbered#c9ad9afe54c7178d6f870b59bbe129aef8efc3ff",
|
||||
PermanentURL := StrSplit(PermanentURL, "lbry:")
|
||||
PermanentURL := "lbry:" . PermanentURL[2]
|
||||
PermanentURL := StrReplace(PermanentURL, ",", "")
|
||||
PermanentURL := StrReplace(PermanentURL, SingleQuotationmark, "")
|
||||
PermanentURL := StrReplace(PermanentURL, "`n", "")
|
||||
PermanentURL := StrReplace(PermanentURL, "`r", "")
|
||||
|
||||
; End Result lbry://Test-Video-161-Numbered#c9ad9afe54c7178d6f870b59bbe129aef8efc3ff
|
||||
Return PermanentURL
|
||||
}
|
||||
|
||||
|
||||
GetLBRYCanonicalURL(LBRYJSONObject){ ; input json string
|
||||
; ResolveURL := StrSplit(LBRYResolveAPICommand, "lbry://")
|
||||
; ResolveURL := "lbry://" . ResolveURL[2]
|
||||
; StrReplace(Haystack, SearchText [, ReplaceText, OutputVarCount, Limit := -1])
|
||||
LBRYPermanentURLJsonOBJ := StrReplace(LBRYJSONObject, LBRYPermanentURL, "LBRYPermanentURL")
|
||||
; clipboard := LBRYPermanentURLJsonOBJ
|
||||
; DevModeMsgBox(LBRYPermanentURLJsonOBJ)
|
||||
|
||||
try parsed := JSON.Load(LBRYPermanentURLJsonOBJ)
|
||||
try LBRYCanonicalURL := parsed.LBRYPermanentURL.canonical_url
|
||||
|
||||
; DevModeMsgBox(LBRYCanonicalURL)
|
||||
|
||||
if(LBRYCanonicalURL = ""){
|
||||
Return "" ; return blank
|
||||
}
|
||||
|
||||
; otherwise return the LBRY url
|
||||
LBRYCanonicalURL := StrReplace(LBRYCanonicalURL, "lbry://", "https://lbry.tv/")
|
||||
Return LBRYCanonicalURL
|
||||
}
|
||||
|
||||
|
||||
LBRYCMDTextReplacement(LBRYURLSlug){
|
||||
SingleQUote = "
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, " ", "_") ; replace all spaces with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, ":", "_") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, ",", "_") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, "?", "") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, "!", "") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, "`;", "_") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, "/", "_") ; replace all colons with dashes
|
||||
; LBRYURLSlug := StrReplace(LBRYURLSlug, "?", "") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, "<", "_") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, ">", "_") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, SingleQUote, "") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, "'", "") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, "=", "") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, ";", "") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, ")", "") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, "(", "") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, "___", "_") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, "__", "_") ; replace all colons with dashes
|
||||
LBRYURLSlug := StrReplace(LBRYURLSlug, "__", "_") ; replace all colons with dashes
|
||||
Return LBRYURLSlug
|
||||
}
|
||||
|
||||
GetLBRYAPIErrorFromString(UploadResult){
|
||||
UploadResultArray := StrSplit(UploadResult, "message")
|
||||
LBRYAPIError := UploadResultArray[2]
|
||||
; LBRYAPIErrorStrLen := StrLen(LBRYAPIError)
|
||||
|
||||
; LBRYAPIErrorStrToTrim := LBRYAPIErrorStrLen - 3
|
||||
; Msgbox % "LBRYAPIErrorStrToTrim: " LBRYAPIErrorStrToTrim
|
||||
LBRYAPIError := SubStr(LBRYAPIError, 4)
|
||||
LBRYAPIError := StrReplace(LBRYAPIError, "}", "")
|
||||
|
||||
|
||||
; Msgbox % "LBRYAPIError: " LBRYAPIError
|
||||
Return LBRYAPIError
|
||||
|
||||
}
|
||||
|
||||
|
||||
LogErrorToTextFile(Error){
|
||||
/* if(LogErrorsToTextFile != 1)
|
||||
Return
|
||||
*/
|
||||
ErrorLoggingFile := VideoFolderDir . "\" . "ErrorLogging.txt"
|
||||
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
|
||||
text =
|
||||
(
|
||||
|
||||
|
||||
---------------%TodayDate%---------------
|
||||
%CurrentSite%: %Error%
|
||||
|
||||
|
||||
)
|
||||
if(LogErrorsToMsgbox)
|
||||
Msgbox % "Text: " Text
|
||||
|
||||
FileAppend, %Text%, %ErrorLoggingFile%
|
||||
} ; End of Function
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
AddToTotalVideosUploadedCount(){
|
||||
; IniRead, TotalVideosUploaded, %SettingsIniFilepath%, General, TotalVideosUploaded, %A_Space%
|
||||
TotalVideosUploaded += 1
|
||||
; IniWrite, %TotalVideosUploaded%, %SettingsIniFilepath%, General, TotalVideosUploaded
|
||||
}
|
||||
|
||||
|
||||
|
||||
OnMsgBoxPodcastFinish() {
|
||||
DetectHiddenWindows, On
|
||||
Process, Exist
|
||||
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
|
||||
WinMove,, 0
|
||||
}
|
||||
}
|
||||
|
||||
OnMsgBoxSocialMediaPoster() {
|
||||
DetectHiddenWindows, On
|
||||
Process, Exist
|
||||
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
|
||||
ControlSetText Button1, Yes
|
||||
ControlSetText Button2, Not Now
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Check_For_Stuck_Video_Upload(Index_Number, Upload_Status){
|
||||
if(A_index = 1){ ; Create a blank array
|
||||
ProgressStatusArray := []
|
||||
Return
|
||||
}
|
||||
|
||||
Message = Upload Status: %Upload_Status%
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
|
||||
|
||||
; if we reached the last loop number:
|
||||
if(A_index = %Number_of_loops_to_Check_Upload_status%){
|
||||
Message = Upload Most Likely Failed: Video Hasn't Finished Uploading after 1 hour.
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return "Failed"
|
||||
}
|
||||
|
||||
; If progress is still the same after a ten minute interval then error out
|
||||
if(HasVal(Array_Index_Num_of_Upload_StatusChecks, A_index)){ ; if current index is in Array of index numbers to check status during
|
||||
|
||||
; Send a notification message of upload status
|
||||
Message = Upload Status: %Upload_Status%
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
; if current upload_status is in the array of values that are updated every 10 mins
|
||||
if(HasVal(ProgressStatusArray, Upload_Status)){
|
||||
Message = Upload Failed (E#4508)`nUpload Stuck at same point for 10 minutes. Stuck Status: %ProgressStatus%
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return "Failed"
|
||||
}
|
||||
ProgressStatusArray.Push(Upload_Status) ; append current status to array
|
||||
}
|
||||
} ; end of func
|
||||
|
||||
/*
|
||||
*/
|
||||
; Find the longest word in a string of words
|
||||
FindLongestWordInString(m, calloutNumber, pos, haystack, pattern){
|
||||
Global wordLength, longestWord
|
||||
|
||||
len := StrLen(m)
|
||||
|
||||
If ( len > wordLength )
|
||||
{
|
||||
wordLength := len
|
||||
longestWord := m
|
||||
|
||||
; MsgBox, %m%
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
; Split a long string into multiple pieces based on the string lengtht you want and return an array with all strings
|
||||
SplitStringWithSentences(text, maxChunkSize) {
|
||||
sentences := StrSplit(text, "\. ") ; split at period with space after it
|
||||
|
||||
currentChunk := ""
|
||||
chunks := []
|
||||
|
||||
Loop, % sentences.Length()
|
||||
{
|
||||
sentence := sentences[A_Index]
|
||||
CurrentChunkAndSentence := currentChunk . sentence
|
||||
; Msgbox % "CurrentChunkAndSentence: " CurrentChunkAndSentence
|
||||
; msgbox % StrLen(CurrentChunkAndSentence)
|
||||
|
||||
if (StrLen(CurrentChunkAndSentence) <= maxChunkSize)
|
||||
{
|
||||
currentChunk .= sentence . "\. "
|
||||
}
|
||||
else
|
||||
{
|
||||
chunks.Push(currentChunk)
|
||||
currentChunk := sentence . "\. "
|
||||
}
|
||||
}
|
||||
|
||||
if (currentChunk != "")
|
||||
chunks.Push(currentChunk)
|
||||
|
||||
return chunks
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
[Video-Uploader]
|
||||
Version=3.34
|
||||
Version=3.53
|
||||
Name=Freedomain Video Uploader
|
||||
|
Loading…
Reference in New Issue