commit bc275c32e882aed314ddd15133e9389fb9fd8094 Author: celso Date: Wed Jul 26 17:15:16 2023 -0300 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3fd7c21 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +cookies.txt diff --git a/getcookies.sh b/getcookies.sh new file mode 100755 index 0000000..7b0c8cc --- /dev/null +++ b/getcookies.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +FILENAME="${1:-empty}" +[ "${FILENAME}" = "empty" ] && { + # this is where the profile folder is in my installation, change to suit your own + PREFIX="$(ls -td /home/"${USER}"/.moonchild\ productions/pale\ moon/* | head -n1)" + FILENAME="${PREFIX}/cookies.sqlite" +} + +# file is under lock while browser is running, so we copy it +TMPFILE="/tmp/cookies.sqlite" +cp "${FILENAME}" "${TMPFILE}" +sqlite3 -separator $'\t' "${TMPFILE}" ".mode tabs" ".header off" "select host, case substr(host,1,1)='.' when 0 then 'FALSE' else 'TRUE' end, path, case isSecure when 0 then 'FALSE' else 'TRUE' end, expiry, name, value from moz_cookies;" > cookies.txt +sed -i ':a;N;$!ba;s/^/# Netscape HTTP Cookie File\n/' cookies.txt +rm "${TMPFILE}"