Chegg-Answer-Bot
Chegg-Answer-Bot copied to clipboard
How do I solve this problem? list index out of range
Problem is with the 153rd line in helper.py This one. q_id = js['props']['pageProps']['questionData']['uuid']
It is trying to fetch the uuid of the question but the JSON structuring has been changed by chegg also this bot came out 2 years back.
@AdithyahNair bro can you create this bot again?
@ritik5555 I have created a pull request with the fix.
Please let me know if the fix worked out for you or not. Also put channel ID as 1 or 0. I worked very hard in debugging the error and fixing it.
@AdithyahNair bro after running setup.py nothing shows up in terminal
setup is successfully completed but when i run python3 bot.py the following error is showing
Traceback (most recent call last): File "C:\Python311\Lib\site-packages\urllib3\connection.py", line 203, in _new_conn sock = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\urllib3\util\connection.py", line 60, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\socket.py", line 962, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ socket.gaierror: [Errno 11001] getaddrinfo failed
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "C:\Python311\Lib\site-packages\urllib3\connectionpool.py", line 790, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\urllib3\connectionpool.py", line 491, in _make_request raise new_e File "C:\Python311\Lib\site-packages\urllib3\connectionpool.py", line 467, in _make_request self._validate_conn(conn) File "C:\Python311\Lib\site-packages\urllib3\connectionpool.py", line 1092, in _validate_conn conn.connect() File "C:\Python311\Lib\site-packages\urllib3\connection.py", line 611, in connect self.sock = sock = self._new_conn() ^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\urllib3\connection.py", line 210, in _new_conn raise NameResolutionError(self.host, self, e) from e urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x0000026B17696750>: Failed to resolve 'api.telegram.org' ([Errno 11001] getaddrinfo failed)
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "C:\Python311\Lib\site-packages\requests\adapters.py", line 486, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\urllib3\connectionpool.py", line 844, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\urllib3\util\retry.py", line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot6415696156:AAFsJlS7ibMGa6Hnfvl6IM09cnc5fYoUDCg/getMe (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x0000026B17696750>: Failed to resolve 'api.telegram.org' ([Errno 11001] getaddrinfo failed)"))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\laksh\OneDrive\Desktop\Chegg Bot\bot.py", line 29, in
The above problem is solved but when i run setup.py nothing shows in terminal i thought that code running well when i run setup.py
and tried sending the links to bot but bot is not reponding