Skip to content

Instantly share code, notes, and snippets.

@philz
Created February 12, 2024 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philz/eeac689b2cc1f0a695f125201e0f19b3 to your computer and use it in GitHub Desktop.
Save philz/eeac689b2cc1f0a695f125201e0f19b3 to your computer and use it in GitHub Desktop.
# Reads OS X / Safari reading list and dumps out URLs.
#!/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