Created
February 4, 2023 09:03
-
-
Save mkckr0/0812ea7a56700af6c653fcc196299b2e to your computer and use it in GitHub Desktop.
read cookie string and write into json format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cookies = SimpleCookie() | |
cookies.load(open('cookie.txt', 'r', encoding='utf8').read()) | |
cookies = {k: v.value for k, v in cookies.items()} | |
json.dump(dict(session.cookies.items()), open('cookie.json', 'w', encoding='utf8'), indent=2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment