Created
March 13, 2016 01:31
-
-
Save eungju/01c831cf04763af7a9b4 to your computer and use it in GitHub Desktop.
SMI 자막 시간 조절
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env elixir | |
{d, _} = Integer.parse(Enum.at(System.argv(), 0)) | |
IO.stream(:stdio, :line) | |
|> Stream.map(&Regex.replace(~r/<SYNC Start=(\d+)>/i, &1, fn _, g1 -> {t, _} = Integer.parse(g1); "<SYNC Start=#{t + d}>" end)) | |
|> Stream.each(&IO.write/1) | |
|> Stream.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ cat foo.smi | smi-adjust.exs 27000 > foo-adjusted.smi