tweepy-self 1.6.0__tar.gz → 1.6.2__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/PKG-INFO +1 -1
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/pyproject.toml +1 -1
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/twitter/client.py +14 -4
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/README.md +0 -0
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/twitter/__init__.py +0 -0
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/twitter/account.py +0 -0
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/twitter/base/__init__.py +0 -0
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/twitter/base/client.py +0 -0
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/twitter/base/session.py +0 -0
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/twitter/enums.py +0 -0
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/twitter/errors.py +0 -0
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/twitter/models.py +0 -0
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/twitter/utils/__init__.py +0 -0
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/twitter/utils/file.py +0 -0
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/twitter/utils/html.py +0 -0
- {tweepy_self-1.6.0 → tweepy_self-1.6.2}/twitter/utils/other.py +0 -0
@@ -388,7 +388,7 @@ class Client(BaseClient):
|
|
388
388
|
self,
|
389
389
|
image: bytes,
|
390
390
|
attempts: int = 3,
|
391
|
-
timeout: float | tuple[float, float] =
|
391
|
+
timeout: float | tuple[float, float] = 10,
|
392
392
|
) -> int:
|
393
393
|
"""
|
394
394
|
Upload image as bytes.
|
@@ -409,8 +409,18 @@ class Client(BaseClient):
|
|
409
409
|
)
|
410
410
|
media_id = response_json["media_id"]
|
411
411
|
return media_id
|
412
|
-
except HTTPException as exc:
|
413
|
-
if
|
412
|
+
except (HTTPException, requests.errors.RequestsError) as exc:
|
413
|
+
if (
|
414
|
+
attempt < attempts - 1
|
415
|
+
and (
|
416
|
+
isinstance(exc, requests.errors.RequestsError)
|
417
|
+
and exc.code == 28
|
418
|
+
)
|
419
|
+
or (
|
420
|
+
isinstance(exc, HTTPException)
|
421
|
+
and exc.response.status_code == 408
|
422
|
+
)
|
423
|
+
):
|
414
424
|
continue
|
415
425
|
else:
|
416
426
|
raise
|
@@ -595,7 +605,7 @@ class Client(BaseClient):
|
|
595
605
|
tweets = await self.request_tweets(self.account.id)
|
596
606
|
duplicate_tweet = None
|
597
607
|
for tweet_ in tweets:
|
598
|
-
if tweet_.full_text
|
608
|
+
if tweet_.full_text.startswith(text.strip()):
|
599
609
|
duplicate_tweet = tweet_
|
600
610
|
|
601
611
|
if not duplicate_tweet:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|