Updated post failed: please login again message for all sites

main
Yuriy 2 years ago
parent 2286c13ceb
commit dc0b69be8d

@ -30,6 +30,13 @@ global UpdateVersionNumber
;---Notes/Extra Info/#Includes------------------------------------------------------ ;---Notes/Extra Info/#Includes------------------------------------------------------
#Include %A_ScriptDir%\Lib\SharedFunctions.ahk
#Include %A_ScriptDir%\Lib\Json.ahk
#Include %A_ScriptDir%\Lib\ChromeAutomationFunctions.ahk
#Include %A_ScriptDir%\Lib\RunCMD.ahk
ScriptName = Freedomain Social Media Poster ScriptName = Freedomain Social Media Poster
ScriptVersion = 2.73 ScriptVersion = 2.73
FullScriptName := ScriptName . " " . ScriptVersion FullScriptName := ScriptName . " " . ScriptVersion
@ -1731,7 +1738,7 @@ if(InStr(CurrentTabURL, "/login")){
Status := Selenium_LoopToClickID(IDName:="cover_upload",NumOfLoops:=5,SleepLength:=1000) Status := Selenium_LoopToClickID(IDName:="cover_upload",NumOfLoops:=5,SleepLength:=1000)
if(Status){ if(Status){
Message = Post Failed: Check Login Status Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
; TakeScreenshotOfPage() ; TakeScreenshotOfPage()
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
@ -1970,7 +1977,7 @@ if(InStr(CurrentTabURL, "/login")){
sleep, 1000 sleep, 1000
try CurrentTabURL := driver.Url try CurrentTabURL := driver.Url
if(InStr(CurrentTabURL, "login")){ if(InStr(CurrentTabURL, "login")){
Message = Login Cookies Expired. Please Re-Login Message = Login Expired. Please log back in
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") ; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
@ -2027,7 +2034,7 @@ if(InStr(CurrentTabURL, "/login")){
} }
if(Status){ if(Status){
Message = Post Failed: Please Check Login Status Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return Return
} }
@ -2209,7 +2216,7 @@ if(InStr(CurrentTabURL, "/login")){
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=10,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=10,SleepLength:=1000)
; Status := Selenium_LoopToClickXpath(Xpath,5,1000) ; Status := Selenium_LoopToClickXpath(Xpath,5,1000)
if(Status){ if(Status){
SaveOrPostProgress(Message:="Post Failed: Check Login Status",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:="Login Expired. Please log back in",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
} }
@ -2426,7 +2433,7 @@ if(InStr(CurrentTabURL, "/login")){
try CurrentTabURL := driver.Url try CurrentTabURL := driver.Url
if(InStr(CurrentTabURL, "/login") OR InStr(CurrentTabURL, "/register")){ if(InStr(CurrentTabURL, "/login") OR InStr(CurrentTabURL, "/register")){
Message = Login Cookies Expired. Please Re-Login Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
@ -2687,7 +2694,7 @@ if(InStr(CurrentTabURL, "/login")){
Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000) Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,SendKeysContent:=PostTitleAndBody) Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,SendKeysContent:=PostTitleAndBody)
if(Status){ if(Status){
SaveOrPostProgress(Message:="Post Failed: Check Login Status",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:="Login Expired. Please log back in",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
} }
@ -2754,7 +2761,7 @@ if(InStr(CurrentTabURL, "/login")){
; Msgbox % "Status: " Status ; Msgbox % "Status: " Status
} }
if(Status){ ; if failed to click into entry box if(Status){ ; if failed to click into entry box
Message = Post Failed: Check Login Status Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
@ -3003,7 +3010,7 @@ if(InStr(CurrentTabURL, "/login")){
Xpath = //a[normalize-space()='Login'] Xpath = //a[normalize-space()='Login']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){ if(Status){
Message = Upload Failed: Check Login Status Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
@ -3014,7 +3021,7 @@ if(InStr(CurrentTabURL, "/login")){
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=20,SleepLength:=100) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=20,SleepLength:=100)
; DevModeMsgBox(Status) ; DevModeMsgBox(Status)
if(Status){ if(Status){
Message = Upload Failed: Check Login Status Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
@ -3061,7 +3068,7 @@ if(InStr(CurrentTabURL, "/login")){
Xpath = //input[@placeholder='Title'] Xpath = //input[@placeholder='Title']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=PostTitle) Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=PostTitle)
if(Status){ if(Status){
Message = Post Failed: Check Login Status Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
@ -3204,7 +3211,7 @@ if(InStr(CurrentTabURL, "/login")){
Xpath = //textarea[@placeholder='Title'] Xpath = //textarea[@placeholder='Title']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=PostTitle) Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=PostTitle)
if(Status){ if(Status){
Message = Post Failed: Check Login Status Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
@ -3429,7 +3436,7 @@ sleep, 1000
try CurrentTabURL := driver.Url try CurrentTabURL := driver.Url
if(InStr(CurrentTabURL, "/onboarding")) if(InStr(CurrentTabURL, "/onboarding"))
{ {
Message = Login Cookies Expired. Please Re-Login Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
@ -3717,7 +3724,7 @@ CurrentSite := "Twetch"
Xpath = //button[@type='submit'][normalize-space()='Sign in'] Xpath = //button[@type='submit'][normalize-space()='Sign in']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){ if(Status){
SaveOrPostProgress(Message:="Failed to Login. Please Login Manually",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:="Login Expired. Please log back in",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
} }
@ -3868,7 +3875,7 @@ if(Status){
Xpath = //button[@class='submit-button ng-star-inserted'] Xpath = //button[@class='submit-button ng-star-inserted']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){ ; if failed to click login button, give error and quit if(Status){ ; if failed to click login button, give error and quit
SaveOrPostProgress(Message:="Post Failed: Check Login Status",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:="Login Expired. Please log back in",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return Return
} }
Xpath = //div[@class='new-text-area'] ; start new post button Xpath = //div[@class='new-text-area'] ; start new post button
@ -4149,8 +4156,6 @@ Return
; -------------------------------Functions------------------------------- ; -------------------------------Functions-------------------------------
#Include %A_ScriptDir%\Lib\SharedFunctions.ahk
#Include %A_ScriptDir%\Lib\Json.ahk
; #Include %A_scriptdir%\Lib\RunCMD.ahk ; #Include %A_scriptdir%\Lib\RunCMD.ahk

Loading…
Cancel
Save