From 613f9d222a5744e70f0337b8f7711a2bffd4426c Mon Sep 17 00:00:00 2001 From: yuriy Date: Tue, 2 Jul 2024 15:10:21 -0400 Subject: [PATCH] Fixed errorout when bitchute or brighteon URLs missing --- Modules/Post-To-Discord.ahk | 9 ++++++++- Modules/Post-To-Telegram.ahk | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Modules/Post-To-Discord.ahk b/Modules/Post-To-Discord.ahk index cdbdccb..e523357 100644 --- a/Modules/Post-To-Discord.ahk +++ b/Modules/Post-To-Discord.ahk @@ -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 := diff --git a/Modules/Post-To-Telegram.ahk b/Modules/Post-To-Telegram.ahk index 2e5afcc..e7dc5dd 100644 --- a/Modules/Post-To-Telegram.ahk +++ b/Modules/Post-To-Telegram.ahk @@ -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 . ") \| "