iamleot / transferwee

Download/upload files via wetransfer.com
155 stars 38 forks source link

Too many blocks too quickly (too many files) #76

Open antoinedelplace opened 11 months ago

antoinedelplace commented 11 months ago

It seems there is a problem if too many files are sent at the same time. Maybe a well positioned time.sleep could solve this problem.

Checking for no duplicate filenames
Preparing to upload
Could not find any csrf-token
From storm_upload_token WETRANSFER_STORM_PREFLIGHT URL is: https://storm-us-east-1.wetransfer.net/api/v2/batch/preflight
From storm_upload_token WETRANSFER_STORM_BLOCK URL is: https://storm-us-east-1.wetransfer.net/api/v2/blocks
From storm_upload_token WETRANSFER_STORM_BLOCK URL is: https://storm-us-east-1.wetransfer.net/api/v2/batch
Get transfer id eac9fe195aa5***0231128094504
Doing preflight storm
Preparing storm block upload

Traceback (most recent call last):
  File "/upload_wetransfer.py", line 18, in upload_wetransfer
    url = upload(files)
          ^^^^^^^^^^^^^
  File "/transferwee/transferwee.py", line 588, in upload
    for f, b in zip(files, blocks["data"]["blocks"]):
                           ~~~~~~^^^^^^^^
KeyError: 'data'

The request is sending this response :

>>> print(blocks)
>>> {'ok': False, 'error': {'client_action_required': False, 'error_code': 'TOO_MANY_REQUESTS', 'message': 'You are creating too many blocks too quickly, please try again after waiting for a little bit.'}}

I am trying to send 636 files at the same time.

antoinedelplace commented 11 months ago

Note : trying to zip all the files and sending a unique file triggers another error.

https://github.com/iamleot/transferwee/pull/72#issuecomment-1829521651

sharevb commented 11 months ago

Adapted to #72