minor sanitization of file extensions

This commit is contained in:
r888888888
2014-10-06 14:35:45 -07:00
parent fb2219d4ac
commit 57001a7e39

View File

@@ -50,7 +50,7 @@ class PixivUgoiraConverter
# Duplicate last frame to avoid it being displayed only for a very short amount of time.
last_file_name = folder.to_a.last.name
last_file_name =~ /\A(\d{6})(\..+)\Z/
last_file_name =~ /\A(\d{6})(\.\w{,4})\Z/
new_last_index = $1.to_i + 1
file_ext = $2
new_last_filename = ("%06d" % new_last_index) + file_ext
@@ -70,7 +70,7 @@ class PixivUgoiraConverter
f.write("#{delay_sum}\n")
end
ext = folder.first.name.match(/\.(.+)$/)[1]
ext = folder.first.name.match(/\.(\w{,4})$/)[1]
system("ffmpeg -i #{tmpdir}/images/%06d.#{ext} -codec:v libvpx -crf 4 -b:v 5000k -an #{tmpdir}/tmp.webm")
system("mkvmerge -o #{write_path} --timecodes 0:#{tmpdir}/timecodes.tc #{tmpdir}/tmp.webm")
end