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------------------------------------------------------
#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
ScriptVersion = 2.73
FullScriptName := ScriptName . " " . ScriptVersion
@ -1731,7 +1738,7 @@ if(InStr(CurrentTabURL, "/login")){
Status := Selenium_LoopToClickID(IDName:="cover_upload",NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Post Failed: Check Login Status
Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
; TakeScreenshotOfPage()
SaveDriverURLOFErrorPage()
@ -1970,7 +1977,7 @@ if(InStr(CurrentTabURL, "/login")){
sleep, 1000
try CurrentTabURL := driver.Url
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,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
@ -2027,7 +2034,7 @@ if(InStr(CurrentTabURL, "/login")){
}
if(Status){
Message = Post Failed: Please Check Login Status
Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
@ -2209,7 +2216,7 @@ if(InStr(CurrentTabURL, "/login")){
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=10,SleepLength:=1000)
; Status := Selenium_LoopToClickXpath(Xpath,5,1000)
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()
Return
}
@ -2426,7 +2433,7 @@ if(InStr(CurrentTabURL, "/login")){
try CurrentTabURL := driver.Url
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")
SaveDriverURLOFErrorPage()
Return
@ -2687,7 +2694,7 @@ if(InStr(CurrentTabURL, "/login")){
Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,SendKeysContent:=PostTitleAndBody)
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()
Return
}
@ -2754,7 +2761,7 @@ if(InStr(CurrentTabURL, "/login")){
; Msgbox % "Status: " Status
}
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")
SaveDriverURLOFErrorPage()
Return
@ -3003,7 +3010,7 @@ if(InStr(CurrentTabURL, "/login")){
Xpath = //a[normalize-space()='Login']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Upload Failed: Check Login Status
Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
@ -3014,7 +3021,7 @@ if(InStr(CurrentTabURL, "/login")){
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=20,SleepLength:=100)
; DevModeMsgBox(Status)
if(Status){
Message = Upload Failed: Check Login Status
Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
@ -3061,7 +3068,7 @@ if(InStr(CurrentTabURL, "/login")){
Xpath = //input[@placeholder='Title']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=PostTitle)
if(Status){
Message = Post Failed: Check Login Status
Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
@ -3204,7 +3211,7 @@ if(InStr(CurrentTabURL, "/login")){
Xpath = //textarea[@placeholder='Title']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=PostTitle)
if(Status){
Message = Post Failed: Check Login Status
Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
@ -3429,7 +3436,7 @@ sleep, 1000
try CurrentTabURL := driver.Url
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")
SaveDriverURLOFErrorPage()
Return
@ -3717,7 +3724,7 @@ CurrentSite := "Twetch"
Xpath = //button[@type='submit'][normalize-space()='Sign in']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
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()
Return
}
@ -3868,7 +3875,7 @@ if(Status){
Xpath = //button[@class='submit-button ng-star-inserted']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
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
}
Xpath = //div[@class='new-text-area'] ; start new post button
@ -4149,8 +4156,6 @@ Return
; -------------------------------Functions-------------------------------
#Include %A_ScriptDir%\Lib\SharedFunctions.ahk
#Include %A_ScriptDir%\Lib\Json.ahk
; #Include %A_scriptdir%\Lib\RunCMD.ahk

Loading…
Cancel
Save