Created
February 12, 2024 04:39
-
-
Save philz/eeac689b2cc1f0a695f125201e0f19b3 to your computer and use it in GitHub Desktop.
# Reads OS X / Safari reading list and dumps out URLs.
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/bin/env python3 | |
# Reads OS X / Safari reading list and dumps out URLs. | |
import plistlib | |
import os | |
for p in [ | |
y["URLString"] | |
for y in [ | |
x | |
for x in plistlib.load( | |
open(os.path.expanduser("~/Library/Safari/Bookmarks.plist"), "rb") | |
)["Children"] | |
if "Title" in x and x["Title"] == "com.apple.ReadingList" | |
][0]["Children"] | |
if "URLString" in y | |
]: | |
print(p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment