From 6e2f88b69ff11d7a51fa3db318a1111c8ea68101 Mon Sep 17 00:00:00 2001 From: parkminwoo Date: Wed, 29 Nov 2023 11:55:24 +0900 Subject: [PATCH] feat: update features --- func_test.ipynb | 53 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/func_test.ipynb b/func_test.ipynb index 4e1797e17..4db44212d 100644 --- a/func_test.ipynb +++ b/func_test.ipynb @@ -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": [ + "\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", + "\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": {