Skip to content

Instantly share code, notes, and snippets.

@nuomi1
Last active March 2, 2016 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nuomi1/a6b8632f8b50fda72a67 to your computer and use it in GitHub Desktop.
Save nuomi1/a6b8632f8b50fda72a67 to your computer and use it in GitHub Desktop.
Automator
on run {input, parameters}
set inputPath to ""
repeat with temp in input
set inputPath to inputPath & " " & quoted form of POSIX path of temp
end repeat
tell application "Terminal"
activate
do script "concat.py " & inputPath & ""
end tell
end run
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import subprocess
import sys
def concat(files, output = sys.argv[1].replace('[00].f4v', '') + '.mp4'):
concat_list = open(output + '.txt', 'w', encoding = "utf-8")
for file in files:
if os.path.isfile(file):
concat_list.write("file '%s'\n" % file)
concat_list.close()
params = ['ffmpeg', '-f', 'concat', '-i', output + '.txt', '-c', 'copy', output]
subprocess.check_call(params)
os.remove(output + '.txt')
concat(sys.argv[1:])
on run {input, parameters}
set inputPath to ""
repeat with temp in input
set inputPath to inputPath & space & quoted form of POSIX path of temp
end repeat
tell application "Terminal"
activate
do script "Leanify " & inputPath & " "
end tell
end run
on run {input, parameters}
set inputPath to ""
repeat with temp in input
set inputPath to inputPath & space & quoted form of POSIX path of temp
end repeat
tell application "Terminal"
activate
do script "MediaInfo " & inputPath & ""
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment