Thursday, November 21, 2024

openai – Determine the UUID or URL of the recent conversations using local data from the ChatGPT macOS app?

For some convenience scripts, Alfred workflows etc I would like to be able to programmatically determine the UUID (and hence the URL) of my chats. This used to be easy by simply looking in the data directory of the ChatGPT macOS app, which can be determined using:

OPENAI_ACCOUNT=$(defaults read com.openai.chat activeAccountID)
cd "$HOME/Library/Application Support/$BUNDLE_ID/conversations-v2-$OPENAI_ACCOUNT"

This directory contains *.data files, which used to be stored in unencrypted bplist (Binary Plist) format. The filenames directly corresponded to the UUID of the chat, and those conversation IDs were synced between the web app and the desktop app. Thus, you could trivially reconstruct the full URL using the format chatgpt.com/c/{uuid} e.g.:

https://chatgpt.com/c/0c8f1e06-e42c-4596-beeb-3baa1ed2770e

One could also easily extract metadata from them, e.g.

plutil -extract title raw 0c8f1e06-e42c-4596-beeb-3baa1ed2770e.data
==> Methods of restarting a systemd service

However, since a commotion was raised, this data is encrypted/obfuscated and the files there are not readable. I can’t figure out how to reverse it. I know it’s possible to do locally because I’ve tested it with no network connection. So there is a local decryption algo or key stored somewhere. Anyone know how to do this?

example

Related Articles

Latest Articles