gemini-webapi 1.8.2__py3-none-any.whl → 1.8.4__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
@@ -174,6 +174,7 @@ class GeminiClient:
174
174
  )
175
175
 
176
176
  self.client = AsyncClient(
177
+ http2=True,
177
178
  timeout=timeout,
178
179
  proxy=self.proxy,
179
180
  follow_redirects=True,
@@ -27,7 +27,7 @@ class Model(Enum):
27
27
  UNSPECIFIED = ("unspecified", {}, False)
28
28
  G_1_5_FLASH = (
29
29
  "gemini-1.5-flash",
30
- {"x-goog-ext-525001261-jspb": '[null,null,null,null,"7daceb7ef88130f5"]'},
30
+ {"x-goog-ext-525001261-jspb": '[null,null,null,null,"418ab5ea040b5c43"]'},
31
31
  False,
32
32
  )
33
33
  G_1_5_PRO = (
@@ -42,7 +42,7 @@ class Model(Enum):
42
42
  )
43
43
  G_2_0_FLASH_EXP = (
44
44
  "gemini-2.0-flash-exp",
45
- {"x-goog-ext-525001261-jspb": '[null,null,null,null,"948b866104ccf484"]'},
45
+ {"x-goog-ext-525001261-jspb": '[null,null,null,null,"f299729663a2343f"]'},
46
46
  False,
47
47
  )
48
48
  G_2_0_EXP_ADVANCED = (
@@ -80,7 +80,7 @@ class Image(BaseModel):
80
80
  return None
81
81
 
82
82
  async with AsyncClient(
83
- follow_redirects=True, cookies=cookies, proxy=self.proxy
83
+ http2=True, follow_redirects=True, cookies=cookies, proxy=self.proxy
84
84
  ) as client:
85
85
  response = await client.get(self.url)
86
86
  if response.status_code == 200:
@@ -47,6 +47,7 @@ async def get_access_token(
47
47
 
48
48
  async def send_request(cookies: dict) -> tuple[Response | None, dict]:
49
49
  async with AsyncClient(
50
+ http2=True,
50
51
  proxy=proxy,
51
52
  headers=Headers.GEMINI.value,
52
53
  cookies=cookies,
@@ -39,7 +39,7 @@ async def rotate_1psidts(cookies: dict, proxy: str | None = None) -> str:
39
39
 
40
40
  # Check if the cache file was modified in the last minute to avoid 429 Too Many Requests
41
41
  if not (path.is_file() and time.time() - os.path.getmtime(path) <= 60):
42
- async with AsyncClient(proxy=proxy) as client:
42
+ async with AsyncClient(http2=True, proxy=proxy) as client:
43
43
  response = await client.post(
44
44
  url=Endpoint.ROTATE_COOKIES.value,
45
45
  headers=Headers.ROTATE_COOKIES.value,
@@ -34,7 +34,7 @@ async def upload_file(file: bytes | str | Path, proxy: str | None = None) -> str
34
34
  with open(file, "rb") as f:
35
35
  file = f.read()
36
36
 
37
- async with AsyncClient(proxy=proxy) as client:
37
+ async with AsyncClient(http2=True, proxy=proxy) as client:
38
38
  response = await client.post(
39
39
  url=Endpoint.UPLOAD.value,
40
40
  headers=Headers.UPLOAD.value,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gemini-webapi
3
- Version: 1.8.2
3
+ Version: 1.8.4
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
@@ -676,9 +676,9 @@ Classifier: Programming Language :: Python :: 3.12
676
676
  Requires-Python: >=3.10
677
677
  Description-Content-Type: text/markdown
678
678
  License-File: LICENSE
679
- Requires-Dist: httpx~=0.28.0
680
- Requires-Dist: pydantic~=2.10.2
681
- Requires-Dist: loguru~=0.7.2
679
+ Requires-Dist: httpx[http2]~=0.28.1
680
+ Requires-Dist: pydantic~=2.10.5
681
+ Requires-Dist: loguru~=0.7.3
682
682
 
683
683
  <p align="center">
684
684
  <img src="https://raw.githubusercontent.com/HanaokaYuzu/Gemini-API/master/assets/banner.png" width="55%" alt="Gemini Banner" align="center">
@@ -942,9 +942,9 @@ asyncio.run(main())
942
942
 
943
943
  You can choose a specified language model version by passing `model` argument to `GeminiClient.generate_content` or `GeminiClient.start_chat`. The default value is `unspecified`.
944
944
 
945
- Currently available models (as of Dec 21, 2024):
945
+ Currently available models (as of Feb 1, 2025):
946
946
 
947
- - `unspecified` - Default model (Gemini 1.5 Pro if account has Gemini Advanced subscription, otherwise Gemini 1.5 Flash)
947
+ - `unspecified` - Default model (Gemini 2.0 Flash if account does NOT have Gemini Advanced subscription)
948
948
  - `gemini-1.5-flash` - Gemini 1.5 Flash
949
949
  - `gemini-1.5-pro` - Gemini 1.5 Pro **(requires Gemini Advanced account)**
950
950
  - `gemini-1.5-pro-research` - Gemini 1.5 Pro with Deep Research **(requires Gemini Advanced account)**
@@ -0,0 +1,19 @@
1
+ gemini_webapi/__init__.py,sha256=28uNIywK4vCXxENaSagNWUzhqr1RyNtLzDF6WRRM4KQ,194
2
+ gemini_webapi/client.py,sha256=PPr8hZljMKOxszKFJihvqUZaMV0eSNJ-X2d4Hvz7jFU,22759
3
+ gemini_webapi/constants.py,sha256=_glqlB6Wy_VDi7h6ruorGGdtoyKfVg6shYfA_BAT9Q4,2178
4
+ gemini_webapi/exceptions.py,sha256=6e-EXHGApi4iC0GDw7RKc3YqVK8UvEkHYaJyGQbReLw,548
5
+ gemini_webapi/types/__init__.py,sha256=d2kvXnE004s2E2KDmPPLi5N-BQ59FgDSlrGrO3Wphww,163
6
+ gemini_webapi/types/candidate.py,sha256=Z9bpIK4l8UWbUVMLEoophfhgROo93dxOM9cAwx77CkU,1030
7
+ gemini_webapi/types/image.py,sha256=4BC8hxAWJrYFwzA60CivF1di4RZkzPKjcaSPPFKmRdY,5237
8
+ gemini_webapi/types/modeloutput.py,sha256=sGEnaQtSOJE68ve5R5sFgW4POmsyWZAV5zei3Z4BRVk,1090
9
+ gemini_webapi/utils/__init__.py,sha256=mcm1kgQ5HHKyZrhHS-rd_GXbKMpIDUsq02XtmlQNN_I,357
10
+ gemini_webapi/utils/get_access_token.py,sha256=uyb6tuzPr3mHttCjiM86M29ykrnHqsUClYdf5sVkyEQ,5465
11
+ gemini_webapi/utils/load_browser_cookies.py,sha256=A5n_VsB7Rm8ck5lpy856UNJEhv30l3dvQ3j0g3ln1fE,1535
12
+ gemini_webapi/utils/logger.py,sha256=PF4ROQq7scRRrWzeYdeYiYs2S2Jqr0bgjyrPbXVOCqE,816
13
+ gemini_webapi/utils/rotate_1psidts.py,sha256=NyQ9OYPLBOcvpc8bodvEYDIVFrsYN0kdfc831lPEctM,1680
14
+ gemini_webapi/utils/upload_file.py,sha256=A-ZQ54gy2wOVA_giEEVLQQK5zTJfrgq99Z5YYYOAFYc,1163
15
+ gemini_webapi-1.8.4.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
16
+ gemini_webapi-1.8.4.dist-info/METADATA,sha256=zKj_zbFMsF1Gkm2VEsIkXX6Zab_x6dBNpPwjsz1efZQ,57135
17
+ gemini_webapi-1.8.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
18
+ gemini_webapi-1.8.4.dist-info/top_level.txt,sha256=dtWtug_ZrmnUqCYuu8NmGzTgWglHeNzhHU_hXmqZGWE,14
19
+ gemini_webapi-1.8.4.dist-info/RECORD,,
@@ -1,19 +0,0 @@
1
- gemini_webapi/__init__.py,sha256=28uNIywK4vCXxENaSagNWUzhqr1RyNtLzDF6WRRM4KQ,194
2
- gemini_webapi/client.py,sha256=sw95MQu5hozKSCI4_bzzRgnyBKUPTHnnOOUtRY7sg5M,22731
3
- gemini_webapi/constants.py,sha256=xwWz2epimU_njyBe8yy-zCT69-TKn5RdPJxMn3pAqzQ,2178
4
- gemini_webapi/exceptions.py,sha256=6e-EXHGApi4iC0GDw7RKc3YqVK8UvEkHYaJyGQbReLw,548
5
- gemini_webapi/types/__init__.py,sha256=d2kvXnE004s2E2KDmPPLi5N-BQ59FgDSlrGrO3Wphww,163
6
- gemini_webapi/types/candidate.py,sha256=Z9bpIK4l8UWbUVMLEoophfhgROo93dxOM9cAwx77CkU,1030
7
- gemini_webapi/types/image.py,sha256=9l4_k4C3RPFOgGIVnPnTAKYmUISdvdx_LwvcJYJNLuo,5225
8
- gemini_webapi/types/modeloutput.py,sha256=sGEnaQtSOJE68ve5R5sFgW4POmsyWZAV5zei3Z4BRVk,1090
9
- gemini_webapi/utils/__init__.py,sha256=mcm1kgQ5HHKyZrhHS-rd_GXbKMpIDUsq02XtmlQNN_I,357
10
- gemini_webapi/utils/get_access_token.py,sha256=h0gcCCQZzVStE4sgUS_jjMVGYQT_20LK2HX5jcIriWs,5441
11
- gemini_webapi/utils/load_browser_cookies.py,sha256=A5n_VsB7Rm8ck5lpy856UNJEhv30l3dvQ3j0g3ln1fE,1535
12
- gemini_webapi/utils/logger.py,sha256=PF4ROQq7scRRrWzeYdeYiYs2S2Jqr0bgjyrPbXVOCqE,816
13
- gemini_webapi/utils/rotate_1psidts.py,sha256=cwCXsE_mX2knaKCuquZT2jsRXHQo-GK2Ldom-cO9Gio,1668
14
- gemini_webapi/utils/upload_file.py,sha256=X0k-3jW7usheFo5z0nXL9mUt-XF-2L2OgwpJnPSIcKw,1151
15
- gemini_webapi-1.8.2.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
16
- gemini_webapi-1.8.2.dist-info/METADATA,sha256=F-t_Ea1rhbotXoCzXp2BlCZZQ8__7kej6zuVI6DI_hc,57145
17
- gemini_webapi-1.8.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
18
- gemini_webapi-1.8.2.dist-info/top_level.txt,sha256=dtWtug_ZrmnUqCYuu8NmGzTgWglHeNzhHU_hXmqZGWE,14
19
- gemini_webapi-1.8.2.dist-info/RECORD,,