gemini-webapi 1.11.0__py3-none-any.whl → 1.11.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
gemini_webapi/client.py CHANGED
@@ -16,6 +16,7 @@ from .exceptions import (
16
16
  GeminiError,
17
17
  UsageLimitExceeded,
18
18
  ModelInvalid,
19
+ TemporarilyBlocked,
19
20
  )
20
21
  from .types import WebImage, GeneratedImage, Candidate, ModelOutput
21
22
  from .utils import (
@@ -395,6 +396,10 @@ class GeminiClient:
395
396
  "Failed to generate contents. The specified model is not available. Please update gemini_webapi to the latest version. "
396
397
  "If the error persists and is caused by the package, please report it on GitHub."
397
398
  )
399
+ case ErrorCode.IP_TEMPORARILY_BLOCKED:
400
+ raise TemporarilyBlocked(
401
+ "Failed to generate contents. Your IP address is temporarily blocked by Google. Please try using a proxy or waiting for a while."
402
+ )
398
403
  case _:
399
404
  raise Exception
400
405
  except GeminiError:
@@ -78,3 +78,4 @@ class ErrorCode(Enum):
78
78
 
79
79
  USAGE_LIMIT_EXCEEDED = 1037
80
80
  MODEL_HEADER_INVALID = 1052
81
+ IP_TEMPORARILY_BLOCKED = 1060
@@ -44,3 +44,11 @@ class ModelInvalid(GeminiError):
44
44
  """
45
45
 
46
46
  pass
47
+
48
+
49
+ class TemporarilyBlocked(GeminiError):
50
+ """
51
+ Exception for 429 Too Many Requests when IP is temporarily blocked.
52
+ """
53
+
54
+ pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gemini-webapi
3
- Version: 1.11.0
3
+ Version: 1.11.1
4
4
  Summary: ✨ An elegant async Python wrapper for Google Gemini web app
5
5
  Author: UZQueen
6
6
  License: GNU AFFERO GENERAL PUBLIC LICENSE
@@ -1,7 +1,7 @@
1
1
  gemini_webapi/__init__.py,sha256=28uNIywK4vCXxENaSagNWUzhqr1RyNtLzDF6WRRM4KQ,194
2
- gemini_webapi/client.py,sha256=C3xSlhEniIlKciaT_lgpnGgsGWXcFUMZsb1l9zq_3vQ,24127
3
- gemini_webapi/constants.py,sha256=cHOm0kPdVGYORYkA3Qzv6QpnfyvrT3-Y9zwc_auAViE,2496
4
- gemini_webapi/exceptions.py,sha256=3TnwWlUjM9uCL6Ug7H9qF4P0juS6XXZPk8ZGtFtyrJk,783
2
+ gemini_webapi/client.py,sha256=waD8cnC8ol00T64F9NHihB43Wxzui9guYwrOpTvGw-8,24460
3
+ gemini_webapi/constants.py,sha256=xQloL6yHngniVEX5UnrsEKGTmMAieqxH7UUceefUVd8,2530
4
+ gemini_webapi/exceptions.py,sha256=7p6R5WZsAgwmggqoTM3No0i76PhYbPAFBdS7iqBExLE,922
5
5
  gemini_webapi/types/__init__.py,sha256=d2kvXnE004s2E2KDmPPLi5N-BQ59FgDSlrGrO3Wphww,163
6
6
  gemini_webapi/types/candidate.py,sha256=dMoGr53WR7FYDRrXpG9Yd_n9YTHGwGaFHZ8zPt8RMWw,1178
7
7
  gemini_webapi/types/image.py,sha256=4BC8hxAWJrYFwzA60CivF1di4RZkzPKjcaSPPFKmRdY,5237
@@ -12,8 +12,8 @@ gemini_webapi/utils/load_browser_cookies.py,sha256=A5n_VsB7Rm8ck5lpy856UNJEhv30l
12
12
  gemini_webapi/utils/logger.py,sha256=PF4ROQq7scRRrWzeYdeYiYs2S2Jqr0bgjyrPbXVOCqE,816
13
13
  gemini_webapi/utils/rotate_1psidts.py,sha256=NyQ9OYPLBOcvpc8bodvEYDIVFrsYN0kdfc831lPEctM,1680
14
14
  gemini_webapi/utils/upload_file.py,sha256=SJOMr6kryK_ClrKmqI96fqZBNFOMPsyAvFINAGAU3rk,1468
15
- gemini_webapi-1.11.0.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
16
- gemini_webapi-1.11.0.dist-info/METADATA,sha256=qVE4s3uC1iiON3ce25m9gsWKxL4xFLK21laFHLL2mBI,57167
17
- gemini_webapi-1.11.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
18
- gemini_webapi-1.11.0.dist-info/top_level.txt,sha256=dtWtug_ZrmnUqCYuu8NmGzTgWglHeNzhHU_hXmqZGWE,14
19
- gemini_webapi-1.11.0.dist-info/RECORD,,
15
+ gemini_webapi-1.11.1.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
16
+ gemini_webapi-1.11.1.dist-info/METADATA,sha256=ClvGwberW9SgN8v81Zz0t0drx1ulluD6WQclybfzKnY,57167
17
+ gemini_webapi-1.11.1.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
18
+ gemini_webapi-1.11.1.dist-info/top_level.txt,sha256=dtWtug_ZrmnUqCYuu8NmGzTgWglHeNzhHU_hXmqZGWE,14
19
+ gemini_webapi-1.11.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (79.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5