-
Notifications
You must be signed in to change notification settings - Fork 21
"feat: allow cookie-based auth to bypass recaptcha" #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
substack/api.py
Outdated
if not custom_domain: | ||
publication_url = f"https://{publication['subdomain']}.substack.com" | ||
else: | ||
if publication['custom_domain_optional']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be a get to avoid KeyError for the custom_domain_optional key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i fix this issue in this commit
substack/cookie_session.py
Outdated
super().__init__() | ||
with open(cookie_file, "r", encoding="utf-8") as f: | ||
raw = json.load(f) | ||
self.cookies = cookiejar_from_dict({c["name"]: c["value"] for c in raw}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this fully replace the cookies with the content of the json file? if so then it is should update the cookies dict instead of replacing it in order to not break the behavior of
self._session.cookies.update(cookies)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s true, so I removed CookieSession.py (it was no longer needed) and updated the cookie-session instance instead.
i add the "cookie_session" for bypass the captcha and fix some issue with substack changes