Skip to content

Conversation

@NHagar
Copy link
Owner

@NHagar NHagar commented May 25, 2025

This pull request introduces support for accessing paywalled Substack content using user-provided authentication via session cookies. It includes updates to the library's core functionality, documentation, and examples to reflect this new feature.

Core Functionality Enhancements

  • Added the SubstackAuth class to handle authentication using session cookies, enabling access to paywalled content. (docs/api-reference/auth.md, docs/authentication.md, README.md, [1] [2]
  • Updated the Newsletter and Post classes to accept an optional auth parameter for authenticated access to paywalled content. (docs/api-reference/newsletter.md, docs/api-reference/post.md, [1] [2]

Documentation Updates

  • Added a comprehensive guide on setting up and using authentication, including cookie export instructions and security considerations. (docs/authentication.md, docs/authentication.mdR1-R172)
  • Updated API reference and user guides to include examples and explanations for accessing paywalled content. (docs/api-reference/auth.md, docs/user-guide.md, README.md, [1] [2]

Example Code and Usage

  • Provided example code for authenticated workflows with Newsletter and Post, demonstrating how to access paywalled content programmatically. (README.md, docs/index.md, docs/user-guide.md, [1] [2]

Security and Compliance

  • Highlighted the importance of using personal session cookies, keeping them secure, and complying with Substack's terms of service. (docs/authentication.md, README.md, [1] [2]

Miscellaneous

  • Updated quick start and feature lists to reflect the addition of authentication support. (docs/index.md, README.md, [1] [2]

@NHagar NHagar requested a review from Copilot May 25, 2025 16:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds support for authentication using session cookies to access paywalled Substack content. Key changes include:

  • Introducing the new SubstackAuth class and integrating authentication into Post and Newsletter classes.
  • Updating tests, documentation, and example usage to demonstrate authenticated workflows.
  • Adjusting package metadata and navigation to reflect the new authentication feature.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_auth.py New tests added for authentication-related functionality.
substack_api/post.py Updated Post to accept an auth parameter and use authenticated requests.
substack_api/newsletter.py Updated Newsletter to accept an auth parameter and pass it to Post objects.
substack_api/auth.py New authentication class for managing session cookies.
substack_api/init.py Exposed the SubstackAuth class in the package API.
pyproject.toml Minor dependency and metadata updates.
mkdocs.yml Updated docs navigation to include authentication.
examples/usage_walkthrough.ipynb Added usage examples demonstrating authentication workflows.
docs/user-guide.md Updated guide with authentication setup and usage instructions.
docs/index.md Updated quick start with authentication details.
docs/authentication.md New authentication guide with comprehensive setup instructions.
docs/api-reference/post.md Updated API reference for Post to include authentication parameter.
docs/api-reference/newsletter.md Updated API reference for Newsletter to include authentication parameter.
docs/api-reference/auth.md New API reference documentation for the SubstackAuth class.
README.md Enhanced documentation and examples to reflect authentication support.
Comments suppressed due to low confidence (1)

substack_api/post.py:108

  • Consider replacing print statements with a logging mechanism to provide configurable and consistent error reporting.
print("Warning: This post is paywalled. Provide authentication to access full content.")

@NHagar NHagar merged commit e83d61d into master May 25, 2025
2 checks passed
@NHagar NHagar deleted the auth-support branch May 25, 2025 16:57
@NHagar NHagar mentioned this pull request May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants