Skip to content

Pass effective proxy to XClIdGen - #319

Merged
vladkens merged 2 commits into
vladkens:mainfrom
kn1l:fix-xclid-proxy
Jul 21, 2026
Merged

Pass effective proxy to XClIdGen#319
vladkens merged 2 commits into
vladkens:mainfrom
kn1l:fix-xclid-proxy

Conversation

@kn1l

@kn1l kn1l commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Pass the effective account proxy to the XClIdGen asset client.

Previously, GraphQL requests could use the configured account/API proxy, but XClIdGen.create() created a separate HTTP client without
proxy settings. That client fetches x.com and abs.twimg.com assets before the GraphQL request is sent, so requests could fail in
environments where direct access to those hosts is blocked or unstable even when the account proxy works.

This change:

  • adds Account.resolve_proxy() to reuse the same proxy resolution order as Account.make_client()
  • passes the resolved proxy into XClIdGen.create()
  • includes proxy in the XClIdGenStore cache key to avoid reusing generators across different proxy contexts

Tests

  • uv run pytest
  • uv run ruff check .
  • uv run ty check

@vladkens

Copy link
Copy Markdown
Owner

Thanks, this is a great improvement! Congrats on your first contribution to twscrape 🎉

@vladkens
vladkens merged commit 441f088 into vladkens:main Jul 21, 2026
5 checks passed
@kn1l
kn1l deleted the fix-xclid-proxy branch July 22, 2026 02:42
@ironspidernft

This comment was marked as spam.

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.

3 participants