Skip to main content
blog.philz.dev

Extracting Safari's Reading List

This nonsense might extract the URLs from your Add to Reading List habit.

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)