I want to get my cookies.txt for YouTube so that I can youtube-dl my liked videos playlist.

How can I get my cookies from Safari? Opening the web inspector just lets me view them, I can't see how to download the text file from here.

1 Answer 1


Safari cookies are located under ~/Library/Cookies. However, they're binary cookies, so you'll have to decode it to human-readable (Netscape equivalent) cookies.

To do so, you would have to install this tool and follow the instruction (I've never used it before, so I don't know if this still works.)

Personally, I'd rather just install Chrome (or a browser that uses Chromium, such as Vivaldi, etc) and use extensions like Get cookies.txt locally, though.

  • 2
    Is it just me, or is the folder empty now? (Safari, v16.0) Commented Oct 9, 2022 at 14:01
  • @AlexandreCassagne At least on my MBP (Monterey 12.4, Safari 16.0) I have cookies. I think it's just you.
    – Skye-AT
    Commented Oct 9, 2022 at 16:49
  • 2
    It's empty for me as well on macOS 13.1 (Ventura) and Safari 16.2, and trying to run sudo ls ~/Library/Cookies gives "Operation not permitted" Commented Mar 16, 2023 at 10:33
  • I have cookies there (Safari 15.5; MacOS 10.15.7). Commented Nov 13, 2023 at 15:53
  • @LinusUnnebäck You can get around the "Operation not permitted" by by going into System Preferences > Security & Privacy and giving Full Disk Access to Terminal. However, on my machine, after doing this, I've discovered that the folder is empty Commented Feb 2 at 8:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .