Closed Karmel0x closed 2 years ago
I don't have time for that now. If someone have time I recommend doing the following steps:
I'll probably only have time for it in two weeks or more.
I checked megatools out of curiosity: looks like either it does not have this issue or, it it have, it was not been handled yet. Neither the GitHub issue tracker nor the mail archive show reports of this issue. The the commit history don't show recent changes on uploading.
In the other hand the code that handles uploading handles an upload checksum which is something not implemented at the moment. This checksum is quite easy to implement so I suggest someone to try implementing it and checking if it solves this issue. Update this file to something like this:
const sendChunk = () => {
const chunkPosition = position
const chunkBuffer = uploadBuffer
let tries = 0
const checksum = Buffer.alloc(12)
for (let i = 0; i < chunkBuffer.length; i++) {
checksum[i % 12] ^= chunkBuffer[i]
}
const trySendChunk = () => {
tries++
this.api.fetch(uploadURL + '/' + (type === 0 ? chunkPosition : (type - 1) + '?c=' + e64(checksum)), {
method: 'POST',
body: chunkBuffer,
headers: {
'content-length': chunkBuffer.length
}
/* ... */
Oh, forget all the above! For some reason I missed the "without encryption" part of the entire question!
I noticed it too: https://github.com/qgustavor/mega/discussions/108 I will close this issue in favor of that discussion.
Describe the bug
To Reproduce
Expected behavior Upload file
Additional context Probably some changes on MEGA endpoint. I was using older version of this library and it was working some time ago but it has stopped working. On latest version not working too.