]> git.0d.be Git - pige-extractor.git/commitdiff
add support for flac
authorFrédéric Péters <fpeters@0d.be>
Sun, 15 May 2016 13:11:38 +0000 (15:11 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sun, 15 May 2016 13:11:38 +0000 (15:11 +0200)
download.cgi

index be1812b2353102364de7a0b7bcd47457ef261cf8..c55471ceef26ddae02f6c50a1929aa170a236260 100755 (executable)
@@ -35,7 +35,7 @@ if os.environ.get('PATH_INFO'):
         end += ':' + filename[24:26]
     else:
         end += ':00'
-    ext = filename[-3:]
+    ext = filename.rsplit('.')[-1]
 
     start = datetime.datetime.strptime('%s %s' % (date, start),
            '%Y%m%d %H:%M:%S')
@@ -135,6 +135,8 @@ sys.stdout.flush()
 
 if ext == 'ogg':
     command = ['sox'] + filenames + ['-t', 'ogg', '-C', '6', '-']
+elif ext == 'flac':
+    command = ['sox'] + filenames + ['-t', 'flac', '-']
 else:
     command = ['sox'] + filenames + ['-t', 'wav', '-']