diff --git a/Freedomain Video Uploader.ahk b/Freedomain Video Uploader.ahk index 7cb9ecc..5ec0f8a 100644 --- a/Freedomain Video Uploader.ahk +++ b/Freedomain Video Uploader.ahk @@ -46,7 +46,8 @@ UStartTime := A_TickCount ; start time #include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\StdOutToVar.ahk #include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Zip.ahk #include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\URLDownloadToVar.ahk -#Include %A_ScriptDir%\Modules\Miscellaneous-Functions.ahk ; Misc functions for video uploading specifically +#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Miscellaneous-Functions.ahk ; Misc functions for video uploading specifically +#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\LBRY-Functions.ahk ; LBRY Specific Functions ;---Global Variables--- @@ -652,7 +653,7 @@ if(!status){ Status := DownloadLatestChromium() if(Status) - GuiControl,,ChromeUpdateAvailable, Chrome Up-to-Dat + GuiControl,,ChromeUpdateAvailable, Chrome Up-to-Date Return @@ -1204,3 +1205,7 @@ Return ;------------------------------------------------ #Include %A_ScriptDir%\Modules\Podcast-Upload.ahk + +; Update Functionality +; ------------------------------------------------ +#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Update-Functions.ahk \ No newline at end of file diff --git a/Lib/Freedomain-Posters-Shared-Functions b/Lib/Freedomain-Posters-Shared-Functions index f625e78..8395c5c 160000 --- a/Lib/Freedomain-Posters-Shared-Functions +++ b/Lib/Freedomain-Posters-Shared-Functions @@ -1 +1 @@ -Subproject commit f625e782ebe7a837c4ab77b8f6b6569ca1c5edb1 +Subproject commit 8395c5c367aedac8b50f069fe62368144860166f diff --git a/Modules/GUI-Main-Window.ahk b/Modules/GUI-Main-Window.ahk index 40c0925..e17d86d 100644 --- a/Modules/GUI-Main-Window.ahk +++ b/Modules/GUI-Main-Window.ahk @@ -326,23 +326,13 @@ ControlFocus, Edit4, %FullScriptName% ToolTip - ; calculate run time and convert to seconds +; calculate run time and convert to seconds URunTime1 := round(((A_TickCount - UStartTime) / 1000), 2) ;---Check for Updates--- ;------------------------------------------------ if(AutoUpdateCheck AND !UpdateAvailable){ - Message = Checking for Updates - SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") - - if(CheckForUpdates(GitReleasesAPIURL)) - GuiControl,,UpdateAvailable, Uploader Update Available! - - if(CheckForChromeUpdates(ChromeFilepath)){ - GuiControl,,ChromeUpdateAvailable, Chrome Update Available! - ChromeUpdateAvailable := 1 - - } + SetTimer, CheckForUpdates, -1000 } @@ -351,6 +341,3 @@ URunTime2 := round(((A_TickCount - UStartTime) / 1000), 2) Return - - -Return \ No newline at end of file diff --git a/Modules/Miscellaneous-Functions.ahk b/Modules/Miscellaneous-Functions.ahk deleted file mode 100644 index 307d7a3..0000000 --- a/Modules/Miscellaneous-Functions.ahk +++ /dev/null @@ -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 -} - diff --git a/New Text File.txt b/New Text File.txt new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index afebbbb..0232cea 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,15 @@ You can select a different file in the main window if the auto selection does no `*.jpg` or `*.png` file which will be the thumbnail for your video/podcast
+# LBRY Desktop Application `daemon_settings.yml` +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 +- spv11.lbry.com:50001 +- spv19.lbry.com:50001 +``` # Uncaught Errors