tweepy-self 1.6.1__tar.gz → 1.6.2__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tweepy-self
3
- Version: 1.6.1
3
+ Version: 1.6.2
4
4
  Summary: Twitter (selfbot) for Python!
5
5
  Author: Alen
6
6
  Author-email: alen.kimov@gmail.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "tweepy-self"
3
- version = "1.6.1"
3
+ version = "1.6.2"
4
4
  description = "Twitter (selfbot) for Python!"
5
5
  authors = ["Alen <alen.kimov@gmail.com>"]
6
6
  readme = "README.md"
@@ -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] = None,
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 attempt < attempts - 1 and exc.response.status_code == 408:
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
File without changes