Created
July 25, 2017 21:14
-
-
Save alastairmccormack/8197a678eaaf802252f9e7e7bfe87bdc to your computer and use it in GitHub Desktop.
Get "where from" information in macOS / OS X for a file
This file contains hidden or 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 xattr | |
import plistlib | |
x = xattr.xattr('mydownloaded.file') | |
where_from_plist = x['com.apple.metadata:kMDItemWhereFroms'] | |
where_from = plistlib.loads(where_from_plist) | |
# list object of URLs. Presumably right most is original URL and left most is the redirected location(s) | |
print(where_from) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment