Skip to content

Instantly share code, notes, and snippets.

@standage
Created November 10, 2017 02:57
Show Gist options
  • Save standage/1ee44acdfe7bc9682361dea8fa2b4309 to your computer and use it in GitHub Desktop.
Save standage/1ee44acdfe7bc9682361dea8fa2b4309 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from __future__ import print_function
import glob
import os
m4a_files = glob.glob('*/*/*.m4a')
mp3_files = glob.glob('*/*/*.mp3')
to_delete = list()
for m4a in m4a_files:
test = m4a.replace('.m4a', '.mp3')
if test in mp3_files:
to_delete.append(m4a)
for m4a in to_delete:
# print(m4a)
os.unlink(m4a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment