20 lines
524 B
Python
20 lines
524 B
Python
"""bookmarks_to_avs_trimps.py: generates Avisynth trims from VapourSynth Bookmarks."""
|
|
|
|
__author__ = "Yuuki-chan"
|
|
__copyright__ = "Copyright 2022, Raiza.dev"
|
|
|
|
|
|
import sys
|
|
|
|
|
|
if sys.argv[1].endswith('.bookmarks'):
|
|
trimz = []
|
|
|
|
with open(sys.argv[1], mode='r') as ff:
|
|
trims = ff.read().split(', ')
|
|
|
|
for trim in range(0, len(trims), 2):
|
|
trimz.append(f'Trim({trims[trim]}, {trims[trim+1]})')
|
|
|
|
with open(f'{sys.argv[1]}.trims.txt', mode='w') as ff:
|
|
ff.write('++'.join(trimz))
|