Compare commits
7 Commits
959a81bf98
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a6dc3e00e9 | |||
| 5cae8f6fa3 | |||
| 2ed71756d0 | |||
| b1a7fb3326 | |||
|
e04a6b8d11
|
|||
| 199fbc1b78 | |||
| 9c52c6ec8d |
@@ -615,6 +615,13 @@ UpdateScript()
|
||||
; @todo: Save any changes made to the script before installing update
|
||||
Return
|
||||
|
||||
|
||||
PostToDiscordAndTelegram:
|
||||
gosub, PostToDiscord
|
||||
gosub, PostToTelegram
|
||||
Return
|
||||
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ Loop, 10 {
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
; SaveOrPostProgress(Message:=Message,PostType:="DiscordErrorLogging")
|
||||
|
||||
Xpath = //div[@class='e-content e-lib e-keyboard']
|
||||
Xpath = //div[@id='richtexteditor_747903514_0_rte-edit-view'] ; generated using SelectorHub, using the exclude id tag option.
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoDescription)
|
||||
if(Status){
|
||||
SaveOrPostProgress(Message:="Failed to input Video Description",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
@@ -302,7 +302,7 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
|
||||
sleep, %Time_Between_Loops_Upload_Status%
|
||||
|
||||
; Get progress status through javascript
|
||||
jsCheck = return document.getElementsByClassName('video-upload--details')[0].textContent;
|
||||
jsCheck = return document.querySelector("#UploadDetails").textContent;
|
||||
try ProgressStatus := driver.executeScript(jsCheck)
|
||||
|
||||
if(ProgressStatus = ""){
|
||||
@@ -332,7 +332,7 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
|
||||
|
||||
|
||||
; "Save Now" button
|
||||
js = return document.querySelector("button[class='mr-2 btn btn-primary btn-sm']").textContent;
|
||||
js = return document.querySelector("#Submit").textContent;
|
||||
try, status := driver.executeScript(js)
|
||||
if(!InStr(status, "Save Video")){
|
||||
Message = Save Video Button is not clickable. Please check page for errors.
|
||||
@@ -345,6 +345,11 @@ if(!InStr(status, "Save Video")){
|
||||
; Save Video button
|
||||
TooltipThis("Clicking Save Video Button to finalize Upload")
|
||||
try BrighteonUploadPageURL := driver.url
|
||||
|
||||
js = document.querySelector("#Submit").click();
|
||||
driver.executeScript(js)
|
||||
|
||||
; wait for page to finish loading
|
||||
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
||||
|
||||
|
||||
@@ -372,7 +377,7 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
sleep, 2000
|
||||
|
||||
; Navigate to Videos page to make sure it's refreshed with latest video
|
||||
try driver.Get("https://www.brighteon.com/dashboard/videos") ;Open selected URL
|
||||
try driver.Get("https://www.brighteon.com/dashboard?page=1") ;Open selected URL
|
||||
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
||||
sleep, 2000
|
||||
|
||||
|
||||
@@ -461,8 +461,8 @@ Gui, Add, Button, x+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButto
|
||||
Gui, Add, Button, x+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gRetryUpload, Try Failed Again
|
||||
|
||||
|
||||
Gui, Add, Button, x%MarginSize% y+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gPostToDiscord vPostToDiscordButton, Post to Discord
|
||||
Gui, Add, Button, x+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gPostToTelegram vPostToTelegramButton, Post to Telegram
|
||||
Gui, Add, Button, x%MarginSize% y+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gPostToDiscordAndTelegram vPostToDiscordTelegramButton, Post to Discord/Telegram
|
||||
; Gui, Add, Button, x+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gPostToTelegram vPostToTelegramButton, Post to Telegram
|
||||
Gui, Add, Button, x+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gStartSocialMediaPoster, Start Social Media Poster
|
||||
|
||||
; Row 3
|
||||
|
||||
@@ -122,10 +122,13 @@ if(Status){
|
||||
|
||||
; make sure the "Notify Users" checkbox is selected
|
||||
Xpath = (//input[contains(@name,'is_do_promo')])[1]
|
||||
ClickXpath = //input[@name='is_do_promo']//parent::*
|
||||
|
||||
try, Status := driver.findelementbyxpath(Xpath).isSelected()
|
||||
if(Status = 0){
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=1000)
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=ClickXpath,NumOfLoops:=1,SleepLength:=1000)
|
||||
|
||||
; Check Again if the checkbox is checked ON (-1)
|
||||
try, Status := driver.findelementbyxpath(Xpath).isSelected()
|
||||
if(Status = "0"){
|
||||
Message = Failed to Check ON the Notify Users Checkbox
|
||||
@@ -133,6 +136,8 @@ if(Status = 0){
|
||||
}
|
||||
}
|
||||
|
||||
DevModeMsgBox("notify user option checked?")
|
||||
|
||||
; check if the "Auto Submit Post" checkbox is checked, and if not check it
|
||||
js = return document.querySelector("#autosubmit_enabled").checked;
|
||||
try AutoSubmitstatus := driver.executeScript(js)
|
||||
|
||||
@@ -117,14 +117,27 @@ if(Status){
|
||||
|
||||
}
|
||||
|
||||
; Click on logout button to force a logout. Sometimes the page shows logged in even though cookies have expired?
|
||||
Xpath = //span[contains(text(),'Logout')]
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||
|
||||
|
||||
Message = Logging in
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
Xpath = //input[@id='email']
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Username)
|
||||
; Selenium can't clear out text that's prepopulated by chrome or a password manager until we send some input to the element
|
||||
; So we input text, then clear it and then input the string we want to work around this.
|
||||
try, driver.findelementbyxpath(Xpath).clear() ; clear input field in case it's autofilled by chrome or password manager
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Username)
|
||||
|
||||
if(!Status){ ; if inputting email did NOT fail, then we are on the login page, input the password and then click login.
|
||||
Xpath = //input[@id='password']
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Password)
|
||||
try, driver.findelementbyxpath(Xpath).clear() ; clear input field in case it's autofilled by chrome or password manager
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Password)
|
||||
|
||||
|
||||
Xpath = //a[@id='loginButton']
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||
@@ -271,13 +284,15 @@ ArrayOfPodcastTags := StrSplit(Podcasttags,",")
|
||||
LengthOfArrayOfPodcastTags := ArrayOfPodcastTags.Length() ; Save total number of items in the array
|
||||
|
||||
try pagehtml := driver.pagesource
|
||||
; Msgbox % "pagehtml: " pagehtml
|
||||
|
||||
|
||||
Loop, %LengthOfArrayOfPodcastTags% {
|
||||
Tag := ArrayOfPodcastTags[A_Index] ; find value from position in array
|
||||
|
||||
SpanID = title">%Tag%</span></div></li><li><div id="tagIDs_easyui_tree_
|
||||
|
||||
if(InStr(pagehtml, SpanID)){ ; if tag found in page, do this
|
||||
; if tag found in the raw HTML source, get the tag # from the source code and use it to click on the appropriate checkbox
|
||||
if(InStr(pagehtml, SpanID)){
|
||||
number := StrSplit(pagehtml, SpanID)
|
||||
Number := Number[2]
|
||||
; Msgbox % "number: " number
|
||||
|
||||
@@ -96,7 +96,7 @@ SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile")
|
||||
|
||||
|
||||
SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
GuiControl,, PostToDiscordButton, Discord - Posted Successfully
|
||||
GuiControl,, PostToDiscordTelegramButton, Discord - Posted Successfully
|
||||
|
||||
sleep, 2000
|
||||
ToolTip
|
||||
|
||||
@@ -167,7 +167,7 @@ else, {
|
||||
|
||||
Message = Video Links Posted to Telegram Successfully
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
GuiControl,, PostToTelegramButton, Telegram - Posted Successfully
|
||||
GuiControl,, PostToDiscordTelegramButton, Telegram - Posted Successfully
|
||||
|
||||
ToolTip
|
||||
CurrentSite :=
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
[Video-Uploader]
|
||||
Version=3.51
|
||||
Version=3.53
|
||||
Name=Freedomain Video Uploader
|
||||
|
||||
Reference in New Issue
Block a user