mirror of
https://github.com/USCMig/twikit.git
synced 2026-04-27 07:45:54 +03:00
[PR #1] Fix Twitter/X authentication errors via session persistence and endpoint updates #1
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/twikit-USCMig#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/USCMig/twikit/pull/1
Author: @Copilot
Created: 1/31/2026
Status: 🔄 Open
Base:
main← Head:copilot/add-export-bookmarks-script📝 Commits (9)
73cbe72Initial plane314e4aAdd export_bookmarks.py script with documentation6a7465eAdd defensive error handling to export_bookmarks.pycde5801Update .gitignore to exclude pycache3f4c215Add test script for export_bookmarks.py validation61e8c3aAdd clarifying comments based on code review feedback3a07c21Fix 403 authentication error with cookie-based session managementd407835Add comprehensive troubleshooting guide for authentication issues14efccaFix 404 error by updating onboarding API endpoints to internal API paths📊 Changes
7 files changed (+917 additions, -3 deletions)
View changed files
➕
.env.example(+7 -0)📝
.gitignore(+5 -1)➕
scripts/README.md(+124 -0)➕
scripts/TROUBLESHOOTING.md(+291 -0)➕
scripts/export_bookmarks.py(+326 -0)➕
scripts/test_export_bookmarks.py(+162 -0)📝
twikit/client/v11.py(+2 -2)📄 Description
Twitter/X login was failing with 403 (rate limiting from repeated logins) and 404 (deprecated endpoint paths).
Changes
Session persistence prevents 403 rate limits
export_bookmarks.py: Addcookies_fileparameter toclient.login()OUTPUT_DIRECTORY/twitter_session.jsonAPI endpoint migration fixes 404s
twikit/client/v11.py: Update onboarding endpoints from public API to internal API patternONBOARDING_TASK:https://api.x.com/1.1/onboarding/task.json→https://x.com/i/api/1.1/onboarding/task.jsonONBOARDING_SSO_INIT: Similar migration to/i/api/pathx.com/i/apiwhile public data usesapi.x.comError handling and documentation
export_bookmarks.py: Add targeted error messages for 403, 404, 429, 401 with actionable solutionsscripts/TROUBLESHOOTING.md: New 7KB guide covering all auth error scenarios, best practices, session managementscripts/README.md: Add troubleshooting section with session persistence explanationFirst run: authenticates and saves session
Subsequent runs: loads session, no authentication, 2-3s faster, no rate limit risk
Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.