BitChuteUpload: ;------------------------------------------------ CurrentSite := "Bitchute" Message = Starting Upload SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") Status := NavigateFromBaseURLTo("https://www.bitchute.com/myupload", "BitChute Video Uploader") if(Status) Return Message = Checking Login Status SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") try TabUrl := driver.url if(InStr(TabUrl, "/accounts/login/")){ if(AutoLogin){ Xpath = (//button[normalize-space()='Submit'])[1] Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000) if(Status){ Message = Failed to click Login Button. Please Log Back In SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveDriverURLOFErrorPage() Return } } else, { Message = Login Expired. Please Log Back In SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveDriverURLOFErrorPage() Return } } CheckForAlerts() Message = Inputting Title SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") ; Try to input video title, check if input and if not, try again loop, 5 { status := js_SendAndCheckWithQuerySelector(Selector:="#title",ValueToCheck:="value",SleepLength:=1000,JSStringText:=VideoTitle) ; Msgbox % "status: " status if(!Status) break } if(Status){ Message = Failed to input Video Title with Javascript. Trying again with Manual Typing SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging") Xpath = //input[@id='title'] Status := Selenium_TypeTextIntoElement(VideoTitle, Xpath) if(Status){ Message = Failed to Input Video Title after trying two different ways. Please try Upload again and double check that the website hasn't been updated in a major way. SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar, DiscordErrorLogging") SaveDriverURLOFErrorPage() Return } try, TextInputted := driver.findelementbyxpath(Xpath).Attribute("value") ;XPath: ID=site-title & span tag if(InStr(VideoTitle, TextInputted) OR VideoTitle = TextInputted){ ; Title got input successfully } else, { Message = Title that got input into Bitchute: %TextInputted% SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging") Message = Failed to Input Video Title after trying two different ways. Please try Upload again and double check that the website hasn't been updated in a major way. SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar, DiscordErrorLogging") SaveDriverURLOFErrorPage() Return } } Message = Inputting Description SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") ; trim description if it's too long BitchuteDescription := VideoDescription if(StrLen(BitchuteDescription) > 2995){ BitchuteDescription := SubStr(BitchuteDescription, 1, 2995) JSBitchuteDescription := FormatTextToJSText(BitchuteDescription) } else, JSBitchuteDescription := FormatTextToJSText(BitchuteDescription) Loop, 10 { ; Attempt to input video description a couple of times Message = Inputting Description. Attempt #%A_index% SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") if(A_index = 10){ try currentTabURL := GetCurrentTabURlBase() ; currentTabURL := SubStr(currentTabURL, 1, 40) Message = Failed to input Video Description after %A_index% attempts`nCurrent Tab URL: %currentTabURL% SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveDriverURLOFErrorPage() Return } status := js_SendAndCheckWithQuerySelector("#description",ValueToCheck:="value",SleepLength:=1000,JSStringText:=JSBitchuteDescription) if(status){ Message = %status% SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") } else, Break sleep, 1000 } Message = Inputting Tags SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") ; Convert tags into #hasthtags Loop, 3 { Value := KeywordsArray[A_Index] Value := StrReplace(Value, " ", "") ; Remove spaces if hashtag has two words ; HashTag := "#" . Value BitchuteHashtags .= Value . " " } ; input hashtags Xpath = //input[@placeholder='Search Terms'] Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=BitchuteHashtags) ; Upload Thumbnail Message = Attaching Thumbnail SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") if(VideoThumbFilepath != ""){ ; Upload Cover Image Button Message = Uploading Thumbnail SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") Xpath = //input[@name='thumbnailInput'] Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoThumbFilepath) if(Status){ Message = Failed to Attach Thumbnail SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveDriverURLOFErrorPage() Return } ; sleep, 5000 } ; Upload Video button Message = Uploading Video File SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") Xpath = //input[@name='videoInput'] Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoFilepath) if(Status){ Message = Failed to Upload Video SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveDriverURLOFErrorPage() Return } Message = Waiting for Video to Finish Uploading`nChecking Progress Every 5 seconds SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") Xpath = //div[@role='progressbar'] ; Xpath to progress % Loop, %Number_of_loops_to_Check_Upload_status% { sleep, %Time_Between_Loops_Upload_Status% if(A_index = 5){ ; while waiting for bitchute video to finish uploading, start up lbry if(OdyseeVideo OR OdyseeAudio){ SaveOrPostProgress(Message:="Starting up LBRY while waiting for Bitchute Video to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") CheckLBRYProcess() } } ; Selenium ; try BitChuteUploadProgress := driver.findelementbyxpath(Xpath).Attribute("innerText") ;GREAT FOR GRABBING INNER CONTENTS/Values try BitChuteUploadProgress := driver.executeScript("return document.querySelector('.filepond--file-status').innerHTML;") ;navigate using javascript ; Msgbox % "BitChuteUploadProgress: " BitChuteUploadProgress if(BitChuteUploadProgress = ""){ Message = Unable to Grab Upload Progress, Upload Possibly Failed SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveDriverURLOFErrorPage() Return } if(InStr(BitChuteUploadProgress, "Upload complete")){ Message = Waiting 10 Seconds before clicking "Proceed" button SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") sleep, 10000 Break ; Break out of the loop when 100% upload status } ; split_text = "> ; Pull out upload percentage BitChuteUploadProgress := StrSplit(BitChuteUploadProgress, ">") BitChuteUploadProgress := BitChuteUploadProgress[2] BitChuteUploadProgress := StrSplit(BitChuteUploadProgress, "