Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecursionError on some links #3

Open
shalak opened this issue Sep 2, 2024 · 2 comments
Open

RecursionError on some links #3

shalak opened this issue Sep 2, 2024 · 2 comments

Comments

@shalak
Copy link

shalak commented Sep 2, 2024

  File "/root/bin/chomyk.py", line 226, in dl_step_2
    self.postData(dts)
  File "/root/bin/chomyk.py", line 140, in postData
    self.parseResponse(response.content)
  File "/root/bin/chomyk.py", line 325, in parseResponse
    self.dl_step_2(idx, agreementInfo,cost)
  File "/root/bin/chomyk.py", line 226, in dl_step_2
    self.postData(dts)
  File "/root/bin/chomyk.py", line 140, in postData
    self.parseResponse(response.content)
  File "/root/bin/chomyk.py", line 325, in parseResponse
    self.dl_step_2(idx, agreementInfo,cost)
  File "/root/bin/chomyk.py", line 226, in dl_step_2
    self.postData(dts)
  File "/root/bin/chomyk.py", line 139, in postData
    response = requests.post(url, data=body, headers=headers)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests/api.py", line 115, in post
    return request("post", url, data=data, json=json, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 489, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 704, in urlopen
    httplib_response = self._make_request(
                       ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 399, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 239, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/lib/python3.11/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.11/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 205, in connect
    conn = self._new_conn()
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 73, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 964, in getaddrinfo
    addrlist.append((_intenum_converter(af, AddressFamily),
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 105, in _intenum_converter
    return enum_klass(value)
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/enum.py", line 717, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/enum.py", line 1106, in __new__
    return cls._value2member_map_[value]
           ^^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded while calling a Python object

This happens when I provide URL to the folder, as well as an URL for a file in a folder.

Folder in question is 67GB, 843 files in it.

Any idea how to solve, or work around this? This is first time I'm getting this error.

@shalak
Copy link
Author

shalak commented Sep 2, 2024

I believe this happens because there's an additional prompt when downloading from this folder:

Właściciel chomika pozwolił pobierać pliki z tego folderu na koszt jego transferu (nawet bez logowania do portalu).
image

I guess the script doesn't handle this case?

@shalak
Copy link
Author

shalak commented Sep 2, 2024

I found a workaround: instead of downloading directly, we must add it to our own "Chomik" (i.e. use the "Zachomikuj" feature), then use the link from our folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant