gemini-webapi 1.8.2__py3-none-any.whl → 1.8.3__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,
@@ -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.3
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">
@@ -1,19 +1,19 @@
1
1
  gemini_webapi/__init__.py,sha256=28uNIywK4vCXxENaSagNWUzhqr1RyNtLzDF6WRRM4KQ,194
2
- gemini_webapi/client.py,sha256=sw95MQu5hozKSCI4_bzzRgnyBKUPTHnnOOUtRY7sg5M,22731
2
+ gemini_webapi/client.py,sha256=PPr8hZljMKOxszKFJihvqUZaMV0eSNJ-X2d4Hvz7jFU,22759
3
3
  gemini_webapi/constants.py,sha256=xwWz2epimU_njyBe8yy-zCT69-TKn5RdPJxMn3pAqzQ,2178
4
4
  gemini_webapi/exceptions.py,sha256=6e-EXHGApi4iC0GDw7RKc3YqVK8UvEkHYaJyGQbReLw,548
5
5
  gemini_webapi/types/__init__.py,sha256=d2kvXnE004s2E2KDmPPLi5N-BQ59FgDSlrGrO3Wphww,163
6
6
  gemini_webapi/types/candidate.py,sha256=Z9bpIK4l8UWbUVMLEoophfhgROo93dxOM9cAwx77CkU,1030
7
- gemini_webapi/types/image.py,sha256=9l4_k4C3RPFOgGIVnPnTAKYmUISdvdx_LwvcJYJNLuo,5225
7
+ gemini_webapi/types/image.py,sha256=4BC8hxAWJrYFwzA60CivF1di4RZkzPKjcaSPPFKmRdY,5237
8
8
  gemini_webapi/types/modeloutput.py,sha256=sGEnaQtSOJE68ve5R5sFgW4POmsyWZAV5zei3Z4BRVk,1090
9
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
10
+ gemini_webapi/utils/get_access_token.py,sha256=uyb6tuzPr3mHttCjiM86M29ykrnHqsUClYdf5sVkyEQ,5465
11
11
  gemini_webapi/utils/load_browser_cookies.py,sha256=A5n_VsB7Rm8ck5lpy856UNJEhv30l3dvQ3j0g3ln1fE,1535
12
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,,
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.3.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
16
+ gemini_webapi-1.8.3.dist-info/METADATA,sha256=lZqJydIDM3exH41EOiw9L7Kr2EmuZAEctvhsS_k3amc,57152
17
+ gemini_webapi-1.8.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
18
+ gemini_webapi-1.8.3.dist-info/top_level.txt,sha256=dtWtug_ZrmnUqCYuu8NmGzTgWglHeNzhHU_hXmqZGWE,14
19
+ gemini_webapi-1.8.3.dist-info/RECORD,,