Skip to content
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

Add proxies support #154

Open
obnoxiousish opened this issue Dec 11, 2023 · 5 comments
Open

Add proxies support #154

obnoxiousish opened this issue Dec 11, 2023 · 5 comments

Comments

@obnoxiousish
Copy link

obnoxiousish commented Dec 11, 2023

Hi Trevor thanks for creating this repository, very very helpful for my current project. Also from vancouver <3

But anyways, I was looking at the best way I could use proxies with the Account class, and while the Account class does indeed take a session kwarg it checks to see if the session is authenticated, if I want to authenticate with email user password I could import the Login function and do that and get an authenticated Client

BUT if I do that it will login without the proxy and Login does not accept a session kwarg it creates a Client from HTTPX and even though **kwargs gets passed along to __validate_session and then to login it gets used in execute_login_flow kwargs not the Client kwargs

So I think the best patch would be to include a proxies=kwargs.pop("proxies", None) in Client for the login function

For cookies auth, I recommend adding kwargs.pop('proxies', None) to proxies= for their Clients as well in __validate_session

I might be able to make a pull request but its like a couple lines so i imagine it could be added with ease

Thanks for reading

@seoprodaddy
Copy link

@obnoxiousish How did you get proxies to work for you? I couldn't get it to work for me. Please can you help with how I can subclass Scraper, Account and Search classes so I can use proxies with it?

@obnoxiousish
Copy link
Author

obnoxiousish commented Jan 20, 2024

https://github.com/obnoxiousish/async_twitter_api_client proxy support was added in my async version ( i think it might be missing a couple endpoints, i dont remember, + readme is outdated at time of posting this, uses asyncAuthenticate now instead of ainit

@bayugtt
Copy link

bayugtt commented Jan 28, 2024

i'm new here, thanks for all your write it help me a lot.

but i more explanation, could you share
account.cookies look a like?
where i can write that cookies/account so i can use it without getting notifications on my twitter "logging with new device".

thank in any advance

@obnoxiousish
Copy link
Author

i'm new here, thanks for all your write it help me a lot.

but i more explanation, could you share account.cookies look a like? where i can write that cookies/account so i can use it without getting notifications on my twitter "logging with new device".

thank in any advance

@trevorhobenshield 's official git repo supports saving cookies to file via .save_cookies() or something, look over account.py

@bayugtt
Copy link

bayugtt commented Feb 11, 2024

i'm new here, thanks for all your write it help me a lot.
but i more explanation, could you share account.cookies look a like? where i can write that cookies/account so i can use it without getting notifications on my twitter "logging with new device".
thank in any advance

@trevorhobenshield 's official git repo supports saving cookies to file via .save_cookies() or something, look over account.py

thank, got it.

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

No branches or pull requests

3 participants