How to get cookies.txt for YouTube from Safari?

Solution 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, though.