8000 Fix: prevent KeyError when removing 'content-type' header in media up… by lord-dubious · Pull Request #353 · d60/twikit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: prevent KeyError when removing 'content-type' header in media up… #353

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
10000
Diff view
Diff view
14 changes: 4 additions & 10 deletions twikit/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2371,7 +2371,7 @@ async def edit_bookmark_folder(

Returns
-------
:class:`BookmarkFolder`
:class:`BookmarkFolder`
Updated bookmark folder.

Examples
Expand Down Expand Up @@ -3580,12 +3580,6 @@ async def get_list_tweets(
...

>>> more_tweets = await tweets.next() # Retrieve more tweets
>>> for tweet in more_tweets:
... print(tweet)
<Tweet id="...">
<Tweet id="...">
...
...
"""
response, _ = await self.gql.list_latest_tweets_timeline(list_id, count, cursor)

Expand Down Expand Up @@ -4213,7 +4207,7 @@ async def _stream(self, topics: set[str]) -> AsyncGenerator[tuple[str, Payload]]
url = f'https://api.{DOMAIN}/live_pipeline/events'
params = {'topics': ','.join(topics)}
headers = self._base_headers
headers.pop('content-type')
headers.pop('content-type', None)

async with self.http.stream('GET', url, params=params, headers=headers, timeout=None) as response:
self._remove_duplicate_ct0_cookie()
Expand Down Expand Up @@ -4261,12 +4255,12 @@ async def get_streaming_session(
... user_id = payload.dm_update.user_id
... print(f'{conversation_id}: {user_id} sent a message')
>>>
>>> if payload.dm_typing:
... if payload.dm_typing:
... conversation_id = payload.dm_typing.conversation_id
... user_id = payload.dm_typing.user_id
... print(f'{conversation_id}: {user_id} is typing')
>>>
>>> if payload.tweet_engagement:
... if payload.tweet_engagement:
... like = payload.tweet_engagement.like_count
... retweet = payload.tweet_engagement.retweet_count
... view = payload.tweet_engagement.view_count
Expand Down
0