Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ with a standalone console script:

```console
$ pycookiecheat --help
usage: pycookiecheat [-h] -u URL [-b BROWSER] [-o OUTPUT_FILE]
usage: pycookiecheat [-h] -u URL [-b BROWSER] [-o OUTPUT_FILE] [--verbose]
[-c COOKIE_FILE]

Copy cookies from Chrome or Firefox and output as json

Expand All @@ -63,6 +64,9 @@ options:
-b BROWSER, --browser BROWSER
-o OUTPUT_FILE, --output-file OUTPUT_FILE
Output to this file in netscape cookie file format
--verbose, -v Increase logging verbosity (may repeat), default is `logging.ERROR`
-c COOKIE_FILE, --cookie-file COOKIE_FILE
Cookie file
```

### As a Python Library
Expand Down
7 changes: 7 additions & 0 deletions src/pycookiecheat/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ def main() -> None:
"`logging.ERROR`"
),
)
parser.add_argument(
"-c",
"--cookie-file",
help="Cookie file",
)
args = parser.parse_args()

logging.basicConfig(level=max(logging.ERROR - 10 * args.verbose, 0))
Expand All @@ -48,12 +53,14 @@ def main() -> None:
url=args.url,
browser=browser,
curl_cookie_file=args.output_file,
cookie_file=args.cookie_file,
)
else:
cookies = chrome_cookies(
url=args.url,
browser=browser,
curl_cookie_file=args.output_file,
cookie_file=args.cookie_file,
)

if not args.output_file:
Expand Down
Loading