Compare commits
20 Commits
8d650d3856
...
3.31
| Author | SHA1 | Date | |
|---|---|---|---|
| 4940d18946 | |||
| 679e698435 | |||
| 646d5994df | |||
| 15e5328d1e | |||
| ad232d4d44 | |||
| 0f679a0792 | |||
|
b0290eef6e
|
|||
| 678ba3d495 | |||
| 1d926a91a7 | |||
| 9ec17b0ead | |||
| 03c75ab073 | |||
| a1dc003cdc | |||
| 1aba6a650a | |||
| adeb7a9df1 | |||
| aa1110a780 | |||
|
4b39f927d3
|
|||
|
3a0b6921f6
|
|||
| 08eff7166a | |||
| 8c34e1de09 | |||
|
54b8670438
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -18,3 +18,4 @@ Compile Scripts to EXE.ahk
|
||||
Freedomain Video Uploader.exe
|
||||
Lib/LBRY Process Killer.exe
|
||||
Lib/chrome-win64
|
||||
Lib/Version.ini
|
||||
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,3 +1,3 @@
|
||||
[submodule "Lib/Freedomain-Posters-Shared-Functions"]
|
||||
path = Lib/Freedomain-Posters-Shared-Functions
|
||||
url = https://git.freedomainplaylists.com/yuriy/Freedomain-Posters-Shared-Functions.git
|
||||
url = https://freedomain.dev/yuriy/posters-shared-functions.git
|
||||
|
||||
@@ -35,6 +35,16 @@ ScriptToCompile = SocialMediaPoster
|
||||
AHKFilepath = %A_ScriptDir%\Freedomain Video Uploader.ahk
|
||||
Exefilepath = %A_ScriptDir%\Freedomain Video Uploader.exe
|
||||
icopath = %A_ScriptDir%\Assets\FreedomainVideo.ico
|
||||
VersionIniFP = %A_ScriptDir%\Version.ini
|
||||
|
||||
|
||||
|
||||
; Bump the version number in the version.ini file
|
||||
IniRead, VersionNumber, %VersionIniFP%, Video-Uploader, Version, 0.0 ; , Filename, Section, Key [, Default]
|
||||
VersionNumber += .01
|
||||
VersionNumber := SubStr(VersionNumber, 1, 4)
|
||||
; Msgbox % "VersionNumber: " VersionNumber
|
||||
IniWrite, %VersionNumber%, %VersionIniFP%,Video-Uploader, Version
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -31,9 +31,7 @@ global FullScriptName
|
||||
|
||||
|
||||
|
||||
ScriptName = Freedomain Video Uploader
|
||||
ScriptVersion = 3.25
|
||||
FullScriptName := ScriptName . " - " . ScriptVersion
|
||||
|
||||
|
||||
|
||||
UStartTime := A_TickCount ; start time
|
||||
@@ -51,25 +49,6 @@ UStartTime := A_TickCount ; start time
|
||||
#include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\URLDownloadToVar.ahk
|
||||
|
||||
|
||||
;---ToDo---
|
||||
;------------------------------------------------
|
||||
; @todo: Update Locals Share link grabbing
|
||||
; @todo: fix uploader saying there's been failures b/c there was no lbry audio upload
|
||||
; @todo: finish telegram multi-message split functionality.
|
||||
; @todo: add different icon when update is available
|
||||
; @todo: fix telegram post getting cut off if too long instead of splitting into 2
|
||||
; @todo: let user make last minute changes to text before submitting to telegram and discord
|
||||
; @todo: replace all .Attribute("innerText") with js
|
||||
; @todo: Fix locals not grabbing url if a post is pinned
|
||||
; @todo: Add an input box for sources in the new frontend
|
||||
; @todo: Add login check for each website and ability to auto login
|
||||
; @todo: ; add to statistics in statusbar - length of philosophy uploaded... total hours uploaded?
|
||||
; @todo: Bitchute has a 5k char limit for description as well. split description to remove reocurring bits and Add freedomainpodcasts.com/podcast/# link if still not big enough
|
||||
; @todo: Split long discord/telegram messages into multiple messages
|
||||
; @todo: Redo Discord posting with "PostErrors" function from social media poster
|
||||
; @todo: Save updates made to GUi text to .ini file on changes
|
||||
; @todo: add a SaveDriverURL() next to each RETURN in the code so reusable tabs can be grouped together
|
||||
|
||||
;---Global Variables---
|
||||
;------------------------------------------------
|
||||
global LBRYResolveAPICommand
|
||||
@@ -135,6 +114,13 @@ global ScriptSettingsSection
|
||||
ScriptSettingsSection := "VideoUploader"
|
||||
|
||||
|
||||
FileInstall, Version.ini, %A_ScriptDir%\Lib\Version.ini, 1
|
||||
IniRead, ScriptVersion, %A_ScriptDir%\Lib\Version.ini,Video-Uploader, Version, 0.0
|
||||
|
||||
ScriptName = Freedomain Video Uploader
|
||||
FullScriptName := ScriptName . " - " . ScriptVersion
|
||||
|
||||
|
||||
;---Script Settings---
|
||||
;------------------------------------------------
|
||||
; Checkbox Settings
|
||||
@@ -191,11 +177,7 @@ if(DiscordErrorLoggingWebhookBotURL = ""){
|
||||
;---Auto Updater Settings---
|
||||
;------------------------------------------------
|
||||
global GitReleasesAPIURL
|
||||
GitReleasesAPIURL = https://git.freedomainplaylists.com/api/v1/repos/yuriy/Freedomain-Video-Uploader/releases
|
||||
|
||||
global GitReleasesLBRYKillerAPIURL
|
||||
GitReleasesLBRYKillerAPIURL = https://git.freedomainplaylists.com/api/v1/repos/yuriy/LBRY-Process-Killer/releases
|
||||
|
||||
GitReleasesAPIURL = https://freedomain.dev/api/v1/repos/yuriy/Freedomain-Video-Uploader/releases
|
||||
|
||||
|
||||
;---LBRY Settings---
|
||||
@@ -302,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"){
|
||||
@@ -348,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)){
|
||||
@@ -387,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%
|
||||
@@ -438,6 +431,9 @@ if(VideoFileSizeInMB > 6144){
|
||||
FacebookCheckStatus := 0
|
||||
TelegramCheckStatus := 0
|
||||
|
||||
;---/Read Info From Previous Run And Set Upload Options---
|
||||
;--------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
;---Testing Mode Overrides---
|
||||
@@ -572,9 +568,6 @@ else, {
|
||||
}
|
||||
|
||||
|
||||
; @ TODO REMOVE
|
||||
; LocalsGrabURL := 0
|
||||
; Locals := 0
|
||||
|
||||
|
||||
|
||||
@@ -598,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%
|
||||
@@ -793,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
|
||||
|
||||
@@ -914,7 +912,7 @@ Return
|
||||
|
||||
|
||||
OpenGiteaPage:
|
||||
run, https://git.freedomainplaylists.com/yuriy/Freedomain-Video-Uploader
|
||||
run, https://freedomain.dev/yuriy/video-uploader
|
||||
Return
|
||||
|
||||
|
||||
@@ -1127,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
|
||||
|
||||
|
||||
|
||||
@@ -1172,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
|
||||
|
||||
Submodule Lib/Freedomain-Posters-Shared-Functions updated: cfce669061...e32fe026e9
@@ -16,6 +16,8 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,Disc
|
||||
try TabUrl := driver.url
|
||||
if(InStr(TabUrl, "/accounts/login/")){
|
||||
if(AutoLogin){
|
||||
|
||||
|
||||
Xpath = (//button[normalize-space()='Submit'])[1]
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||
if(Status){
|
||||
@@ -124,15 +126,17 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,Disc
|
||||
|
||||
; Convert tags into #hasthtags
|
||||
Loop, 3 {
|
||||
Value := KeywordsArray[A_Index]
|
||||
Value := StrReplace(Value, " ", "") ; Remove spaces if hashtag has two words
|
||||
; HashTag := "#" . Value
|
||||
BitchuteHashtags .= Value . " "
|
||||
BitchuteTags .= VideoTagsArray[A_Index] . " "
|
||||
}
|
||||
|
||||
; input hashtags
|
||||
; input Search Terms (Tags)
|
||||
Xpath = //input[@placeholder='Search Terms']
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=BitchuteHashtags)
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=BitchuteTags)
|
||||
if(Status){
|
||||
Message = Failed to input search terms (tags)
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
}
|
||||
|
||||
|
||||
; Upload Thumbnail
|
||||
Message = Attaching Thumbnail
|
||||
|
||||
@@ -177,9 +177,6 @@ Loop, 10 {
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
; SaveOrPostProgress(Message:=Message,PostType:="DiscordErrorLogging")
|
||||
|
||||
; SaveOrPostProgress(Message:="Inputting Video Description",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar")
|
||||
; TooltipThis("Inputting Description)
|
||||
|
||||
Xpath = //div[@class='e-content e-lib e-keyboard']
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=VideoDescription)
|
||||
if(Status){
|
||||
@@ -188,19 +185,6 @@ Loop, 10 {
|
||||
; Return
|
||||
}
|
||||
|
||||
; DevModeMsgBox("pause")
|
||||
|
||||
; driver.FindElementByXPath(Xpath).SendKeys(VideoDescription)
|
||||
|
||||
; js = document.getElementById('description').value = "%JSBrighteonVideoDescription%";
|
||||
; try driver.executeScript(js)
|
||||
|
||||
|
||||
; sleep, 1000
|
||||
; TooltipThis("checking description input")
|
||||
; try driver.findElementsByID("description").item[1].SendKeys(driver.Keys.ENTER)
|
||||
; sleep, 1000
|
||||
|
||||
sleep, 5000
|
||||
|
||||
|
||||
@@ -218,11 +202,9 @@ Loop, 10 {
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
Break
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
; Thumbnail
|
||||
if(VideoThumbFilepath != "") {
|
||||
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")
|
||||
Loop, 5 {
|
||||
XPath = //input[@id='keywords']
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(VideoTags) ;Sends Variable to an Xpath Item
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(BrighteonKeywords) ;Sends Variable to an Xpath Item
|
||||
catch e {
|
||||
Message = Error (E#2312)`nVideo Uploaded but Unable to Input Video Tags
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
@@ -261,7 +253,6 @@ Loop, 5 {
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
break
|
||||
}
|
||||
; Msgbox % "status: " status
|
||||
|
||||
|
||||
}
|
||||
@@ -370,7 +361,6 @@ Loop % VideoTitleArray.Length(){
|
||||
if(StrLen(VideoTitleLongWord) > 4)
|
||||
Break
|
||||
|
||||
; MsgBox % VideoTitleArray[A_Index]
|
||||
}
|
||||
|
||||
|
||||
@@ -392,23 +382,6 @@ Loop, 4 {
|
||||
jsCheck = return document.getElementsByClassName('col')[%ElementIndexNumber%].textContent;
|
||||
try InnerText := driver.executeScript(jsCheck)
|
||||
|
||||
; Message = Loop Number: %ElementIndexNumber% element's Text Content: %innerText%`nBrighteonURL: %BrighteonURL%
|
||||
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
; Message = InnerText: %InnerText%
|
||||
; SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
||||
; DevModeMsgBox(InnerText)
|
||||
|
||||
; Message = BrighteonURL: %BrighteonURL%
|
||||
; SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
||||
|
||||
|
||||
|
||||
; Msgbox % "VideoTitleLongWord: " VideoTitleLongWord "`nInnerText: " InnerText
|
||||
; clipboard := Message
|
||||
; msgbox % Message
|
||||
; Msgbox % "InnerText: " InnerText . "`n" . "BrighteonURL: " . BrighteonURL
|
||||
|
||||
if(InStr(InnerText, VideoTitleLongWord)){
|
||||
Message = Title Keyword was found on %A_index% loop, within element: %innerText%`nTrying to pull out BrighteonURL from element's outerHTML
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
@@ -432,10 +405,6 @@ Loop, 4 {
|
||||
}
|
||||
|
||||
|
||||
|
||||
; Convert dashboard URL to Public URL
|
||||
; BrighteonURL := StrReplace(BrighteonURL, "dashboard/videos/", "")
|
||||
|
||||
if(BrighteonURL = ""){
|
||||
Message = Upload Completed Successfully but failed to grab Share URL. Please Copy and Paste it in.
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
|
||||
@@ -39,7 +39,7 @@ if(LoggedOutStatus){
|
||||
try driver.FindElementByXPath(Xpath).click()
|
||||
|
||||
js = document.querySelector("button[type='submit']").click();
|
||||
driver.executeScript(js)
|
||||
try driver.executeScript(js)
|
||||
|
||||
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
||||
sleep, 1000
|
||||
@@ -243,13 +243,22 @@ Message = Inputting Tags
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
; Append comma to end of tags
|
||||
; DailyMotion page automtically splits the tags into their little boxes when they're seperated by commas
|
||||
DailyMotionVideoTags := VideoTags . ","
|
||||
; DailyMotion page automtically splits the tags into individual tags when they're seperated by commas
|
||||
|
||||
; Iterate from one end of the array to another:
|
||||
Loop % VideoTagsArray.Length(){
|
||||
; ArrayItem := ARRAY[A_Index]
|
||||
; MsgBox %
|
||||
DailyMotionVideoTags .= VideoTagsArray[A_Index] . ","
|
||||
}
|
||||
|
||||
|
||||
; DailyMotionVideoTags := VideoTags . ","
|
||||
|
||||
Message = Video Tags: %DailyMotionVideoTags%
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
Xpath = //div[@class='ant-select-selection-search']//input[@role='combobox']
|
||||
Xpath = (//input[@id='tags'])[1]
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=DailyMotionVideoTags)
|
||||
|
||||
; double check the input
|
||||
@@ -259,14 +268,12 @@ Message = Tags that got input: %inputTags% (Will be doubled b/c of js)
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
|
||||
; msgbox
|
||||
Message = Clicking Next Button to Move on to next input screen
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
Xpath = //button[@type='button']//span[contains(text(),'Next')]
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||
|
||||
; msgbox, click work?
|
||||
|
||||
Message = Selecting "Not For Kids" checkbox
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
@@ -303,51 +310,6 @@ if(Status){
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
; Disable monitization for video
|
||||
SaveOrPostProgress(Message:="Unchecking monetizaton checkbox",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
Xpath = //button[normalize-space()='Advanced'] ; advanced tab button
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
|
||||
if(Status = "Failed"){
|
||||
Message = Unable to Navigate to Advanced Settings Page to turn off monetization
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
; SaveOrPostProgress(Message:="Unchecking monetizaton checkbox",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
; switch over to advanced tab
|
||||
; js = document.getElementsByName('advanced')[0].click();
|
||||
; try driver.executeScript(js)
|
||||
/*
|
||||
|
||||
sleep, 1000
|
||||
Loop, 5 { ; Loop to uncheck the "monetization button"
|
||||
|
||||
if(A_index = 5){
|
||||
Message = Failed to uncheck "monetization enabled" checkbox
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
}
|
||||
|
||||
Xpath = //input[@name='advertising_instream_blocked'] ; monetization checkbox
|
||||
try Status := driver.FindElementByXPath(Xpath).isSelected()
|
||||
|
||||
if(Status = 0) ; -1 is checked, 0 is unchecked
|
||||
Break
|
||||
|
||||
; Click to uncheck the "allow monetization" checkbox
|
||||
Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||
}
|
||||
|
||||
*/
|
||||
/*
|
||||
; Switch back to Basic tab
|
||||
js = document.getElementsByName('basic')[0].click();
|
||||
try driver.executeScript(js)
|
||||
|
||||
*/
|
||||
|
||||
Message = Clicking Next Button to Move on to third video settings screen
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
@@ -355,7 +317,6 @@ Xpath = //button[@type='button']//span[contains(text(),'Next')]
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||
|
||||
|
||||
|
||||
Message = Clicking Save Button to Finalize Upload
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
|
||||
135
Modules/LBRY-Process-Killer.ahk
Normal file
135
Modules/LBRY-Process-Killer.ahk
Normal 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)
|
||||
}
|
||||
BIN
Modules/LBRY-Process-Killer.exe
Normal file
BIN
Modules/LBRY-Process-Killer.exe
Normal file
Binary file not shown.
BIN
Modules/LBRY-Process-Killer.ico
Normal file
BIN
Modules/LBRY-Process-Killer.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 319 KiB |
@@ -31,15 +31,19 @@ if(!FileExist(LBRYKillerPath)){
|
||||
; Msgbox % "LBRYKillerPath: " LBRYKillerPath
|
||||
; Msgbox % "LBRYProcessKillerURL: " LBRYProcessKillerURL
|
||||
LBRYKillerPath = %A_ScriptDir%\Lib\LBRY Process Killer.exe
|
||||
LBRYKillerUpdateURL = https://git.freedomainplaylists.com/attachments/7865dc8d-5aad-4f9f-8a30-94bab0192b1d
|
||||
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.
|
||||
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")
|
||||
|
||||
@@ -25,25 +25,12 @@ Status := NavigateFromBaseURLTo(LocalsPostPageURL)
|
||||
if(Status)
|
||||
Return
|
||||
|
||||
/*
|
||||
if(DevMode){
|
||||
MsgBox 0x4, DevMode Skip, Skip uploading section and skip straight to grab URL?
|
||||
|
||||
IfMsgBox Yes, {
|
||||
goto, Devmodeskip
|
||||
} Else IfMsgBox No, {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
Message = Waiting for Page to fully load
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
Xpath = //textarea[@id='body']
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=10,SleepLength:=1000)
|
||||
if(Status){
|
||||
Message = 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")
|
||||
|
||||
@@ -56,7 +43,7 @@ if(DevMode){
|
||||
|
||||
Return
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
Message = Inputting Title
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
@@ -253,6 +240,11 @@ Return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;--------------LocalsGrabURL----------------------------------
|
||||
LocalsGrabURL:
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -31,7 +39,7 @@ CheckLBRYProcess(){
|
||||
; Msgbox % "daemon_settingsText: " daemon_settingsText
|
||||
FileMove, %LBRYDaemonSettingsFP%, %LBRYDaemonSettingsBackupFP%, 1 ; Dest [, Flag (1 = overwrite)]
|
||||
|
||||
UrlDownloadToFile, https://git.freedomainplaylists.com/yuriy/Freedomain-Video-Uploader/raw/branch/main/Assets/daemon_settings.yml , %LBRYDaemonSettingsFP%
|
||||
UrlDownloadToFile, https://freedomain.dev/yuriy/video-uploader/raw/branch/main/Assets/daemon_settings.yml , %LBRYDaemonSettingsFP%
|
||||
|
||||
sleep, 1000
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ Loop, %LengthOfArrayOfPodcastTags% {
|
||||
Continue
|
||||
}
|
||||
|
||||
Xpath = //div[@id='_easyui_tree_4025_%number%']//span[@class='tree-checkbox tree-checkbox0']
|
||||
Xpath = //div[@id='tagIDs_easyui_tree_%number%']//span[@class='tree-checkbox tree-checkbox0']
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||
|
||||
}
|
||||
|
||||
31
README.md
31
README.md
@@ -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
|
||||
- After downloading, extract “chromedriver_win32.zip” and move the extracted chromedriver.exe to: `C:\Program Files\SeleniumBasic\chromedriver.exe`
|
||||
- NOTE: The chromedriver will need to be re-downloaded whenever Chrome updates to keep up with API changes
|
||||
4. Install the [LBRY Desktop Application Manually](https://lbry.com/ or through chocolatey `choco install -y lbry`)
|
||||
4. Install the [LBRY Desktop Application Manually](https://lbry.com/) or through chocolatey `choco install -y lbry`
|
||||
- Once installed log into your account, and also add your LBRY Channel ID to the settings.ini file
|
||||
5. [Download the latest .exe of the Uploader](https://git.freedomainplaylists.com/yuriy/Freedomain-Video-Uploader/releases)
|
||||
5. [Download the latest .exe of the Uploader](https://freedomain.dev/yuriy/video-uploader/releases)
|
||||
- When run, the Uploader will automatically create the folders and files it requires in the same directory it's run from.
|
||||
|
||||
# Using Portable Version of Chrome
|
||||
@@ -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.
|
||||
@@ -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
|
||||
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.
|
||||
|
||||
|
||||
# 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.
|
||||
2
Version.ini
Normal file
2
Version.ini
Normal file
@@ -0,0 +1,2 @@
|
||||
[Video-Uploader]
|
||||
Version=3.29
|
||||
Reference in New Issue
Block a user