AmmeySaini / Chegg-Answer-Bot

You can share your Chegg account for answers using this bot with your friends without getting your account blocked/flagged
MIT License
50 stars 29 forks source link

How do I solve this problem? list index out of range #26

Open TH3CZAR opened 2 years ago

TH3CZAR commented 2 years ago

Screenshot_20220701_135231_org telegram plus

AdithyahNair commented 1 year ago

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.

ritik5555 commented 1 year ago

@AdithyahNair bro can you create this bot again?

AdithyahNair commented 1 year ago

@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.

rkofficial5555 commented 1 year ago

@AdithyahNair bro after running setup.py nothing shows up in terminal

techoutlook commented 1 year ago

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 bot.polling() File "C:\Python311\Lib\site-packages\telebot__init.py", line 1040, in polling logger.info('Starting your bot with username: [@%s]', self.user.username) ^^^^^^^^^ File "C:\Python311\Lib\site-packages\telebot\init.py", line 273, in user self._user = self.get_me() ^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\telebot\init__.py", line 1236, in get_me result = apihelper.get_me(self.token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\telebot\apihelper.py", line 196, in get_me return _make_request(token, method_url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\telebot\apihelper.py", line 156, in _make_request result = _get_req_session().request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\requests\adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: 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)"))

techoutlook commented 1 year ago

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