Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
n8henrie committed Nov 2, 2024
1 parent 49bf831 commit 646a66c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ with a standalone console script:

```console
$ python -m pycookiecheat --help
usage: pycookiecheat [-h] [-b BROWSER] [-o OUTPUT_FILE] [-v] [-c COOKIE_FILE] [-V] url
usage: pycookiecheat [-h] [-b BROWSER] [-o OUTPUT_FILE] [-v] [-c COOKIE_FILE]
[-V]
url

Copy cookies from Chrome or Firefox and output as json

Expand All @@ -65,10 +67,13 @@ options:
-b BROWSER, --browser BROWSER
-o OUTPUT_FILE, --output-file OUTPUT_FILE
Output to this file in netscape cookie file format
-v, --verbose Increase logging verbosity (may repeat), default is `logging.ERROR`
-v, --verbose Increase logging verbosity (may repeat), default is
`logging.ERROR`
-c COOKIE_FILE, --cookie-file COOKIE_FILE
Cookie file
-V, --version show program's version number and exit```
-V, --version show program's version number and exit

```

### As a Python Library

Expand Down
20 changes: 9 additions & 11 deletions src/pycookiecheat/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,15 @@ def as_cookie_file_line(self) -> str:
See details at http://www.cookiecentral.com/faq/#3.5
"""
return "\t".join(
[
self.host_key,
"TRUE",
self.path,
"TRUE" if self.is_secure else "FALSE",
str(self.expires_utc),
self.name,
self.value,
]
)
return "\t".join([
self.host_key,
"TRUE",
self.path,
"TRUE" if self.is_secure else "FALSE",
str(self.expires_utc),
self.name,
self.value,
])


def generate_host_keys(hostname: str) -> Iterator[str]:
Expand Down

0 comments on commit 646a66c

Please sign in to comment.