lzzy12 / python-aria-mirror-bot

A telegram bot for all your mirror needs | OG Repo
https://t.me/pythonmirrorsupport
GNU General Public License v3.0
737 stars 1.3k forks source link

MEGA downloading still does not work? #244

Closed srijansaxena11 closed 3 years ago

srijansaxena11 commented 3 years ago

Hi. Does the MEGA mirroring still not work? PFA.

2021/08/02 13:29:41 No mega.nz api key provided, exiting.
2021-08-02 13:29:44,204 - bot - INFO - Mega API KEY provided but credentials not provided. Starting meg                                                                                                                                      a in anonymous mode!
2021-08-02 13:29:46,594 - pyrogram.crypto.aes - INFO - Using TgCrypto
2021-08-02 13:29:48,671 - bot - INFO - Bot Started!
2021-08-02 13:30:08,906 - bot - INFO - https://mega.nz/file/YCx3gKAB#VhBeP0fUXFYkLfJfP-VSc3QyV4cXsF_fFd                                                                                                                                      H419jphNc
2021-08-02 13:30:08,907 - bot - INFO - https://mega.nz/file/YCx3gKAB#VhBeP0fUXFYkLfJfP-VSc3QyV4cXsF_fFd                                                                                                                                      H419jphNc: No Direct link function found for https://mega.nz/file/YCx3gKAB#VhBeP0fUXFYkLfJfP-VSc3QyV4cX                                                                                                                                      sF_fFdH419jphNc
2021-08-02 13:30:08,912 - telegram.utils.promise - ERROR - An uncaught error was raised while running t                                                                                                                                      he promise
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 169, in _new_conn
    conn = connection.create_connection(
  File "/usr/local/lib/python3.8/dist-packages/urllib3/util/connection.py", line 96, in create_connecti                                                                                                                                      on
    raise err
  File "/usr/local/lib/python3.8/dist-packages/urllib3/util/connection.py", line 86, in create_connecti                                                                                                                                      on
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/lib/python3.8/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1007, in _send_output
    self.send(msg)
  File "/usr/lib/python3.8/http/client.py", line 947, in send
    self.connect()
  File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 200, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 181, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f751bcf3070>: Fa                                                                                                                                      iled to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.8/dist-packages/urllib3/util/retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=6090): Max retries exceeded                                                                                                                                       with url: /adddl (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f751bc                                                                                                                                      f3070>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/telegram/utils/promise.py", line 57, in run
    self._result = self.pooled_function(*self.args, **self.kwargs)
  File "/usr/src/app/bot/modules/mirror.py", line 231, in mirror
    _mirror(context.bot, update)
  File "/usr/src/app/bot/modules/mirror.py", line 221, in _mirror
    mega_dl.add_download(link, f'{DOWNLOAD_DIR}{listener.uid}/')
  File "/usr/src/app/bot/helper/mirror_utils/download_utils/mega_download.py", line 98, in add_download
    dl = self.__mega_client.addDl(link, path)
  File "/usr/local/lib/python3.8/dist-packages/megasdkrestclient/client.py", line 19, in addDl
    res = self.session.post(constructUrl(self.base_endpoint, RoutePath.PATH_ADD_DL), data={
  File "/usr/local/lib/python3.8/dist-packages/requests/sessions.py", line 590, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/dist-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=6090): Max retries excee                                                                                                                                      ded with url: /adddl (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f75                                                                                                                                      1bcf3070>: Failed to establish a new connection: [Errno 111] Connection refused'))
lzzy12 commented 3 years ago

Use docker if you're not using it. Mega is working fine

srijansaxena11 commented 3 years ago

Use docker if you're not using it. Mega is working fine

Hi. I am using docker. I followed all the steps from Readme. Am I still missing something somehow? Can you please help me to diagnose?

lzzy12 commented 3 years ago

Can you try mirroring it after a minute the bot starts?

srijansaxena11 commented 3 years ago

Can you try mirroring it after a minute the bot starts?

Yes I tried waiting also. I just ran mirroring right now. Still Same.

image

Do I have to use mega credentials too apart from the mega api key? It was mentioned as optional so I left them.

lzzy12 commented 3 years ago

Try stoping it and starting it again. This error means the mega server we are using isn't started.. I'm not sure why that would happen

srijansaxena11 commented 3 years ago

Started docker:

image

Waiting a few minutes... Mirroring:

image

Same error. One thing more. This time I provided my mega credentials. But it still says credentials not provided.

lzzy12 commented 3 years ago

Same error. One thing more. This time I provided my mega credentials. But it still says credentials not provided.

What config variable did you use ? And Are you on the latest master branch?

srijansaxena11 commented 3 years ago

What config variable did you use ? And Are you on the latest master branch?

For mega credentials I used:

image

from config.env file

I am using this from readme: git clone https://github.com/lzzy12/python-aria-mirror-bot mirror-bot/

lzzy12 commented 3 years ago

Can you try cloning the master branch of the repo again? This is weird

srijansaxena11 commented 3 years ago

Can you try cloning the master branch of the repo again? This is weird

I am creating a new VM to test again from scratch. Will report in like 5 minutes.

srijansaxena11 commented 3 years ago

Can you try cloning the master branch of the repo again? This is weird

It started working. LOL. sorry for disturbing you man.

image

Thanks for the support. Is there a donation link somewhere I can use to support?

lzzy12 commented 3 years ago

Thanks for the support. Is there a donation link somewhere I can use to support?

You can use UPI: jhashivam2020-2@oksbi

lzzy12 commented 3 years ago

Thanks for your generous support.

srijansaxena11 commented 3 years ago

Thanks for your generous support.

Most welcome. Keep up the good work.