Skip to content

Commit 864a9d1

Browse files
committed
Add ability to supply custom path to cookie file
Fixes #67
2 parents 88b411f + 6e0d130 commit 864a9d1

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
##
44

55
- Add `--version` flag (thanks @samiam)
6+
- Add `-c` flag to specify custom path to cookie file (thanks @samiam)
67
- Fix new path to Firefox profile on MacOS (thanks @MattMuffin)
78
- Support Chrome's new v24 cookies (thanks @chrisgavin)
89
- Now requires python >= 3.9

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ with a standalone console script:
5353

5454
```console
5555
$ pycookiecheat --help
56-
usage: pycookiecheat [-h] -u URL [-b BROWSER] [-o OUTPUT_FILE]
56+
usage: pycookiecheat [-h] -u URL [-b BROWSER] [-o OUTPUT_FILE] [--verbose]
57+
[-c COOKIE_FILE]
5758

5859
Copy cookies from Chrome or Firefox and output as json
5960

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

6872
### As a Python Library

src/pycookiecheat/__main__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ def main() -> None:
3535
"`logging.ERROR`"
3636
),
3737
)
38+
parser.add_argument(
39+
"-c",
40+
"--cookie-file",
41+
help="Cookie file",
42+
)
3843
parser.add_argument(
3944
"-V",
4045
"--version",
@@ -55,12 +60,14 @@ def main() -> None:
5560
url=args.url,
5661
browser=browser,
5762
curl_cookie_file=args.output_file,
63+
cookie_file=args.cookie_file,
5864
)
5965
else:
6066
cookies = chrome_cookies(
6167
url=args.url,
6268
browser=browser,
6369
curl_cookie_file=args.output_file,
70+
cookie_file=args.cookie_file,
6471
)
6572

6673
if not args.output_file:

0 commit comments

Comments
 (0)