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

Twitter Denying Access for create_tweet() #226

Open
PhatStraw opened this issue Oct 3, 2024 · 4 comments
Open

Twitter Denying Access for create_tweet() #226

PhatStraw opened this issue Oct 3, 2024 · 4 comments

Comments

@PhatStraw
Copy link

PhatStraw commented Oct 3, 2024

await client.create_tweet(text="reply here", reply_to="432432")

gets this error

Traceback (most recent call last):
File "/Users/kevinsims/Code/twitter-automate/index.py", line 141, in
asyncio.run(main())
File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/kevinsims/Code/twitter-automate/index.py", line 51, in main
await client.create_tweet("testinggg")
File "/opt/homebrew/lib/python3.12/site-packages/twikit/client/client.py", line 1241, in create_tweet
_result = response['data']['create_tweet']['tweet_results']

@PhatStraw
Copy link
Author

Looks like twitter is restricting usage

added a print to twitkit/client/client.py
python response, _ = await self.gql.create_tweet( is_note_tweet, text, media_entities, poll_uri, reply_to, attachment_url, community_id, share_with_followers, richtext_options, edit_tweet_id, limit_mode ) print(response) _result = response['data']['create_tweet']['tweet_results']

Got
python {'errors': [{'message': "Authorization: This request looks like it might be automated. To protect our users from spam and other malicious activity, we can't complete this action right now. Please try again later. (226)", 'locations': [{'line': 18, 'column': 3}], 'path': ['create_tweet'], 'extensions': {'name': 'AuthorizationError', 'source': 'Client', 'code': 226, 'kind': 'Permissions', 'tracing': {'trace_id': '036e71f21ad8f53d'}}, 'code': 226, 'kind': 'Permissions', 'nam'}}]

@PhatStraw PhatStraw changed the title Create Tweet not working Twitter Denying Access for create_tweet() Oct 4, 2024
@CoderMike1
Copy link

same problem

@AritzUMA
Copy link

I have the same proble, sometimes the crate_tweet funtion fails

Error al enviar el tweet: 'create_tweet'
Traceback (most recent call last):
File "c:\proyectos\monitoreo de grupos de interés twitter\lobby_spain_twitter.py", line 266, in main
tweet = await client.create_tweet(text, reply_to=reply_to)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USUARIO\anaconda3\Lib\site-packages\twikit\client\client.py", line 1241, in create_tweet
_result = response['data']['create_tweet']['tweet_results']
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'create_tweet'

@muhammad-usama-aleem
Copy link

did anyone find any fix for this?

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

4 participants