feat: extract standalone Xiaohongshu URL crawler module#772
Open
handysome6 wants to merge 2 commits intoNanmiCoder:mainfrom
Open
feat: extract standalone Xiaohongshu URL crawler module#772handysome6 wants to merge 2 commits intoNanmiCoder:mainfrom
handysome6 wants to merge 2 commits intoNanmiCoder:mainfrom
Conversation
- Create xhs_url_crawler.py with all necessary components - Include authentication (QR code and cookie login) - Support URL parsing and note detail fetching - Remove all database dependencies - Add comprehensive documentation in XHS_CRAWLER_README.md Features: - Simple API for crawling individual Xiaohongshu notes - Multiple auth methods (QR code, cookies) - Automatic signature generation - Fallback to HTML parsing if API fails - Proxy support - No external dependencies on project structure
Integrated the cookie persistence improvements from the other agent's work into the standalone xhs_url_crawler.py module. ## Key Improvements 1. **CookieManager Class** - Save cookies to JSON file with timestamp - Load cookies from file - Validate cookie age (warns if >30 days old) - Clear and get cookie info methods 2. **Enhanced Login Flow** - Auto-save cookies after successful QR code login - Auto-load cookies from file if no cookie_str provided - All cookies are saved, not just web_session - New auto_login() method for seamless re-authentication 3. **XhsUrlCrawler Updates** - Added auto_save_cookies parameter (default: True) - Added cookie_dir parameter for custom cookie location - Initialize CookieManager in constructor - Pass cookie_manager to login objects 4. **Updated Documentation** - New "Cookie Management" section in README - Updated examples to show auto-login workflow - Added troubleshooting for auto-login issues - Added changelog showing v2.0 improvements ## Benefits **Before**: Scan QR code every single run ❌ **After**: Scan QR code only once, then automatic authentication ✅ ## Security - Added cookies/ to .gitignore - Cookie files stored locally with metadata - No sensitive data committed to repository This integration provides a much better user experience by eliminating repeated QR code authentication while maintaining security.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Features: