34 Commits

Author SHA1 Message Date
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
Yuriy
8d650d3856 fixed podcast tag checkbox selection 2023-12-08 19:24:44 -05:00
Yuriy
c8a5e6a286 Fixed podcast tag input to use updated layout 2023-12-07 21:12:20 -05:00
Yuriy
4a6d719a3e fixed locals always going for new upload isntead of trying to grab url of existing upload 2023-12-04 21:42:40 -05:00
Yuriy
9f11fd5f00 added support for unchecking monetization checkbox in dailymotion 2023-12-04 21:16:11 -05:00
ea91ebb237 version bump 2023-10-22 01:20:27 -04:00
edb3ad07c8 fixed locals posting, errors if gitea is not reachable, results gui appearing at wrong position on screen 2023-10-22 00:06:55 -04:00
263fb222e9 fixed GUI giving error if iniread xposition and yposition doesn't work, wav filepath will check for a FLAC file first and then .wav if not found 2023-09-21 20:50:06 -04:00
45b27311d4 fixed bug where locals would upload even when checkbox was unchecked 2023-09-21 00:44:20 -04:00
5052713c55 updated ignore files to ignore Chrome updater files 2023-09-20 23:41:13 -04:00
180f89909e increased each site's upload time from 1 hour to 3 hours before erroring out 2023-09-20 23:18:26 -04:00
20 changed files with 1471 additions and 1184 deletions

5
.gitignore vendored
View File

@@ -2,6 +2,10 @@ Settings.ini
VideoLinks.ini VideoLinks.ini
body.txt body.txt
**/ErrorLogging **/ErrorLogging
**/chrome-win64
**/Downloads
**/Chromedriver-Mover.exe
**/ChromedriverMover.ini
**/Test Videos **/Test Videos
**/Backups **/Backups
**/Debug **/Debug
@@ -14,3 +18,4 @@ Compile Scripts to EXE.ahk
Freedomain Video Uploader.exe Freedomain Video Uploader.exe
Lib/LBRY Process Killer.exe Lib/LBRY Process Killer.exe
Lib/chrome-win64 Lib/chrome-win64
Lib/Version.ini

2
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "Lib/Freedomain-Posters-Shared-Functions"] [submodule "Lib/Freedomain-Posters-Shared-Functions"]
path = 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

@@ -35,6 +35,16 @@ ScriptToCompile = SocialMediaPoster
AHKFilepath = %A_ScriptDir%\Freedomain Video Uploader.ahk AHKFilepath = %A_ScriptDir%\Freedomain Video Uploader.ahk
Exefilepath = %A_ScriptDir%\Freedomain Video Uploader.exe Exefilepath = %A_ScriptDir%\Freedomain Video Uploader.exe
icopath = %A_ScriptDir%\Assets\FreedomainVideo.ico 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

File diff suppressed because it is too large Load Diff

View File

@@ -16,6 +16,8 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,Disc
try TabUrl := driver.url try TabUrl := driver.url
if(InStr(TabUrl, "/accounts/login/")){ if(InStr(TabUrl, "/accounts/login/")){
if(AutoLogin){ if(AutoLogin){
Xpath = (//button[normalize-space()='Submit'])[1] Xpath = (//button[normalize-space()='Submit'])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){ if(Status){
@@ -124,15 +126,17 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,Disc
; Convert tags into #hasthtags ; Convert tags into #hasthtags
Loop, 3 { Loop, 3 {
Value := KeywordsArray[A_Index] BitchuteTags .= VideoTagsArray[A_Index] . " "
Value := StrReplace(Value, " ", "") ; Remove spaces if hashtag has two words
; HashTag := "#" . Value
BitchuteHashtags .= Value . " "
} }
; input hashtags ; input Search Terms (Tags)
Xpath = //input[@placeholder='Search Terms'] 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")
}
; Upload Thumbnail ; Upload Thumbnail
Message = Attaching Thumbnail Message = Attaching Thumbnail

View File

@@ -177,9 +177,6 @@ Loop, 10 {
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="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'] Xpath = //div[@class='e-content e-lib e-keyboard']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoDescription) Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoDescription)
if(Status){ if(Status){
@@ -188,19 +185,6 @@ Loop, 10 {
; Return ; 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 sleep, 5000
@@ -218,11 +202,9 @@ Loop, 10 {
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Break Break
} }
} }
; Thumbnail ; Thumbnail
if(VideoThumbFilepath != "") { if(VideoThumbFilepath != "") {
TooltipThis("Uploading Thumbnail") TooltipThis("Uploading Thumbnail")
@@ -235,11 +217,21 @@ if(VideoThumbFilepath != "") {
} }
; DevModeMsgBox(VideoTags) ; Brighteon has a max of 25 for tags.
if(VideoTagsArray.Length() > 25){
Loop % 24 {
BrighteonKeywords := VideoTagsArray[A_Index]
}
}
else,
BrighteonKeywords := VideoTags
TooltipThis("Inputting Keywords") TooltipThis("Inputting Keywords")
Loop, 5 { Loop, 5 {
XPath = //input[@id='keywords'] 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 { catch e {
Message = Error (E#2312)`nVideo Uploaded but Unable to Input Video Tags Message = Error (E#2312)`nVideo Uploaded but Unable to Input Video Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
@@ -261,7 +253,6 @@ Loop, 5 {
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
break break
} }
; Msgbox % "status: " status
} }
@@ -370,7 +361,6 @@ Loop % VideoTitleArray.Length(){
if(StrLen(VideoTitleLongWord) > 4) if(StrLen(VideoTitleLongWord) > 4)
Break Break
; MsgBox % VideoTitleArray[A_Index]
} }
@@ -392,23 +382,6 @@ Loop, 4 {
jsCheck = return document.getElementsByClassName('col')[%ElementIndexNumber%].textContent; jsCheck = return document.getElementsByClassName('col')[%ElementIndexNumber%].textContent;
try InnerText := driver.executeScript(jsCheck) 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)){ 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 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") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@@ -432,10 +405,6 @@ Loop, 4 {
} }
; Convert dashboard URL to Public URL
; BrighteonURL := StrReplace(BrighteonURL, "dashboard/videos/", "")
if(BrighteonURL = ""){ if(BrighteonURL = ""){
Message = Upload Completed Successfully but failed to grab Share URL. Please Copy and Paste it in. Message = Upload Completed Successfully but failed to grab Share URL. Please Copy and Paste it in.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")

View File

@@ -36,12 +36,12 @@ if(LoggedOutStatus){
try driver.FindElementByXPath(Xpath).click() try driver.FindElementByXPath(Xpath).click()
Xpath = //input[@placeholder='Enter password'] Xpath = //input[@placeholder='Enter password']
driver.FindElementByXPath(Xpath).click() try driver.FindElementByXPath(Xpath).click()
js = document.querySelector("button[type='submit']").click(); js = document.querySelector("button[type='submit']").click();
driver.executeScript(js) try driver.executeScript(js)
driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
sleep, 1000 sleep, 1000
; Do a double check to make sure that login worked ; Do a double check to make sure that login worked
@@ -243,13 +243,22 @@ Message = Inputting Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; Append comma to end of tags ; Append comma to end of tags
; DailyMotion page automtically splits the tags into their little boxes when they're seperated by commas ; DailyMotion page automtically splits the tags into individual tags when they're seperated by commas
DailyMotionVideoTags := VideoTags . ","
; Iterate from one end of the array to another:
Loop % VideoTagsArray.Length(){
; ArrayItem := ARRAY[A_Index]
; MsgBox %
DailyMotionVideoTags .= VideoTagsArray[A_Index] . ","
}
; DailyMotionVideoTags := VideoTags . ","
Message = Video Tags: %DailyMotionVideoTags% Message = Video Tags: %DailyMotionVideoTags%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") 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) Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=DailyMotionVideoTags)
; double check the input ; 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") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; msgbox
Message = Clicking Next Button to Move on to next input screen Message = Clicking Next Button to Move on to next input screen
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = //button[@type='button']//span[contains(text(),'Next')] Xpath = //button[@type='button']//span[contains(text(),'Next')]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; msgbox, click work?
Message = Selecting "Not For Kids" checkbox Message = Selecting "Not For Kids" checkbox
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@@ -284,50 +291,24 @@ catch e {
} }
/* ; Disable Monetization Checkbox
; Disable monitization for video Message = Disabling Monetization Checkbox
SaveOrPostProgress(Message:="Unchecking monetizaton checkbox",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
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")
}
Xpath = //*[@id="advertising_instream_blocked"]
*/ Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; SaveOrPostProgress(Message:="Unchecking monetizaton checkbox",PostType:="Tooltip,ErrorLoggingTextFile") if(Status){
Message = Failed to click on Monetization slider with xpath, trying with full xpath
; 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") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = /html/body/div/div[2]/div/div[3]/div/div/div[2]/div[2]/div/div/div/div[4]/div/button
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to click on Monetization slider with full xpath, sleeping for 5 seconds so user can manually uncheck it.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,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 Message = Clicking Next Button to Move on to third video settings screen
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@@ -336,7 +317,6 @@ Xpath = //button[@type='button']//span[contains(text(),'Next')]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
Message = Clicking Save Button to Finalize Upload Message = Clicking Save Button to Finalize Upload
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")

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

@@ -0,0 +1,337 @@
;---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,94 @@
Gui, Font, s%GuiFontSize%
Gui, Font, Bold
; Gui, Add, Text,x10 y+10, Podcast #:
Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyPodcastNumber, Podcast #
Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% w%ResultEditBoxWidths% gUpdateVars vPodcastNumber, %PodcastNumber%
Gui, Font, Bold
Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyBitChuteURL, Bitchute
Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vBitChuteURL w%ResultEditBoxWidths% gUpdateVars , %BitChuteURL%
Gui, Font, Bold
Gui, Add, Button, x10 y+%Marginspace% h%ButtonHeights% w%CopyButtonWidths% gCopyBrighteonURL, Brighteon
Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vBrighteonURL w%ResultEditBoxWidths% gUpdateVars , %BrighteonURL%
Gui, Font, Bold
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyDailyMotionURL, DailyMotion
Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vDailyMotionURL w%ResultEditBoxWidths% gUpdateVars , %DailyMotionURL%
Gui, Font, Bold
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyOdyseeVideoURL, Odysee Video
Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vOdyseeVideoURL w%ResultEditBoxWidths% gUpdateVars, %OdyseeVideoURL%
Gui, Font, Bold
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyOdyseeAudioURL, Odysee Audio
Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vOdyseeAudioURL w%ResultEditBoxWidths% gUpdateVars , %OdyseeAudioURL%
Gui, Font, Bold
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyRumbleURL, Rumble
Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vRumbleURL w%ResultEditBoxWidths% gUpdateVars , %RumbleURL%
Gui, Font, Bold
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths%, Locals
Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vLocalsURL w%ResultEditBoxWidths% gUpdateVars, %LocalsURL%
Gui, Font, Bold
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyVideoTags vVideoTagsEdit, Video Tags
Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vVideoTags w%ResultEditBoxWidths% gUpdateVars , %VideoTags%
Gui, Font, Bold
Gui, Add, Button, x10 y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyPodcastTags, Podcast Tags
Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h%ButtonHeights% vPodcasttags w%ResultEditBoxWidths% gUpdateVars , %Podcasttags%
Gui, Font, Bold
Gui, Add, Button, x%Marginspace% y+10 h%ButtonHeights% w%CopyButtonWidths% gCopyVideoDescription, Description
Gui, Font, Normal
Gui, Add, Edit, x+5 yp+0 h50 vVideoDescription w%ResultEditBoxWidths% gUpdateVars , %VideoDescription%
Gui, Font, s%GuiFontSize%
Gui, Font, Bold
Gui, Add, Button, x%ResultEditBoxXPos% w%ResultEditBoxHalfWidths% gUpdateINI, Save Modified Links
Gui, Add, Button, x+%MarginSpace% w%ResultEditBoxHalfWidths% gUploadPodcast, Upload Podcast
Gui, Add, Button, x%ResultEditBoxXPos% y+%MarginSpace% w%ResultEditBoxThirdsWidths% gPostToDiscord vPostToDiscordButton, Post to Discord
Gui, Add, Button, x+5 w%ResultEditBoxThirdsWidths% gPostToTelegram vPostToTelegramButton, Post to Telegram
Gui, Add, Button, x+5 w%ResultEditBoxThirdsWidths% gStartSocialMediaPoster, Start Social Media Poster
Gui, Font, Bold
Gui, Add, Button, x%ResultEditBoxXPos% y+%MarginSpace% w%ResultEditBoxHalfWidths% gSendErrorLoggingThroughTelegram,
Gui, Add, Button, x+%MarginSpace% w%ResultEditBoxHalfWidths% gRetryUpload, Try Failed Again
Gui, Add, Button, x%ResultEditBoxXPos% w%ResultEditBoxHalfWidths% gOpenLBRYBlobFilesFolder %ButtonWidths% , Open LBRY Blob Files Folder
Gui, Add, Button, x+%MarginSpace% w%ResultEditBoxHalfWidths% gCancelPost %ButtonWidths% , Close
; Gui, Add, Button, x+%MarginSpace% w%ResultEditBoxHalfWidths% gKillScript %ButtonWidths% , Close
; gui, Add, Text, y+10
Gui, Font, s%GuiFontSize%
Gui, Add, Button, x%ErrorLogEditBoxXPos% w%ErrorLogEditBoxWidth% y%MarginSpace% h%ButtonHeights%, Error 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
OriginalVideoDescription := VideoDescription
OriginalPodcastTags := PodcastTags
if(XPosition and YPosition)
Gui, Show,x%XPosition% y%YPosition%,%FullScriptName% - Upload Results
else,
Gui, Show,,%FullScriptName% - Upload Results

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

@@ -31,15 +31,19 @@ if(!FileExist(LBRYKillerPath)){
; Msgbox % "LBRYKillerPath: " LBRYKillerPath ; Msgbox % "LBRYKillerPath: " LBRYKillerPath
; Msgbox % "LBRYProcessKillerURL: " LBRYProcessKillerURL ; Msgbox % "LBRYProcessKillerURL: " LBRYProcessKillerURL
LBRYKillerPath = %A_ScriptDir%\Lib\LBRY Process Killer.exe LBRYKillerPath = %A_ScriptDir%\Lib\LBRY Process Killer.exe
LBRYKillerUpdateURL = https://git.freedomainplaylists.com/attachments/7865dc8d-5aad-4f9f-8a30-94bab0192b1d LBRYKillerUpdateURL = https://freedomain.dev/yuriy/video-uploader/raw/branch/main/Modules/LBRY-Process-Killer.exe
UrlDownloadToFile, %LBRYKillerUpdateURL%, %LBRYKillerPath%
; msgbox, work?
; UrlDownloadToFile, URL, Filename
Message = LBRY Process Killer Not Found. Automatically Downloading. Message = LBRY Process Killer Not Found. Automatically Downloading.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") 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
}
}
TooltipThis("Uploading Video through API") TooltipThis("Uploading Video through API")
@@ -87,7 +91,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 ; 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(){ Loop % KeywordsArray.Length(){
LBRYTags .= "--tags=" . SingleQuotationmark KeywordsArray[A_Index] . SingleQuotationmark . " " LBRYTags .= "--tags=" . SingleQuotationmark ArrayOfVideoTags[A_Index] . SingleQuotationmark . " "
} }
; Msgbox % "FilePathForLBRYAPI: " FilePathForLBRYAPI ; Msgbox % "FilePathForLBRYAPI: " FilePathForLBRYAPI

View File

@@ -13,76 +13,71 @@ if(LocalsPostPageURL = ""){
Return Return
} }
if(!InStr(LocalsPostPageURL, "/share/post")){ if(InStr(LocalsPostPageURL, "/share/post")){
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) Status := NavigateFromBaseURLTo(LocalsPostPageURL)
if(Status) if(Status)
Return Return
/*
if(DevMode){
MsgBox 0x4, DevMode Skip, Skip uploading section and skip straight to grab URL?
IfMsgBox Yes, { Message = Waiting for Page to fully load
goto, Devmodeskip SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
} Else IfMsgBox No, { Xpath = //textarea[@id='body']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=10,SleepLength:=1000)
}
}
*/
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
/*Xpath = //textarea[@id='body']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=VideoDescription)
if(Status){ 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") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
*/
; Input Description send, {Escape} ; Temporary workaround, as Page seems to endlessly load for Stef
TooltipThis("Inputting Description")
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 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){ if(A_index = 5){
Clipboard := VideoDescription Clipboard := VideoDescription
Message = Unable to Input Video Description`nDescription copied to clipboard, please paste it in at your earliest convenience. Message = Unable to Input Video Description`nDescription copied to clipboard, please paste it in at your earliest convenience.
@@ -93,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) 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. 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) 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) 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. try Description := driver.executeScript(jsCheck) ;Executes a Javascript on the webpage, mostly used for buttons.
@@ -108,7 +100,7 @@ Loop, 5 { ; Attempt to input video description a couple of times
sleep, 2000 sleep, 2000
} }
SaveOrPostProgress(Message:="Waiting Video to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile") ; SaveOrPostProgress(Message:="Waiting Video to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
Message = Uploading Video File Message = Uploading Video File
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //div[@class='uploadvideo-wrapper']//input[@name='Filedata'] Xpath = //div[@class='uploadvideo-wrapper']//input[@name='Filedata']
@@ -123,9 +115,6 @@ if(Status){
; check if the "Auto Submit Post" checkbox is checked, and if not check it ; check if the "Auto Submit Post" checkbox is checked, and if not check it
js = return document.querySelector("#autosubmit_enabled").checked; js = return document.querySelector("#autosubmit_enabled").checked;
try AutoSubmitstatus := driver.executeScript(js) try AutoSubmitstatus := driver.executeScript(js)
; DevModeMsgBox(status)
; message = AutoSubmitstatus: %AutoSubmitstatus%
; DevModeMsgBox(message)
if(AutoSubmitstatus = "0"){ if(AutoSubmitstatus = "0"){
js = document.querySelector("li[id='autosubmit_container'] small").click() ; ; CHECK YES js = document.querySelector("li[id='autosubmit_container'] small").click() ; ; CHECK YES
@@ -148,8 +137,6 @@ if(AutoSubmitstatus = "0"){
} }
DevModeMsgBox("autosubmit status -1 string here")
; msgbox % AutoSubmitstatus = "-1"
if(AutoSubmitstatus = "-1"){ ; if checked YES if(AutoSubmitstatus = "-1"){ ; if checked YES
; check that there are no error messages ; check that there are no error messages
@@ -189,15 +176,8 @@ if(AutoSubmitstatus = "-1"){ ; if checked YES
IniWrite, %LocalsURL%, %VideoLinksIniFile%, URLs, LocalsURL IniWrite, %LocalsURL%, %VideoLinksIniFile%, URLs, LocalsURL
AddToTotalVideosUploadedCount() AddToTotalVideosUploadedCount()
; Msgbox % "LocalsURL: " LocalsURL ; Set variable so that URL gets grabbed later in the upload
; Msgbox % "VideoLinksIniFile: " VideoLinksIniFile LocalsGrabURL := 1
;
; FileRead, inicontents, %VideoLinksIniFile% ; , Filename
; Msgbox % "inicontents: " inicontents
; IniWrite, Value, Filename, Section, Key
; LocalsTabURL := SaveDriverURL()
Return Return
} }
@@ -211,11 +191,16 @@ Return
;--------------LocalsGrabURL---------------------------------- ;--------------LocalsGrabURL----------------------------------
LocalsGrabURL: LocalsGrabURL:
CurrentSite := Locals CurrentSite := "Locals"
; msgbox, pause
SaveOrPostProgress(Message:="Navigating to Locals Feed to grab URL",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:="Navigating to Locals Feed to grab URL",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") ; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@@ -237,7 +222,6 @@ if(Status = "Failed"){
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return Return
} }
; Msgbox % "Status: " Status
try currentpageURL := driver.url try currentpageURL := driver.url
@@ -254,51 +238,97 @@ Return
js = return document.querySelector("a[class='btn']").innerText; js = return document.querySelector("a[class='btn']").innerText;
try, status := driver.executeScript(js) try, status := driver.executeScript(js)
if(status){ if(status){
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. Message = Video is in Draft Mode. Publishing.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return ; video is in draft mode, we need to confirm the title and then publish it.
; click Retrieve draft button
js = document.querySelector("a[class='btn']").click()
try, driver.executeScript(js)
js = return document.querySelector("#title").value
try LocalsDraftTitle := driver.executeScript(JS)
if(LocalsDraftTitle != VideoTitle){
Message = Failed to Grab URL. Locals Draft Title does not Match video Title:`nVideo Title: %VideoTitle%`nLocals Draft Title: %LocalsDraftTitle%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
; otherwise we are good to publish video
Xpath = (//button[@name='submitPost'])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to click Publish button on saved Draft
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
sleep, 2000
} }
/*
; Get word that's longer than 4 characters in video title ; Get word that's longer than 4 characters in video title
VideoTitleArray := StrSplit(VideoTitle, " ") VideoTitleArray := StrSplit(VideoTitle, " ")
; Iterate from 1 to the end of the array: ; Iterate from 1 to the end of the array:
Loop % VideoTitleArray.Length(){ Loop % VideoTitleArray.Length(){
VideoTitleFirstWord := VideoTitleArray[A_Index] LongestWordInVideoTitle := VideoTitleArray[A_Index]
VideoTitleFirstWord := StrReplace(VideoTitleFirstWord, "_","-") LongestWordInVideoTitle := StrReplace(LongestWordInVideoTitle, "_","-")
if(StrLen(VideoTitleFirstWord) > 4) if(StrLen(LongestWordInVideoTitle) > 4)
Break Break
; MsgBox % VideoTitleArray[A_Index]
} }
*/
; 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
Msgbox % "LongestWordInVideoTitle: " LongestWordInVideoTitle
; MsgBox, Longest word: %longestWord%`, #%wordLength%
; Grab Video Share Link From Page Source
; ------------------------------------------------
; 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 { loop, 7 {
ElementIndexNum := A_index - 1 ElementIndexNum := A_index - 1
Message = ElementIndexNum: %ElementIndexNum% Message = ElementIndexNum: %ElementIndexNum%
DevModeMsgBox(Message) DevModeMsgBox(Message)
; Msgbox % "ElementIndexNum: " ElementIndexNum
jscheck = return document.getElementsByClassName('post-bottom')[%ElementIndexNum%].outerHTML; jscheck = return document.getElementsByClassName('post-bottom')[%ElementIndexNum%].outerHTML;
try outerHTML := driver.executeScript(jsCheck) try outerHTML := driver.executeScript(jsCheck)
; clipboard := outerHTML
; Msgbox % "outerHTML: " outerHTML
if(DevMode){ if(DevMode){
Message = Looking for VideoTitleFirstWord: %VideoTitleFirstWord% `nwithin outerHTML Message = Looking for LongestWordInVideoTitle: %LongestWordInVideoTitle% `nwithin outerHTML: %outerHTML%
DevModeMsgBox(message) DevModeMsgBox(message)
Clipboard := outerHTML Clipboard := message
DevModeMsgBox(outerHTML) ; DevModeMsgBox(outerHTML)
} }
; msgbox % "outerHTML: " . outerHTML
if(InStr(OuterHTML,VideoTitleFirstWord)){ if(InStr(OuterHTML,LongestWordInVideoTitle)){
; @todo replace with regex ; @todo replace with regex
Message = %VideoTitleFirstWord% is in`n`n %OuterHTML% Message = %LongestWordInVideoTitle% is in`n`n %OuterHTML%
DevModeMsgBox(Message) DevModeMsgBox(Message)
Message = Found at at index: %A_index% Message = Found at at index: %A_index%
@@ -328,14 +358,18 @@ loop, 7 {
ShareLink := ShareLink :=
} }
DevModeMsgBox(ShareLink) if(ShareLink = ""){
Message = Video was published succsessfully, but failed to grab Share Link.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
; ShareLink := "Successful"
Message = Upload Complete: %ShareLink% Message = Upload Complete: %ShareLink%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
DevModeMsgBox(ShareLink)
IniWrite, %ShareLink%, %VideoLinksIniFile%, URLs, LocalsURL IniWrite, %ShareLink%, %VideoLinksIniFile%, URLs, LocalsURL
AddToTotalVideosUploadedCount() AddToTotalVideosUploadedCount()
@@ -343,253 +377,9 @@ SaveDriverURL()
Return Return
;--------------/LocalsGrabURL---------------------------------- ;--------------/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(){
VideoTitleFirstWord := VideoTitleArray[A_Index]
VideoTitleFirstWord := StrReplace(VideoTitleFirstWord, "_","-")
if(StrLen(VideoTitleFirstWord) > 4)
Break
; MsgBox % VideoTitleArray[A_Index]
}
; DevModeMsgBox(VideoTitleFirstWord)
; Message = VideoTitleFirstWord: %VideoTitleFirstWord%
; SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
; VideoTitleFirstWord := VideoTitleFirstWord[1]
; Msgbox % "VideoTitleFirstWord: " VideoTitleFirstWord
/* ; 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,VideoTitleFirstWord)){
Message = %VideoTitleFirstWord% 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,5 +1,23 @@
; -------------------------------Functions------------------------------- ; -------------------------------Functions-------------------------------
OnMsgBoxConfirmChromiumOverwrite() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
ControlSetText Button1, Cancel
ControlSetText Button2, Yes
}
}
; https://www.autohotkey.com/docs/v2/Functions.htm#Variadic
Join(sep, params*) {
For index, param in params
str .= param . sep
return SubStr(str, 1, -StrLen(sep))
}
CheckLBRYProcess(){ CheckLBRYProcess(){
; Check if LBRY Process exists ; Check if LBRY Process exists
Process, Exist,LBRY.exe Process, Exist,LBRY.exe
@@ -31,7 +49,7 @@ CheckLBRYProcess(){
; Msgbox % "daemon_settingsText: " daemon_settingsText ; Msgbox % "daemon_settingsText: " daemon_settingsText
FileMove, %LBRYDaemonSettingsFP%, %LBRYDaemonSettingsBackupFP%, 1 ; Dest [, Flag (1 = overwrite)] 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% UrlDownloadToFile, https://freedomain.dev/yuriy/video-uploader/raw/branch/main/Assets/daemon_settings.yml , %LBRYDaemonSettingsFP%
sleep, 1000 sleep, 1000
@@ -235,3 +253,19 @@ Check_For_Stuck_Video_Upload(Index_Number, Upload_Status){
ProgressStatusArray.Push(Upload_Status) ; append current status to array ProgressStatusArray.Push(Upload_Status) ; append current status to array
} }
} ; end of func } ; 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

@@ -266,7 +266,7 @@ try pagehtml := driver.pagesource
Loop, %LengthOfArrayOfPodcastTags% { Loop, %LengthOfArrayOfPodcastTags% {
Tag := ArrayOfPodcastTags[A_Index] ; find value from position in array Tag := ArrayOfPodcastTags[A_Index] ; find value from position in array
SpanID = title">%Tag%</span></div></li><li><div id="_easyui_tree_ SpanID = title">%Tag%</span></div></li><li><div id="tagIDs_easyui_tree_
if(InStr(pagehtml, SpanID)){ ; if tag found in page, do this if(InStr(pagehtml, SpanID)){ ; if tag found in page, do this
number := StrSplit(pagehtml, SpanID) number := StrSplit(pagehtml, SpanID)
@@ -289,7 +289,7 @@ Loop, %LengthOfArrayOfPodcastTags% {
Continue Continue
} }
Xpath = //div[@id='_easyui_tree_%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) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
} }

View File

@@ -22,9 +22,9 @@ 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 - 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` - 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 - 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 - 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. - 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 Portable Version of Chrome
@@ -37,11 +37,13 @@ The Uploader will check for a portable version of Chrome first, before defaultin
2. Download the `win64` chromedriver for the same version and move it to `C:\Program Files\SeleniumBasic\chromedriver.exe` 2. Download the `win64` chromedriver for the same version and move it to `C:\Program Files\SeleniumBasic\chromedriver.exe`
# Settings # Settings File
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: 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] [General]
RootDirToStartIn=ParentFolderForAllYourVideoProjects RootDirToStartIn= Parent Folder with your Video Projects
ShowTooltipProgress=1 ShowTooltipProgress=1
DiscordWebhookBotURL= DiscordWebhookBotURL=
DiscordVideosWebhookURL= DiscordVideosWebhookURL=
@@ -57,6 +59,19 @@ 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/) - [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. - 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>
# Uncaught Errors # 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. 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.
@@ -66,3 +81,9 @@ I have done my best to catch any possible errors that might pop up and write fun
# Compiling to .exe from Source # Compiling to .exe from Source
1. [Install Autohotkey v1](https://www.autohotkey.com/download/) 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.
# Extra Tools
## LBRY-Process-Killer
Autohotkey script that continuously reads the lbrynet.log for when your videos are fully uploaded/seeded to lbry and then kills the LBRY process.

3
Version.ini Normal file
View File

@@ -0,0 +1,3 @@
[Video-Uploader]
Version=3.31
Name=Freedomain Video Uploader