Hansimov commited on
Commit
bca6285
1 Parent(s): 2cecdc3

:recycle: [Refactor] Remove unnecessary info

Browse files
chathub_request_constructor.py CHANGED
@@ -1,6 +1,5 @@
1
  import random
2
  import uuid
3
- from datetime import datetime
4
 
5
 
6
  class ChathubRequestConstructor:
 
1
  import random
2
  import uuid
 
3
 
4
 
5
  class ChathubRequestConstructor:
conversation_creater.py CHANGED
@@ -1,19 +1,14 @@
1
  import aiohttp
2
  import asyncio
3
- import certifi
4
  import httpx
5
  import json
6
  import pprint
7
- import ssl
8
  import urllib
9
 
10
  from chathub_request_constructor import ChathubRequestConstructor
11
- from cookies_constructor import CookiesConstructor
12
 
13
- ssl_context = ssl.create_default_context()
14
- ssl_context.load_verify_locations(certifi.where())
15
 
16
- http_proxy = "http://localhost:11111"
17
 
18
 
19
  class ConversationCreator:
@@ -81,7 +76,6 @@ class ConversationChatter:
81
  "Origin": "https://www.bing.com",
82
  "Pragma": "no-cache",
83
  "Sec-Websocket-Extensions": "permessage-deflate; client_max_window_bits",
84
- # "Sec-Websocket-Key": "**********************==",
85
  "Sec-Websocket-Version": "13",
86
  "Upgrade": "websocket",
87
  "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36",
@@ -89,7 +83,6 @@ class ConversationChatter:
89
  wss = await self.aio_session.ws_connect(
90
  self.ws_url,
91
  headers=request_headers,
92
- ssl=ssl_context,
93
  proxy=http_proxy,
94
  )
95
 
 
1
  import aiohttp
2
  import asyncio
 
3
  import httpx
4
  import json
5
  import pprint
 
6
  import urllib
7
 
8
  from chathub_request_constructor import ChathubRequestConstructor
 
9
 
 
 
10
 
11
+ http_proxy = "http://localhost:11111" # Replace with yours
12
 
13
 
14
  class ConversationCreator:
 
76
  "Origin": "https://www.bing.com",
77
  "Pragma": "no-cache",
78
  "Sec-Websocket-Extensions": "permessage-deflate; client_max_window_bits",
 
79
  "Sec-Websocket-Version": "13",
80
  "Upgrade": "websocket",
81
  "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36",
 
83
  wss = await self.aio_session.ws_connect(
84
  self.ws_url,
85
  headers=request_headers,
 
86
  proxy=http_proxy,
87
  )
88
 
cookies_constructor.py CHANGED
@@ -1,7 +1,6 @@
1
  class CookiesConstructor:
2
  def __init__(self) -> None:
3
- self.cookies_list = [
4
- ]
5
 
6
  def construct(self):
7
  self.cookies = {}
 
1
  class CookiesConstructor:
2
  def __init__(self) -> None:
3
+ self.cookies_list = [] # Dumped from Cookie-Editor extension in Browser
 
4
 
5
  def construct(self):
6
  self.cookies = {}