Version 2.0.0
Version 2.0.0 has been released
Twikit version 2.0.0 has been released. From this version, the synchronous version has been discontinued and only the asynchronous version is available. Also, twikit.twikit_async
module has been renamed to twikit
.
To update run pip install -U twikit
.
Example Code for version 2:
import asyncio
import os
# No need to write "from twikit.twikit_async import Client"
from twikit import Client
client = Client()
async def main():
if not os.path.exists('cookies.json'):
await client.login(
auth_info_1='example',
auth_info_2='email@example.com',
password='example0000'
)
client.save_cookies('cookies.json')
else:
client.load_cookies('cookies.json')
client.create_tweet('Hello World.')
asyncio.run(main())
More usage examples: https://github.com/d60/twikit/tree/main/examples
Documentation: https://twikit.readthedocs.io/en/latest/twikit.html
Minor Changes and Bug Fixes:
- Removed
Result.cursor
andResult.token
. - Changed the return type of
follow_user
,unfollow_user
,mute_user
,block_user
,unblock_user
andunmute_user
fromhttpx.Response
toUser
. - Fixed a bug where the capsolver proxy was not specified.