0

How might I gather all the songs in my music library (maintained in iTunes) on Mac OS X 10.8.5 with ID3 title tags (I guess? their titles in iTunes) that consist of 4 random capital letters. Or all the ones whose titles are 4 characters long, case insensitive, or mixed character types... if they're just 4 in length... anything that could help me narrow it down to that specific criteria. My whole iTunes music library is contained within one folder, to be clear, so anything that could identify these for me within a particular folder will work. Thanks much.

Edited by cilla

2
Contributors
1
Reply
9
Views
2 Years
Discussion Span
Last Post by chriswelborn
0

How much python do you know? What have you tried? You can walk a directory like this:

import os
for root, dirs, files in os.walk('/my_directory'):
    for filename in files:
        if not filename.endswith('.mp3'):
            continue
        fullpath = os.path.join(root, filename)
        print('Found mp3 file: {}'.format(fullpath))

After that, there is the re module for regex, or simply str.startswith() and str.endswith(), or len(str). There are a lot of ways to do this. For the ID3 tags there is Mutagen and a bunch of other libraries that would help.

If you get stuck, come back for help (with a small code example to explain your problem).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.