Skip to content
This repository was archived by the owner on Jun 12, 2024. It is now read-only.

Commit fc738d5

Browse files
committed
fix: del get reqid method for clean code
1 parent eed73ad commit fc738d5

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

gemini/core.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(
6666
self.session = session or self._initialize_session()
6767
self.base_url: str = HOST
6868
self.nonce = nonce
69-
self._reqid = self.get_reqid()
69+
self._reqid = int("".join(random.choices(string.digits, k=7)))
7070
self.parser = ResponseParser(cookies=self.cookies)
7171

7272
def _initialize_session(
@@ -269,15 +269,6 @@ def extract_sid_nonce(response_text):
269269
nonce_match = re.search(r'"SNlM0e":"(.*?)"', response_text)
270270
return sid_match, nonce_match
271271

272-
@staticmethod
273-
def get_reqid() -> int:
274-
"""
275-
Generates a random 7-digit request ID.
276-
277-
Returns:
278-
int: A random 7-digit integer used as a request ID.
279-
"""
280-
return int("".join(random.choices(string.digits, k=7)))
281272

282273
def _construct_params(self, sid: str) -> str:
283274
"""

0 commit comments

Comments
 (0)