cmv has asked for the wisdom of the Perl Monks concerning the following question:
I would like to be able to read my Chrome cookies on a Mac.
My understanding is that I can use HTTP::Cookies::Chrome to do this. The following is an example script I pulled from the git repository and modified it for my Chrome profile.
When I run it I get the attached failure messages with no other output. Any help or pointers are much appreciated.
Thanks
Craig
Script:
#!/opt/homebrew/bin/perl use v5.10; use strict; use warnings; use Mojo::Util qw(dumper); use HTTP::Cookies::Chrome; my $class = 'HTTP::Cookies::Chrome'; #my $path = $class->guess_path; my $path = '/Users/cmv/Library/Application Support/Google/Chrome/P +rofile 1/Cookies'; my $password = $class->guess_password; say <<~"HERE"; File: $path Pass: $password HERE my $cookies = HTTP::Cookies::Chrome->new( chrome_safe_storage_password => $password, ignore_discard => 0, ); $cookies->load( $path ); $cookies->scan( \&summary ); sub summary { state $previous_domain = ''; my( @cookie ) = @_; say $cookie[4] unless $cookie[4] eq $previous_domain; $previous_domain = $cookie[4]; printf "\t%-5s %-16s %s\n", map { $_ // '' } @cookie[3,1,2]; }
Errors:
$ ./chromecookie.pl File: /Users/cmv/Library/Application Support/Google/Chrome/Profile 1/C +ookies Pass: XXXXXXXXXXXXXX Encrypted value is unexpected type <1> at ./chromecookie.pl line 27. Encrypted value is unexpected type <1> at ./chromecookie.pl line 27. Encrypted value is unexpected type <1> at ./chromecookie.pl line 27. Encrypted value is unexpected type <1> at ./chromecookie.pl line 27. ... Argument "v10?M-\f??ʷM-^EM-^T>^YM-^EdtM-^F^Y??kM-\0&dkYh!M-^Q??M- +^F..." isn't numeric in division (/) at /Users/cmv/perl5/lib/perl5/HT +TP/Cookies/Chrome.pm line 451. Argument "v108M-^Q-^D<-?^Z?^K?vM-\r%M-^[K?7%?M-^\^UM-^_?3եM-^[&# +1760;?..." isn't numeric in division (/) at /Users/cmv/perl5/lib/perl +5/HTTP/Cookies/Chrome.pm line 451. Argument "v10????BA^G^D?dM-^TM-^A^Z???$^H]\n0??^^?:F?g??"^[G?EM-^H..." + isn't numeric in division (/) at /Users/cmv/perl5/lib/perl5/HTTP/Coo +kies/Chrome.pm line 451. ...
|
---|
Replies are listed 'Best First'. | |
---|---|
SOLVED: HTTP::Cookies::Chrome fails with Chrome cookies
by cmv (Chaplain) on Jun 23, 2025 at 13:02 UTC | |
HTTP::Cookies::Chrome doesn't seem to decrypt properly
by cmv (Chaplain) on Jun 23, 2025 at 23:35 UTC | |
by brian_d_foy (Abbot) on Jun 25, 2025 at 04:30 UTC |