Created
August 1, 2015 19:18
-
-
Save mcomisso/5ee44759856167f1e70d to your computer and use it in GitHub Desktop.
Remove app downloaded with a different account
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/local/bin/python | |
import zipfile, os | |
for zip_app_name in os.listdir("/Path/to/Music/iTunes/iTunes Music/Mobile Applications"): | |
if os.path.isdir(zip_app_name) or not zip_app_name.endswith('.ipa'): | |
continue | |
workflow = zipfile.ZipFile(zip_app_name) | |
try: | |
f = workflow.open("iTunesMetadata.plist") | |
if not 'your_email@domain.com' in f.read(): | |
f.close | |
print "Removing ", zip_app_name | |
os.remove(zip_app_name) | |
else: | |
f.close | |
except: | |
continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment