gemini-webapi 1.9.0__tar.gz → 1.9.1__tar.gz

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.
Files changed (36) hide show
  1. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/PKG-INFO +3 -2
  2. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi/client.py +11 -12
  3. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi.egg-info/PKG-INFO +3 -2
  4. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/.github/dependabot.yml +0 -0
  5. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/.github/workflows/github-release.yml +0 -0
  6. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/.github/workflows/pypi-publish.yml +0 -0
  7. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/.gitignore +0 -0
  8. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/.vscode/launch.json +0 -0
  9. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/.vscode/settings.json +0 -0
  10. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/LICENSE +0 -0
  11. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/README.md +0 -0
  12. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/assets/banner.png +0 -0
  13. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/assets/favicon.png +0 -0
  14. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/assets/logo.svg +0 -0
  15. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/pyproject.toml +0 -0
  16. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/setup.cfg +0 -0
  17. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi/__init__.py +0 -0
  18. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi/constants.py +0 -0
  19. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi/exceptions.py +0 -0
  20. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi/types/__init__.py +0 -0
  21. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi/types/candidate.py +0 -0
  22. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi/types/image.py +0 -0
  23. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi/types/modeloutput.py +0 -0
  24. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi/utils/__init__.py +0 -0
  25. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi/utils/get_access_token.py +0 -0
  26. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi/utils/load_browser_cookies.py +0 -0
  27. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi/utils/logger.py +0 -0
  28. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi/utils/rotate_1psidts.py +0 -0
  29. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi/utils/upload_file.py +0 -0
  30. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi.egg-info/SOURCES.txt +0 -0
  31. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi.egg-info/dependency_links.txt +0 -0
  32. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi.egg-info/requires.txt +0 -0
  33. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/src/gemini_webapi.egg-info/top_level.txt +0 -0
  34. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/tests/test_client_features.py +0 -0
  35. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/tests/test_rotate_cookies.py +0 -0
  36. {gemini_webapi-1.9.0 → gemini_webapi-1.9.1}/tests/test_save_image.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: gemini-webapi
3
- Version: 1.9.0
3
+ Version: 1.9.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
@@ -679,6 +679,7 @@ License-File: LICENSE
679
679
  Requires-Dist: httpx[http2]~=0.28.1
680
680
  Requires-Dist: pydantic~=2.10.5
681
681
  Requires-Dist: loguru~=0.7.3
682
+ Dynamic: license-file
682
683
 
683
684
  <p align="center">
684
685
  <img src="https://raw.githubusercontent.com/HanaokaYuzu/Gemini-API/master/assets/banner.png" width="55%" alt="Gemini Banner" align="center">
@@ -361,18 +361,17 @@ class GeminiClient:
361
361
  try:
362
362
  response_json = json.loads(response.text.split("\n")[2])
363
363
 
364
- # Plain request
365
- body = json.loads(response_json[0][2])
366
-
367
- if not body[4]:
368
- # Request with thinking models
369
- body = json.loads(response_json[1][2])
370
-
371
- if not body[4]:
372
- # Request with Gemini extensions enabled
373
- body = json.loads(response_json[4][2])
374
-
375
- if not body[4]:
364
+ body = None
365
+ for part in response_json:
366
+ try:
367
+ main_part = json.loads(part[2])
368
+ if main_part[4]:
369
+ body = main_part
370
+ break
371
+ except (IndexError, TypeError, ValueError):
372
+ continue
373
+
374
+ if not body:
376
375
  raise Exception
377
376
  except Exception:
378
377
  await self.close()
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: gemini-webapi
3
- Version: 1.9.0
3
+ Version: 1.9.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
@@ -679,6 +679,7 @@ License-File: LICENSE
679
679
  Requires-Dist: httpx[http2]~=0.28.1
680
680
  Requires-Dist: pydantic~=2.10.5
681
681
  Requires-Dist: loguru~=0.7.3
682
+ Dynamic: license-file
682
683
 
683
684
  <p align="center">
684
685
  <img src="https://raw.githubusercontent.com/HanaokaYuzu/Gemini-API/master/assets/banner.png" width="55%" alt="Gemini Banner" align="center">
File without changes
File without changes
File without changes
File without changes