Fixed Bitchute video link broken by string replace, removed no longer relevant odysee thumbnail Selenium upload code, added extra error logging to discord, added extra check to Tab Switching function

pull/2/head
Yuriy 2 years ago
parent 6ca022c223
commit f7b4a9e04c

@ -931,7 +931,6 @@ UpdateScript:
UpdateScript()
; @todo: Save any changes made to the script before installing update
; Changelog := FindUpdateChangeLog(ScriptUpdateFilepath)
Return
; now defunt, safe to remove
@ -1215,15 +1214,17 @@ KeywordsArray := StrSplit(VideoTags,",")
Gosub, LBRYGetURL
}
if(OdyseeVideoThumb){
/* if(OdyseeVideoThumb){
OdyseeUploadType := "Video"
Gosub, OdyseeVideoThumbUpload
}
if(OdyseeAudioThumb){
*/
/* if(OdyseeAudioThumb){
OdyseeUploadType := "Audio"
Gosub, OdyseeAudioThumbUpload
}
*/
if(LocalsGrabURL OR LocalsURL = "LocalsUploadStartedNeedToGrabURL"){
Gosub, LocalsGrabURL
@ -1489,38 +1490,40 @@ if(SocialMediaPosterFilepath = "" or !FileExist(SocialMediaPosterFilepath)){
; msgbox %SocialMediaPosterFilepath%
run, %SocialMediaPosterFilepath% "%VideoLinksIniFile%"
Return
; Podcast Upload
;------------------------------------------------
UploadPodcast:
CurrentSite := "Podcast"
PodcastTags := StrReplace(PodcastTags, " ,", ",")
PodcastTags := StrReplace(PodcastTags, ", ", ",")
PodcastTags := StrReplace(PodcastTags, " ", "-")
PodcastTags := StrReplace(PodcastTags, "--", "-")
PodcastTags := StrReplace(PodcastTags, "--", "-")
; Msgbox % "PodcastTags: " PodcastTags
/*
*/
; -------------------------------Podcast-------------------------------
UploadPodcast:
CurrentSite := "Podcast"
PodcastTags := StrReplace(PodcastTags, " ,", ",")
PodcastTags := StrReplace(PodcastTags, ", ", ",")
PodcastTags := StrReplace(PodcastTags, " ", "-")
PodcastTags := StrReplace(PodcastTags, "--", "-")
PodcastTags := StrReplace(PodcastTags, "--", "-")
; Msgbox % "PodcastTags: " PodcastTags
IniRead, FDRRadioURL, %SettingsIniFilepath%, General, FDRRadioURL, %A_Space%
if(FDRRadioURL = ""){
IniRead, FDRRadioURL, %SettingsIniFilepath%, General, FDRRadioURL, %A_Space%
if(FDRRadioURL = ""){
Message = FDRRadioURL is blank.`nPlease add URL to Settings.ini file under:`n`n[General]`nFDRRadioURL=
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
MsgBox 0x10,, %Message%
Return
}
}
IniRead, Username, %SettingsIniFilepath%, General, FDRRadioUN, %A_Space%
IniRead, Password, %SettingsIniFilepath%, General, FDRRadioPW, %A_Space%
IniRead, Username, %SettingsIniFilepath%, General, FDRRadioUN, %A_Space%
IniRead, Password, %SettingsIniFilepath%, General, FDRRadioPW, %A_Space%
if(Username = "" or Password = ""){
if(Username = "" or Password = ""){
Message = Username and/or Password are blank.`nPlease add Login to Settings.ini file under:`n`n[General]`nFDRRadioUN=`nFDRRadioPW=
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
}
if(MP3AudioFilepath = ""){
if(MP3AudioFilepath = ""){
MsgBox 0x33, Unable to Upload Podcast, No MP3 File Was Found/Selected. `nWould you like to select one now?
IfMsgBox Yes, {
@ -1533,72 +1536,77 @@ if(SocialMediaPosterFilepath = "" or !FileExist(SocialMediaPosterFilepath)){
Return
}
}
/*
Sublime Indentation Reset
*/
if(!InStr(MP3AudioFilepath, ".mp3")){
if(!InStr(MP3AudioFilepath, ".mp3")){
Message = Unable to upload podcast, no mp3 file was selected.
MsgBox 0x40, Error, %Message%
Return
}
}
Message = Grabbing MP3 file data
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; Message = Grabbing MP3 file data
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; https://www.autohotkey.com/boards/viewtopic.php?t=59882
Message = Calculating MP3 File Size and Length
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile, DiscordErrorLogging")
; https://www.autohotkey.com/boards/viewtopic.php?t=59882
Message = Calculating MP3 File Size and Length
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile, DiscordErrorLogging")
Obj := Filexpro(MP3AudioFilepath,,
Obj := Filexpro(MP3AudioFilepath,,
, "Length"
, "Size" )
MP3AudioFilesize := obj["Size"]
MP3AudioLength := obj["Length"]
; MsgBox % obj["Size"]
MP3AudioFilesize := obj["Size"]
MP3AudioLength := obj["Length"]
; MsgBox % obj["Size"]
AudioLengthArray := StrSplit(MP3AudioLength,":")
AudioLengthArray := StrSplit(MP3AudioLength,":")
Message = MP3 Audio Length: %MP3AudioLength%
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging")
Message = MP3 Audio Length: %MP3AudioLength%
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging")
AudioLength_Seconds := ((AudioLengthArray[1] * 60 ) * 60) + (AudioLengthArray[2] * 60) + AudioLengthArray[3]
Message = MP3 Audio Length in Seconds: %TotalTimeInSeconds%
AudioLength_Seconds := ((AudioLengthArray[1] * 60 ) * 60) + (AudioLengthArray[2] * 60) + AudioLengthArray[3]
Message = MP3 Audio Length in Seconds: %TotalTimeInSeconds%
SaveOrPostProgress(Message:="Message",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; AudioLength_Hours := AudioLengthArray[1]
; AudioLength_Minutes := AudioLengthArray[2]
; AudioLength_Seconds := AudioLengthArray[3]
; AudioLength_SecondsOriginal := AudioLength_Seconds
; AudioLength_Seconds := (AudioLength_Minutes * 60) + ((AudioLength_Hours * 60) * 60) + AudioLength_Seconds
; AudioLength_Hours := AudioLengthArray[1]
; AudioLength_Minutes := AudioLengthArray[2]
; AudioLength_Seconds := AudioLengthArray[3]
; AudioLength_SecondsOriginal := AudioLength_Seconds
; AudioLength_Seconds := (AudioLength_Minutes * 60) + ((AudioLength_Hours * 60) * 60) + AudioLength_Seconds
; Msgbox % "AudioLength_Hours: " AudioLength_Hours
; Msgbox % "AudioLength_Minutes: " AudioLength_Minutes
; Msgbox % "AudioLength_Seconds: " AudioLength_Seconds
; Msgbox % "AudioLength_SecondsOriginal: " AudioLength_SecondsOriginal
; Msgbox % "AudioLength_Hours: " AudioLength_Hours
; Msgbox % "AudioLength_Minutes: " AudioLength_Minutes
; Msgbox % "AudioLength_Seconds: " AudioLength_Seconds
; Msgbox % "AudioLength_SecondsOriginal: " AudioLength_SecondsOriginal
FileGetSize, OutputVar, %MP3AudioFilepath%, K ; Retrieve the size in Kbytes.
FIlesizeInBytes := OutputVar * 1024
FileGetSize, OutputVar, %MP3AudioFilepath%, K ; Retrieve the size in Kbytes.
FIlesizeInBytes := OutputVar * 1024
Message = Inputting Podcast Information
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Message = Inputting Podcast Information
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Status := NavigateFromBaseURLTo(FDRRadioURL)
if(Status)
Return
Status := CheckForAlerts()
if(Status){
Status := NavigateFromBaseURLTo(FDRRadioURL)
if(Status){
Message = Upload Failed (E#7295)`nUnable to Navigate to Upload Page`nChrome was closed or Internet down possibly?
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
}
Message = Logging in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Message = Logging in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //input[@id='email']
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='email']
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)
@ -1615,123 +1623,119 @@ if(SocialMediaPosterFilepath = "" or !FileExist(SocialMediaPosterFilepath)){
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
}
}
Message = Waiting for Page to Load
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Message = Waiting for Page to Load
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //input[@id='num']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=60,SleepLength:=1000)
if(Status){
Xpath = //input[@id='num']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=60,SleepLength:=1000)
if(Status){
Message = New Podcast Page did not load after 60 seconds. Check Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Return
}
Message = Inputting Podcast Info
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Click the "Is Active?" Checkbox
Xpath = //input[@id='isActive']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
}
; Input Podcast Number
Xpath = //input[@id='num']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PodcastNumber)
Message = Inputting Podcast Info
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Input Podcast Title
Xpath = //input[@id='title']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoTitle)
; Click the "Is Active?" Checkbox
Xpath = //input[@id='isActive']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; INput Audio URL
Xpath = //input[@id='url-audio']
SplitPath, MP3AudioFilepath, MP3AudioNameWithExt
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=MP3AudioNameWithExt)
; Input Podcast Number
Xpath = //input[@id='num']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PodcastNumber)
; INput thumbnail URL
Xpath = //input[@id='url-thumbnail']
SplitPath, VideoThumbFilepath, VideoThumbnailFilenameWithExt
ThumbnailURL = https://cdn.freedomainradio.com/%VideoThumbnailFilenameWithExt%
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=ThumbnailURL)
; Input Podcast Title
Xpath = //input[@id='title']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoTitle)
; Input BitChute URL
Xpath = //input[@id='url-bitchute']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=BitChuteURL)
; INput Audio URL
Xpath = //input[@id='url-audio']
SplitPath, MP3AudioFilepath, MP3AudioNameWithExt
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=MP3AudioNameWithExt)
; Input Brighteon URL
Xpath = //input[@id='url-brighteon']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=BrighteonURL)
; INput thumbnail URL
Xpath = //input[@id='url-thumbnail']
SplitPath, VideoThumbFilepath, VideoThumbnailFilenameWithExt
ThumbnailURL = https://cdn.freedomainradio.com/%VideoThumbnailFilenameWithExt%
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=ThumbnailURL)
; Input DailyMotion URL
Xpath = //input[@id='url-dailymotion']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=DailyMotionURL)
; Input BitChute URL
Xpath = //input[@id='url-bitchute']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=BitChuteURL)
; Input LBRY URL
Xpath = //input[@id='url-lbry']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=OdyseeVideoURL)
; Input Brighteon URL
Xpath = //input[@id='url-brighteon']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=BrighteonURL)
; Input LBRY URL
Xpath = //input[@id='url-locals']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LocalsURL)
; Input DailyMotion URL
Xpath = //input[@id='url-dailymotion']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=DailyMotionURL)
; Input Rumble URL
Xpath = //input[@id='url-rumble']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=RumbleURL)
; Input LBRY URL
Xpath = //input[@id='url-lbry']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=OdyseeVideoURL)
; Input LBRY URL
Xpath = //input[@id='url-locals']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=LocalsURL)
; Soundcloud but actually LBRY Audio URL
Xpath = //input[@id='url-lbry-audio']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=OdyseeAudioURL)
; Input Rumble URL
Xpath = //input[@id='url-rumble']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=RumbleURL)
; INput filesize
Xpath = //input[@id='fileSize']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=FIlesizeInBytes)
; Soundcloud but actually LBRY Audio URL
Xpath = //input[@id='url-lbry-audio']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=OdyseeAudioURL)
; Msgbox % "FIlesizeInBytes2: " FIlesiz
; ToolTip
; INput filesize
Xpath = //input[@id='fileSize']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=FIlesizeInBytes)
Xpath = //input[@id='lengthHours']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=AudioLength_Hours)
Xpath = //input[@id='lengthHours']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=AudioLength_Hours)
Xpath = //input[@id='lengthMinutes']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=AudioLength_Minutes)
Xpath = //input[@id='lengthMinutes']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=AudioLength_Minutes)
Xpath = //input[@id='lengthSeconds']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=AudioLength_Seconds)
; Message = Audio Length in Seconds that got input: %AudioLength_Seconds%
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = //input[@id='lengthSeconds']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=AudioLength_Seconds)
; Message = Audio Length in Seconds that got input: %AudioLength_Seconds%
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Message = Inputting Description
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Message = Inputting Description
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //textarea[@id='description']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
Xpath = //textarea[@id='description']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; Input Description
JSVideoDescription := FormatTextToJSText(VideoDescription)
; Input Description
JSVideoDescription := FormatTextToJSText(VideoDescription)
js = document.getElementById('description').value = "%JSVideoDescription%";
try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
js = document.getElementById('description').value = "%JSVideoDescription%";
try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
Message = Inputting Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Message = Inputting Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Podcasttags := StrReplace(Podcasttags, " , ", ",")
Podcasttags := StrReplace(Podcasttags, " ,", ",")
Podcasttags := StrReplace(Podcasttags, ", ", ",")
Podcasttags := StrReplace(Podcasttags, " , ", ",")
Podcasttags := StrReplace(Podcasttags, " ,", ",")
Podcasttags := StrReplace(Podcasttags, ", ", ",")
ArrayOfPodcastTags := StrSplit(Podcasttags,",")
LengthOfArrayOfPodcastTags := ArrayOfPodcastTags.Length() ; Save total number of items in the array
ArrayOfPodcastTags := StrSplit(Podcasttags,",")
LengthOfArrayOfPodcastTags := ArrayOfPodcastTags.Length() ; Save total number of items in the array
try pagehtml := driver.pagesource
; Msgbox % "pagehtml: " pagehtml
Loop, %LengthOfArrayOfPodcastTags% {
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="_easyui_tree_
@ -1780,18 +1784,12 @@ if(SocialMediaPosterFilepath = "" or !FileExist(SocialMediaPosterFilepath)){
break ; otherwise break out of the loop
}
}
}
; Message = Podcast Upload Complete
; msgbox,4096, Done., Input Done.`n`nPlease confirm input and click the final "Save" button.
}
; ToolTip,
/*
OnMessage(0x44, "OnMsgBoxPodcastFinish")
MsgBox 0x40, Finished!, Input Complete!`n`nPlease confirm input and click the final "Save" button on the page.
OnMessage(0x44, "")
Sublime Indentation Reset
*/
Message = Input Complete! `nPlease Confirm and click Final "Save" Button on Podcast Page
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@ -2267,7 +2265,7 @@ if(!InStr(LocalsPostPageURL, "/share/post")){
Status := NavigateFromBaseURLTo(LocalsPostPageURL)
if(Status = "Failed")
if(Status)
Return
/*
@ -2926,13 +2924,8 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
Status := NavigateFromBaseURLTo("https://www.bitchute.com/myupload", "BitChute Video Uploader")
if(Status){
Message = Upload Failed (E#7295)`nUnable to Navigate to Upload Page`nChrome was closed or Internet down possibly?
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
if(Status)
Return
}
Message = Checking Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@ -3179,7 +3172,7 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
}
BitChuteURL := "https://www.bitchute.com/" . VideoHref
BitChuteURL := StrReplace(BitchuteURL, "//video", "/")
BitChuteURL := StrReplace(BitchuteURL, "//video", "/video")
; navigate to video page
try driver.Get(BitChuteURL) ;Open selected URL
@ -3227,15 +3220,9 @@ Loop, %Number_of_loops_to_Check_Upload_status% {
CurrentSite := "Brighteon"
SaveOrPostProgress(Message:="Starting Upload",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
URLAttempt := NavigateFromBaseURLTo("https://www.brighteon.com/dashboard/video-upload")
if(URLAttempt = "Failed"){
Message = Failed to Navigate to Upload Page
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Status := NavigateFromBaseURLTo("https://www.brighteon.com/dashboard/video-upload")
if(Status)
Return
}
; try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
JSBrighteonVideoDescription := FormatTextToJSText(VideoDescription)
@ -3674,11 +3661,8 @@ if(DailyMotionParnerUploadPage = ""){
}
Status := NavigateFromBaseURLTo(DailyMotionParnerUploadPage,"Partner HQ - Dailymotion")
if(Status){
SaveDriverURLOFErrorPage()
Return
}
if(Status)
Return
Message = Waiting for Page to Finish Fully Loading
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
@ -3825,7 +3809,7 @@ DailyMotionDescription := VideoDescription
DailyMotionJSDescription := FormatTextToJSText(DailyMotionDescription)
Message = DailyMotionJSDescription String Length := StrLen(DailyMotionJSDescription)
Message := "DailyMotionJSDescription String Length: " . StrLen(DailyMotionJSDescription)
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@ -3911,7 +3895,7 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,Disc
; DailyMotion page automtically splits the tags into their little boxes when they're seperated by commas
DailyMotionVideoTags := VideoTags . ","
Message = DailyMotion Video Tags: %DailyMotionVideoTags%
Message = Video Tags: %DailyMotionVideoTags%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = //div[@class='ant-select-selection-search']//input[@role='combobox']
@ -4468,341 +4452,26 @@ Return
; -------------------------------LBRY Thumb---Odysee Thumb-----------------------
OdyseeVideoThumbUpload:
OdyseeAudioThumbUpload:
if(VideoThumbFilepath = "") {
Message = Thumbnail Upload Skipped. Thumbnail Filepath not provided
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
if(OdyseeUploadType = "Audio"){
OdyseeURLToUploadThumbnailFor := OdyseeAudioURL
CurrentSite := "Odysee Audio"
}
if(OdyseeUploadType = "Video"){
OdyseeURLToUploadThumbnailFor := OdyseeVideoURL
CurrentSite := "Odysee Video"
}
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
if(OdyseeUploadType = "Audio" AND OdyseeAudioURL = "")
{
Message = Audio Thumbnail Upload Skipped. OdyseeAudioURL is blank.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
if(OdyseeUploadType = "Video" AND OdyseeVideoURL = "")
{
Message = Video Thumbnail Upload Skipped. OdyseeVideoURL is blank.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Msgbox % "LBRYAudioURL: " LBRYAudioURL
; Msgbox % "LBRYUploadType: " LBRYUploadType
; Msgbox % "OdyseeURLToUploadThumbnailFor: " OdyseeURLToUploadThumbnailFor
/*Message = Uploading %OdyseeUploadType% Thumbnail through Odysee. `nNavigating to: %OdyseeURLToUploadThumbnailFor%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
*/
Message = Uploading Thumbnail through Odysee
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
/*try driver.ExecuteScript("window.open();") ;Opens a new Window or tab (Depends on your Chrome Prefs)
catch e {
Message = Failed to Open New Window
}
try driver.SwitchToNextWindow
*/
URLAttempt := NavigateFromBaseURLTo(OdyseeURLToUploadThumbnailFor)
if(URLAttempt = "Failed"){
Message =Unable to Navigate to Video Page (E#2816)`nInternet Connectivity issue or LBRY link not properly grabbed from API`nPlease upload Thumbnail manually at your earliest convenience.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
TooltipThis("Waiting 10 Seconds for Video Page to Fully Load")
sleep, 10000
/*; Check login status
Message = Checking Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
try LoginStatus := driver.findelementbyxpath(Xpath).Attribute("innerText") ; Grabb innertext
if(!LoginStatus){
Message = Upload Failed (E#3985)`nLogin Cookies have expired. Please Re-login
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
*/
Message = Checking Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
try html := driver.pagesource ; save page's entire HTML to a variable
if(!InStr(HTML, "Edit</span>")){
Message = Upload Failed: Unable to Find Edit Button: Check Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
Message = Clicking "Edit" on PageURL %OdyseeURLToUploadThumbnailFor%
SaveOrPostProgress(Message:=Message,PostType:="DiscordErrorLogging")
; Click Edit button to check if logged in or not.
Xpath = //span[contains(text(),'Edit')]
loop, 3 {
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=5000)
if(Status){
; msgbox, click failed
Sleep, 60000
try driver.executeScript("history.go(0)") ;refresh page
}
else,
Break
}
if(Status){
try CurrentPage := driver.url
Message = Unable to click "Edit" button. Most likely Reason is Video is Still Confirming OR Login Cookies Have Expired.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
/*
; Close the video preview floating window
Xpath = //button[@title='Close']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
*/
; "Use thumbnail upload tool"
TooltipThis("Selecting Thumbnail Upload Tool")
Xpath = //span[contains(text(),'Use thumbnail upload tool')]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Thumbnail Upload Failed (E#5617)`nUnable to click on "Use thumbnail upload tool"
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
/*
try CurrentPage := driver.url
Message = Trying to Click Browse for Thumbnail Button on Page: %CurrentPage%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
*/
/*
Xpath = /html/body/div/div/div[1]/main/div/div/section[2]/div/div/fieldset-section/input-submit/button/span/span
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Failed to Click "Browse" button with Direct Xpath to input thumbnail filepath. Trying with Relative
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
*/
/*; Select Use Thumbnail upload tool button
Xpath = //span[contains(text(),'Use thumbnail upload tool')]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Failed to click "Use Thumbanil Upload Tool"
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
}
*/
/*
Xpath = //div[@class='card__main-actions']//div//span[@class='button__label'][normalize-space()='Browse']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Failed to click "Browse" button using relative and direct Xpath
Xpath = //div[@class='card__main-actions']//div//button[@aria-label='Browse']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Failed to click "Browse" button using Relative Xpath of parent element as well
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
}
*/
/*
Message = Trying to select thumbnail to upload
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
*/
; -------------------------------Rumble-------------------------------
RumbleUpload:
CurrentSite := "Rumble"
SaveOrPostProgress(Message:="Starting Upload",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
/*
Status := InputFilePathIntoOpenWindow(VideoThumbFilepath)
Status := NavigateFromBaseURLTo("https://rumble.com/upload.php")
if(Status)
{
Message = Upload Failed:`nUnable to Find "Open File" window to input filepath into
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
*/
Xpath = //input[@accept='.png, .jpg, .jpeg, .gif']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoThumbFilepath)
if(Status){
Message = Failed to Upload Thumbnail Image
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
; Return
}
; try driver.FindElementByXPath(Xpath).SendKeys(VideoThumbFilepath)
; "Upload thumbnail" popup
; Confirmation Upload Popup - popup box
Xpath = //span[contains(text(),'Upload')]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Thumbnail Upload Failed (E#2866)`nUnable to click upload confirmation button
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
/*
Xpath = /html/body/div[4]/div/div/div/button[1]/span/span
loop, 15 {
if(A_index = 15){
Message = Thumbnail Upload Failed (E#2866)`nUnable to click upload confirmation button
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Break
}
try driver.FindElementByXPath(Xpath).click() ;click on confirmaiton button
catch e {
Sleep, 1000
Continue
}
Break
}
*/
/*; "Upload Complete" Text
Xpath = /html/body/div/div/div[1]/main/div/div/section[2]/div/div/div/div[2]/p
Loop, 15 {
if(A_index = 15){
Message = Thumbnail Upload Failed (E#5580)`nUnable to find upload confirmation text on page.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Break
}
try UploadStatus := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
if(!InStr(UploadStatus, "Complete"))
{
sleep, 2000
Continue
}
Break
}
*/
; sleep, 5000 ; sleep 5 seconds for everything to catch up.
Message = Waiting for Thumbnail to Finish Uploading
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 5000
; Hit the save button
Xpath = //button[@class='button button--primary'] ; Save button popup
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=5000)
if(Status = Failed){
/* Message = Failed to click last "Save" button. Please click it to finalize the upload.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
*/
}
sleep, 5000
; Click off the confirmation popup and Check the "Skip Preview and Confirmation" checkbox
; xpath = //label[normalize-space()='Skip preview and confirmation']
; try SkipPreviewCheck := driver.findelementbyxpath(Xpath).Attribute("innerText") ; Grabb innertext
; if(SkipPreviewCheck != ""){
; Check skip preview checkbox so the box doesn't pop up again
TooltipThis("Checking for Confirmation Popup")
xpath = //label[normalize-space()='Skip preview and confirmation']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
Message = Unchecked "Confirm Edit" on each video Checkbox
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; msgbox ?
; Save Button
Xpath = //button[@aria-label='Save']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=1000)
; }
Message = Thumbnail Uploaded Successfully
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
if(OdyseeUploadType = "Video")
IniWrite, Successful, %VideoLinksIniFile%, Misc, OdyseeVideoThumb
if(OdyseeUploadType = "Audio")
IniWrite, Successful, %VideoLinksIniFile%, Misc, OdyseeAudioThumb
; TakeScreenshotOfPage(ScreenShotSavePath)
Return
; ---------------------/LBRY Thumb--------/Odysee Thumb-----------------------
Return
; -------------------------------Rumble-------------------------------
RumbleUpload:
CurrentSite := "Rumble"
SaveOrPostProgress(Message:="Starting Upload",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
URLAttempt := NavigateFromBaseURLTo("https://rumble.com/upload.php")
if(URLAttempt)
Return
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
Message = Checking Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Message = Checking Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
CheckForAlerts()
CheckForAlerts()
try CurrentURL := driver.URL
if(InStr(CurrentURL, "/login.php")){
try CurrentURL := driver.URL
if(InStr(CurrentURL, "/login.php")){
; AutoLogin := 1
@ -4850,34 +4519,34 @@ sleep, 5000
Message = Waiting 5 seconds for page to fully load
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 5000
}
}
CheckForAlerts()
CheckForAlerts()
Message = Uploading Video File
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Message = Uploading Video File
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //input[@id='Filedata']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoFilepath)
if(Status){
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.
catch e {
; Input Title
try driver.findElementsByName("title").item[1].SendKeys(VideoTitle) ;selects element based on Name and sends variable to it.
catch e {
Message = Video Upload Failed, Please Check Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
; Input Description
Loop, 5 { ; Attempt to input video description a couple of times
}
; Input Description
Loop, 5 { ; Attempt to input video description a couple of times
TooltipThis("Inputting Description `nAttempt Number: " A_index)
status := js_SendAndCheckWithID(Element:="description",ValueToCheck:="value",SleepLength:=3000,JSStringText:=JSVideoDescription)
@ -5116,9 +4785,11 @@ Return
FacebookUpload:
CurrentSite := "Facebook"
SaveOrPostProgress(Message:="Starting Upload",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
URLAttempt := NavigateFromBaseURLTo("https://www.facebook.com/")
if(URLAttempt)
Status := NavigateFromBaseURLTo("https://www.facebook.com/")
if(Status)
Return
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding

@ -1 +1 @@
Subproject commit 89c1042e013f14eda16477c719e9427045ddfa1e
Subproject commit 694c440a6a89b0b84fee0c49370d95150667c7a9
Loading…
Cancel
Save