Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling a cURL #237

Open
crunchyfx opened this issue May 4, 2019 · 3 comments
Open

Calling a cURL #237

crunchyfx opened this issue May 4, 2019 · 3 comments

Comments

@crunchyfx
Copy link

Hi

I have released a plugin using Gumroads licensing system. https://help.gumroad.com/article/76-license-keys

I have done that using the extendscript:
system.callSystem('curl https://api.gumroad.com/v2/licenses/verify -d "product_permalink=xxxxxxxxxx" -d "license_key='+licensekey+'" -X POST');

This works for me and for the majority of the users. But a few people get this error: "After Effects warning. ERROR: The system can not find the file specified"

Because of that error I am now trying to call the curl with node js instead. I have enabled it in the manifest and I have tried this:

var exec = require('child_process').exec;
exec('curl https://api.gumroad.com/v2/licenses/verify -d "product_permalink=XXXXXXX" -d "license_key=XXXXXXXXXXXXX" -X POST', {encoding: 'UTF-8'}, function(err, stdout, stderr){alert(stderr)});

That gives me this error: 'curl' is not recognized as an internal or external command, operable program or batch file.

Can anybody help to the best way of calling the cURL from a CEP panel?

Thanks,
Jakob Wagner

@crunchyfx
Copy link
Author

OK. I found the problem. Curl is only available on Windows 10 17063 and above.
I would still love to hear if there is an alternative way of calling a curl from a CEP panel without using the system command.

@sean256
Copy link

sean256 commented Jun 13, 2019

CEP runs in a chrome window. Can't you just use the http features available to you from there? I personally use axios for making http calls.

@pralay03
Copy link

Maybe I am too late. But may help others.

Enable node in the manifest file. And in Javascript, you need to use :

var exec = cep_node.require("child_process").exec;

Try doing like this:

var exec = cep_node.require("child_process").exec;

exec('curl https://api.gumroad.com/v2/licenses/verify -d "product_permalink=XXXXXXX" -d "license_key=XXXXXXXXXXXXX" -X POST', {encoding: 'UTF-8'}, function(err, stdout, stderr){console.dir(stdout});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants