Syntactic Confectionery Delight | |
PerlMonks |
DBI DBD::SQLite unable to open Firefox cookies.sqlite databaseby Discipulus (Canon) |
on Nov 29, 2022 at 11:39 UTC ( [id://11148433]=perlquestion: print w/replies, xml ) | Need Help?? |
Discipulus has asked for the wisdom of the Perl Monks concerning the following question:
Hello, inspired by Using LWP (or some other module) to Dowload HTML with Cookie Session ID I tried to unlock the cookies case of Firefox using perl. I have installed DBD::SQLite but the following code fails to open the DB even if Firefox is closed or if try the readonly flag. I also tried to make a copy of the DB cookiesTEST.sqlite in the case some lock was there.. but nothing but failures.
With FF open both DBeaver and sqlite3 command line utility can access the DB without problem. DBeaver uses jdbc:sqlite driver and sqlite> .version shows SQLite 3.40.0 2022-11-16 12:10:08 so not the 3.39.4 shown by DBD. I have no sqlite in the path. Searching I found HTTP::Cookies::Mozilla and I installed it: it comes with a stringy documentation ( yes! adopt it ;) but, lurking in /examples I have found /examples/convert-to-mojo.pl that slightly modified to work on windows (around line 19 my @cookies_files = glob( $ENV{AppData}.'\Mozilla\Firefox\Profiles\*\cookies.sqlite'); ) accesses the db without any issue. The module documentation ( scan method not even mentioned ;) says explicitly: > .. so you will need to have either DBI/DBD::SQLite, or the sqlite3 executable somewhere in the path. Since I have not sqlite in the path, it should use the very same driver used by my failing script, ie: DBD::SQLite So why the above code fails? L* PS ..and now crack the Chrome cookies jar
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Back to
Seekers of Perl Wisdom
|
|