Fixed Locals.com URL grabbing not working and DailyMotion description check not working properly

pull/2/head
Yuriy 2 years ago
parent 7aa2e4aded
commit a626ff1763

@ -728,7 +728,7 @@ Gui, Add, GroupBox,r8 y+15 x%PageTwoXStartPos% w%PageTwoGroupBoxWidth%, Platform
; Msgbox % "LocalsURL: " LocalsURL ; Msgbox % "LocalsURL: " LocalsURL
if(LocalsURL = "LocalsUploadStartedNeedToGrabURL"){ if(LocalsURL = "LocalsUploadStartedNeedToGrabURL"){
Gui, Add, Checkbox, xp+10 yp+25 vLocals Checked%LocalsCheckStatus%, Locals (Grab URL) Gui, Add, Checkbox, xp+10 yp+25 vLocalsGrabURL Checked%LocalsCheckStatus%, Locals (Grab URL)
} }
else, { else, {
Gui, Add, Checkbox, xp+10 yp+25 vLocals Checked%LocalsCheckStatus%, Locals Gui, Add, Checkbox, xp+10 yp+25 vLocals Checked%LocalsCheckStatus%, Locals
@ -1211,8 +1211,8 @@ KeywordsArray := StrSplit(VideoTags,",")
Gosub, OdyseeAudioThumbUpload Gosub, OdyseeAudioThumbUpload
} }
if(LocalsGetURL OR LocalsURL = "LocalsUploadStartedNeedToGrabURL"){ if(LocalsGrabURL OR LocalsURL = "LocalsUploadStartedNeedToGrabURL"){
Gosub, LocalsGetURL Gosub, LocalsGrabURL
} }
@ -2408,18 +2408,34 @@ if(AutoSubmitstatus = "-1"){ ; if checked YES
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
LocalsURL := "LocalsUploadStartedNeedToGrabURL" LocalsURL := "LocalsUploadStartedNeedToGrabURL"
; Msgbox % "LocalsURL: " LocalsURL
IniWrite, %LocalsURL%, %VideoLinksIniFile%, URLs, LocalsURL IniWrite, %LocalsURL%, %VideoLinksIniFile%, URLs, LocalsURL
AddToTotalVideosUploadedCount() AddToTotalVideosUploadedCount()
; Msgbox % "LocalsURL: " LocalsURL
; Msgbox % "VideoLinksIniFile: " VideoLinksIniFile
;
; FileRead, inicontents, %VideoLinksIniFile% ; , Filename
; Msgbox % "inicontents: " inicontents
; IniWrite, Value, Filename, Section, Key
; LocalsTabURL := SaveDriverURL() ; LocalsTabURL := SaveDriverURL()
Return Return
} }
Return
;--------------\Locals----------------------------------
;--------------LocalsGrabURL---------------------------------- ;--------------LocalsGrabURL----------------------------------
LocalsGetURL: LocalsGrabURL:
SaveOrPostProgress(Message:="Navigating to Locals Feed to grab URL",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Navigating to Locals Feed to grab URL",PostType:="Tooltip,ErrorLoggingTextFile")
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") ; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@ -2437,7 +2453,12 @@ if(InStr(LocalsPostPageURL, "/share/post")){
Status := ActivateChromeTab(LocalsPostPageURL) Status := ActivateChromeTab(LocalsPostPageURL)
Msgbox % "Status: " Status if(Status = "Failed"){
Message = Failed to Activate Locals Tab. Please grab URL manually
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Msgbox % "Status: " Status
try currentpageURL := driver.url try currentpageURL := driver.url
@ -2445,7 +2466,7 @@ if(InStr(currentpageURL,"share/post")){ ; we're still on create new post page
Message = Locals is still on the Create New Post page. Please double check if post was published successfully. Message = Locals is still on the Create New Post page. Please double check if post was published successfully.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
; Return Return
} }
@ -2453,7 +2474,7 @@ SaveDriverURLOFErrorPage()
; check for "Retrieve Draft button" ; check for "Retrieve Draft button"
js = return document.querySelector("a[class='btn']").innerText; js = return document.querySelector("a[class='btn']").innerText;
try, status := driver.executeScript(js) try, status := driver.executeScript(js)
if(status = "Retrieve Draft"){ if(status){
Message = Video was uploaded but Locals saved it as a draft instead of instantly publishing it. Please go to the Locals Page and Retrieve Draft and manually Publish it. Message = Video was uploaded but Locals saved it as a draft instead of instantly publishing it. Please go to the Locals Page and Retrieve Draft and manually Publish it.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
@ -2547,6 +2568,7 @@ Return
;--------------/LocalsGrabURL----------------------------------
@ -3800,7 +3822,7 @@ Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000
*/ */
sleep, 1000 sleep, 1000
/*
TooltipThis("Inputting Tags") TooltipThis("Inputting Tags")
; Input Each tag one by one ; Input Each tag one by one
Loop % KeywordsArray.Length() Loop % KeywordsArray.Length()
@ -3826,6 +3848,8 @@ Loop % KeywordsArray.Length()
; sleep, 100 ; sleep, 100
} }
*/
; DevModeMsgBox("tags input?") ; DevModeMsgBox("tags input?")
; Grab the Share URL and pull out the Video Link from it and save it to the Video Linsk ini file, so double uploads are not tried if fialure occurs ; Grab the Share URL and pull out the Video Link from it and save it to the Video Linsk ini file, so double uploads are not tried if fialure occurs
@ -3885,14 +3909,21 @@ Loop, 5 { ; make a couple attempts to input description
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.BackSpace) try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.BackSpace)
sleep, 1000
js = return document.querySelector("textarea[placeholder='Enter a description']").textContent; js = return document.querySelector("textarea[placeholder='Enter a description']").textContent;
try, InputDescription := driver.executeScript(js) try, InputDescription := driver.executeScript(js)
message = InputDescription: %InputDescription%
DevModeMsgBox(InputDescription)
; if input description is less than 15 chars, try again ; if input description is less than 15 chars, try again
if(StrLen(InputDescription) < 15){ if(StrLen(InputDescription) < 15){
Continue Continue
} }
else, {
Break
}

@ -843,7 +843,7 @@ CreateArrayOfChromeTabs() {
if(TotalTabsFound = 1 AND A_index > TotalTabsFound){ if(TotalTabsFound = 1 AND A_index > TotalTabsFound){
Message = Exiting Early after 1 loop Message = Exiting Early after 1 loop
DevModeMsgBox(message) DevModeMsgBox(message)
break
} }

Loading…
Cancel
Save