Reworked Rumble.com channel selection and fixed video file not getting uploaded

pull/2/head
Yuriy 2 years ago
parent 961fd8bd2e
commit 38295d8430

@ -4936,7 +4936,7 @@ try CurrentURL := driver.URL
if(InStr(CurrentURL, "/login.php")){
; AutoLogin := 1
AutoLogin := 1
; Msgbox % "AutoLogin: " AutoLogin
if(AutoLogin){
@ -4978,10 +4978,24 @@ if(InStr(CurrentURL, "/login.php")){
Return
}
Message = Waiting 5 seconds for page to fully load
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 5000
}
Message = Uploading Video File
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //input[@id='Filedata']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoFilepath)
if(Status){
Message = Failed to Upload Video File
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
; Input Title
try driver.findElementsByName("title").item[1].SendKeys(VideoTitle) ;selects element based on Name and sends variable to it.
@ -5022,21 +5036,55 @@ Loop, 5 { ; Attempt to input video description a couple of times
; sleep, 5000
Message = Selecting "Freedomain" Channel
Message = Selecting Channel
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
try driver.findElementsByID("channelId").item[1].click()
sleep, 500
; //option[@value='762377']
Xpath = //option[@value='294021']
; try driver.findElementsByID("channelId").item[1].click()
; @todo replace with regex
js = return document.querySelector("#channelId").innerHTML;
try, ChannelIDNumber := driver.executeScript(js)
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
ChannelIDNumber := StrSplit(ChannelIDNumber, "option value=")
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
ChannelIDNumber := ChannelIDNumber[3]
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
SingleQuote = "
ChannelIDNumber := StrSplit(ChannelIDNumber, "data-private")
ChannelIDNumber := ChannelIDNumber[1]
ChannelIDNumber := StrReplace(ChannelIDNumber, SingleQuote, "")
ChannelIDNumber := StrReplace(ChannelIDNumber, " ", "")
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
; js = return document.querySelector("#channelId").value;
; try, ChannelIDNumber := driver.executeScript(js)
; Msgbox % "ChannelIDNumber: " ChannelIDNumber
if(ChannelIDNumber = ""){
Message = ChannelIDNumber is blank. Unable to select Upload Channel
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
; //option[@value='762377'] ; freedomain
Xpath = //option[@value='%ChannelIDNumber%']
try driver.FindElementByXPath(Xpath).click()
catch e {
Message = Failed to click on Channel using %ChannelIDNumber%.`nPlease send ErrorLog to Yuriy.
Message = Failed to click on Channel using %ChannelIDNumber%.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
; sleep, 2000
@ -5044,7 +5092,7 @@ catch e {
Message = Inputting Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
driver.findElementsByName("tags").item[1].SendKeys(VideoTags) ;selects element based on Name and sends variable to it.
try driver.findElementsByName("tags").item[1].SendKeys(VideoTags) ;selects element based on Name and sends variable to it.

Loading…
Cancel
Save