diff --git a/my_cookies/my_cookies.py b/my_cookies/my_cookies.py index cc9af15..f824514 100755 --- a/my_cookies/my_cookies.py +++ b/my_cookies/my_cookies.py @@ -7,6 +7,7 @@ def main(): """Print cookies.""" cookiejar = None + try: cookiejar = browser_cookie3.chrome(domain_name="leetcode.com") except Exception: @@ -25,10 +26,14 @@ def main(): print("get cookie from Microsoft Edge failed", file=sys.stderr) return - leetcode_cookies = list(filter(lambda c: c.name in ("LEETCODE_SESSION", "csrftoken"), cookiejar)) + leetcode_cookies = list( + filter(lambda c: c.name in ("LEETCODE_SESSION", "csrftoken"), cookiejar) + ) if len(leetcode_cookies) < 2: - print("get cookie failed, make sure you have Chrome or Firefox installed and login in LeetCode with one of them at least once.") + print( + "get cookie failed, make sure you have Chrome or Firefox installed and login in LeetCode with one of them at least once." + ) return for c in leetcode_cookies: diff --git a/setup.py b/setup.py index cebd8f5..c05fc63 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name="my_cookies", packages=["my_cookies"], - version="0.1.1", + version="0.1.2", license="MIT", description="Retrieve chrome cookies", author="Wang Kai", @@ -11,7 +11,7 @@ url="/~https://github.com/kaiwk/my_cookies", download_url="/~https://github.com/kaiwk/my_cookies", keywords=["browser", "cookies"], - scripts=['bin/my_cookies'], + scripts=["bin/my_cookies"], install_requires=["browser_cookie3"], classifiers=[ # Chose either "3 - Alpha", "4 - Beta", or "5 - Production/Stable"