Skip to content

Instantly share code, notes, and snippets.

@yunazuno
Created February 9, 2011 09:22
Show Gist options
  • Save yunazuno/818194 to your computer and use it in GitHub Desktop.
Save yunazuno/818194 to your computer and use it in GitHub Desktop.
Output filepath if the mp3 has no album artwork
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Output filepath if the mp3 has no album artwork.
Usage:
./get_no_artwork_file.py file [file..]
Example:
find . -name "*.mp3" -print0 | xargs -0 ./get_no_artwork_file.py
"""
import eyeD3
import sys
def check_artwork(path):
tag = eyeD3.Tag()
tag.link(path)
if (len(tag.getImages()) == 0):
print path
def main():
if (len(sys.argv) < 2):
sys.exit("Usage: ./get_no_artwork_file.py file [file...]")
for i in range(1, len(sys.argv)):
check_artwork(sys.argv[i])
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment