Created
April 23, 2014 16:47
-
-
Save jaymzcd/11223100 to your computer and use it in GitHub Desktop.
Meh, can't be arsed :) not all tracks have id3 "files" it seems, and not all them have id3 tags! :) Will let you sort this out in some fancy tool way via iTunes or something, probably going OTT this way! :)
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 python2 | |
import os | |
import re | |
for root, dirs, files in os.walk('.'): | |
for file in files: | |
if file[-1] == '0': | |
mp3 = os.path.join(root, file) | |
print "MP3: %s" % mp3 | |
id3 = os.path.join(root, '%s%s' % (file[:-1], '1')) | |
with open(id3) as id3_file: | |
content = id3_file.read() | |
artist = re.search('artist=(.*)', content) | |
title = re.search('title=(.*)', content) | |
album = re.search('source=(.*)', content) | |
if artist and title and album: | |
print "%s%s%s.mp3" % (artist.group(1), title.group(1), album.group(1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://files.u-dox.com/jc/sebrio.zip (5.6Gb) → give that ~6 minutes to copy! :)