Skip to content

Instantly share code, notes, and snippets.

@zanculmarktum
Created April 7, 2018 09:06
Show Gist options
  • Save zanculmarktum/eb0a9f3049120dfb91ef33dd1f9a91ea to your computer and use it in GitHub Desktop.
Save zanculmarktum/eb0a9f3049120dfb91ef33dd1f9a91ea to your computer and use it in GitHub Desktop.
Convert chromium cookies to netscape format
#!/bin/sh
cookies_path=~/.local/share/qutebrowser/webengine/Cookies
#sqlite3 $cookies_path 'pragma table_info(cookies)'
#echo
sqlite3 -separator "$(printf '\t')" $cookies_path \
'select host_key,httponly,path,secure,expires_utc,name,value from cookies where host_key like "%'"$1"'%"' | \
awk '
BEGIN {
FS="\t"
OFS="\t"
}
{
if ($2 == 0) {
$2 = "FALSE"
}
else {
$2 = "TRUE"
}
if ($4 == 0) {
$4 = "FALSE"
}
else {
$4 = "TRUE"
}
print
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment