Twikit

Latest version: v2.1.3

Safety actively analyzes 681866 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

2.1.3

- Fixed `KeyError: 'open_account'"`
- `flow name LoginFlow is currently not accessible` has not yet been fixed.

version2.1.0

2.1.0

New Features

- Added `twikit.guest` module, which allows operations such as retrieving users, tweets, and user tweets **without logging in**. You can refer to [`examples/guest.py`](<https://github.com/d60/twikit/blob/main/examples/guest.py>) for usage examples.

- Added `Client.get_user_highlights_tweets`.



**Guest client quickstart**
python
import asyncio

from twikit.guest import GuestClient

client = GuestClient()


async def main():
Activate the client by generating a guest token.
await client.activate()

Get user by screen name
user = await client.get_user_by_screen_name('elonmusk')
print(user)
Get user by ID
user = await client.get_user_by_id('44196397')
print(user)


user_tweets = await client.get_user_tweets('44196397')
print(user_tweets)

tweet = await client.get_tweet_by_id('1519480761749016577')
print(tweet)

asyncio.run(main())


version2.0.0

2.0.0

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:
python
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='emailexample.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` and `Result.token`.
- Changed the return type of `follow_user`, `unfollow_user`, `mute_user`, `block_user`, `unblock_user` and `unmute_user` from `httpx.Response` to `User`.
- Fixed a bug where the capsolver proxy was not specified.

version1.7.6
Tweet.state → Tweet.view_count_state

version1.7.3


version1.7.1
Added totp_secret parameter to the login method for handling two-factor authentication

version1.7.0

1.7.0

Added
- Account auto unlock
Added the ability to automatically unlock accounts using Captcha Solver.
<https://twikit.readthedocs.io/en/latest/twikit.html#twikit._captcha.capsolver.Capsolver>

Removed
- Random User Agent Generation
Discontinued random User Agent generation.
- Client.get_media
This method has been removed.

Deprecated
- proxies Argument
The proxies argument in `Client` is now deprecated. Use `proxy` instead.

version1.6.4
Added `Client.reverse_geocode`, `Client.search_geo`, `Client.get_place`, `Place`

version1.6.3
Added get_latest_followers, get_latest_friends, get_followers_ids, get_friends_ids

version1.6.1
Added get_place_trends, get_available_locations, TweetEngagementEvent.reply_count

version1.6.0
Now supports the streaming API.
You can receive real-time events such as tweet engagements updates, DM updates, and DM typings.
For more information and usage examples, see the [document](https://twikit.readthedocs.io/en/latest/twikit.html#streaming).

version1.5.13


version1.5.11
Fixed Tweet.full_text, Tweet.urls

Version1.5.8


version1.5.6
Added bookmark folder features.
(Twitter Premium user ony)

version1.5.4
Added some features for Twitter Premium.

version1.5.3


version1.4.9


version1.4.8


version1.4.7
Added `Client.create_media_metadata` method.

version1.4.6


version1.4.5


version1.4.4

1.4.4

Added `TooManyRequests.rate_limit_reset`.

python
try:
client.get_user_tweets('44196397', 'Tweets')
except TooManyRequests as e:
print(f'rate limit is reset after {e.rate_limit_reset - time.time()} seconds.')

rate limit is reset after 250.506977558136 seconds.


version1.4.3

1.4.3

Added `Client.set_delegate_account` method, enabling manipulation of delegated accounts.
Example:
python
client.set_delegate_account('00000000000')
client.create_tweet('Hello, World') Tweet as user 00000000000

client.set_delegate_account(None) Revert back to the original user


version1.4.1
Added `Result.previous`

version1.3.16


version1.3.14


version1.3.13

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.