Skip to content
All gists
Back to GitHub
Sign in
Sign up
Sign in
Sign up
{{ message }}
Instantly share code, notes, and snippets.
nicerobot
/
chrome-cookies.sh
Created
Dec 7, 2011
Star
26
Fork
10
Star
Code
Revisions
8
Stars
26
Forks
10
Embed
What would you like to do?
Embed
Embed this gist in your website.
Share
Copy sharable link for this gist.
Clone via HTTPS
Clone with Git or checkout with SVN using the repository’s web address.
Learn more about clone URLs
Download ZIP
Convert Google Chrome sqlite Cookies into cookies.txt. Useful for utilities like curl.
Raw
chrome-cookies.sh
sqlite3 -separator
'
'
${COOKIES
:-
Cookies}
\
'
select host_key, "TRUE", path, "FALSE", expires_utc, name, value from cookies
'
Raw
cookies-txt.sh
#!
/bin/sh
#
curl -ks https://raw.github.com/gist/1443588/cookies-txt.sh | 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://raw.github.com/gist/1443588/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
You can’t perform that action at this time.
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.