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

Is there a way to get groups as list and not as coroutine? #223

Open
Jaden024 opened this issue Nov 23, 2024 · 7 comments
Open

Is there a way to get groups as list and not as coroutine? #223

Jaden024 opened this issue Nov 23, 2024 · 7 comments

Comments

@Jaden024
Copy link

Jaden024 commented Nov 23, 2024

Is there a way to get groups as list and not as coroutine?

In other words, is there a way to use synced version of tweety?

@Jaden024
Copy link
Author

Jaden024 commented Nov 24, 2024

Idk if the synced version is going to be supported or updated, but the async update definitely messed up the synced flow, the lists are coroutines now and some action like .add_member_to_group and .follow_user want to required to be awaited

@Jaden024
Copy link
Author

Also, I think add_member_to_group action does not work at all

@mahrtayyab
Copy link
Owner

Sync is just a little hack , may not work for all methods , I will try to improve it but can't guarantee.

image
What do mean by "get groups"?

@mahrtayyab
Copy link
Owner

Pushed an improved sync version, do consider upgrading.

@Jaden024
Copy link
Author

Sync is just a little hack , may not work for all methods , I will try to improve it but can't guarantee.

image What do mean by "get groups"?

What I meant is the .get_inbox method, it also can't run through sync, I didn't check after the update though

@Jaden024
Copy link
Author

Jaden024 commented Nov 25, 2024

get_inbox works now, but when logging in and adding subscribing to user gives me an error "invalid cookies"

Here's the function I made that gives me this error:

def add_to_friends(acc_str, user_to_add):

            acc_name, email, password, proxy_str, auth_token = acc_str

            try:

                proxy_ip, proxy_port, proxy_user, proxy_pass = proxy_str.split(':')

                proxy_url = f'http://{proxy_user}:{proxy_pass}@{proxy_ip}:{proxy_port}'

                app = Twitter(f"{script_dir}/sessions/{acc_name}", proxy=proxy_url)
                app.load_auth_token(auth_token)
                app.connect()

                user = app.get_user_info(user_to_add)

                if not user.following:
                    app.follow_user(user.id)
                    print(f'{acc_name} | ' + colored(f'@{user_to_add} Followed Succesfully', 'green'))
                else:
                    print(f'{acc_name} | ' + colored(f'@{user_to_add} was Already Followed', 'green'))
            except Exception as e:
                print(f'{acc_name} | ' + colored(f'Couldn`t Follow @{user_to_add} | Error: {e}', 'red'))

@mahrtayyab
Copy link
Owner

can you please post full traceback

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

2 participants