Giter VIP home page Giter VIP logo

node-wetransfert's People

Contributors

agustim avatar cylwin avatar dependabot[bot] avatar doblev55 avatar orgrimarr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-wetransfert's Issues

Bug when uploading files bigger than 10 Mb

Hi, I was using wetransfert to upload somes files and I got an issue where files with an approximate size of 10 Mb's or bigger, don't upload to WeTransfer.
I'm using this module on a Electron project and when I open DevTools I see the error below multiple times:

Uncaught (in promise) TypeError: Cannot read property 'destroy' of null
    at ReadStream.<anonymous> (VM358 C:\Path\To\Project\node_modules\wetransfert\handler\upload.js:393)
    at ReadStream.emit (VM14 events.js:315)
    at addChunk (VM79 readable.js:309)
    at readableAddChunk (VM79 readable.js:284)
    at ReadStream.Readable.push (VM79 readable.js:223)
    at VM92 streams.js:226
    at FSReqCallback.wrapper [as oncomplete] (VM45 fs.js:539)

I hope you can fix this problem!

Error : 'not found'

Hi there, this error is always returned when I run test.js which is located in the wetransfert package. Does it have something to do with the weTransfert module? Can you please help? Thank you :)

ERROR { StatusCodeError: 404 - {"status":"404","error":"Not Found"}
at new StatusCodeError (C:\Users\lyes.khellaf\Desktop\Delair\node_modules\request-promise-core\lib\errors.js:32:15)
at Request.plumbing.callback (C:\Users\lyes.khellaf\Desktop\Delair\node_modules\request-promise-core\lib\plumbing.js:104:33)
at Request.RP$callback [as _callback] (C:\Users\lyes.khellaf\Desktop\Delair\node_modules\request-promise-core\lib\plumbing.js:46:31)
at Request.self.callback (C:\Users\lyes.khellaf\Desktop\Delair\node_modules\request\request.js:185:22)
at Request.emit (events.js:182:13)
at Request. (C:\Users\lyes.khellaf\Desktop\Delair\node_modules\request\request.js:1157:10)
at Request.emit (events.js:182:13)
at IncomingMessage. (C:\Users\lyes.khellaf\Desktop\Delair\node_modules\request\request.js:1079:12)
at Object.onceWrapper (events.js:273:13)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1086:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
name: 'StatusCodeError',
statusCode: 404,
message: '404 - {"status":"404","error":"Not Found"}',
error: { status: '404', error: 'Not Found' },

Upload : server respond with status 417 Expectation Failed

Hello! I'm trying to initiate a simple upload and getting the following error:

Info: Start process (10:32:52 PM)
Error: 
ERROR Error: Error GET https://wetransfer.com/api/v4/auth/session server respond with status 417 Expectation Failed. ["message", "CSRF token was invalid"]
    at Object.exports.login (c:\maher_scripts\weTransfer\node_modules\wetransfert\utils\utils.js:192:15)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Error: 
ERROR Error: Error GET https://wetransfer.com/api/v4/auth/session server respond with status 417 Expectation Failed. ["message", "CSRF token was invalid"]
    at Object.exports.login (c:\maher_scripts\weTransfer\node_modules\wetransfert\utils\utils.js:192:15)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Info: End process (10:33:02 PM)

here's my code with my private data replaced:

const { upload } = require('wetransfert');
const myUpload = upload('[email protected]', ['[email protected]'], ['C:/example/example.txt'], 'Hello World', 'en', '[email protected]', 'myPassword')
.on('progress', (progress) => console.log('PROGRESS', progress))
.on('end', (end) => console.log('END', end))
.on('error', (error) => console.error('ERROR', error));

setTimeout(function(){
    myUpload.cancel();
}, 10000);

403 with long urls

Hey, nice project there !

If I use a not shortened-url, copied from the receiver mailbox, I get the error :

403 - {"message":"No download access to this Transfer"}

Format of the URL :

https://wetransfer.com/downloads/0123456789abcdef0123456789abcdef0123456789abcd/0123456789abcdef0123456789abcdef0123456789abcd/012345

of with a company account :

https://mycompany.wetransfer.com/downloads/0123456789abcdef0123456789abcdef0123456789abcd/0123456789abcdef0123456789abcdef0123456789abcd/012345

Some url not down

Hello,
I was use wetransfert to download file from url. But, there are some urls cant download. Url is public, I can download when access url on browser
url subdomain.wetransfer.com/downloads/...

Error: Unhanle url: undefined
    at getInfo (C:\xampp\htdocs\epp-system-node\node_modules\wetransfert\handler\getInfo.js:95:15)
    at C:\xampp\htdocs\epp-system-node\node_modules\wetransfert\handler\download.js:21:45
    at C:\xampp\htdocs\epp-system-node\node_modules\wetransfert\utils\PProgress.js:79:4
    at new Promise (<anonymous>)
    at new PProgress (C:\xampp\htdocs\epp-system-node\node_modules\wetransfert\utils\PProgress.js:78:3)
    at exports.download (C:\xampp\htdocs\epp-system-node\node_modules\wetransfert\handler\download.js:16:12)
    at C:\xampp\htdocs\epp-system-node\schedules\jobNew.js:52:5
    at new Promise (<anonymous>)
    at downloadfile (C:\xampp\htdocs\epp-system-node\schedules\jobNew.js:51:9)
    at handleJob (C:\xampp\htdocs\epp-system-node\schedules\jobNew.js:43:13)
    at async C:\xampp\htdocs\epp-system-node\schedules\jobNew.js:20:9

I hope you can fix this problem!

trim undefined

utils/utils.js:176
from:
const csrf = $("meta[name=csrf-token]").attr('content').trim()
to:
const csrf = $("meta[name=csrf-token]").attr('content')//.trim()
Now csrf value is undefined and works well.

The 'content' attribute doesn't exist anymore, maybe wetransfer remove it. I removed it to test it out, and it works perfectly well.

return {
        htmlPage,
        sessionCookie,
        csrf // being undefined it's okay
    }

Issue when passing Base64 encoded file string

When passing a Base64 string into the file path argument, the node module throws an error, I understand my hypothesis was absurd however I was hoping it would be possible. I would like to request this feature (uploading base64 strings) in the near future. Apart from this issue, you have done a marvellous job at creating this module.

upload is not a function

When I try to upload a file I get this error:

 TypeError: upload is not a function
     at Object.<anonymous> (/Users/DrBrains/Desktop/wetrans.js:2:18)
     at Module._compile (module.js:635:30)
     at Object.Module._extensions..js (module.js:646:10)
     at Module.load (module.js:554:32)
     at tryModuleLoad (module.js:497:12)
     at Function.Module._load (module.js:489:3)
     at Function.Module.runMain (module.js:676:10)
     at startup (bootstrap_node.js:187:16)
     at bootstrap_node.js:608:3

I used the example script and edited the file names and email adresses to my own:

const { upload, download, getInfo,  isValidWetransfertUrl  } = require('wetransfert');
const myUpload = upload('[email protected]', ['[email protected]'], ['/Users/DrBrains/Desktop/testfile.indd'], 'Uploadscript Test', 'en')
  .on('progress', (progress) => console.log('PROGRESS', progress))
  .on('end', (end) => console.log('END', end))
  .on('error', (error) => console.error('ERROR', error));

  setTimeout(function(){
      myUpload.cancel();
  }, 10000);

I just run it with node wetrans.js
Pretty new to all this, what am I doing wrong?

Don't working anymore

Hello,

This time I have no idea where the problem is :

This is a log dump :

DEBUG=wetransfert:* node helpers/wetransfer.js wetransfert:utils wetransfer API version: v4 +0ms wetransfert:utils isValidWetransfertUrl: true +79ms wetransfert:getinfos URLObject URL { href: 'https://wetransfer.com/downloads/068f46823c14ad9c3b5ef39d0f01f90120210504211103/7924157e91f9eff675d18ac63fcc23b820210504211117/ecbda7', origin: 'https://wetransfer.com', protocol: 'https:', username: '', password: '', host: 'wetransfer.com', hostname: 'wetransfer.com', port: '', pathname: '/downloads/068f46823c14ad9c3b5ef39d0f01f90120210504211103/7924157e91f9eff675d18ac63fcc23b820210504211117/ecbda7', search: '', searchParams: URLSearchParams {}, hash: '' } +0ms wetransfert:utils getContentInfo: GET https://wetransfer.com/downloads/068f46823c14ad9c3b5ef39d0f01f90120210504211103/7924157e91f9eff675d18ac63fcc23b820210504211117/ecbda7 +4ms wetransfert:utils getWetransferPageContent: GET https://wetransfer.com/downloads/068f46823c14ad9c3b5ef39d0f01f90120210504211103/7924157e91f9eff675d18ac63fcc23b820210504211117/ecbda7 +0ms wetransfert:utils getContentInfo: sessionCookie, csrf _wt_session=OEhZWDkydU82UjVPSHBMbXc0V2FrdEJhTEh4UGcxUVVwY2lFT040eFZLM1E0NjBmN1BDRXZJTDZhWmtrZzFmMjNFd0wwamswTGhFMzIyTXl4K1lzejltNnZzd29lZVVDbi9ZTDFyWEJENnlnaStBZ1NyYS9UZHI4RXVYWThMMFFtZ1lLekpDYUVBdGN2eFFhT0dKTDRBPT0tLVNIM201RDhyblNrV1R5Snh0NG9Henc9PQ%3D%3D--240381c1bdad5134da088b4c8a5f9ae6c2e5e0c4; domain=wetransfer.com; path=/; secure; HttpOnly; SameSite=Lax hmQfnD7wM3_3xxdGkE-aEHN8mBUhj2nZC9OxiZ4DihsDIXAQbIEuYKdcNF86pxzU4_EGjFXraYqg48eYGd4g0A +525ms wetransfert:getinfos security { sessionCookie: '_wt_session=OEhZWDkydU82UjVPSHBMbXc0V2FrdEJhTEh4UGcxUVVwY2lFT040eFZLM1E0NjBmN1BDRXZJTDZhWmtrZzFmMjNFd0wwamswTGhFMzIyTXl4K1lzejltNnZzd29lZVVDbi9ZTDFyWEJENnlnaStBZ1NyYS9UZHI4RXVYWThMMFFtZ1lLekpDYUVBdGN2eFFhT0dKTDRBPT0tLVNIM201RDhyblNrV1R5Snh0NG9Henc9PQ%3D%3D--240381c1bdad5134da088b4c8a5f9ae6c2e5e0c4; domain=wetransfer.com; path=/; secure; HttpOnly; SameSite=Lax', csrf: 'hmQfnD7wM3_3xxdGkE-aEHN8mBUhj2nZC9OxiZ4DihsDIXAQbIEuYKdcNF86pxzU4_EGjFXraYqg48eYGd4g0A' } +528ms wetransfert:utils formatDownloadApiUri: normal_url +0ms wetransfert:getinfos infos { message: 'No download access to this Transfer' } +302ms

Do you have an idea ? I can work on a PR

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.