Last active
December 16, 2015 07:09
-
-
Save horimislime/5396517 to your computer and use it in GitHub Desktop.
Example to list files downloaded from specific domain
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
import os | |
import xattr | |
watchdir="/Users/horimislime/Desktop/" | |
#search files downloaded from pixiv | |
domain='www.pixiv.net' | |
for file in os.listdir(watchdir): | |
try: | |
fullpath=os.path.join(watchdir,file) | |
if xattr.getxattr(fullpath,'com.apple.metadata:kMDItemWhereFroms').find(domain)> 0: | |
print fullpath | |
except: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment