opencoconut / coconutjs Goto Github PK
View Code? Open in Web Editor NEWNodeJS client Library for encoding Videos with Coconut
Home Page: https://coconut.co
NodeJS client Library for encoding Videos with Coconut
Home Page: https://coconut.co
Methods:
coconut.Metadata.retrieve()
coconut.Job.retrieve()
When using an unknown/invalid job ID causes the following error.
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at IncomingMessage.<anonymous> (/node_modules/coconutjs/api.js:35:29)
at IncomingMessage.emit (events.js:194:15)
at endReadableNT (_stream_readable.js:1125:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
I would expect the callback to be invoked with an error and not simply blowup.
"coconutjs": "^3.0.0"
At the moment the only way to stop this is to try/catch which feels wrong since the callback flow should be able handle this. Nothing seems to stop it ๐ข
Hello can you guys please add typescript and esm support?
In api.js you're building the url path using the path library. This is an issue because it was meant for file system paths.
The resulting path on a unix machine is:
https:/api.coconut.co/v2/jobs
which kinda works since https.request
is smart enough to not have issue with only one /
at https.
BUT, on Windows the result is:
https:\\api.coconut.co\\v2\\jobs
this doesn't work, https.request
sees this invalid url and tries it's best to convert it and it ends up being https://api.coconut.co//v2/jobs
. Now the server since it receives this invalid url it responds with 400 Bad Request.
A good fix would be to use something like the URL
object to build the URL or somethign else.
Warning
path is only meant for filesystem paths.
Is there a way to get the current conversion progress ?
Events ?
Cheers Marc
Last commit was months ago and there is some outstanding issues that aren't acknowledged.
@brunoceleste how to pass watermark can u show my an example?
Hi, in line 48, on the req.on('error')
function handler. Could you please return an error?
req.on('error', function(e) {
console.log('problem with request: ' + e.message);
if(callback) {
callback(null);
}
});
This could return callback(e, null)
or an object Job with the error code and messages like {status: 'error', error_code: e.code, error_message: e.message}
That way the code in the readme page which has the would always work with a proper return
var coconut = require('coconutjs');
coconut.createJob({
'api_key': 'k-api-key',
'conf': 'coconut.conf',
'source': 'https://s3-eu-west-1.amazonaws.com/files.coconut.co/test.mp4',
'vars': {'vid': 1234}
}, function(job) {
if(job.status == 'ok') {
console.log(job.id);
} else {
console.log(job.error_code);
console.log(job.error_message);
}
});
Thanking you in advance
I get the following error.
Is there a solution?
TypeErrorCannot read property 'request' of undefined
at null.null (/opt/ee/node_modules/coconutjs/job.js:15:28)
at null.Promise (null:null:null)
at Function.create (/opt/ee/node_modules/coconutjs/job.js:14:14)
at Object.module.exports (/steps/nodejs.js:23:34)
at MessagePort.messageHandler (/opt/nodejs/node_modules/@pipedreamhq/execution-environment/launch_worker.js:427:41)
at MessagePort.[nodejs.internal.kHybridDispatch] (internal/event_target.js:354:41)
at MessagePort.exports.emitMessage (internal/per_context/messageport.js:18:26)
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.