Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
feat: update features
Browse files Browse the repository at this point in the history
  • Loading branch information
dsdanielpark committed Nov 29, 2023
1 parent d5b7a77 commit 6e2f88b
Showing 1 changed file with 51 additions and 2 deletions.
53 changes: 51 additions & 2 deletions func_test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,62 @@
"bard = Bard(token=token, session=session, conversation_id=\"c_1f04f704a788e6e4\", timeout=30)\n",
"bard.get_answer(\"나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘\")['content']"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<re.Match object; span=(772688, 772752), match='https://accounts.google.com/ListAccounts?authuser> <re.Match object; span=(776121, 776186), match='https://accounts.google.com/RotateCookiesPage\"],3>\n",
"authuser=0&pid=658\n",
"og_pid: 658\n",
"Values array: [3, 0, 1, 0, 3701177, 0]\n",
"rot: 3\n",
"exp_id: 3701177\n",
"<!DOCTYPE html><html><body><script src='https://www.gstatic.com/_/mss/boq-identity/_/js/k=boq-identity.IdentityRotateCookiesHttp.ko.vFNyU-Lk-tA.es5.O/am=CAM/d=1/rs=AOaEmlFQpSkPkGpokh2AASCcHGhCfPB_lA/m=hfcr' nonce=\"fwfOvIr5QKiEzxtYQuaRvg\"></script><script nonce=\"fwfOvIr5QKiEzxtYQuaRvg\">init('-7546079642772715825', 658.0 , 0.0 , 0.0 , 600.0 , false )</script></body></html>\n",
"['-7546079642772715825']\n",
"New cookies: {'__Secure-1PSIDTS': 'sidts-CjEBNiGH7ldEz633gURuY8PfjdJ4UNDlxnz-8Ii6G_j16helunBkZzzTHkTcyRXfvJvsEAA', 'Domain': '.google.com', 'Expires': 'Thu, 28-Nov-2024 02:01:26 GMT', 'Path': '/', 'Priority': 'HIGH', 'SameParty, __Secure-3PSIDTS': 'sidts-CjEBNiGH7ldEz633gURuY8PfjdJ4UNDlxnz-8Ii6G_j16helunBkZzzTHkTcyRXfvJvsEAA', 'expires': 'Thu, 28-Nov-2024 02:01:26 GMT', 'path': '/', 'domain': '.google.com', 'priority': 'high', 'SameSite': 'none'}\n",
"sidts-CjEBNiGH7ldEz633gURuY8PfjdJ4UNDlxnz-8Ii6G_j16helunBkZzzTHkTcyRXfvJvsEAA\n",
"None\n",
"None\n"
]
}
],
"source": [
"from bardapi import Bard, SESSION_HEADERS\n",
"import requests\n",
"session = requests.Session()\n",
"token = '-'\n",
"session.cookies.set(\"__Secure-1PSID\", token)\n",
"session.cookies.set( \"__Secure-1PSIDCC\", \"-\")\n",
"session.cookies.set(\"__Secure-1PSIDTS\", \"-\")\n",
"session.headers = SESSION_HEADERS\n",
"bard = Bard(token=token, session=session, timeout=30)\n",
"\n",
"new_cookies = bard.update_1PSIDTS()\n",
"print('New cookies:', new_cookies)\n",
"print(new_cookies.get(\"__Secure-1PSIDTS\"))\n",
"print(new_cookies.get(\"__Secure-1PSIDCC\"))\n",
"print(new_cookies.get(\"__Secure-3PSIDTS\"))\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "mxnet",
"display_name": "cc",
"language": "python",
"name": "mxnet"
"name": "cc"
},
"language_info": {
"codemirror_mode": {
Expand Down

0 comments on commit 6e2f88b

Please sign in to comment.