8 Commits

4 changed files with 93 additions and 20 deletions

View File

@@ -284,6 +284,11 @@ Loop, files, %VideoFolderDir%\*.*, F ; loop through the files in the director
VideoFilepath := A_LoopFileFullPath
SplitPath, A_LoopFileFullPath,,,, VideoFileNameNoExt
FileGetSize, VideoFileSizeInMB, %A_LoopFileFullPath%, M
VideoInfoObj := Filexpro(VideoFilepath,
, "System.Video.TotalBitrate" )
VideoTotalBitrate := VideoInfoObj["System.Video.TotalBitrate"]
}
if(FileExt = "png" OR FileExt = "jpg"){
@@ -330,9 +335,11 @@ Loop, files, %VideoFolderDir%\*.mp3, F ; loop through the files in the direct
}
}
;---Read Info From Previous Run (If Any)---
;------------------------------------------------
; @todo: Figure out a way to do this with an array
;---Read Info From Previous Run And Set Upload Options---
;--------------------------------------------------------
VideoLinksIniFile = %VideoFolderDir%\VideoLinks.ini
if(FileExist(VideoLinksIniFile)){
@@ -369,6 +376,10 @@ if(FileExist(VideoLinksIniFile)){
; MISC
IniRead, ErrorLoggingFilePath, %VideoLinksIniFile%, Misc, ErrorLoggingFilePath, %A_Space%
IniRead, TempVideoThumbFilepath, %VideoLinksIniFile%, Misc, VideoThumbFilepath, %A_Space%
if(TempVideoThumbFilepath){ ; if Video Thumbnail was saved in last run, overwrite variable path that was grabbed in the file loop above
VideoThumbFilepath := TempVideoThumbFilepath
}
if(VideoFileSizeInMB < 50){
IniRead, Telegram, %VideoLinksIniFile%, Misc, Telegram, %A_Space%
@@ -420,6 +431,9 @@ if(VideoFileSizeInMB > 6144){
FacebookCheckStatus := 0
TelegramCheckStatus := 0
;---/Read Info From Previous Run And Set Upload Options---
;--------------------------------------------------------
;---Testing Mode Overrides---
@@ -554,9 +568,6 @@ else, {
}
; @ TODO REMOVE
; LocalsGrabURL := 0
; Locals := 0
@@ -580,8 +591,8 @@ Gui, Add, Edit, yp+0 x+%Marginspace% w%PodcastNumberEditWidth% h%EditBoxHeight%
; LBRY URL
Gui, Font, Bold
Gui, Add, Text, x%Marginspace%,Video Tags
Gui, Add, Text,x%ColumnOneHalfWidthXPos% yp+0,Podcast Tags
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%
@@ -775,7 +786,12 @@ Gui, Add, Checkbox, x%GroupBoxCheckboxPos% y+%MarginSpace% vOdyseeAudio Checked%
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
@@ -1109,6 +1125,7 @@ LBRYURLSlug := LBRYCMDTextReplacement(LBRYURLSlug)
IniWrite, %LBRYURLSlug%, %VideoLinksIniFile%, Misc, LBRYUrlSlug
IniWrite, %VideoThumbFilepath%, %VideoLinksIniFile%, Misc, VideoThumbFilepath
IniWrite, %PodcastNumber%, %VideoLinksIniFile%, Misc, PodcastNumber
IniWrite, %VideoThumbFilepath%, %VideoLinksIniFile%, Misc, VideoThumbFilepath
@@ -1154,19 +1171,44 @@ JSVideoDescription := FormatTextToJSText(VideoDescription)
; -------------------------------/Log Info To Text-------------------------------
; @todo: note: it would be better to replace accented chars w/ their pure latin equivalents but that seems a bit
; beyond the scope of this change. here's a link talking about how to do that tho
; https://www.autohotkey.com/boards/viewtopic.php?t=61626
; Create an array out of the keywords to be used in different places
VideoTags := StrReplace(VideoTags, ", ",",")
VideoTags := StrReplace(VideoTags, " ,",",")
VideoTags := StrReplace(VideoTags, " ",",")
VideoTagsArray := []
PodcastTagsArray := []
KeywordsArray := StrSplit(VideoTags,",")
; VIDEO Tags
For index, val in StrSplit(VideoTags, ",") {
; for each element in the split videotags array, trim leading & trailing spaces
val := Trim(val)
; and remove any chars that are not a letter, number, or space (i = case-insensitive)
val := RegexReplace(val, "i)[^a-z0-9 ]", "")
VideoTagsArray.InsertAt(index, val)
}
; PODCAST Tags
For index, val in StrSplit(PodcastTags, ",") {
; for each element in the split videotags array, trim leading & trailing spaces
val := Trim(val)
; and remove any chars that are not a letter, number, or space (i = case-insensitive)
val := RegexReplace(val, "i)[^a-z0-9 ]", "")
PodcastTagsArray.InsertAt(index, val)
}
; Call each sub one by one, if errors occur then an upload will be stopped and the next upload will then proceed
; update VideoTags with sanitized keywords list
VideoTags := Join(",", VideoTagsArray*)
; update PodcastTags with sanitized keywords list
PodcastTags := Join(",", PodcastTagsArray*)
; Call each submodule one by one
; if errors occur then an upload for that site will be stopped and the next upload will then proceed
if(Telegram)
gosub, TelegramVideoUpload

View File

@@ -235,11 +235,19 @@ 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")
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")

View File

@@ -1,5 +1,13 @@
; -------------------------------Functions-------------------------------
; 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(){
; Check if LBRY Process exists
Process, Exist,LBRY.exe

View File

@@ -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`
# 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 +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/)
- 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.
The program will then loop through that project folder and look for the following files and automatically select them.
You can select a different file in the main window if the auto selection does not select the correct file.
`title.txt` which should contain the Title of your video/podcast
`body.txt` which should contain the body text of your video/podcast
`keywords.txt` which contains the tags/keywords that will be used in the video uploads
`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.
`*.mp4` an mp4 file which is the video file that you are going to upload
`*.jpg` or `*.png` file which will be the thumbnail for your video/podcast
# 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.