Skip to content

Instantly share code, notes, and snippets.

@Laurent-Sarrazin
Forked from nicerobot/chrome-cookies.sh
Last active December 31, 2015 03:29
Show Gist options
  • Save Laurent-Sarrazin/7928074 to your computer and use it in GitHub Desktop.
Save Laurent-Sarrazin/7928074 to your computer and use it in GitHub Desktop.
sqlite3 -separator ' ' ${COOKIES:-Cookies} \
'select host_key, "TRUE", path, "FALSE", expires_utc, name, value from cookies'
#!/bin/sh
STARTD=${PWD}
NOW=$(date -u +%Y%m%dt%H%M%S)
HOST=${HOSTNAME:-$(hostname)}
UNQ=${NOW}.${RANDOM}.$$
COOKIES=/tmp/${UNQ}
date
CHROME="${1:-${HOME}/Library/Application Support/Google/Chrome/Default}"
[ -d "${CHROME}" ] && cd "${CHROME}"
[ -r Cookies ] || exit 1
umask 0077
t=${STARTD}/cookies.txt
: </dev/null >${t}
trap "rm -f ${COOKIES}" 0
cp Cookies ${COOKIES}
curl -ks https://gist.github.com/Laurent-Sarrazin/7928074/raw/95bbb17c730f25ac2e8f43011f1cf9922e1bf8a1/chrome-cookies.sh \
| sh \
>> ${STARTD:-.}/cookies.txt
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment