68 Commits

Author SHA1 Message Date
ba33d479ac code cleanup, fixed Telegram not outputting API Reponse to errorlog.txt 2024-07-04 00:46:29 -04:00
da34b98324 Fixed some items not being logged to errorlog.txt 2024-07-04 00:29:58 -04:00
9e76ace3c3 readme 2024-07-02 21:23:53 -04:00
fd0b620e23 minor code cleanups 2024-07-02 19:33:22 -04:00
c7924f7cc7 minor code clearup and errorlogging additions 2024-07-02 19:24:31 -04:00
8b43ddc8be Automated New Releases Process 2024-07-02 18:49:19 -04:00
dbdefc5a95 Initial version of Release Automation 2024-07-02 15:14:56 -04:00
613f9d222a Fixed errorout when bitchute or brighteon URLs missing 2024-07-02 15:10:21 -04:00
f3817cb9f9 fixed bitchute URL missing solidus 2024-07-01 13:10:48 -04:00
478f8f769e fixed bitchute 2024-06-30 23:52:29 -04:00
1b856287df bitchute update 2024-06-30 23:31:59 -04:00
45e2d2b0f0 readme 2024-06-25 00:52:35 -04:00
76d410e4d3 code cleanup 2024-06-25 00:37:48 -04:00
ee21a03d55 check Bitchute URl and Brighteon URL for processing status and skip them in Discord + Telegram if still processing 2024-06-25 00:19:19 -04:00
540a688733 Set LBRY URL Slug to be regenerated each time a project is loaded and not saved between runs in case title.txt file is changed 2024-06-24 22:42:16 -04:00
be75660548 added double check for Locals Notify Users checkbox 2024-06-24 22:31:08 -04:00
9f1388160c readme 2024-06-24 22:30:30 -04:00
4ce82bde6a fixed thumbnail not being found if it's file name changes between runs 2024-06-22 15:28:09 -04:00
d1e471bd26 added Aspect Ratio check for Brighteon, and set brighteon check status appropriately, added video info to errorlog 2024-06-22 15:14:44 -04:00
f5ffe32766 readme 2024-06-22 15:14:32 -04:00
dcd947b136 Check notify users checkbox 2024-06-21 23:50:35 -04:00
4476bfdda6 fixed grabbing Locals Video Share Link 2024-06-21 22:50:44 -04:00
5f63640185 fixed grabbing Locals Video Share Link 2024-06-21 22:50:29 -04:00
6639c907c9 Rumble Primary Category input 2024-06-21 18:28:08 -04:00
3492ecccee moved saving of LastPost ini var to before gui shows 2024-06-21 18:10:26 -04:00
38a579c486 Locals hide link preview 2024-06-21 17:58:01 -04:00
4beb83caa6 reworked discord message formatting, code cleanup 2024-06-21 17:37:43 -04:00
b98ae5e190 Added API Responses to ErrorLog.txt files 2024-06-18 15:22:31 -04:00
ba0bf308b4 added ability to schedule an upload for a later time 2024-06-08 18:26:22 -04:00
58d80bd084 fixed LBRY Killer sometimes killing LBRY before URL has been grabbed 2024-05-21 21:25:31 -04:00
8b1a8d407c gui updates, code cleanups, initial support for post scheduling 2024-05-21 19:36:42 -04:00
b59bfbe2cf modularized update check and made it run asynchronously 2024-05-09 15:33:22 -04:00
c4b2eeea8e removed transcript hyperlink from telegram posts 2024-04-18 21:55:44 -04:00
723dec3fac removed all instances of ReuseTabs var 2024-04-17 17:30:33 -04:00
c60a45445c gui updated after podcast is uploaded 2024-04-17 14:13:39 -04:00
fa43716ebe fixed update available not showing in GUI 2024-04-16 23:07:36 -04:00
ef3cb41e9c added box for Unauthorized.tv to results GUI and added ability to input url into podcasts backend 2024-04-16 22:30:35 -04:00
777cfaa242 reworked telegram posting, add transcript URL to GUI, Added Transcript and fdrpodcast hyperlinsk to telegram and discord posts 2024-04-16 22:17:15 -04:00
dd7c85e22e fixed Brighteon description getting input multiple times 2024-02-14 20:04:51 -05:00
ca0b6ce1b7 added double check to Bitchute tag input 2024-01-27 18:46:58 -05:00
a576a194c1 added support for Video Summaries 2024-01-27 15:33:48 -05:00
9cbe1410e5 removed testing line 2024-01-27 14:47:06 -05:00
f339ede04c added a second upload attempt if description input fails 10 times 2024-01-27 14:45:40 -05:00
4f4361276f removed telegram video upload option. Never used and only works on videos less than 50mb 2024-01-16 18:46:38 -05:00
7acefafdc7 fixed locals uploading 2024-01-16 18:37:44 -05:00
2cd1b0de84 formatting 2024-01-16 06:41:19 -05:00
d01ce11347 major code cleanup organization and restructuring 2024-01-16 06:35:42 -05:00
d546628d8a fixed tags input for lbry 2024-01-16 05:43:42 -05:00
4940d18946 fixed tag input to Bitchute, Dailymotion, code cleanup 2024-01-16 05:41:17 -05:00
679e698435 added bitrate check to video file, automatic uncheck if below 300kbps for brighteon 2024-01-13 12:20:58 -05:00
646d5994df readme 2024-01-12 22:14:57 -05:00
15e5328d1e readme 2024-01-12 22:12:42 -05:00
ad232d4d44 typo 2024-01-12 22:06:21 -05:00
0f679a0792 Reworked podcast tag parsing to be same as video tags, Added tag input limit to brighteon, small code cleanup 2024-01-12 22:02:42 -05:00
b0290eef6e #12, maybe also #13: change VideoTags parsing a bit to fix some minor issues with Brighteon 2024-01-13 01:52:26 +00:00
678ba3d495 video thumbnail only pulled in from file if it exists in the file, otherwise pull first jpg/png in project directory 2024-01-12 20:41:59 -05:00
1d926a91a7 video thumbnail saved between runs if it's modified 2024-01-12 20:35:45 -05:00
9ec17b0ead moved version number to external file 2023-12-19 15:48:33 -05:00
03c75ab073 Migrated inline list to git 2023-12-15 17:26:06 -05:00
a1dc003cdc updated submodules, readme type 2023-12-15 17:07:31 -05:00
1aba6a650a updated all urls to point to freedomain.dev 2023-12-15 17:04:10 -05:00
adeb7a9df1 merged in LBRY-Process-Killer module 2023-12-15 16:10:10 -05:00
aa1110a780 version bump 2023-12-15 15:46:52 -05:00
4b39f927d3 Merge pull request 'no, srsly, ACTUALLY FIX the tag selection checkbox' (#6) from double-dashed-to-pieces into main
Reviewed-on: #6
2023-12-15 20:36:08 +00:00
3a0b6921f6 no, srsly, ACTUALLY FIX the tag selection checkbox 2023-12-15 13:30:45 -07:00
08eff7166a Merge remote-tracking branch 'origin/tag-selection-possible-fix' 2023-12-11 13:40:49 -05:00
8c34e1de09 API calls and docs urls migrated to freedomain.dev 2023-12-11 13:38:51 -05:00
54b8670438 change Xpath to click individual tag entry in tree 2023-12-11 10:59:25 -07:00
25 changed files with 2065 additions and 1909 deletions

5
.gitignore vendored
View File

@@ -18,3 +18,8 @@ Compile Scripts to EXE.ahk
Freedomain Video Uploader.exe
Lib/LBRY Process Killer.exe
Lib/chrome-win64
Lib/Version.ini
Lib/Version-FVU.ini
Lib/Version-FPS.ini
**/Scheduled-Posts
Freedomain Post Scheduler.exe

2
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "Lib/Freedomain-Posters-Shared-Functions"]
path = Lib/Freedomain-Posters-Shared-Functions
url = https://git.freedomainplaylists.com/yuriy/Freedomain-Posters-Shared-Functions.git
url = https://freedomain.dev/yuriy/posters-shared-functions.git

View File

Before

Width:  |  Height:  |  Size: 302 KiB

After

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

155
Compile and Release.ahk Normal file
View File

@@ -0,0 +1,155 @@
;---ENVIRONMENT---------------------------------------------------------------------
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
;#Warn ; Enable warnings to assist with detecting common errors.
;DetectHiddenWindows, On
#SingleInstance, Force
DetectHiddenWindows, ON
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;SetKeyDelay, 500
CoordMode, ToolTip, Screen
CoordMode, Mouse, Screen
; #NoTrayIcon
; Menu, Tray, Icon, RMScriptManager.ico
;---Notes/Extra Info/#Includes------------------------------------------------------
#Include, %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\WindowCredentialManager.ahk
;---VARIABLES-----------------------------------------------------------------------
ProgramName = Freedomain Video Uploader
ExeProgramName = %ProgramName%.exe
AHKFilepath = %A_ScriptDir%\%ProgramName%.ahk
Exefilepath = %A_ScriptDir%\%ProgramName%.exe
icopath = %A_ScriptDir%\Assets\Icon.ico
VersionIniFP = %A_ScriptDir%\Version.ini
; Generate a new errorlog text file each run
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
ErrorLogTextFile = %A_ScriptDir%\Lib\ErrorLogging\Compiler_%TodayDate%.txt
; Read Credential token from Windows Credential Manager using WindowCredentialManager.ahk
cred := CredRead("FDR-Gitea-Token")
GiteaToken := Cred.Password
; Info for Creating the Release with Gitea-CreateRelease.ps1
CreateReleasePS1Filepath = %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Gitea-CreateRelease.ps1
CreateReleaseAPIURL = https://freedomain.dev/api/v1/repos/yuriy/video-uploader/releases?token=%GiteaToken%
; Info for Attaching exe file to release using Gitea-AttachAssetToRelease.ps1
AttachAssetToReleasePS1Filepath = %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Gitea-AttachAssetToRelease.ps1
AttachAssetToReleaseAPIURL = https://freedomain.dev/api/v1/repos/yuriy/video-uploader/releases
;---\VARIABLES-----------------------------------------------------------------------
; Compile to .exe
; ------------------------------------------------
; Bump the version number in the version.ini file
IniRead, VersionNumber, %VersionIniFP%, Video-Uploader, Version, 0.0 ; , Filename, Section, Key [, Default]
VersionNumber += .01
VersionNumber := SubStr(VersionNumber, 1, 4)
IniWrite, %VersionNumber%, %VersionIniFP%,Video-Uploader, Version
; Kill any active intances of the uploaders so the .exe file can be overwriten by the compilation
process, close, %ExeProgramName%
sleep, 500
; Delete the .exe file so it can be repalced
if(FileExist(Exefilepath)){
FileDelete, %Exefilepath%
if(ErrorLevel){
msgbox, failed to delete Exe file. Please delete manually and re-run the compiler.
ExitApp
}
}
; check if file exists and if not, give user error and stop
if(!FileExist(AHKFilepath)){
msgbox, %AHKFilepath% does not exist`nExiting
ExitApp
}
; check if file exists and if not, give user error and stop
if(!FileExist(icopath)){
msgbox, %icopath% does not exist`nExiting
ExitApp
}
; run, %comspec% /c ""C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%""
Command = "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%"
Results := RunCMD(Command)
LogToErrorLogFile(Results, ErrorLogTextFile)
if(!InStr(Results, "Successfully")){
Msgbox, Error, Compilation failed with the following error:`n`n%Results%
ExitApp
}
; Create new Release on Gitea using Gitea-CreateRelease.ps1
; ------------------------------------------------
InputBox, ReleaseBody, Release Body, Please Input Text to be used in the Release Body
ReleaseName := VersionNumber
ReleaseTag := VersionNumber
; Strings with spaces in them need to be surrounted by a single quote and double quote, eg: "'spaced string'"
Command = Powershell "%CreateReleasePS1Filepath%" "%CreateReleaseAPIURL%" "%ReleaseName%" "%ReleaseTag%" "'%ReleaseBody%'"
Message = PowerShell Command to Create Release:`n%Command%
LogToErrorLogFile(Message, ErrorLogTextFile)
Results := RunCMD(Command)
LogToErrorLogFile(Results, ErrorLogTextFile)
; Pull out the release ID Number, needed for attaching a file to the release
SplitText = @{id=
SplitText2 = `;
ReleaseID := StrSplit(Results, SplitText)[2]
ReleaseID := StrSplit(ReleaseID, SplitText2)[1]
Message = ReleaseID: %ReleaseID%
LogToErrorLogFile(Message, ErrorLogTextFile)
; Attach .exe File to Release using Gitea-AttachAssetToRelease.ps1
; ------------------------------------------------
AttachAssetToReleaseAPIURL = %AttachAssetToReleaseAPIURL%/%ReleaseID%/assets
; Strings with spaces in them need to be surrounted by a single quote and double quote, eg: "'spaced string'"
Command = Powershell "%AttachAssetToReleasePS1Filepath%" "%AttachAssetToReleaseAPIURL%" "%GiteaToken%" "'%ExeProgramName%'" "'%Exefilepath%'"
LogToErrorLogFile(Command, ErrorLogTextFile)
Results := RunCMD(Command)
LogToErrorLogFile(Results, ErrorLogTextFile)
ExitApp
;---FUNCTIONS-----------------------------------------------------------------------
LogToErrorLogFile(Text, TextFileFilepath){
FileAppend, %Text%`n, %TextFileFilepath%
}

View File

@@ -14,27 +14,23 @@ CoordMode, Mouse, Screen
;---Notes/Extra Info/#Includes------------------------------------------------------
; msgbox
;---VARIABLES-----------------------------------------------------------------------
/*ScriptToCompile = %1%
CompileType = %2% ; Testing OR Production
if(CompileType = "")
CompileType = Testing
; Msgbox % "CompileType: " CompileType
if(ScriptToCompile = "")
ExitApp
*/
; Msgbox % "ScriptToCompile: " ScriptToCompile
ScriptToCompile = SocialMediaPoster
; ScriptToCompile = ScriptUpdater
;---MAIN SCRIPT---------------------------------------------------------------------
AHKFilepath = %A_ScriptDir%\Freedomain Video Uploader.ahk
Exefilepath = %A_ScriptDir%\Freedomain Video Uploader.exe
icopath = %A_ScriptDir%\Assets\FreedomainVideo.ico
VersionIniFP = %A_ScriptDir%\Version.ini
; Bump the version number in the version.ini file
IniRead, VersionNumber, %VersionIniFP%, Video-Uploader, Version, 0.0 ; , Filename, Section, Key [, Default]
VersionNumber += .01
VersionNumber := SubStr(VersionNumber, 1, 4)
; Msgbox % "VersionNumber: " VersionNumber
IniWrite, %VersionNumber%, %VersionIniFP%,Video-Uploader, Version
@@ -67,9 +63,6 @@ if(!FileExist(icopath)){
run, %comspec% /c ""C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%""
; OldNotify(ScriptToCompile,"Compiled Successfully",5)
; sleep, 5000
ExitApp

File diff suppressed because it is too large Load Diff

View File

@@ -6,16 +6,29 @@ Message = Starting Upload
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Status := NavigateFromBaseURLTo("https://www.bitchute.com/myupload", "BitChute Video Uploader")
Status := NavigateFromBaseURLTo("https://www.bitchute.com/")
if(Status)
Return
Message = Checking Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = (//div[normalize-space()='Sign in'])[1]
try LoginStatus := driver.findelementbyxpath(Xpath).Attribute("innerText")
if(LoginStatus = "Sign In"){
Message = Logged out. Trying to Log Back In
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){
@@ -33,10 +46,33 @@ if(InStr(TabUrl, "/accounts/login/")){
}
}
*/
CheckForAlerts()
if(BitchuteUploadUploadURL = "")
{
; click on video upload icon so dropdown menu appears
Xpath = (//i[normalize-space()='video_call'])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; grab upload url from dropdown menu
Xpath = (//a[@id='id_upload_video'])[1]
UploadURL := GetHTMLValueFromXpathOuterHTML(XPATH, "href")
if(!InStr(UploadURL, "https")){
Message = Failed to Grab Upload Page URL from Home Page
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
UploadURL := StrReplace(UploadURL, "api.bitchute", "old.bitchute")
}
try, driver.Get(UploadURL) ;Open selected URL
try, driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
Message = Inputting Title
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@@ -122,17 +158,30 @@ Loop, 10 { ; Attempt to input video description a couple of times
Message = Inputting Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; Convert tags into #hasthtags
; Get first 3 tags from Video Tags array
Loop, 3 {
Value := KeywordsArray[A_Index]
Value := StrReplace(Value, " ", "") ; Remove spaces if hashtag has two words
; HashTag := "#" . Value
BitchuteHashtags .= Value . " "
BitchuteTags .= ArrayOfVideoTags[A_Index] . " "
}
; input hashtags
Message = Inputting Tags: %BitchuteTags%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; input Search Terms (Tags)
Xpath = //input[@placeholder='Search Terms']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=BitchuteHashtags)
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=BitchuteTags)
if(Status){
Message = Failed to input search terms (tags)
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
js = return document.querySelector("#hashtags").value;
try CurrentHashTagValue := driver.executeScript(JS) ;Execute Javascript
if(CurrentHashTagValue = ""){
Message = Tags that got input into page: %CurrentHashTagValue%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
; Upload Thumbnail
Message = Attaching Thumbnail
@@ -257,7 +306,6 @@ try driver.executeScript("history.go(0)") ;refresh page
try FirstResultVideoTitle := driver.findElementsByClass("channel-videos-title").item[1].Attribute("innerText") ; Grabb innertext
; msgbox % FirstResultVideoTitle = VideoTitle
try FirstResultIDAndTag := driver.findElementsByClass("channel-videos-title").item[1].Attribute("outerHTML") ;XPath: ID=site-title & span tag
; Msgbox % "FirstResultIDAndTag: " FirstResultIDAndTag
@@ -272,9 +320,10 @@ if(VideoHref = ""){
Return
}
BitChuteURL := "https://www.bitchute.com/" . VideoHref
BitChuteURL := "https://old.bitchute.com/" . VideoHref
BitChuteURL := StrReplace(BitchuteURL, "//video", "/video")
; navigate to video page
try driver.Get(BitChuteURL) ;Open selected URL
driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
@@ -301,6 +350,9 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,Disc
Xpath = //button[normalize-space()='Save']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
BitChuteURL := StrReplace(BitchuteURL, "old.", "")
Message = Upload Complete:`n%BitChuteURL%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
IniWrite, %BitChuteURL%, %VideoLinksIniFile%, URLs, BitChuteURL

View File

@@ -8,7 +8,8 @@ Return
JSBrighteonVideoDescription := FormatTextToJSText(VideoDescription)
; Msgbox % "JSBrighteonVideoDescription: " JSBrighteonVideoDescription
; descriptions longer than 5k characters just fail to get input so trim them to below 5000 characters
if(StrLen(VideoDescription) >= 5000){
@@ -62,33 +63,23 @@ if(InStr(CurrentTab, "login")) ; we're logged out
Message = Trying to Log Back In
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile, DiscordErrorLogging")
; js = return document.querySelector("input[placeholder='username/email']").value;
; status := try driver.executeScript(JS) ;Execute Javascript
Xpath = //a[normalize-space()='Log In'] ; click login button at top right of page
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; sleep, 5000
; Msgbox % "status: " status
; sleep, 2000
Xpath = //button[@type='submit'] ; click login button on login page
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=6,SleepLength:=1000)
try driver.executeScript("return document.readyState").equals("complete")
; if(StrLen(Status) > 0){
; msgbox, clicking login button
Xpath = //a[normalize-space()='Log In'] ; click login button at top right of page
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
sleep, 2000
; sleep, 2000
Xpath = //button[@type='submit'] ; click login button on login page
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=6,SleepLength:=1000)
try driver.executeScript("return document.readyState").equals("complete")
sleep, 2000
; }
}
else, {
SaveOrPostProgress(Message:="Login Expired. Please log back in",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
}
else, {
SaveOrPostProgress(Message:="Login Expired. Please log back in",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
}
}
@@ -112,6 +103,10 @@ try driver.FindElementByXPath(Xpath).click()
CheckForAlerts()
if(BrighteonUploadAttempt){
Sleep, 2000
}
Message = Uploading Video
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Upload Video
@@ -133,6 +128,25 @@ loop, 3 {
}
; input with js. Doesn't work in production, but does in the ConnectActiveTab script
/*
SaveOrPostProgress(Message:="Inputting title with JS",PostType:="Tooltip")
; Input Title of the Video
js = document.querySelector("#name").value = "%JSVideoDescription%";
driver.executeScript(JS) ;Execute Javascript
SaveOrPostProgress(Message:="Waiting 5 seconds to check if input was saved",PostType:="Tooltip")
sleep, 5000
Xpath = //input[@id='name']
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.SPACE)
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.BACKSPACE) ;Sends Variable to an Xpath Item
*/
; Input Title of the Video
Xpath = //input[@id='name']
try driver.FindElementByXPath(Xpath).SendKeys(VideoTitle) ;Sends Variable to an Xpath Item
@@ -162,13 +176,24 @@ loop, 3 {
TooltipThis("Inputting Video Description")
; Attempt to input video description a couple of times
; Attempt to input video description multiple time in case Brighteon rejects the input
Loop, 10 {
if(A_index = 10){
Message = Failed to input Video Description after 10 attempts.
Message = Failed to input Video Description after 10 attempts.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
if(!BrighteonUploadAttempt){
Message = Re-Trying Entire Upload
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
BrighteonUploadAttempt := 2
goto, BrighteonUpload
}
Message = Brighteon Upload Failed after 2 seperate individual attempts. Please try uploading manually and report any errors.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
@@ -177,9 +202,6 @@ Loop, 10 {
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="DiscordErrorLogging")
; SaveOrPostProgress(Message:="Inputting Video Description",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar")
; TooltipThis("Inputting Description)
Xpath = //div[@class='e-content e-lib e-keyboard']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoDescription)
if(Status){
@@ -188,23 +210,10 @@ Loop, 10 {
; Return
}
; DevModeMsgBox("pause")
; driver.FindElementByXPath(Xpath).SendKeys(VideoDescription)
; js = document.getElementById('description').value = "%JSBrighteonVideoDescription%";
; try driver.executeScript(js)
; sleep, 1000
; TooltipThis("checking description input")
; try driver.findElementsByID("description").item[1].SendKeys(driver.Keys.ENTER)
; sleep, 1000
sleep, 5000
js = return document.querySelector("div[class='e-content e-lib e-keyboard'] p").innerText;
; get text that was input into description box
js = return document.querySelector("#richtexteditor_747903514_0rte-view").innerText;
try Input_Description := driver.executeScript(JS) ;Execute Javascript
Input_DescriptionStrLen := StrLen(Input_Description)
@@ -218,11 +227,9 @@ Loop, 10 {
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Break
}
}
; Thumbnail
if(VideoThumbFilepath != "") {
TooltipThis("Uploading Thumbnail")
@@ -235,11 +242,21 @@ if(VideoThumbFilepath != "") {
}
; DevModeMsgBox(VideoTags)
; Brighteon has a max of 25 for tags.
if(ArrayOfVideoTags.Length() > 25){
Loop % 24 {
BrighteonKeywords := ArrayOfVideoTags[A_Index]
}
}
else,
BrighteonKeywords := VideoTags
TooltipThis("Inputting Keywords")
Loop, 5 {
XPath = //input[@id='keywords']
try driver.FindElementByXPath(Xpath).SendKeys(VideoTags) ;Sends Variable to an Xpath Item
try driver.FindElementByXPath(Xpath).SendKeys(BrighteonKeywords) ;Sends Variable to an Xpath Item
catch e {
Message = Error (E#2312)`nVideo Uploaded but Unable to Input Video Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
@@ -261,7 +278,6 @@ Loop, 5 {
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
break
}
; Msgbox % "status: " status
}
@@ -370,7 +386,6 @@ Loop % VideoTitleArray.Length(){
if(StrLen(VideoTitleLongWord) > 4)
Break
; MsgBox % VideoTitleArray[A_Index]
}
@@ -392,23 +407,6 @@ Loop, 4 {
jsCheck = return document.getElementsByClassName('col')[%ElementIndexNumber%].textContent;
try InnerText := driver.executeScript(jsCheck)
; Message = Loop Number: %ElementIndexNumber% element's Text Content: %innerText%`nBrighteonURL: %BrighteonURL%
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; Message = InnerText: %InnerText%
; SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
; DevModeMsgBox(InnerText)
; Message = BrighteonURL: %BrighteonURL%
; SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
; Msgbox % "VideoTitleLongWord: " VideoTitleLongWord "`nInnerText: " InnerText
; clipboard := Message
; msgbox % Message
; Msgbox % "InnerText: " InnerText . "`n" . "BrighteonURL: " . BrighteonURL
if(InStr(InnerText, VideoTitleLongWord)){
Message = Title Keyword was found on %A_index% loop, within element: %innerText%`nTrying to pull out BrighteonURL from element's outerHTML
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@@ -432,10 +430,6 @@ Loop, 4 {
}
; Convert dashboard URL to Public URL
; BrighteonURL := StrReplace(BrighteonURL, "dashboard/videos/", "")
if(BrighteonURL = ""){
Message = Upload Completed Successfully but failed to grab Share URL. Please Copy and Paste it in.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")

View File

@@ -39,7 +39,7 @@ if(LoggedOutStatus){
try driver.FindElementByXPath(Xpath).click()
js = document.querySelector("button[type='submit']").click();
driver.executeScript(js)
try driver.executeScript(js)
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
sleep, 1000
@@ -243,13 +243,22 @@ Message = Inputting Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; Append comma to end of tags
; DailyMotion page automtically splits the tags into their little boxes when they're seperated by commas
DailyMotionVideoTags := VideoTags . ","
; DailyMotion page automtically splits the tags into individual tags when they're seperated by commas
; Iterate from one end of the array to another:
Loop % ArrayOfVideoTags.Length(){
; ArrayItem := ARRAY[A_Index]
; MsgBox %
DailyMotionVideoTags .= ArrayOfVideoTags[A_Index] . ","
}
; DailyMotionVideoTags := VideoTags . ","
Message = Video Tags: %DailyMotionVideoTags%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = //div[@class='ant-select-selection-search']//input[@role='combobox']
Xpath = (//input[@id='tags'])[1]
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=DailyMotionVideoTags)
; double check the input
@@ -259,14 +268,12 @@ Message = Tags that got input: %inputTags% (Will be doubled b/c of js)
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; msgbox
Message = Clicking Next Button to Move on to next input screen
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = //button[@type='button']//span[contains(text(),'Next')]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; msgbox, click work?
Message = Selecting "Not For Kids" checkbox
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@@ -303,51 +310,6 @@ if(Status){
}
/*
; Disable monitization for video
SaveOrPostProgress(Message:="Unchecking monetizaton checkbox",PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //button[normalize-space()='Advanced'] ; advanced tab button
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status = "Failed"){
Message = Unable to Navigate to Advanced Settings Page to turn off monetization
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
*/
; SaveOrPostProgress(Message:="Unchecking monetizaton checkbox",PostType:="Tooltip,ErrorLoggingTextFile")
; switch over to advanced tab
; js = document.getElementsByName('advanced')[0].click();
; try driver.executeScript(js)
/*
sleep, 1000
Loop, 5 { ; Loop to uncheck the "monetization button"
if(A_index = 5){
Message = Failed to uncheck "monetization enabled" checkbox
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
Xpath = //input[@name='advertising_instream_blocked'] ; monetization checkbox
try Status := driver.FindElementByXPath(Xpath).isSelected()
if(Status = 0) ; -1 is checked, 0 is unchecked
Break
; Click to uncheck the "allow monetization" checkbox
Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
}
*/
/*
; Switch back to Basic tab
js = document.getElementsByName('basic')[0].click();
try driver.executeScript(js)
*/
Message = Clicking Next Button to Move on to third video settings screen
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@@ -355,7 +317,6 @@ Xpath = //button[@type='button']//span[contains(text(),'Next')]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
Message = Clicking Save Button to Finalize Upload
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")

484
Modules/GUI-Main-Window.ahk Normal file
View File

@@ -0,0 +1,484 @@
;---GUI Variables---
;------------------------------------------------
SetGUIVariables:
GuiHeight = 800
GuiWidth = 1366
GuiFontSize = 10
ButtonHeights := 30
ResultsActionButtonHeights := 50
MarginSize := 10
MarginSizeDoubled := MarginSize * 2
MarginSizeTripled := MarginSize * 3
EditBoxWidths := (GuiWidth / 100) * 60
EditBoxHalfWidths := (EditBoxWidths / 2) - (MarginSize / 2)
OdyseeURLSlugEditWidth := (EditBoxHalfWidths / 4) * 3
PodcastNumberTextXPos := EditBoxHalfWidths + OdyseeURLSlugEditWidth + (MarginSize * 3)
PodcastNumberEditWidth := (EditBoxHalfWidths / 4) - MarginSize
EditBoxOneFourthWidth := (EditBoxWidths / 4 )
EditBoxThreeFourthsWidth := (EditBoxWidths / 4 ) * 3
ColumnOneHalfWidthXPos := EditBoxHalfWidths + MarginSizeDoubled
EditBoxThirdsWidths := (EditBoxWidths / 3) - (MarginSize / 2)
OdyseeURLSlugXPos := EditBoxHalfWidths + (MarginSize * 2)
EditBoxFourthWidths := (EditBoxWidths / 4) - (MarginSize - 2)
VideoTagsTextXPos := EditBoxHalfWidths + (MarginSize * 2)
; EditBoxHalfWidthsWithMargin := (EditBoxWidths / 2)
DescriptionCharCountXPos := EditBoxHalfWidths - 40
PageTwoXStartPos := EditBoxWidths + 50
CopyButtonWidths := 150
ResultEditBoxXPos := CopyButtonWidths + MarginSize + 5
ResultEditBoxWidth := EditBoxWidths - ( CopyButtonWidths)
ResultsEditAndCopyButtonWidth := CopyButtonWidths + ResultEditBoxWidth + MarginSize
ResultsGUIWidth := ResultsEditAndCopyButtonWidth + ErrorLogEditBoxWidth + MarginSize
ErrorLogEditBoxXPos := ResultEditBoxWidth + CopyButtonWidths + 30
ErrorLogEditBoxHeight := ButtonHeights * 14 + (MarginSize * 9)
ErrorLogEditBoxWidth := 330
ResultEditBoxHalfWidths := (((ResultEditBoxWidth + CopyButtonWidths)) - (MarginSize * 3))
ResultLBRYURLEditBoxWidthPieces := (ResultEditBoxWidth / 4)
ResultLBRYURLEditBoxWidths := ResultLBRYURLEditBoxWidthPieces * 3
ResultEditBoxThirdsWidths := (ResultEditBoxWidth / 3) - (MarginSize /3)
ResultsScreenOneThirdsWidth := (ResultEditBoxWidth + CopyButtonWidths + ErrorLogEditBoxWidth) / 3
ResultLBRYThumbEditBoxWidth := ResultLBRYURLEditBoxWidthPieces - 5
ButtonWidths := 150
ButtonXPos := GuiWidth - ButtonWidths - 15
SubmitButtonYLocation := GuiHeight - 50
SubmitButtonXLocation := GuiWidth - 90
CancelButtonXLocation := GuiWidth - 180
EditBoxHeight := 25
ThumbnailPreviewWidth := 300
PageTwoGroupBoxWidth := ThumbnailPreviewWidth + 20
; Size of Description Edit Box and the location of the checkboxes underneath them
VideoDescriptionEditBoxHeight = 100
CheckboxesStartYPos := 630
FilePathEditBoxWidths := EditBoxWidths - MarginSize - 70
SelectFileButtonWidths := 30
ButtonStartYPos := CheckboxesStartYPos + 10
MarginSquared := MarginSize * 2
if(DevMode){
MainButtonHeight := 30
SecondaryButtonHeights := 30
}
else, {
MainButtonHeight := 30
SecondaryButtonHeights := 35
}
Return
; -------------------------------GUI-------------------------------
SetAndShowMainGUI:
Gosub, SetGUIVariables
Gui, Font, s%GuiFontSize%
Gui, Margin, %MarginSize%, %MarginSize%
; Video Title
Gui, Font, Bold
Gui, Add, Text,, Show Title
Gui, Add, Text, x%ColumnOneHalfWidthXPos% yp+0,Odysee URL Slug
Gui, Add, Text, x%PodcastNumberTextXPos% yp+0,Podcast #
Gui, Font, Normal
Gui, Add, Edit, y+5 x%MarginSize% w%EditBoxHalfWidths% h%EditBoxHeight% gUpdateVars vVideoTitle, %VideoTitle%
Gui, Add, Edit, yp+0 x+%MarginSize% w%OdyseeURLSlugEditWidth% h%EditBoxHeight% gUpdateVars vLBRYURLSlug, %LBRYURLSlug%
Gui, Add, Edit, yp+0 x+%MarginSize% w%PodcastNumberEditWidth% h%EditBoxHeight% gUpdateVars vPodcastNumber, %PodcastNumber%
; LBRY URL
Gui, Font, Bold
Gui, Add, Text, x%MarginSize%,Video Tags (Comma Seperated)
Gui, Add, Text,x%ColumnOneHalfWidthXPos% yp+0,Podcast Tags (Comma Seperated)
Gui, Font, Normal
Gui, Add, Edit, x%MarginSize% Y+5 w%EditBoxHalfWidths% h%EditBoxHeight% gUpdateVars vVideoTags, %VideoTags%
Gui, Add, Edit, yp+0 x+%MarginSize% w%EditBoxHalfWidths% h%EditBoxHeight% gUpdateVars vPodcastTags, %PodcastTags%
; Description/Summary Headers
Gui, Font, Bold
Gui, Add, Text,y+%MarginSize% x%MarginSize%,Description
Gui, Add, Text,yp+0 x%ColumnOneHalfWidthXPos%,Summary
Gui, Font, Normal
; Video Description edit box
Gui, Add, Edit,x%MarginSize% y+5 w%EditBoxHalfWidths% h%VideoDescriptionEditBoxHeight% vVideoDescription gSubmitDescription,%VideoDescription%
; Video Summary Edit Box
Gui, Add, Edit,x%ColumnOneHalfWidthXPos% yp+0 w%EditBoxHalfWidths% h%VideoDescriptionEditBoxHeight% vVideoSummary gUpdateVars,%VideoSummary%
Gui, Font, Normal
gui, font, s8
Gui, Add, Edit, x%MarginSize% y+5 vDescriptionCharCount, %DescriptionCharCount%
Gui, Add,Text, yp+4 x+%MarginSize%,Limits: DM+Bitchute = 3K, Odysee, Brighteon = 5K
; Gui, font, Bold
Gui, Font, s%GuiFontSize%
Gui, font, Bold
Gui, Add, GroupBox,r8.5 x%MarginSize% y+10 w%EditBoxWidths% Center, Filepaths
; Video Filepath
Gui, Font, Bold
Gui, Add, Text,xp+5 yp+15,Video Filepath
Gui, Font, Normal
Gui, Add, Edit, x%MarginSquared% y+2 w%FilePathEditBoxWidths% h%EditBoxHeight% gUpdateVars vVideoFilepath,%VideoFilepath%
Gui, Add, Button, x+%MarginSize% yp+0 h%EditBoxHeight% gSelectVideoFilepath, Select
; Video Thumbnail Filepath
Gui, Font, Bold
if(NoOriginalVideoThumbFilepath)
Gui, Add, Text, x%MarginSquared% CRed y+15,Video Thumbnail Filepath
else,
Gui, Add, Text,y+15 x%MarginSquared% ,Video Thumbnail Filepath
Gui, Font, Normal
Gui, Add, Edit, x%MarginSquared% y+2 w%FilePathEditBoxWidths% h%EditBoxHeight% gUpdateVars vVideoThumbFilepath,%VideoThumbFilepath%
Gui, Add, Button, x+%MarginSize% yp+0 h%EditBoxHeight% gSelectVideoThumbFilepath, Select
; WAV Audio File Filepath
Gui, Font, Bold
if(WavAudioFilepath = "")
Gui, Add, Text,cRed x%MarginSquared% y+15,WAV Filepath
else, { ; change text depending on if WAV or FLAC file
if(InStr(WavFilepath, ".flac"))
Gui, Add, Text,x%MarginSquared% y+15,FLAC Filepath
else,
Gui, Add, Text,x%MarginSquared% y+15,WAV Filepath
}
Gui, Font, Normal
Gui, Add, Edit, x%MarginSquared% y+2 w%FilePathEditBoxWidths% h%EditBoxHeight% gUpdateVars vWavAudioFilepath,%WavAudioFilepath%
Gui, Add, Button, x+%MarginSize% yp+0 h%EditBoxHeight% gSelectWAVFilepath, Select
Gui, Font, Bold
if(MP3AudioFilepath = "")
Gui, Add, Text,cRed x%MarginSquared% y+15,Podcast MP3 Filepath
else,
Gui, Add, Text,x%MarginSquared% y+15,Podcast MP3 Filepath
Gui, Font, Normal
Gui, Add, Edit, x%MarginSquared% y+2 w%FilePathEditBoxWidths% h%EditBoxHeight% gUpdateVars vMP3AudioFilepath,%MP3AudioFilepath%
Gui, Add, Button, x+%MarginSize% yp+0 h%EditBoxHeight% gSelectMP3Filepath, Select
; Submit Button
Gui, Font, s%GuiFontSize%
gui, Font, Bold
Gui, Add, Button, w%EditBoxFourthWidths% x%MarginSize% vUpdateAvailable h%SecondaryButtonHeights% gUpdateScript,FVU Up-to-Date
Gui, Add, Button, x+%MarginSize% w%EditBoxFourthWidths% h%SecondaryButtonHeights% gOpenProjectFolder, Open Folder
Gui, Add, Button, x+%MarginSize% w%EditBoxHalfWidths% h%SecondaryButtonHeights% gScheduleUpload, Schedule for Later
Gui, Add, Button, w%EditBoxFourthWidths% h%SecondaryButtonHeights% x%MarginSize% y+%MarginSize% vChromeUpdateAvailable gUpdateChrome, Chrome Up-to-Date
Gui, Add, Button, x+%MarginSize% yp+0 w%EditBoxFourthWidths% h%SecondaryButtonHeights% gDisplayResults, View Status
Gui, Add, Button, x+%MarginSize% w%EditBoxHalfWidths% h%SecondaryButtonHeights% gStartScript, UPLOAD
Gui, Add, Button, w%EditBoxFourthWidths% h%SecondaryButtonHeights% x%MarginSize% y+%MarginSize% vPostSchedulerUpdateAvailable gUpdatePostScheduler, Post Scheduler Up-To-Date
; Gui, Add, Button, w%EditBoxFourthWidths% h%SecondaryButtonHeights% x%MarginSize% y+%MarginSize% vPostSchedulerUpdateAvailable, Post Scheduler Up-To-Date
Gui, Add, Button, x+%MarginSize% w%EditBoxFourthWidths% h%SecondaryButtonHeights%
Gui, Add, Button, x+%MarginSize% w%EditBoxHalfWidths% h%SecondaryButtonHeights% gReloadScript, Open New Project
if(DevMode){
Gui, Add, Button, x%MarginSize% w%EditBoxFourthWidths% h30 y+5 h%SecondaryButtonHeights% gOpenErrorLog, Open ErrorLog
Gui, Add, Button, x+%MarginSize% w%EditBoxFourthWidths% h30 h%SecondaryButtonHeights% gClearVideoLinks, Clear VideoLinks
}
; -------------------------------Page 2 Side of Main GUI Window-------------------------------
LineSplitXPosition := PageTwoXStartPos - ( MarginSize * 2)
gui, add, text, x%LineSplitXPosition% y20 h600 0x11 ; 0x11 is a "line"
; Miscellaneous Settings
; DevMode Buttons
gui, Font, s4
Gui, Font, Normal
DevModToggleButton := PageTwoXStartPos + 160
Gui, Add, Button, x%DevModToggleButton% y5 w50 h10 gToggleDevMode,DevMode
Gui, Add, Button, x+%MarginSize% y5 w50 h10 gToggleTestingMode, Testing Mode
Gui, Add, Button, x+%MarginSize% y5 w50 h10 gOpenGiteaPage, Gitea
Gui, Font, s%GuiFontSize%
Gui, Font, Normal
; Settings Section
Gui, Add, GroupBox,r6 y+0 x%PageTwoXStartPos% w%PageTwoGroupBoxWidth%,Settings
Gui, Add, Checkbox, xp+10 yp+20 vAutoUpdateCheck gUpdateVars Checked%AutoUpdateCheck%, Auto Update Check
Gui, Add, Checkbox, vShowTooltipProgress Checked%ShowTooltipProgress% gUpdateVars,Show Tooltip of Actions
Gui, Add, Checkbox, vKillLBRYAfterUpload Checked%KillLBRYAfterUpload%, Kill LBRY After Uploading
Gui, Add, Checkbox, vErrorLogToDiscord gUpdateVars Checked%ErrorLogToDiscord%, Error Log to Discord
Gui, Add, Checkbox, vDiscordPingOnCompletion gUpdateVars Checked%DiscordPingOnCompletion%, Discord Ping Upon Completion
Gui, Add, Checkbox, vConfirmBeforeSubmit checked%ConfirmBeforeSubmit%, Confirm Before Submit
GroupBoxCheckboxPos := PageTwoXStartPos + MarginSize
; -------------------------------PLATFORMS-------------------------------
Gui, Font, s%GuiFontSize%
Gui, Font, Bold
Gui, Add, GroupBox,r6 y+%MarginSizeTripled% x%PageTwoXStartPos% w%PageTwoGroupBoxWidth%, Platforms
Gui, Font, s8
Gui, Font, Bold
Gui, Add, Button, xp+80 yp+0 gUncheckAllPlatforms, Uncheck All
Gui, Font, s%GuiFontSize%
Gui, Font, Normal
Gui, Add, Checkbox, x%GroupBoxCheckboxPos% yp+30 vBitChute Checked%BitChute% gUpdateVars, BitChute
if(LocalsURL = "LocalsUploadStartedNeedToGrabURL"){
; msgbox, checking grab url
Gui, Add, Checkbox, x+%MarginSizeTripled% yp+0 vLocalsGrabURL Checked%Locals% gUpdateVars, Locals (Grab URL)
LocalsGrabURL := 1
Locals := 0
}
else, {
; msgbox, checking locals
Gui, Add, Checkbox, x+%MarginSizeTripled% yp+0 vLocals Checked%Locals% gUpdateVars, Locals
LocalsGrabURL := 0
Locals := 1
}
Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSize% vOdyseeVideo Checked%OdyseeVideo% gUpdateVars, Odysee Video
Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSize% vOdyseeAudio Checked%OdyseeAudio% gUpdateVars, Odysee Audio
Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSize% vRumble Checked%Rumble% gUpdateVars, Rumble
; Brighteon Does not accept videos lower than 300kbps or that don't have the appropriate aspect ratio
if(VideoTotalBitrate < 300000 OR !VideoHasBrighteonCompatibleAspectRatio){
if(!VideoHasBrighteonCompatibleAspectRatio)
Gui, Add, Checkbox, cRed vBrighteon y+%MarginSize% Checked0 gUpdateVars, Brighteon (Aspect Ratio is %VideoAspectRatio%)
else,
Gui, Add, Checkbox, cRed vBrighteon y+%MarginSize% Checked0 gUpdateVars, Brighteon (Bitrate Below 300kbps)
}
else,{
Gui, Add, Checkbox, vBrighteon y+%MarginSize% Checked%Brighteon% gUpdateVars, Brighteon
}
Gui, Add, Checkbox, vDailyMotion y+%MarginSize% Checked%DailyMotion% gUpdateVars, DailyMotion
Gui, Font, s%GuiFontSize%
Gui, Font, Bold
Gui, Add, GroupBox, r6.5 y+%MarginSizeTripled% vImageThumbnail x%PageTwoXStartPos% w%PageTwoGroupBoxWidth%,Thumbnail
gui, Font, Normal
Gui, Add, Picture, xp+10 yp+20 w%ThumbnailPreviewWidth% h-1, %VideoThumbFilepath%
gui, Font, Normal
gui, font, s7
Gui, Add, StatusBar,Center, Total Videos Uploaded: %TotalVideosUploaded% | Total Clicks Saved: %MouseClicksSaved%
; Show GUI to the user
Gui, +Resize +MaximizeBox
if(XPosition and YPosition)
Gui, Show, x%XPosition% y%YPosition%, %FullScriptName% - Upload Settings - %BodyTextFilePath%
else,
Gui, Show,, %FullScriptName% - Upload Settings - %BodyTextFilePath%
ControlFocus, Edit4, %FullScriptName%
ToolTip
; calculate run time and convert to seconds
URunTime1 := round(((A_TickCount - UStartTime) / 1000), 2)
; - Check for Updates
;------------------------------------------------
if(AutoUpdateCheck AND !UpdateAvailable){
SetTimer, CheckForUpdates, -1000
}
; calculate run time and convert to seconds
URunTime2 := round(((A_TickCount - UStartTime) / 1000), 2)
Return
; Scheduler GUI
; ------------------------------------------------
ScheduleUpload:
gui, Submit, NoHide ; submit the main GUI so all the variables get updated
; Create GUI for Scheduler
Gui, ScheduleGUI:New
Gui, Font, s15
Gui, Font, Bold
Gui, Add, Text,, Date:
Gui, Add, DateTime,w%EditBoxHalfWidths% vScheduledDate , MM/dd/yyyy
Gui, Add, Text,, Time:
Gui, Add, DateTime, w%EditBoxHalfWidths% vScheduledTime Choose200505311900, Time
Gui, Add, Button,w%EditBoxHalfWidths% gSubmitScheduler, Schedule
Gui, Show,, Scheduler
Return
; Results GUI Screen
; ------------------------------------------------
SetAndShowResultsGUI:
; Set the GUI Variables, needed if called from Scheduler
Gosub, SetGUIVariables
Gui, Font, s%GuiFontSize%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+%MarginSize% h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard,Transcript URL
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% w%ResultEditBoxWidth% gUpdateVars vPodcastTranscriptURL, %PodcastTranscriptURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+%MarginSize% h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Bitchute
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vBitChuteURL w%ResultEditBoxWidth% gUpdateVars , %BitChuteURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+%MarginSize% h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Brighteon
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vBrighteonURL w%ResultEditBoxWidth% gUpdateVars , %BrighteonURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, DailyMotion
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vDailyMotionURL w%ResultEditBoxWidth% gUpdateVars , %DailyMotionURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Odysee Video
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vOdyseeVideoURL w%ResultEditBoxWidth% gUpdateVars, %OdyseeVideoURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Odysee Audio
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vOdyseeAudioURL w%ResultEditBoxWidth% gUpdateVars , %OdyseeAudioURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Rumble
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vRumbleURL w%ResultEditBoxWidth% gUpdateVars , %RumbleURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Locals
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vLocalsURL w%ResultEditBoxWidth% gUpdateVars, %LocalsURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Unauthorized
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vUnauthorizedTVURL w%ResultEditBoxWidth% gUpdateVars, %UnauthorizedTVURL%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Video Tags
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vVideoTags w%ResultEditBoxWidth% gUpdateVars , %VideoTags%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Podcast Tags
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vPodcasttags w%ResultEditBoxWidth% gUpdateVars , %Podcasttags%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Description
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vVideoDescription w%ResultEditBoxWidth% gUpdateVars , %VideoDescription%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyToClipboard, Summary
Gui, Font, Normal
Gui, Font, Normal
Gui, Add, Edit, x+%MarginSize% yp+0 h%ButtonHeights% vVideoSummary w%ResultEditBoxWidth% gUpdateVars , %VideoSummary%
Gui, Font, s%GuiFontSize%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% w%ResultsEditAndCopyButtonWidth% h%SecondaryButtonHeights% gUpdateINI, Save Modified Links to Files
; Error Log Column
; ------------------------------------------------
Gui, Font, s%GuiFontSize%
Gui, Add, Button, x+%MarginSize% y%MarginSize% w%ErrorLogEditBoxWidth% h%ButtonHeights% y%MarginSize% gOpenErrorLog, Error Log (Click to Open Detailed Log)
Gui, Add, Edit,x%ErrorLogEditBoxXPos% h%ErrorLogEditBoxHeight% w%ErrorLogEditBoxWidth% y+10, %ErrorLogVar%
gui, font, Normal
gui, font, s7
Gui, Add, StatusBar,, Total Videos Uploaded: %TotalVideosUploaded% | Total Clicks Saved: %MouseClicksSaved%
Gui, +Resize +MaximizeBox
Gui, add, text, x%MarginSize% y+%MarginSize% w%ResultsGUIWidth% 0x10 ;Horizontal Line > Etched Gray
; Results GUI Action Buttons
; ------------------------------------------------
Gui, Font, s%GuiFontSize%
Gui, Font, Bold
Gui, Add, Button, x%MarginSize% yp+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gOpenLBRYBlobFilesFolder, Open LBRY Blob Folder
Gui, Add, Button, x+%MarginSize% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gUploadPodcast vUploadPodcast, Upload Podcast
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% w%ResultsScreenOneThirdsWidth% h%SecondaryButtonHeights% gStartSocialMediaPoster, Start Social Media Poster
; Row 3
; Gui, Add, Button, x%ResultEditBoxXPos% y+%MarginSize% w%ResultsScreenOneThirdsWidth% h%ButtonHeights%,
; Gui, Add, Button, x+%MarginSize% w%ResultEditBoxHalfWidths% w%ButtonWidths% h%ButtonHeights% gCancelPost , Close
; Gui, Add, Button, x+%MarginSize% w%ResultEditBoxHalfWidths% gKillScript %ButtonWidths% , Close
; gui, Add, Text, y+10
OriginalVideoDescription := VideoDescription
OriginalPodcastTags := PodcastTags
if(XPosition and YPosition)
Gui, Show,x%XPosition% y%YPosition%,%FullScriptName% - Uploads Status
else,
Gui, Show,,%FullScriptName% - Uploads Results
Return

340
Modules/GUI-Windows.ahk Normal file
View File

@@ -0,0 +1,340 @@
DisplayMainGUI:
;---GUI Variables---
;------------------------------------------------
GuiHeight = 800
GuiWidth = 1366
GuiFontSize = 10
ButtonHeights := 30
MarginSpace := 10
MarginSpaceDoubled := MarginSpace * 2
MarginSpaceTripled := MarginSpace * 3
EditBoxWidths := (GuiWidth / 100) * 60
EditBoxHalfWidths := (EditBoxWidths / 2) - (MarginSpace / 2)
OdyseeURLSlugEditWidth := (EditBoxHalfWidths / 4) * 3
PodcastNumberTextXPos := EditBoxHalfWidths + OdyseeURLSlugEditWidth + (MarginSpace * 3)
PodcastNumberEditWidth := (EditBoxHalfWidths / 4) - MarginSpace
EditBoxOneFourthWidth := (EditBoxWidths / 4 )
EditBoxThreeFourthsWidth := (EditBoxWidths / 4 ) * 3
ColumnOneHalfWidthXPos := EditBoxHalfWidths + MarginSpaceDoubled
EditBoxThirdsWidths := (EditBoxWidths / 3) - (MarginSpace / 2)
OdyseeURLSlugXPos := EditBoxHalfWidths + (MarginSpace * 2)
EditBoxFourthWidths := (EditBoxWidths / 4) - (MarginSpace - 2)
VideoTagsTextXPos := EditBoxHalfWidths + (MarginSpace * 2)
; EditBoxHalfWidthsWithMargin := (EditBoxWidths / 2)
DescriptionCharCountXPos := EditBoxWidths - 40
PageTwoXStartPos := EditBoxWidths + 50
CopyButtonWidths := 150
ResultEditBoxXPos := CopyButtonWidths + MarginSpace + 5
ResultEditBoxWidths := EditBoxWidths - CopyButtonWidths
ResultEditBoxHalfWidths := (ResultEditBoxWidths / 2) - (MarginSpace /2)
ResultLBRYURLEditBoxWidthPieces := (ResultEditBoxWidths / 4)
ResultLBRYURLEditBoxWidths := ResultLBRYURLEditBoxWidthPieces * 3
ResultEditBoxThirdsWidths := (ResultEditBoxWidths / 3) - (MarginSpace /3)
ResultLBRYThumbEditBoxWidth := ResultLBRYURLEditBoxWidthPieces - 5
ErrorLogEditBoxXPos := ResultEditBoxWidths + CopyButtonWidths + 30
ErrorLogEditBoxHeight := GuiHeight - (MarginSpace * 20) - (ButtonHeights * 2)
ErrorLogEditBoxWidth := GuiWidth - ErrorLogEditBoxXPos - (MarginSpace * 12)
ButtonWidths := 150
ButtonXPos := GuiWidth - ButtonWidths - 15
SubmitButtonYLocation := GuiHeight - 50
SubmitButtonXLocation := GuiWidth - 90
CancelButtonXLocation := GuiWidth - 180
EditBoxHeight := 25
ThumbnailPreviewWidth := 300
PageTwoGroupBoxWidth := ThumbnailPreviewWidth + 20
; Size of Description Edit Box and the location of the checkboxes underneath them
VideoDescriptionEditBoxHeight = 100
CheckboxesStartYPos := 630
FilePathEditBoxWidths := EditBoxWidths - MarginSpace - 70
SelectFileButtonWidths := 30
ButtonStartYPos := CheckboxesStartYPos + 10
MarginSquared := MarginSpace * 2
if(DevMode){
MainButtonHeight := 30
SecondaryButtonHeights := 30
}
else, {
MainButtonHeight := 30
SecondaryButtonHeights := 35
}
; -------------------------------GUI-------------------------------
Gui, Font, s%GuiFontSize%
Gui, Margin, %MarginSpace%, %MarginSpace%
; Video Title
Gui, Font, Bold
Gui, Add, Text,, Show Title
Gui, Add, Text, x%ColumnOneHalfWidthXPos% yp+0,Odysee URL Slug
Gui, Add, Text, x%PodcastNumberTextXPos% yp+0,Podcast #
Gui, Font, Normal
Gui, Add, Edit, y+5 x%MarginSpace% w%EditBoxHalfWidths% h%EditBoxHeight% gUpdateVars vVideoTitle, %VideoTitle%
Gui, Add, Edit, yp+0 x+%Marginspace% w%OdyseeURLSlugEditWidth% h%EditBoxHeight% gUpdateVars vLBRYURLSlug, %LBRYURLSlug%
Gui, Add, Edit, yp+0 x+%Marginspace% w%PodcastNumberEditWidth% h%EditBoxHeight% gUpdateVars vPodcastNumber, %PodcastNumber%
; LBRY URL
Gui, Font, Bold
Gui, Add, Text, x%Marginspace%,Video Tags (Comma Seperated)
Gui, Add, Text,x%ColumnOneHalfWidthXPos% yp+0,Podcast Tags (Comma Seperated)
Gui, Font, Normal
Gui, Add, Edit, x%Marginspace% Y+5 w%EditBoxHalfWidths% h%EditBoxHeight% gUpdateVars vVideoTags, %VideoTags%
Gui, Add, Edit, yp+0 x+%Marginspace% w%EditBoxHalfWidths% h%EditBoxHeight% gUpdateVars vPodcastTags, %PodcastTags%
; Video Description
Gui, Font, Bold
if(NoOriginalVideoDescription)
Gui, Add, Text,cRed y+%Marginspace% x%Marginspace%,Video Description
else,
Gui, Add, Text,y+%Marginspace% x%Marginspace%,Video Description:
if(TestingMode)
Gui, Add, Text,cRed yp+0 xp+150 ,TESTING MODE
if(DevMode)
Gui, Add, Text,cRed yp+0 xp+150 ,DEV MODE
Gui, Font, Normal
Gui, Add, Edit,x%Marginspace% y+2 w%EditBoxWidths% h%VideoDescriptionEditBoxHeight% vVideoDescription gSubmitDescription,%VideoDescription%
gui, font, s8
Gui, font, Bold
if(DescriptionCharCount > 3000){
Gui, Add, Edit,cRed w50 h20 x%DescriptionCharCountXPos% y+1 vDescriptionCharCount, %DescriptionCharCount%
}
else,
Gui, Add, Edit, w50 h20 x%DescriptionCharCountXPos% y+1 vDescriptionCharCount, %DescriptionCharCount%
Gui, Font, Normal
Gui, Add,Text, yp+3 xp-310, (Platform Char. Limits: DM+Bitchute = 3K, Odysee,Brighteon = 5K)
Gui, Font, s%GuiFontSize%
Gui, font, Bold
Gui, Add, GroupBox,r8.5 x%MarginSpace% yp+10 w%EditBoxWidths% Center, Filepaths
; Video Filepath
Gui, Font, Bold
Gui, Add, Text,xp+5 yp+15,Video Filepath
Gui, Font, Normal
Gui, Add, Edit, x%MarginSquared% y+2 w%FilePathEditBoxWidths% h%EditBoxHeight% gUpdateVars vVideoFilepath,%VideoFilepath%
Gui, Add, Button, x+5 yp+0 h%EditBoxHeight% gSelectVideoFilepath, Select
; Video Thumbnail Filepath
Gui, Font, Bold
if(NoOriginalVideoThumbFilepath)
Gui, Add, Text, x%MarginSquared% CRed y+15,Video Thumbnail Filepath
else,
Gui, Add, Text,y+15 x%MarginSquared% ,Video Thumbnail Filepath
Gui, Font, Normal
Gui, Add, Edit, x%MarginSquared% y+2 w%FilePathEditBoxWidths% h%EditBoxHeight% gUpdateVars vVideoThumbFilepath,%VideoThumbFilepath%
Gui, Add, Button, x+5 yp+0 h%EditBoxHeight% gSelectVideoThumbFilepath, Select
; WAV Audio File Filepath
Gui, Font, Bold
if(WavAudioFilepath = "")
Gui, Add, Text,cRed x%MarginSquared% y+15,WAV Filepath
else, { ; change text depending on if WAV or FLAC file
if(InStr(WavFilepath, ".flac"))
Gui, Add, Text,x%MarginSquared% y+15,FLAC Filepath
else,
Gui, Add, Text,x%MarginSquared% y+15,WAV Filepath
}
Gui, Font, Normal
Gui, Add, Edit, x%MarginSquared% y+2 w%FilePathEditBoxWidths% h%EditBoxHeight% gUpdateVars vWavAudioFilepath,%WavAudioFilepath%
Gui, Add, Button, x+5 yp+0 h%EditBoxHeight% gSelectWAVFilepath, Select
Gui, Font, Bold
if(MP3AudioFilepath = "")
Gui, Add, Text,cRed x%MarginSquared% y+15,Podcast MP3 Filepath
else,
Gui, Add, Text,x%MarginSquared% y+15,Podcast MP3 Filepath
Gui, Font, Normal
Gui, Add, Edit, x%MarginSquared% y+2 w%FilePathEditBoxWidths% h%EditBoxHeight% gUpdateVars vMP3AudioFilepath,%MP3AudioFilepath%
Gui, Add, Button, x+5 yp+0 h%EditBoxHeight% gSelectMP3Filepath, Select
; Submit Button
Gui, Font, s%GuiFontSize%
gui, Font, Bold
; if(DevMode)
; Gui, Add, Button, x%MarginSpace% w%EditBoxHalfWidths% y+25 h%MainButtonHeight% gCancelPost hwndIcon, Close
; else,
; Script Update Button
if(UpdateAvailable){
Gui, Add, Button, w%EditBoxHalfWidths% x%MarginSpace% gUpdateScript vUpdateAvailable h%SecondaryButtonHeights% center,Uploader Update Available!
; GuiButtonIcon(Icon, "shell32.dll", 278, "s20 a1 r2")
}
else, {
Gui, Add, Button, w%EditBoxHalfWidths% x%MarginSpace% gUpdateScript vUpdateAvailable h%SecondaryButtonHeights% center,Uploader Up-to-Date
; Gui, Add, Button, w%EditBoxHalfWidths% x+%Marginspace% vUpdateAvailable hwndIcon, Script is Up-to-Date
; GuiButtonIcon(Icon, "shell32.dll", 239, "s20 a1 r2")
}
; Gui, Font, s20
; Gui, Font, Bold
Gui, Add, Button, x+%MarginSpace% w%EditBoxHalfWidths% h%SecondaryButtonHeights% gStartScript, UPLOAD
Gui, Font, s%GuiFontSize%
; Chrome Update Button
if(ChromeUpdateAvailable){
Gui, Add, Button, x%MarginSpace% w%EditBoxHalfWidths% y+%Marginspace% h%SecondaryButtonHeights% vChromeUpdateAvailable gUpdateChrome center,Chrome Update Available!
}
else, {
Gui, Add, Button, x%MarginSpace% w%EditBoxHalfWidths% y+%Marginspace% h%SecondaryButtonHeights% vChromeUpdateAvailable gUpdateChrome center,Chrome Up-to-Date
}
; Gui, Add, Button, x%MarginSpace% w%EditBoxHalfWidths% y+25 h%MainButtonHeight% gCancelPost hwndIcon, Exit
; GuiButtonIcon(Icon, "imageres.dll",208, "s20 a1 r2")
if(DevMode)
Gui, Add, Button, x+%MarginSpace% yp+0 w%EditBoxFourthWidths% h%SecondaryButtonHeights% gDisplayResults, View Results
else,
Gui, Add, Button, x+%MarginSpace% yp+0 w%EditBoxFourthWidths% h%SecondaryButtonHeights% gDisplayResults, View Results
Gui, Add, Button, w%EditBoxFourthWidths% x+%Marginspace% h%SecondaryButtonHeights% gOpenProjectFolder, Open Project Folder
if(DevMode){
Gui, Add, Button, x%MarginSpace% w%EditBoxFourthWidths% h30 y+5 h%SecondaryButtonHeights% gOpenErrorLog, Open ErrorLog
Gui, Add, Button, x+%MarginSpace% w%EditBoxFourthWidths% h30 h%SecondaryButtonHeights% gClearVideoLinks, Clear VideoLinks
}
; -------------------------------Page 2 Side of Main GUI Window-------------------------------
LineSplitXPosition := PageTwoXStartPos - ( MarginSpace * 2)
gui, add, text, x%LineSplitXPosition% y20 h500 0x11 ; 0x11 is a "line" ; refer to here: https://autohotkey.com/board/topic/50910-draw-line-gui/
; Thumbnail Preview
Gui, Font, Normal
gui, Font, s4
; Miscellaneous Settings
DevModToggleButton := PageTwoXStartPos + 160
Gui, Add, Button, x%DevModToggleButton% y5 w50 h10 gToggleDevMode,DevMode
Gui, Add, Button, x+5 y5 w50 h10 gToggleTestingMode, Testing Mode
Gui, Add, Button, x+5 y5 w50 h10 gOpenGiteaPage, Gitea
Gui, Font, s%GuiFontSize%
Gui, Font, Bold
; Settings Section
Gui, Add, GroupBox,r5 y+0 x%PageTwoXStartPos% w%PageTwoGroupBoxWidth%,Settings
Gui, Add, Checkbox, xp+10 yp+20 vAutoUpdateCheck gUpdateVars Checked%AutoUpdateCheckCheckStatus%, Auto Update Check
Gui, Add, Checkbox, vShowTooltipProgress Checked%ShowTooltipProgressCheckStatus% gUpdateVars,Show Tooltip Progress
Gui, Add, Checkbox, vKillLBRYAfterUpload Checked%KillLBRYAfterUploadCheckStatus%, Kill LBRY After Uploading
Gui, Add, Checkbox, vAutoLogin gUpdateVars Checked%AutoLoginCheckStatus%, Try to Login Automatically
Gui, Add, Checkbox, vPingOnCompletion gUpdateVars Checked%PingOnCompletionCheckStatus%, Discord Ping Upon Completion
GroupBoxCheckboxPos := PageTwoXStartPos + MarginSpace
; -------------------------------PLATFORMS-------------------------------
Gui, Add, GroupBox,r6 y+%MarginSpaceTripled% x%PageTwoXStartPos% w%PageTwoGroupBoxWidth%, Platforms
; Msgbox % "LocalsURL: " LocalsURL
; if(VideoFileSizeInMB < 1792)
; Gui, Add, Checkbox, x+%MarginSpaceDoubled% vFacebook Checked%FacebookCheckStatus%, Facebook
Gui, Add, Checkbox, xp+10 yp+25 vBitChute Checked%BitChuteCheckStatus% gUpdateVars, BitChute
if(LocalsURL = "LocalsUploadStartedNeedToGrabURL"){
; msgbox, checking grab url
Gui, Add, Checkbox, x+%MarginSpaceTripled% yp+0 vLocalsGrabURL Checked%LocalsCheckStatus% gUpdateVars, Locals (Grab URL)
LocalsGrabURL := 1
Locals := 0
}
else, {
; msgbox, checking locals
Gui, Add, Checkbox, x+%MarginSpaceTripled% yp+0 vLocals Checked%LocalsCheckStatus% gUpdateVars, Locals
LocalsGrabURL := 0
Locals := 1
}
Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vOdyseeVideo Checked%OdyseeVideoCheckStatus% gUpdateVars, Odysee Video
if(VideoFileSizeInMB < 50)
Gui, Add, Checkbox, vTelegram x+%MarginSpaceTripled% yp+0 Checked%TelegramCheckStatus% gUpdateVars, Telegram (>50 MB)
; Gui, Add, Checkbox, x+%MarginSpace% vOdyseeVideoThumb Checked%OdyseeVideoThumbCheckStatus%,Thumbnail
Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vOdyseeAudio Checked%OdyseeAudioCheckStatus% gUpdateVars, Odysee Audio
; Gui, Add, Checkbox, x+%MarginSpace% vOdyseeAudioThumb Checked%OdyseeAudioThumbCheckStatus%, Thumbnail
Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vRumble Checked%RumbleCheckStatus% gUpdateVars, Rumble
if(VideoTotalBitrate > 300000)
Gui, Add, Checkbox, vBrighteon y+%MarginSpace% Checked%BrighteonCheckStatus% gUpdateVars, Brighteon
else,{
Gui, Add, Checkbox, cRed vBrighteon y+%MarginSpace% Checked0 gUpdateVars, Brighteon (Bitrate Below 300kbps)
}
Gui, Add, Checkbox, vDailyMotion y+%MarginSpace% Checked%DailyMotionCheckStatus% gUpdateVars, DailyMotion
; Gui, Add, Checkbox, vStreamanity Checked%StreamanityCheckStatus%, Streamanity
; Gui, Font, s12
gui, Font, Bold
Gui, Add, GroupBox, r6.5 y+%MarginSpaceTripled% vImageThumbnail x%PageTwoXStartPos% w%PageTwoGroupBoxWidth%,Thumbnail
gui, Font, Normal
Gui, Add, Picture, xp+10 yp+20 w%ThumbnailPreviewWidth% h-1, %VideoThumbFilepath%
gui, Font, Normal
gui, font, s7
Gui, Add, StatusBar,Center, Total Videos Uploaded: %TotalVideosUploaded% | Total Clicks Saved: %MouseClicksSaved%
; Show GUI to the user
Gui, +Resize +MaximizeBox
if(XPosition and YPosition)
Gui, Show, x%XPosition% y%YPosition%, %FullScriptName% - Upload Settings - %BodyTextFilePath%
else,
Gui, Show,, %FullScriptName% - Upload Settings - %BodyTextFilePath%
ControlFocus, Edit4, %FullScriptName%
ToolTip
Return

View File

@@ -0,0 +1,135 @@
;---ENVIRONMENT---------------------------------------------------------------------
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
;#Warn ; Enable warnings to assist with detecting common errors.
;DetectHiddenWindows, On
#SingleInstance, Force
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;SetKeyDelay, 500
CoordMode, ToolTip, Screen
CoordMode, Mouse, Screen
;#NoTrayIcon
; Menu, Tray, Icon, %A_scriptDir%\Assets\LBRY-Process-Killer.ico
;---Notes/Extra Info/#Includes------------------------------------------------------
;---VARIABLES-----------------------------------------------------------------------
global DiscordWebhookBotURL
PassedParameter = %1%
if(PassedParameter = "Kill")
ExitApp
IniRead, DiscordWebhookBotURL, %A_scriptDir%\..\Settings.ini, General, DiscordWebhookBotURL, %A_Space%
if(DiscordWebhookBotURL = ""){
; msgbox, Unable to Read Settings.ini for DiscordWebhookBotURL.`nProgram will not be able to post seed status to Discord
; ExitApp
}
;---MAIN SCRIPT---------------------------------------------------------------------
lbrynetlog_FP = C:\Users\%A_Username%\AppData\Local\lbry\lbrynet\lbrynet.log
if(!FileExist(lbrynetlog_FP)){
Message = lbrynet.log not found in the usual location. `nPlease submit issue on gitea to add functionality for custom locations.`nClick OK to open gitea page.
msgbox % Message
run, https://git.zinchuk.xyz/yuriy/LBRY-Process-Killer
ExitApp
}
FileRead, lbrynetlogContents, C:\Users\%A_Username%\AppData\Local\lbry\lbrynet\lbrynet.log
if(lbrynetlogContents = ""){
Message = LBRYNet.log exists at normal location, but is currently empty. `nPlease submit issue on gitea about this error message `nClick OK to open gitea page and exit.
msgbox % Message
run, https://git.zinchuk.xyz/yuriy/LBRY-Process-Killer
ExitApp
}
; Msgbox % "lbrynetlogContents: " lbrynetlogContents
LogContentsArray := StrSplit(lbrynetlogContents, "`n")
OriginalArrayLenght := LogContentsArray.Length() ; Save total number of items in the array
Loop, 45 { ; 3.75 hours, if not complete by this time then exit
sleep, 300000 ; 5 minutes
; sleep, 60000
if(A_index = 6 OR A_index = 12 OR A_index = 24 OR A_index = 36 OR A_index = 48){ ; 30, 60, 120 minutes
Message = LBRY: Still waiting for Video to finish Uploading to Reflectors
PostProgressToDiscord(Message)
}
FileRead, lbrynetlogContents, C:\Users\%A_username%\AppData\Local\lbry\lbrynet\lbrynet.log
UpdatedLogContentsArray := StrSplit(lbrynetlogContents, "`n")
ArrayLenght := UpdatedLogContentsArray.Length() ; Count number of individual rows
Loop, %ArrayLenght% {
if(A_index < %OriginalArrayLenght%)
Continue ; Skip all lines that that were present in the original .log
CurrentLineContents := UpdatedLogContentsArray[A_index]
if(InStr(CurrentLineContents, "Finished sending reflector")){ ; Upload Complete Text on lbrylog
SeedingComplete := 1 ; mark seeding as complete and go to next loop
OriginalArrayLenght := A_index ; set variable to equal this loop number. So all lines up to this one get skipped next loop round
Continue
}
if(InStr(CurrentLineContents, "Sent reflector blob")){ ; Means "Still Uploading" in LBRY API
SeedingComplete := 0 ; mark seeding as incomplete as there is still an upload in progress
Continue
}
}
if(SeedingComplete){
Process, Close, LBRY.exe ; terminate LBRY if it's running
if(DiscordWebhookBotURL){
Message = LBRY: Video Finished Seeding to Reflectors. LBRY Process Killed.
PostProgressToDiscord(Message)
}
ExitApp
}
}
;---FUNCTIONS-----------------------------------------------------------------------
PostProgressToDiscord(Message){
; Need to transform the message into a json string:
FormatTime, CurrentTime, YYYYMMDDHH24MISS, hh:mm
; Message := "-----------" . CurrentTime . "-----------" . "`n" . Message ; add a ------- to the top of the message to help split them up visually on discord
; Escape Backslashes
Message := StrReplace(Message, "", "\/")
; Escape quotation marks
SingleQuotationmark = "
ReplacedQuote = \"
Message := StrReplace(Message, SingleQuotationmark, ReplacedQuote)
; Escape New Character
Message := StrReplace(Message, "`n", "\n")
; Convert into json string
JsonString=
(
{
"content": "%Message%"
}
)
try WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
try WebRequest.Open("POST", DiscordWebhookBotURL, false)
try WebRequest.SetRequestHeader("Content-Type", "application/json")
try WebRequest.Send(JsonString)
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 KiB

View File

@@ -21,27 +21,6 @@ CheckLBRYProcess() ; double check lbry process
SaveOrPostProgress(Message:="Starting Upload",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; If LBRY Killer not found, then download it
; @todo: Add LBRY kill download functionality from gitea
LBRYKillerPath := LibFolder . "\LBRY Process Killer.exe"
if(!FileExist(LBRYKillerPath)){
; Msgbox % "LBRYKillerPath: " LBRYKillerPath
; Msgbox % "LBRYProcessKillerURL: " LBRYProcessKillerURL
LBRYKillerPath = %A_ScriptDir%\Lib\LBRY Process Killer.exe
LBRYKillerUpdateURL = https://git.freedomainplaylists.com/attachments/7865dc8d-5aad-4f9f-8a30-94bab0192b1d
UrlDownloadToFile, %LBRYKillerUpdateURL%, %LBRYKillerPath%
; msgbox, work?
; UrlDownloadToFile, URL, Filename
Message = LBRY Process Killer Not Found. Automatically Downloading.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
TooltipThis("Uploading Video through API")
; Variables of items that need to be replaced before argument is passed to API
Apostrophe = '
@@ -87,7 +66,7 @@ if(LBRYURLSlug = "" OR LBRYURLSlug = "_Audio"){
; loops through array and creates a string of: --tags="tag1" --tags="tag2" --tags="tag3" so that it can be passed to lbrynet
Loop % KeywordsArray.Length(){
LBRYTags .= "--tags=" . SingleQuotationmark KeywordsArray[A_Index] . SingleQuotationmark . " "
LBRYTags .= "--tags=" . SingleQuotationmark ArrayOfVideoTags[A_Index] . SingleQuotationmark . " "
}
; Msgbox % "FilePathForLBRYAPI: " FilePathForLBRYAPI
@@ -197,13 +176,6 @@ if(!InStr(UploadResult, "permanent_url")){ ; if no permanent_url is generated th
Return
}
if(KillLBRYAfterUpload){
try run, %LBRYKillerPath%
catch e {
Message = LBRYKiller not found. Unable to find File.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
}
; Transform the Upload Result json into the LBRY.tv link
; PermanentURL := GetPermanentLBRYURL(UploadResult) ; get permanentURL from the upload result json
@@ -356,7 +328,40 @@ if(LBRYUploadType = "Audio"){
IniWrite, %OdyseeAudioURL%, %VideoLinksIniFile%, URLs, OdyseeAudioURL
}
if(!LBRYKillerStarted){
; If LBRY Killer not found, then download it
; @todo: Add LBRY kill download functionality from gitea
LBRYKillerPath := LibFolder . "\LBRY Process Killer.exe"
if(!FileExist(LBRYKillerPath)){
; Msgbox % "LBRYKillerPath: " LBRYKillerPath
; Msgbox % "LBRYProcessKillerURL: " LBRYProcessKillerURL
LBRYKillerPath = %A_ScriptDir%\Lib\LBRY Process Killer.exe
LBRYKillerUpdateURL = https://freedomain.dev/yuriy/video-uploader/raw/branch/main/Modules/LBRY-Process-Killer.exe
Message = LBRY Process Killer Not Found. Automatically Downloading.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
UrlDownloadToFile, %LBRYKillerUpdateURL%, %LBRYKillerPath%
if(ErrorLevel){
Message = Failed to download the the LBRY-Killer.exe from %LBRYKillerUpdateURL%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Return
}
}
if(KillLBRYAfterUpload){
try run, %LBRYKillerPath%
catch e {
Message = LBRYKiller not found. Unable to find File.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
LBRYKillerStarted := 1
}
}
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; SaveDriverURL()
AddToTotalVideosUploadedCount()

View File

@@ -13,115 +13,71 @@ if(LocalsPostPageURL = ""){
Return
}
if(!InStr(LocalsPostPageURL, "/share/post")){
LocalsPostPageURL .= "/share/post"
if(InStr(LocalsPostPageURL, "/share/post")){
LocalsPostPageURL := StrReplace(LocalsPostPageURL, "/share/post", "")
}
; replace any double slashes that migth have come from the combining
; LocalsPostPageURL := StrReplace(LocalsPostPageURL, "//", "/")
Status := NavigateFromBaseURLTo(LocalsPostPageURL)
if(Status)
Return
/*
if(DevMode){
MsgBox 0x4, DevMode Skip, Skip uploading section and skip straight to grab URL?
IfMsgBox Yes, {
goto, Devmodeskip
} Else IfMsgBox No, {
}
}
*/
Message = Waiting for Page to fully load
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //textarea[@id='body']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=10,SleepLength:=1000)
if(Status){
Message = Page did not load after 10 seconds. Force stopping refresh and trying to continue
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
send, {Escape} ; Temporary workaround, as Page seems to endlessly load for Stef
Xpath = //textarea[@id='body']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
SaveOrPostProgress(Message:="Post Failed: Check Login Status, or Website is Down",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
}
/*
Message = Inputting Title
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //input[@id='title']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=VideoTitle)
if(Status){
Message = Failed to input Title
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
sleep, 1000
*/
TooltipThis("Inputting Title")
Loop, 5 { ; Attempt to input video description a couple of times
if(A_index = 5){
; Clipboard := VideoDescription
Message = Failed to input Video Title
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
js = document.querySelector("#title").value = "%JSVideoTitle%"; ; Send content through javascript (Great for getting around emoji chrome limitaitons)
try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
; msgbox
; try driver.findElementsByName("body").item[1].SendKeys(driver.Keys.SPACE)
; driver.findElementsByID("ELEMENTID").item[1].SendKeys(driver.Keys.ENTER)
; msgbox
jsCheck = return document.querySelector("#title").value; ; Send content through javascript (Great for getting around emoji chrome limitaitons)
try VideoTitle := driver.executeScript(jsCheck) ;Executes a Javascript on the webpage, mostly used for buttons.
; try Description := driver.findElementsByName("body").item[1].Attribute("value") ;XPath: ID=site-title & span tag
if(VideoTitle != "")
Break
sleep, 2000
}
/*Xpath = //textarea[@id='body']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=VideoDescription)
Message = Waiting for Page to fully load
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //textarea[@id='body']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=10,SleepLength:=1000)
if(Status){
Message = Failed to input Body
Message = Page did not load after 10 seconds. Force stopping refresh and trying to continue
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
*/
; Input Description
TooltipThis("Inputting Description")
send, {Escape} ; Temporary workaround, as Page seems to endlessly load for Stef
Xpath = //textarea[@id='body']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
SaveOrPostProgress(Message:="Post Failed: Check Login Status, or Website is Down",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
}
TooltipThis("Inputting Title")
Loop, 5 { ; Attempt to input video description a couple of times
if(A_index = 5){
; Clipboard := VideoDescription
Message = Failed to input Video Title
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
js = document.querySelector("#title").value = "%JSVideoTitle%"; ; Send content through javascript (Great for getting around emoji chrome limitaitons)
try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
; msgbox
; try driver.findElementsByName("body").item[1].SendKeys(driver.Keys.SPACE)
; driver.findElementsByID("ELEMENTID").item[1].SendKeys(driver.Keys.ENTER)
; msgbox
jsCheck = return document.querySelector("#title").value; ; Send content through javascript (Great for getting around emoji chrome limitaitons)
try VideoTitle := driver.executeScript(jsCheck) ;Executes a Javascript on the webpage, mostly used for buttons.
; try Description := driver.findElementsByName("body").item[1].Attribute("value") ;XPath: ID=site-title & span tag
if(VideoTitle != "")
Break
sleep, 2000
}
; Input Video Description
; ------------------------------------------------
TooltipThis("Inputting Description")
Loop, 5 {
if(A_index = 5){
Clipboard := VideoDescription
Message = Unable to Input Video Description`nDescription copied to clipboard, please paste it in at your earliest convenience.
@@ -132,10 +88,7 @@ Loop, 5 { ; Attempt to input video description a couple of times
js = document.getElementsByName('body')[0].value = "%JSVideoDescription%"; ; Send content through javascript (Great for getting around emoji chrome limitaitons)
try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
; msgbox
try driver.findElementsByName("body").item[1].SendKeys(driver.Keys.SPACE)
; driver.findElementsByID("ELEMENTID").item[1].SendKeys(driver.Keys.ENTER)
; msgbox
jsCheck = return document.getElementsByName('body')[0].value; ; Send content through javascript (Great for getting around emoji chrome limitaitons)
try Description := driver.executeScript(jsCheck) ;Executes a Javascript on the webpage, mostly used for buttons.
@@ -147,6 +100,14 @@ Loop, 5 { ; Attempt to input video description a couple of times
sleep, 2000
}
; click the "Hide Links Preview" checkbox to hide previews of hyperlinks
if(InStr(VideoDescription, "https")){
Xpath = (//div[@class='hide-switcher-container'])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=100)
}
; SaveOrPostProgress(Message:="Waiting Video to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
Message = Uploading Video File
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@@ -159,12 +120,22 @@ if(Status){
}
; make sure the "Notify Users" checkbox is selected
Xpath = (//input[contains(@name,'is_do_promo')])[1]
try, Status := driver.findelementbyxpath(Xpath).isSelected()
if(Status = 0){
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=1000)
try, Status := driver.findelementbyxpath(Xpath).isSelected()
if(Status = "0"){
Message = Failed to Check ON the Notify Users Checkbox
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
}
; 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)
; DevModeMsgBox(status)
; message = AutoSubmitstatus: %AutoSubmitstatus%
; DevModeMsgBox(message)
if(AutoSubmitstatus = "0"){
js = document.querySelector("li[id='autosubmit_container'] small").click() ; ; CHECK YES
@@ -187,8 +158,6 @@ if(AutoSubmitstatus = "0"){
}
; DevModeMsgBox("autosubmit status -1 string here")
; msgbox % AutoSubmitstatus = "-1"
if(AutoSubmitstatus = "-1"){ ; if checked YES
; check that there are no error messages
@@ -228,16 +197,6 @@ if(AutoSubmitstatus = "-1"){ ; if checked YES
IniWrite, %LocalsURL%, %VideoLinksIniFile%, URLs, LocalsURL
AddToTotalVideosUploadedCount()
; Msgbox % "LocalsURL: " LocalsURL
; Msgbox % "VideoLinksIniFile: " VideoLinksIniFile
;
; FileRead, inicontents, %VideoLinksIniFile% ; , Filename
; Msgbox % "inicontents: " inicontents
; IniWrite, Value, Filename, Section, Key
; LocalsTabURL := SaveDriverURL()
; Set variable so that URL gets grabbed later in the upload
LocalsGrabURL := 1
@@ -253,11 +212,16 @@ Return
;--------------LocalsGrabURL----------------------------------
LocalsGrabURL:
CurrentSite := "Locals"
; msgbox, pause
SaveOrPostProgress(Message:="Navigating to Locals Feed to grab URL",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@@ -279,7 +243,6 @@ if(Status = "Failed"){
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Msgbox % "Status: " Status
try currentpageURL := driver.url
@@ -346,8 +309,8 @@ Loop % VideoTitleArray.Length(){
; get longest word in video title to use for grabbing the share link from the raw page
RegExMatch(VideoTitle, "ms)\b\S+(?CFindLongestWordInString)\b(?R)", m)
LongestWordInVideoTitle := longestWord
; RegExMatch(VideoTitle, "ms)\b\S+(?CFindLongestWordInString)\b(?R)", m)
; LongestWordInVideoTitle := longestWord
; Msgbox % "LongestWordInVideoTitle: " LongestWordInVideoTitle
; MsgBox, Longest word: %longestWord%`, #%wordLength%
@@ -355,18 +318,39 @@ LongestWordInVideoTitle := longestWord
; Grab Video Share Link From Page Source
; ------------------------------------------------
ShareLink := GrabLocalsPostURLUsingTitle(VideoTitle)
if(!InStr(ShareLink, "https")){
Message = Couldn't find Video Share link in the first 10 posts. Is the video possibly still uploading?
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Msgbox % "ShareLink: " ShareLink
; Msgbox % "LocalsVideoURL: " LocalsVideoURL
; Iterate over the last couple of posts, find the post with the title that contains the Longest word from the uploaded video
; And grab the share URL for it
/*
Message = Looking for - %LongestWordInVideoTitle% - within first 7 posts in order to grab share URL
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
loop, 7 {
ElementIndexNum := A_index - 1
Message = ElementIndexNum: %ElementIndexNum%
DevModeMsgBox(Message)
; Msgbox % "ElementIndexNum: " ElementIndexNum
jscheck = return document.getElementsByClassName('post-bottom')[%ElementIndexNum%].outerHTML;
try outerHTML := driver.executeScript(jsCheck)
; clipboard := outerHTML
; Msgbox % "outerHTML: " outerHTML
if(DevMode){
Message = Looking for LongestWordInVideoTitle: %LongestWordInVideoTitle% `nwithin outerHTML: %outerHTML%
DevModeMsgBox(message)
@@ -374,6 +358,8 @@ loop, 7 {
; DevModeMsgBox(outerHTML)
}
if(InStr(OuterHTML,LongestWordInVideoTitle)){
; @todo replace with regex
@@ -407,6 +393,7 @@ loop, 7 {
ShareLink :=
}
*/
if(ShareLink = ""){
Message = Video was published succsessfully, but failed to grab Share Link.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
@@ -414,9 +401,6 @@ if(ShareLink = ""){
Return
}
; DevModeMsgBox(ShareLink)
; ShareLink := "Successful"
Message = Upload Complete: %ShareLink%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@@ -429,253 +413,9 @@ SaveDriverURL()
Return
;--------------/LocalsGrabURL----------------------------------
; GetLocals
; Xpath = //div[@class='uppy-StatusBar-statusPrimary']
; sleep, 30000 ; wait 30 seconds
; sleep, 2000
/*; Attach Custom Thumbnail
if(VideoThumbFilepath != ""){
Message = Attaching Custom Thumbnail
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //div[@class='custom-thumb-uploader']//input[@name='Filedata']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoThumbFilepath)
if(Status){
Message = Failed to Attach Custom Thumbnail
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
}
*/
sleep, 10000
Loop, %Number_of_loops_to_Check_Upload_status% {
sleep, %Time_Between_Loops_Upload_Status%
jscheck = return document.getElementsByClassName('uppy-StatusBar-statusPrimary')[0].textContent;
try UploadStatus := driver.executeScript(jsCheck)
; UploadStatus := StrSplit(UploadStatus, ": ")
; UploadStatus := UploadStatus[2]
; message = Waiting for Video To Finish Uploading. `nCurrent Status: %UploadStatus%
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Clipboard := jsCheck
; msgbox % "textContent: " . textContent
/* try UploadStatus := driver.findelementbyxpath(Xpath).Attribute("innerText") ; Grabb innertext
catch e {
if(A_index = 1){
Message = Unable to find Progress Upload Percentage. Upload Most Likely Failed.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
else,
Break
}
*/
if(InStr(UploadStatus, "100%")){
Message = Video Upload Complete. Waiting 20 seconds for Video to finalize before submitting.
sleep, 20000
break
}
; if(UploadStatus != ""){
; Message =
; sleep, 30000 ; 30 seconds
; Continue
; }
if(UploadStatus = "" and A_index = 1){
Message = Upload Failed. Unable to Grab Upload Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
; if(UploadStatus = ""){
; Break
; }
Status := Check_For_Stuck_Video_Upload(A_index, UploadStatus)
if(Status = "Failed")
Return
}
/*; attach custom thumbnail
xpath = //label[normalize-space()='Upload Custom Video Thumbnail']
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
}
Status := InputFilePathIntoOpenWindow(VideoThumbFilepath)
*/
; DevModeMsgBox("pause")
; Click the publish button
js = document.getElementsByName('submitPost')[0].click();
try driver.executeScript(js)
Message = Waiting 5 seconds for Video to Get Processed
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 5000
try currentpage := driver.url
if(CUrrentpage = LocalsPostPageURL){
Message = Final page is same as post page. Please double check if post was published successfully.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; sleep, 500
; ToolTip
; AddToTotalPostsPostedCount()
Devmodeskip:
Message = Trying to Grab Share Link
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; refresh page
try driver.executeScript("history.go(0)")
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
; check for "Retrieve Draft button"
js = return document.querySelector("a[class='btn']").innerText;
try, status := driver.executeScript(js)
if(status = "Retrieve Draft"){
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")
SaveDriverURLOFErrorPage()
Return
}
; Get word that's longer than 4 characters in video title
VideoTitleArray := StrSplit(VideoTitle, " ")
; Iterate from 1 to the end of the array:
Loop % VideoTitleArray.Length(){
LongestWordInVideoTitle := VideoTitleArray[A_Index]
LongestWordInVideoTitle := StrReplace(LongestWordInVideoTitle, "_","-")
if(StrLen(LongestWordInVideoTitle) > 4)
Break
; MsgBox % VideoTitleArray[A_Index]
}
; DevModeMsgBox(LongestWordInVideoTitle)
; Message = LongestWordInVideoTitle: %LongestWordInVideoTitle%
; SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
; LongestWordInVideoTitle := LongestWordInVideoTitle[1]
; Msgbox % "LongestWordInVideoTitle: " LongestWordInVideoTitle
/* ; Format the post title to remove all spaces and special characters to match with Locals Post
ShareLinkFormatted := StrReplace(VideoTitle, " ", "-")
ShareLinkFormatted := StrReplace(ShareLinkFormatted, "?", "")
ShareLinkFormatted := StrReplace(ShareLinkFormatted, "!", "")
ShareLinkFormatted := StrReplace(ShareLinkFormatted, ".", "")
ShareLinkFormatted := StrReplace(ShareLinkFormatted, "", "")
ShareLinkFormattedFirst5Chars := SubStr(ShareLinkFormatted, 1, 5)
*/
LocalsBaseURL := StrReplace(LocalsURL, "/share/post", "")
; Msgbox % "LocalsPostPageURL: " LocalsPostPageURL
; Msgbox % "LocalsURL: " LocalsURL
; Msgbox % "LocalsBaseURL: " LocalsBaseURL
loop, 5 {
ElementIndexNum := A_index - 1
DevModeMsgBox(ElementIndexNum)
; Msgbox % "ElementIndexNum: " ElementIndexNum
jscheck = return document.getElementsByClassName('post-bottom')[%ElementIndexNum%].outerHTML;
try outerHTML := driver.executeScript(jsCheck)
; Clipboard := outerHTML
; DevModeMsgBox(outerHTML)
; msgbox % "outerHTML: " . outerHTML
if(InStr(OuterHTML,LongestWordInVideoTitle)){
Message = %LongestWordInVideoTitle% is in %OuterHTML%
; DevModeMsgBox(Message)
; MsgBox, found match at %A_index%
ShareLink := StrSplit(OuterHTML, "data-url=")
ShareLink := ShareLink[2]
; DevModeMsgBox(ShareLink)
; Msgbox % "ShareLink: " ShareLink
URLEndString = ">
ShareLink := StrSplit(ShareLink, URLEndString)
; ShareLink := ShareLink[1]
QuotationMark = "
ShareLink := StrReplace(ShareLink,QuotationMark, "")
Break
}
ShareLink :=
}
DevModeMsgBox(ShareLink)
; ShareLink := "Successful"
Message = Upload Complete: %ShareLink%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
IniWrite, %ShareLink%, %VideoLinksIniFile%, URLs, LocalsURL
AddToTotalVideosUploadedCount()
SaveDriverURL()
Return
;
;------------------/Locals------------------------------

View File

@@ -1,253 +0,0 @@
; -------------------------------Functions-------------------------------
CheckLBRYProcess(){
; Check if LBRY Process exists
Process, Exist,LBRY.exe
if(ErrorLevel = 0) ; if doesn't exist
{
Message = Not Running. Starting up LBRY.exe
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
LBRYExeFilepath = C:\Program Files\LBRY\LBRY.exe
if(!FileExist(LBRYExeFilepath)){
Message = Failed to Find LBRY.exe executable. LBRY not installed?
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Message = Checking LBRY daemon_settings.yml file for Odysee Wallet Servers
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile,DiscordErrorLogging")
FileRead, daemon_settingsFileContent, C:\Users\%A_UserName%\AppData\Local\lbry\lbrynet\daemon_settings.yml
if(!InStr(daemon_settingsFileContent, "a-hub1.odysee.com")){
Message = Odysee wallet server is not in daemon_settings.yml. Replacing File with required settings.
SaveOrPostProgress(Message:=Message,PostType:=",DiscordErrorLogging")
LBRYDaemonSettingsFP = C:\Users\%A_UserName%\AppData\Local\lbry\lbrynet\daemon_settings.yml
LBRYDaemonSettingsBackupFP = C:\Users\%A_UserName%\AppData\Local\lbry\lbrynet\daemon_settings_BU.yml
; Msgbox % "daemon_settingsText: " daemon_settingsText
FileMove, %LBRYDaemonSettingsFP%, %LBRYDaemonSettingsBackupFP%, 1 ; Dest [, Flag (1 = overwrite)]
UrlDownloadToFile, https://git.freedomainplaylists.com/yuriy/Freedomain-Video-Uploader/raw/branch/main/Assets/daemon_settings.yml , %LBRYDaemonSettingsFP%
sleep, 1000
if(!FileExist(LBRYDaemonSettingsFP)){
Message = Failed to download the custom daemon_settings.yml file from git. Restoring Original File
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile,DiscordErrorLogging")
FileMove,%LBRYDaemonSettingsBackupFP%,%LBRYDaemonSettingsFP%, 1
}
}
try run, "%LBRYExeFilepath%"
Message = Waiting 1 Minute for LBRY to start up
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
Sleep, 60000 ; 1 minute
Process, Exist,LBRY.exe
if(ErrorLevel = 0) ; if doesn't exist
{
Message = Failed to Start LBRY.exe after 60 seconds of waiting
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
WinMinimize, LBRY
}
Return
}
GetPermanentLBRYURL(UploadResult){
SingleQuotationmark = "
UploadResult := StrSplit(UploadResult, "`n") ; split results by new line
; Iterate through the array of the results
Loop % UploadResult.Length() {
PermanentURL := UploadResult[A_Index]
if(InStr(PermanentURL, "permanent_url"))
Break
}
; Starting Result: "permanent_url": "lbry://Test-Video-161-Numbered#c9ad9afe54c7178d6f870b59bbe129aef8efc3ff",
PermanentURL := StrSplit(PermanentURL, "lbry:")
PermanentURL := "lbry:" . PermanentURL[2]
PermanentURL := StrReplace(PermanentURL, ",", "")
PermanentURL := StrReplace(PermanentURL, SingleQuotationmark, "")
PermanentURL := StrReplace(PermanentURL, "`n", "")
PermanentURL := StrReplace(PermanentURL, "`r", "")
; End Result lbry://Test-Video-161-Numbered#c9ad9afe54c7178d6f870b59bbe129aef8efc3ff
Return PermanentURL
}
GetLBRYCanonicalURL(LBRYJSONObject){ ; input json string
; ResolveURL := StrSplit(LBRYResolveAPICommand, "lbry://")
; ResolveURL := "lbry://" . ResolveURL[2]
; StrReplace(Haystack, SearchText [, ReplaceText, OutputVarCount, Limit := -1])
LBRYPermanentURLJsonOBJ := StrReplace(LBRYJSONObject, LBRYPermanentURL, "LBRYPermanentURL")
; clipboard := LBRYPermanentURLJsonOBJ
; DevModeMsgBox(LBRYPermanentURLJsonOBJ)
try parsed := JSON.Load(LBRYPermanentURLJsonOBJ)
try LBRYCanonicalURL := parsed.LBRYPermanentURL.canonical_url
; DevModeMsgBox(LBRYCanonicalURL)
if(LBRYCanonicalURL = ""){
Return "" ; return blank
}
; otherwise return the LBRY url
LBRYCanonicalURL := StrReplace(LBRYCanonicalURL, "lbry://", "https://lbry.tv/")
Return LBRYCanonicalURL
}
LBRYCMDTextReplacement(LBRYURLSlug){
SingleQUote = "
LBRYURLSlug := StrReplace(LBRYURLSlug, " ", "_") ; replace all spaces with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, ":", "_") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, ",", "_") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "?", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "!", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "`;", "_") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "/", "_") ; replace all colons with dashes
; LBRYURLSlug := StrReplace(LBRYURLSlug, "?", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "<", "_") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, ">", "_") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, SingleQUote, "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "'", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "=", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, ";", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, ")", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "(", "") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "___", "_") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "__", "_") ; replace all colons with dashes
LBRYURLSlug := StrReplace(LBRYURLSlug, "__", "_") ; replace all colons with dashes
Return LBRYURLSlug
}
GetLBRYAPIErrorFromString(UploadResult){
UploadResultArray := StrSplit(UploadResult, "message")
LBRYAPIError := UploadResultArray[2]
; LBRYAPIErrorStrLen := StrLen(LBRYAPIError)
; LBRYAPIErrorStrToTrim := LBRYAPIErrorStrLen - 3
; Msgbox % "LBRYAPIErrorStrToTrim: " LBRYAPIErrorStrToTrim
LBRYAPIError := SubStr(LBRYAPIError, 4)
LBRYAPIError := StrReplace(LBRYAPIError, "}", "")
; Msgbox % "LBRYAPIError: " LBRYAPIError
Return LBRYAPIError
}
LogErrorToTextFile(Error){
/* if(LogErrorsToTextFile != 1)
Return
*/
ErrorLoggingFile := VideoFolderDir . "\" . "ErrorLogging.txt"
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
text =
(
---------------%TodayDate%---------------
%CurrentSite%: %Error%
)
if(LogErrorsToMsgbox)
Msgbox % "Text: " Text
FileAppend, %Text%, %ErrorLoggingFile%
} ; End of Function
/*
*/
AddToTotalVideosUploadedCount(){
; IniRead, TotalVideosUploaded, %SettingsIniFilepath%, General, TotalVideosUploaded, %A_Space%
TotalVideosUploaded += 1
; IniWrite, %TotalVideosUploaded%, %SettingsIniFilepath%, General, TotalVideosUploaded
}
OnMsgBoxPodcastFinish() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
WinMove,, 0
}
}
OnMsgBoxSocialMediaPoster() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
ControlSetText Button1, Yes
ControlSetText Button2, Not Now
}
}
Check_For_Stuck_Video_Upload(Index_Number, Upload_Status){
if(A_index = 1){ ; Create a blank array
ProgressStatusArray := []
Return
}
Message = Upload Status: %Upload_Status%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
; if we reached the last loop number:
if(A_index = %Number_of_loops_to_Check_Upload_status%){
Message = Upload Most Likely Failed: Video Hasn't Finished Uploading after 1 hour.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return "Failed"
}
; If progress is still the same after a ten minute interval then error out
if(HasVal(Array_Index_Num_of_Upload_StatusChecks, A_index)){ ; if current index is in Array of index numbers to check status during
; Send a notification message of upload status
Message = Upload Status: %Upload_Status%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; if current upload_status is in the array of values that are updated every 10 mins
if(HasVal(ProgressStatusArray, Upload_Status)){
Message = Upload Failed (E#4508)`nUpload Stuck at same point for 10 minutes. Stuck Status: %ProgressStatus%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return "Failed"
}
ProgressStatusArray.Push(Upload_Status) ; append current status to array
}
} ; end of func
; Find the longest word in a string of words
FindLongestWordInString(m, calloutNumber, pos, haystack, pattern){
Global wordLength, longestWord
len := StrLen(m)
If ( len > wordLength )
{
wordLength := len
longestWord := m
; MsgBox, %m%
}
}

View File

@@ -216,6 +216,9 @@ Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength
Xpath = //input[@id='url-rumble']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=RumbleURL)
; Input Rumble URL
Xpath = //input[@id='url-unauthorizedtv']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=UnauthorizedTVURL)
; Soundcloud but actually LBRY Audio URL
Xpath = //input[@id='url-lbry-audio']
@@ -244,12 +247,18 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //textarea[@id='description']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; Input Description
; Format text JS
JSVideoDescription := FormatTextToJSText(VideoDescription)
JSVideoSummary := FormatTextToJSText(VideoSummary)
; Input Description
js = document.getElementById('description').value = "%JSVideoDescription%";
try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
try driver.executeScript(js)
if(VideoSummary){
js = document.getElementById('summary').value = "%JSVideoSummary%";
try driver.executeScript(js)
}
Message = Inputting Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@@ -289,7 +298,7 @@ Loop, %LengthOfArrayOfPodcastTags% {
Continue
}
Xpath = //div[@id='_easyui_tree_4025_%number%']//span[@class='tree-checkbox tree-checkbox0']
Xpath = //div[@id='tagIDs_easyui_tree_%number%']//span[@class='tree-checkbox tree-checkbox0']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
}
@@ -321,7 +330,10 @@ Sublime Indentation Reset
Message = Input Complete! `nPlease Confirm and click Final "Save" Button on Podcast Page
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 5000
; Change GUI button from "Upload Podcast"
GuiControl,,UploadPodcast, Podcast Uploaded
; sleep, 5000
CurrentSite :=
ToolTip

View File

@@ -1,7 +1,15 @@
PostToDiscord:
;------------------------------------------------
CurrentSite := "Discord"
if(!FileExist(VideoThumbFilepath)){
Message = Post Aborted.`nVideo Thumbnail not found at:`n%VideoThumbFilepath%
SaveOrPostProgress(Message,PostType:="ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
MsgBox 0x10,, %Message%
Return
}
CurrentSocialMediaPosting := "Discord"
Message = Posting Video Links to Discord
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@@ -13,58 +21,81 @@ if(DiscordVideosWebhookURL = ""){
Msgbox, Unable to Grab DiscordVideosWebhookURL from %SettingsIniFilepath%.`nPlease input the URL and then try again.
Return
}
/*
; If description is longer than 2k chars, then API will error out. goto section that will allow user to edit video description to shorten it for posting
if(StrLen(SocialMediaDescription) > 2000 AND VideoDescriptionForVideosChannel = ""){
Goto, CreateDescriptionForVideosPosting
}
*/
if(SocialMediaDescription = ""){
CreateDescriptionForSocialMedia()
}
; Msgbox % "SocialMediaDescription: " SocialMediaDescription
SubmitDescriptionForDiscordVideosChannel:
Message := "**" . VideoTitle . "**" . "`n" . SocialMediaDescription . "`n"
; https://stackoverflow.com/questions/63160401/how-to-create-hyperlink-in-discord-in-an-embed-in-general
; Do this with an array!!
;
if(BitChuteURL != "")
Message .= "[BitChute](<" . BitChuteURL . ">) \| "
if(BrighteonURL != "")
Message .= "[Brighteon](<" . BrighteonURL . ">) \| "
VideoLinks :=
TooltipMessage = Checking Bitchute and Brighteon URL for Processing Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; check the status of the Bitchute URL to see if it's done processing
; shows "404 - Page not found" on page if not
if(BitChuteURL){
if(!InStr(URLDownloadToVar(BitChuteURL), "404 - Page not found")){
if(BitChuteURL != "")
VideoLinks .= "[BitChute](<" . BitChuteURL . ">) \| "
}
else, {
LogMessage = Bitchute URL skipped, URL Currently leads to: 404 - page not found
SaveOrPostProgress(Message:=LogMessage,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
}
; check the status of the Brighteon URL to see if it's done processing
; shows "404 - Page not found" on page if not
if(BrighteonURL){
if(!InStr(URLDownloadToVar(BrighteonURL), "SELECTED IS NOT CURRENTLY AVAILABLE")){
if(BrighteonURL != "")
VideoLinks .= "[Brighteon](<" . BrighteonURL . ">) \| "
}
else, {
ErrorLogMsg = Brighteon URL skipped, URL Currently leads to: 404 - page not found
SaveOrPostProgress(Message:=ErrorLogMsg,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
}
if(OdyseeVideoURL != "")
Message .= "[Odysee](<" . OdyseeVideoURL . ">) \| "
VideoLinks .= "[Odysee](<" . OdyseeVideoURL . ">) \| "
if(OdyseeAudioURL != "")
Message .= "[Odysee (Audio)](<" . OdyseeAudioURL . ">) \| "
/*
if(OdyseeVideoURL != "")
Message .= "[Odysee](<" . OdyseeVideoURL . ") \| "
VideoLinks .= "[Odysee (Audio)](<" . OdyseeAudioURL . ">) \| "
if(OdyseeAudioURL != "")
Message .= "[Odysee Audio](<" . OdyseeAudioURL . ") \| "
*/
if(RumbleURL != "")
Message .= "[Rumble](<" . RumbleURL . ">) \| "
VideoLinks .= "[Rumble](<" . RumbleURL . ">) \| "
/*if(StreamanityURL != "" AND InStr(StreamanityURL, "streamanity.com"))
Message .= "[Streamanity](<" . StreamanityURL . ">) \| "
*/
if(DailyMotionURL != "")
Message .= "[DailyMotion](<" . DailyMotionURL . ">)"
VideoLinks .= "[DailyMotion](<" . DailyMotionURL . ">) \| "
if(PodcastTranscriptURL != "")
VideoLinks .= "[Video Transcript](<" . PodcastTranscriptURL . ">) \| "
if(PodcastNumber != "")
VideoLinks .= "[FDRPodcasts](<" . "https://fdrpodcasts.com/" . PodcastNumber . ">) \| "
Clipboard := VideoLinks
Msgbox % "VideoLinks: " VideoLinks
UploadImageToDiscord(DiscordVideosWebhookURL, Message, VideoThumbFilepath)
; StrLenOfDiscordMessage :=
; trim the video description if Title + Body + Links is longer than 2000 chars
if((StrLen(VideoTitle) + StrLen(VideoDescription) + StrLen(VideoLinks)) > 2000){
DiscordAPICharsLeft := 2000 - StrLen(VideoTitle) - StrLen(VideoLinks) - 15
DiscordVideoDescription := SubStr(VideoDescription, 1, DiscordAPICharsLeft) . "..."
}
else,
DiscordVideoDescription := VideoDescription
Message := "**" . VideoTitle . "**" . "`n" . VideoLinks . "`n" . DiscordVideoDescription
Status := UploadImageToDiscord(DiscordVideosWebhookURL, Message, VideoThumbFilepath)
Message = API Response:`n%Status%
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile")
SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile")

View File

@@ -1,6 +1,14 @@
PostToTelegram:
;------------------------------------------------
CurrentSocialMediaPosting := "Telegram"
CurrentSite := "Telegram"
if(!FileExist(VideoThumbFilepath)){
Message = Post Aborted.`nVideo Thumbnail not found at:`n%VideoThumbFilepath%
SaveOrPostProgress(Message,PostType:="ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
MsgBox 0x10,, %Message%
Return
}
Message = Posting Video Links to Telegram
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@@ -15,154 +23,153 @@ if(TelegramBotToken = "" Or TelegramBotChatID =""){
Message = TelegramBotToken or TelegramBotChatID is missing from %SettingsIniFilepath%. `nPlease input them and click the button again.
msgbox, 4096, Error!, %Message%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
; Msgbox, 4096, Error!, TelegramBotToken or TelegramBotChatID is missing from %SettingsIniFilepath%. `nPlease input them and rerun the script.
Return
}
/*
; If description is longer than 2k chars, then API will error out. goto section that will allow user to edit video description to shorten it for posting
if(StrLen(SocialMediaDescription) > 2000 AND VideoDescriptionForVideosChannel = ""){
goto, CreateDescriptionForVideosPosting
}
*/
/*
if(SocialMediaDescription = ""){
CreateDescriptionForSocialMedia()
}
if(SocialMediaDescription > 1000){ ; Telegram has a 1024 char media caption capacity
SocialMediaDescription := SubStr(SocialMediaDescription, 1, 500)
}
*/
; @todo: split telegram message into multiple posts
SubmitDescriptionForTelegramVideosChannel:
TelegramVideoTitle := ASCIISTRReplace(VideoTitle)
TelegramVideoTitle := "*" . TelegramVideoTitle . "*"
TelegramBodymessage := ASCIISTRReplace(VideoDescription)
; Variables
LineBreakChar = `%0A ; Used for API
VideoLinks :=
if(BitChuteURL != "")
VideoLinks .= "[BitChute](" . BitChuteURL . ") \| "
if(BrighteonURL != "")
VideoLinks .= "[Brighteon](" . BrighteonURL . ") \| "
; Create the Hyperlinks for each Platform
; ------------------------------------------------
; check the status of the Bitchute URL to see if it's done processing
; shows "404 - Page not found" on page if not
if(BitChuteURL){
if(!InStr(URLDownloadToVar(BitChuteURL), "404 - Page not found")){
if(BitChuteURL != "")
VideoLinks .= "[BitChute](" . BitChuteURL . ") \| "
}
else, {
LogMessage = Bitchute URL skipped, URL Currently leads to: 404 - page not found
SaveOrPostProgress(Message:=LogMessage,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
}
; check the status of the Brighteon URL to see if it's done processing
; shows "404 - Page not found" on page if not
if(BrighteonURL){
if(!InStr(URLDownloadToVar(BrighteonURL), "SELECTED IS NOT CURRENTLY AVAILABLE")){
if(BrighteonURL != "")
VideoLinks .= "[Brighteon](" . BrighteonURL . ") \| "
}
else, {
LogMessage = Brighteon URL skipped, URL Currently leads to: 404 - page not found
SaveOrPostProgress(Message:=LogMessage,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
}
if(OdyseeVideoURL != "")
VideoLinks .= "[Odysee](" . OdyseeVideoURL . ") \| "
if(OdyseeAudioURL != "")
VideoLinks .= "[Odysee \(Audio\)](" . OdyseeAudioURL . ") \| "
/*
if(OdyseeVideoURL != "")
VideoLinks .= "[Odysee](" . OdyseeVideoURL . ") \| "
if(OdyseeAudioURL != "")
VideoLinks .= "[Odysee Audio](" . OdyseeAudioURL . ") \| "
*/
if(RumbleURL != "")
VideoLinks .= "[Rumble](" . RumbleURL . ") \| "
/*
if(InStr(StreamanityURL, "https://streamanity.com/video/"))
VideoLinks .= "[Streamanity](" . StreamanityURL . ") \| "
*/
if(DailyMotionURL != "")
VideoLinks .= "[DailyMotion](" . DailyMotionURL . ") \| "
if(PodcastNumber != "")
VideoLinks .= "[FDRPodcasts](" . "https://fdrpodcasts.com/" . PodcastNumber . ") \| "
TelegramMessage := TelegramVideoTitle . "`n" . TelegramBodymessage . "`n" . VideoLinks
StrLenOfMessageAndVideoLinks := StrLen(TelegramVideoTitle) + StrLen(TelegramBodymessage) + StrLen(VideoLinks)
; DevModeMsgBox(StrLenOfMessageAndVideoLinks)
; If Length of Title, Video Links and Message is less than 1024 characters:
; ------------------------------------------------
if(StrLenOfMessageAndVideoLinks < 1024) {
Message = Sending Post as One Message
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile")
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramMessage ) ; you could add more options; compare the Telegram API docs
if(InStr(Status, "error_code")){
Message = Telegram Post Failed Due To An Api Issue. Please See Errorlog For More Info.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
Message = API Response:`n%Status% ; Output returned data to ErrorLog File
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
}
if(StrLenOfMessageAndVideoLinks > 1024){
; Telegram SendMessage is limited to 4096 characters
if(StrLenOfMessageAndVideoLinks < 4096){ ; split into sendphoto and 1 sendmessage
; DevModeMsgBox("Less than 4096 chars")
; Photo and Video Title go into SendPhoto
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
; Video Description goes into TelegramMessage
Status2 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessage)
; If Title, Links and Message are longer than 1024, but less than 4096, split into 2 pieces: sendphoto and sendmessage
; ------------------------------------------------
if(StrLenOfMessageAndVideoLinks < 4096){
Message = Sending Post as Two Messages
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile")
} ; split into 2 SendMessages
else if (StrLenOfMessageAndVideoLinks > 4096 AND StrLenOfMessageAndVideoLinks < 8192){ ; Split into 2 parts
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
; Photo and Video Title go into SendPhoto
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
if(InStr(Status, "error_code")){
Message = Telegram Post Failed Due To An Api Issue. Please See Errorlog For More Info.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
Message = API Response:`n%Status% ; Output returned data to ErrorLog File
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
TelegramBodymessagePiece := SubStr(TelegramBodymessage, 1, 4096)
Status2 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece)
; Video Description goes into TelegramMessage
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessage)
if(InStr(Status, "error_code")){
Message = Telegram Post Failed Due To An Api Issue. Please See Errorlog For More Info.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
Message = API Response:`n%Status% ; Output returned data to ErrorLog File
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
TelegramBodymessagePiece := SubStr(TelegramBodymessage, 4097, 8192)
Status3 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece)
}
else, {
; If Title, links and message are longer than 4096 chars, we need to split them into multiple messages
; ------------------------------------------------
Message = Sending Post as Multiple Messages
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile")
} ; split into 3 sendMessages
else if (StrLenOfMessageAndVideoLinks > 8192 AND StrLenOfMessageAndVideoLinks < 12288){ ; Split into 3 parts
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
if(InStr(Status, "error_code")){
Message = Telegram Post Failed Due To An Api Issue. Please See Errorlog For More Info.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
Message = API Response:`n%Status% ; Output returned data to ErrorLog File
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
TelegramBodymessagePiece := SubStr(TelegramBodymessage, 1, 4096)
msgbox % StrLen(TelegramBodymessagePiece)
Status2 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece)
; Split the Description into 4096 character chunks while preserving sentences
; Used 4095 because a ". " has to be put in at the end of the chunk.
VideoDescriptionChunks := SplitStringWithSentences(TelegramBodymessage, 4094)
TelegramBodymessagePiece := SubStr(TelegramBodymessage, 4097, 8192)
msgbox % StrLen(TelegramBodymessagePiece)
DevModeMsgBox(TelegramBodymessagePiece)
Status3 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece)
; TelegramBodymessagePiece := SubStr(TelegramBodymessage, 8193, 12288)
; Status3 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessagePiece)
}
; go through array and post each chunk as new message
Loop % VideoDescriptionChunks.Length(){
; ArrayItem := ARRAY[A_Index]
Description := VideoDescriptionChunks[A_Index]
} else, { ; if less than 1024 characters, send normally
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramMessage ) ; you could add more options; compare the Telegram API docs
if(InStr(Status, "error_code")){
Message = Telegram Post Failed due to an API Issue. Error was saved to ErrorLogging file. Please send it to Yuriy.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := Description)
if(InStr(Status, "error_code")){
Message = Telegram Post Failed Due To An Api Issue. Please See Errorlog For More Info.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
Message = API Response:`n%Status% ; Output returned data to ErrorLog File
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
}
}
; SaveOrPostProgress(Message:=Status,PostType:=",ErrorLoggingTextFile")
Message = Telegram Error: %Status%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Message = Video Links Posted to Telegram Successfully
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
GuiControl,, PostToTelegramButton, Telegram - Posted Successfully
ToolTip
Return
}
}
; Msgbox % "SizeOfCaption: " SizeOfCaption
; SizeOfCaption := SizeOfCaption +
; Message .= VideoLinks
; msgbox % StrLen(VideoLinks)
; Message := StrReplace(Message, "`n", LineBreakChar) ; replace all new line characters with the global charater
; msgbox % StrLen(Message)
; SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordVideos")
; SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile")
Message = Video Links Posted to Telegram Successfully
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
GuiControl,, PostToTelegramButton, Telegram - Posted Successfully
; sleep, 2000
ToolTip
CurrentSite :=
Return
; -------------------------------/Telegram-------------------------------
ToolTip
CurrentSite :=
Return
; -------------------------------/Telegram-------------------------------

View File

@@ -24,7 +24,7 @@ try CurrentURL := driver.URL
if(InStr(CurrentURL, "/login.php")){
if(AutoLogin){
Message = Logging in Automatically by clicking into the UN+PW fields for info to register
Message = Trying to Log in Automatically by clicking into the UN+PW fields for info to register from Password Manager
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; have to click into username and password field for page to register that there's input
@@ -39,11 +39,12 @@ if(InStr(CurrentURL, "/login.php")){
js = document.querySelector("button[type='submit']").click();
driver.executeScript(js)
; Do a double check to make sure that login worked
Message = Checking Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
sleep, 5000
try CurrentURL := driver.URL
if(!InStr(CurrentURL, "/upload")){
@@ -67,11 +68,10 @@ if(InStr(CurrentURL, "/login.php")){
sleep, 5000
}
; CheckForAlerts()
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)
@@ -84,6 +84,9 @@ if(Status){
}
Message = Inputting Video Information
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; Input Title
try driver.findElementsByName("title").item[1].SendKeys(VideoTitle) ;selects element based on Name and sends variable to it.
catch e {
@@ -117,30 +120,22 @@ Loop, 5 { ; Attempt to input video description a couple of times
*/
}
; sleep, 5000
; Input Primary Category
Xpath = (//input[@placeholder='- Primary category -'])[1]
try, driver.FindElementByXPath(Xpath).SendKeys("Podcasts").SendKeys(driver.Keys.ENTER)
Message = Selecting Channel
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; 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]

View File

@@ -1,16 +1,28 @@
# Freedomain-Video-Uploader
# Automated Video and Podcast Uploading to Multiple Sites using Autohotkey, Selenium, and Platform APIs
Video Uploader written for the [Freedomain Philosophy Show](https://freedomain.com/)
![Alt text](Assets/Screenshots/MainScreen_v341.png "Screenshot of Main and Results Window")
![Alt text](Assets/Screenshots/Screenshot_Main_Results.png "Screenshot of Main and Results Window")
# Supported Platforms
| Platform | Upload Type |
|--|--|
| Locals | Video Upload w/Selenium |
| Bitchute | Video Upload w/Selenium |
| Rumble | Video Upload w/Selenium |
| DailyMotion | Video Upload w/Selenium |
| Brighteon | Video Upload w/Selenium |
| Odysee | Video + Audio Upload w/LBRY API |
| FDRPodcasts | Podcast w/Selenium |
| Discord | Announcement w/API |
| Telegram | Announcement w/API |
## Features
Automated posting to the following media platform using either the Platform's API or Selenium Chrome automation.
|**Locals**|**Bitchute**|**Rumble**|**DailyMotion**|**Brighteon**|**Odysee**
|--|--|--|--|--|--|
|Selenium|Selenium|Selenium|Selenium|Selenium|LBRY API
## Other Features
- Install Uploader Updates from Gitea automatically
- Install Chrome Updates from chromium.org automatically
- Schedule Posts for a later date & time
- Log Errors to a Discord Channel using webhook
- Discord Ping on Upload Completion
- Setting to confirm an upload before it's published
- Setting to show Tooltip progress at top of the screen showing current action being executed
# Installation
1. Install .Net Framework 3.5
@@ -22,26 +34,25 @@ Automated posting to the following media platform using either the Platform's AP
- Open Chrome and type in `about::version` into the URL bar. The very first line will tell you what Chrome version you have
- After downloading, extract “chromedriver_win32.zip” and move the extracted chromedriver.exe to: `C:\Program Files\SeleniumBasic\chromedriver.exe`
- NOTE: The chromedriver will need to be re-downloaded whenever Chrome updates to keep up with API changes
4. Install the [LBRY Desktop Application Manually](https://lbry.com/ or through chocolatey `choco install -y lbry`)
4. Install the [LBRY Desktop Application Manually](https://lbry.com/) or through chocolatey `choco install -y lbry`
- Once installed log into your account, and also add your LBRY Channel ID to the settings.ini file
5. [Download the latest .exe of the Uploader](https://git.freedomainplaylists.com/yuriy/Freedomain-Video-Uploader/releases)
5. [Download the latest .exe of the Uploader](https://freedomain.dev/yuriy/video-uploader/releases)
- When run, the Uploader will automatically create the folders and files it requires in the same directory it's run from.
# Using Portable Version of Chrome
Using a portable version of Chrome will give you full control over chrome and chromedriver updates.
Using Selenium with a portable `Chrome for Testing` version of Chrome is the preferred way of uploading as it gives you full control over chrome and chromedriver updates and when to install them.
- When running the uploader for the first time, you will be notified that `Chrome for Testing` was not found and that you can download it by clicking the `Chrome Up to Date` button. This will automatically get the latest version of Chrome and download + extract it to the the `\lib\` folder. It will also download the appropriate `chromedriver.exe` file for that version and prompt you for admin permission to move it to `C:\Program Files\SeleniumBasic\chromedriver.exe`.
The Uploader will check for a portable version of Chrome first, before defaulting to the system installation
# Windows Defender False Positive
Windows Defender will sometimes flag the compiled .exe version as a false positive. The easiest way to get around this is to whitelist the directory the folder where you're keeping the Uploader files in. To do this, open up `Windows Powershell` as Administrator and run the following command: `Add-MpPreference -ExclusionPath "PATHTOTHEFOLDER"`, eg: `Add-MpPreference -ExclusionPath "C:\Users\yuriy\Downloads\VideoUploader"`
1. To use a portable version of Chrome, download the latest version Chrome version that has a chromedriver from [Chrome-for-Testing](https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone-with-downloads.json), extract the `chrome-win64.zip` file and move the extracted folder to the `\Lib\` directory:
The resulting chrome filepath should be `..\Freedomain-Video-Uploader-Folder\Lib\chrome-win64\chrome.exe`
2. Download the `win64` chromedriver for the same version and move it to `C:\Program Files\SeleniumBasic\chromedriver.exe`
# Settings
The Video Uploader reads & saves its settings to a `settings.ini` file located in the same directory as itself. All customization, including custom profile URLs for websites are stored here. The required fields are:
# Settings File
The Uploader reads & saves its settings to a `settings.ini` file, All customization, including custom profile URLs are stored here.
On first run, if this file does not exist it will be automatically downloaded from the git repo.
Before running for the first time you should set the following settings in the file:
````
[General]
RootDirToStartIn=ParentFolderForAllYourVideoProjects
RootDirToStartIn= Parent Folder with your Video Projects
ShowTooltipProgress=1
DiscordWebhookBotURL=
DiscordVideosWebhookURL=
@@ -57,6 +68,28 @@ LocalsPostPageURL=
- [How to get Telegram bot token + chat-id](https://tutorial.cytron.io/2021/09/01/how-to-create-a-telegram-bot-get-the-api-key-and-chat-id/)
- All other settings will automatically get written to the `settings.ini` file as you check/uncheck the setting boxes while running the Poster.
# Project Files
When you start the Uploader, it will ask you to select a project folder that contains the files that will be used for the upload. <br>
The program will then loop through that project folder and look for the following files and automatically select them.<br>
You can select a different file in the main window if the auto selection does not select the correct file.<br>
`title.txt` which should contain the Title of your video/podcast<br>
`body.txt` which should contain the body text of your video/podcast<br>
`keywords.txt` which contains the tags/keywords that will be used in the video uploads<br>
`keywords_podcast.txt` (Optional) which contains the tags/keywords that will be used in the podcast upload. `keywords.txt` will be used for podcast tags if this does not exist.<br>
`*.mp4` an mp4 file which is the video file that you are going to upload<br>
`*.jpg` or `*.png` file which will be the thumbnail for your video/podcast<br>
# LBRY Desktop Application `daemon_settings.yml`
Due to the LBRY Video Platform being discontinued, the default daemon_settings that come with the LBRY Desktop application might no longer work for you due to the servers being offline.
To fix this, add the Odysee server to the top of the list of `lbryum_servers` in the following file: `C:\Users\YOURUSERNAMEHERE\AppData\Local\lbry\lbrynet\daemon_settings.yml` [Source](https://www.reddit.com/r/lbry/comments/11zwtmj/is_lbry_down/)
```
lbryum_servers:
- a-hub1.odysee.com:50001
- spv11.lbry.com:50001
- spv19.lbry.com:50001
```
# Uncaught Errors
I have done my best to catch any possible errors that might pop up and write functionality to handle them. But If an error happens that i haven't written resolves for, it will pop up a message box that looks like this. Please send me a screenshot so I can write a patch for the bug.
@@ -65,4 +98,16 @@ I have done my best to catch any possible errors that might pop up and write fun
# Compiling to .exe from Source
1. [Install Autohotkey v1](https://www.autohotkey.com/download/)
2. `git clone` the project and then either run the `Compile Uploader to EXE.ahk` autohotkey script to automatically compile, or start up the AHK compiler that comes installed with Autohotkey and select the `Freedomain Video Uploader.ahk` and `\Assets\FreedomainVideo.ico` icon.
2. `git clone` the project and then either run the `Compile Uploader to EXE.ahk` autohotkey script to automatically compile, or start up the AHK compiler that comes installed with Autohotkey and select the `Freedomain Video Uploader.ahk` and `\Assets\FreedomainVideo.ico` icon.
# Helper Tools
The following tools will be automatically downloaded from Gitea as needed in order to do the following actions.
## LBRY-Process-Killer
Program that continuously reads the lbrynet.log for when your videos are fully uploaded/seeded to lbry and then kills the LBRY process. This can be be disabled using the `Kill LBRY after Uploading` checkbox on the main screen
## Post Scheduler
Program that continually checks the `Scheduled Posts` folder and automatically starts the Uploader with the specific video/post at the specified scheduled time.
##

4
Version.ini Normal file
View File

@@ -0,0 +1,4 @@
[Video-Uploader]
Version=3.49
Name=Freedomain Video Uploader
APIURL=