commit 175ee0331788aa0bc53b9c384ff2120985df0cac
parent 7f86edae969410f3f2d2564d6f3761d54a0b5bf3
Author: gearsix <gearsix@tuta.io>
Date: Fri, 4 Feb 2022 00:16:24 +0000
minor fixes in split_tracks() when testing on windows
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sya.py b/sya.py
@@ -109,13 +109,13 @@ def split_tracks(ffmpeg, audio_fpath, tracks, format='mp3', outpath='out'):
# some nasty string manip. to extract length (printed to stderr)
try:
length = str(ret).split('\\r')
- length = length[len(length)-1].split(' ')[1].split('=')[1][:-3]
+ length = length[len(length)-2].split(' ')[1].split('=')[1][:-3]
except:
log('Failed to find track length, {}'.format(length))
return
-
+
for i, t in enumerate(tracks):
- outfile = '{}/{} - {}.{}'.format(outpath, str(i).zfill(2), t.title, format)
+ outfile = '{}/{} - {}.{}'.format(outpath, str(i).zfill(2), t.title.strip(' - '), format)
end = length
if i < len(tracks)-1:
end = tracks[i+1].timestamp