|
|
@@ -1,6 +1,6 @@
|
|
|
|
#Requires AutoHotkey v2.0
|
|
|
|
#Requires AutoHotkey v2.0
|
|
|
|
|
|
|
|
|
|
|
|
momentsPath := IniRead("trimUploader.ini", "location", "path", "")
|
|
|
|
momentsPath := IniRead("trimUploader.ini", "location", "momentsPath", "")
|
|
|
|
if (momentsPath = "") {
|
|
|
|
if (momentsPath = "") {
|
|
|
|
momentsPath := DirSelect()
|
|
|
|
momentsPath := DirSelect()
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -9,7 +9,7 @@ ziplineURL := IniRead("trimUploader.ini", "location", "ziplineURL", "PROVIDE ZIP
|
|
|
|
ziplineFolder := IniRead("trimUploader.ini", "location", "ziplineFolder", "PROVIDE FOLDER ID")
|
|
|
|
ziplineFolder := IniRead("trimUploader.ini", "location", "ziplineFolder", "PROVIDE FOLDER ID")
|
|
|
|
ziplineToken := IniRead("trimUploader.ini", "location", "ziplineToken", "PROVIDE ZIPLINE TOKEN")
|
|
|
|
ziplineToken := IniRead("trimUploader.ini", "location", "ziplineToken", "PROVIDE ZIPLINE TOKEN")
|
|
|
|
|
|
|
|
|
|
|
|
IniWrite(momentsPath, "trimUploader.ini", "location", "path")
|
|
|
|
IniWrite(momentsPath, "trimUploader.ini", "location", "momentsPath")
|
|
|
|
IniWrite(trimPattern, "trimUploader.ini", "location", "trimPattern")
|
|
|
|
IniWrite(trimPattern, "trimUploader.ini", "location", "trimPattern")
|
|
|
|
IniWrite(ziplineURL, "trimUploader.ini", "location", "ziplineURL")
|
|
|
|
IniWrite(ziplineURL, "trimUploader.ini", "location", "ziplineURL")
|
|
|
|
IniWrite(ziplineFolder, "trimUploader.ini", "location", "ziplineFolder")
|
|
|
|
IniWrite(ziplineFolder, "trimUploader.ini", "location", "ziplineFolder")
|
|
|
@@ -19,41 +19,48 @@ loop {
|
|
|
|
uploadedURLs := ""
|
|
|
|
uploadedURLs := ""
|
|
|
|
uploadedFiles := 0
|
|
|
|
uploadedFiles := 0
|
|
|
|
Loop Files momentsPath "\" trimPattern, "F" {
|
|
|
|
Loop Files momentsPath "\" trimPattern, "F" {
|
|
|
|
|
|
|
|
fileSize := 0
|
|
|
|
|
|
|
|
while (fileSize < FileGetSize()) {
|
|
|
|
|
|
|
|
Sleep(200)
|
|
|
|
|
|
|
|
fileSize := FileGetSize()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
; Build curl command
|
|
|
|
; ; Build curl command
|
|
|
|
cmd := 'curl -s -H "Authorization: ' ziplineToken '" '
|
|
|
|
; cmd := 'curl -s -H "Authorization: ' ziplineToken '" '
|
|
|
|
cmd .= '-H "x-zipline-original-name: true" '
|
|
|
|
; cmd .= '-H "x-zipline-original-name: true" '
|
|
|
|
cmd .= '-H "x-zipline-folder: ' ziplineFolder '" '
|
|
|
|
; cmd .= '-H "x-zipline-p-format: name" '
|
|
|
|
cmd .= '-F "file=@' A_LoopFileFullPath ';type=video/mp4" '
|
|
|
|
; cmd .= '-H "x-zipline-folder: ' ziplineFolder '" '
|
|
|
|
cmd .= '-F "filename=' A_LoopFileName '" '
|
|
|
|
; cmd .= '-H "x-zipline-filename: ' StrReplace(A_LoopFileName, ".mp4", "") '" '
|
|
|
|
cmd .= '"' ZiplineURL '/api/upload"'
|
|
|
|
; cmd .= '-F "file=@' A_LoopFileFullPath ';type=video/mp4" '
|
|
|
|
|
|
|
|
; cmd .= '"' ZiplineURL '/api/upload"'
|
|
|
|
|
|
|
|
|
|
|
|
; MsgBox(cmd)
|
|
|
|
; ; MsgBox(cmd)
|
|
|
|
|
|
|
|
|
|
|
|
; Run curl and capture output
|
|
|
|
; ; Run curl and capture output
|
|
|
|
RunWait(A_ComSpec " /c " cmd " | clip", , "Hide")
|
|
|
|
; RunWait(A_ComSpec " /c " cmd " | clip", , "Hide")
|
|
|
|
output := A_Clipboard
|
|
|
|
; output := A_Clipboard
|
|
|
|
|
|
|
|
|
|
|
|
; Extract URL from JSON
|
|
|
|
; Extract URL from JSON
|
|
|
|
if RegExMatch(output, '"url":"(.*?)"', &m) {
|
|
|
|
; if RegExMatch(output, '"url":"(.*?)"', &m) {
|
|
|
|
url := m[1]
|
|
|
|
; url := m[1]
|
|
|
|
uploadedURLs .= url "`n"
|
|
|
|
; uploadedURLs .= url "`n"
|
|
|
|
uploadedFiles++
|
|
|
|
; uploadedFiles++
|
|
|
|
|
|
|
|
FileCopy(A_LoopFileFullPath, "\\192.168.0.20\nextcloud\fireshare\fireshare_videos\*.*")
|
|
|
|
FileDelete(A_LoopFileFullPath)
|
|
|
|
FileDelete(A_LoopFileFullPath)
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
; try {
|
|
|
|
} catch Error {
|
|
|
|
; } catch Error {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
; }
|
|
|
|
} else {
|
|
|
|
; } else {
|
|
|
|
MsgBox "Failed to extract URL.`nResponse:`n" output
|
|
|
|
; MsgBox "Failed to extract URL.`nResponse:`n" output
|
|
|
|
}
|
|
|
|
; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( not uploadedURLs = "") {
|
|
|
|
; if ( not uploadedURLs = "") {
|
|
|
|
A_Clipboard := uploadedURLs
|
|
|
|
; A_Clipboard := uploadedURLs
|
|
|
|
TrayTip "Zipline Upload", "Uploaded " uploadedFiles " file(s)", 1
|
|
|
|
; TrayTip "Zipline Upload", "Uploaded " uploadedFiles " file(s)", 1
|
|
|
|
}
|
|
|
|
; }
|
|
|
|
|
|
|
|
|
|
|
|
Sleep(5000)
|
|
|
|
Sleep(5000)
|
|
|
|
}
|
|
|
|
}
|