Cover Copier
Here’s a little script I created to copy all of the covers from my mp3 folders over to my flac folders. It also came in handy a few days ago when I accidentally deleted all of the covers that were present on my Sansa.
#! /usr/bin/env python import os import sys import shutil import string for root, dir, files in os.walk(sys.argv[1]): if len(dir) == 0: copy_from = sys.argv[2] + '/' + root.replace(sys.argv[1],'').translate( string.maketrans(':<>\|*?','_______')) try: for file in os.listdir(copy_from): if file == '.directory' or file.endswith(('.jpg','.jpeg','.png','.gif','.bmp')): copy_file = copy_from + '/' + file shutil.copy(copy_file, root) except OSError: pass