Last active
August 2, 2019 10:33
-
-
Save retrography/3a0de783a78a71777d35937ed324b6fb to your computer and use it in GitHub Desktop.
Create cue sheet for a list of id3-tagged audio files
This file contains 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 python3 | |
from sys import argv | |
from mediafile import MediaFile | |
def main(): | |
args = argv[1:] | |
first_file = True | |
lines = [] | |
for filename in args: | |
tags = MediaFile(filename) | |
cuefile = tags.albumartist + " - " + tags.album + ".cue" | |
if first_file: | |
lines.append('REM DATE ' + str(tags.year)) | |
lines.append('REM GENRE ' + tags.genre) | |
lines.append('PERFORMER "' + tags.albumartist + '"') | |
lines.append('TITLE "' + tags.album + '"') | |
first_file = False | |
lines.append('FILE "' + filename + '" WAVE') | |
lines.append('\tTRACK ' + format(tags.track, '02') + " AUDIO") | |
lines.append('\t\tTITLE "' + tags.title + '"') | |
lines.append('\t\tPERFORMER "' + tags.artist + '"') | |
lines.append('\t\tINDEX 01 00:00:00') | |
cue = open(cuefile,"w+") | |
cue.write("\n".join(lines)) | |
cue.close() | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I made pretty much the same script in Pyhon:
Syntax:
./cuer.py --src some/folder/*.dsf