orgrimarr / node-wetransfert Goto Github PK
View Code? Open in Web Editor NEWDownload wetransfert content with nodeJS
Download wetransfert content with nodeJS
Line https://github.com/orgrimarr/node-wetransfert/blob/master/utils/utils.js#L46
"url is not defined".
It should be urlObj.href
instead of url
Tracking issue for:
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!
Hello,
I got this error. Was working well until today. Maybe a wetransfer update. Do you have an idea ?
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' },
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);
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
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!
email request body payload change
[]filenames => []files
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
}
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.
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?
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.