0

如果这是我的图片网址:https ://static.www.nfl.com/image/private/h_100,f_auto,q_auto,c_fill,g_auto/league/jccqiejlzdigw2zwxx2n

我之前在以下代码中从 http 而非服务器的 url 下载了图像,但不知道如何从cloudinary下载图像。

 var imageURL = "http://www.nfl.com/static/content/public/static/img/fantasy/transparent/512x512/";
 var imageName =  imageURL + playerID + ".png";
 var localFileImage = playerID + ".png";
 var fileRepository = "/01 feedRepository/IMAGE_FILES/";
 var playerName = playerLastName + "_" + playerFirstName;

 getJSONFile(imageName, fileRepository);
 ...

我试过这个,它可以在终端上工作,但不能在 AE 上工作:

app.system.callSystem("curl -o ~/Desktop/OLU474619.png https://static.www.nfl.com/image/private/h_100,f_auto,q_auto,c_fill,g_auto/league/jccqiejlzdigw2zwxx2n.png");
4

2 回答 2

0

您只需在 URL 中添加 fl_attachment 即可下载图片:https ://static.www.nfl.com/image/private/h_100,f_auto,q_auto,c_fill,g_auto,fl_attachment/league/jccqiejlzdigw2zwxx2n

如果以编程方式进行,则在转换中将其作为标志(“附件”)传递。对于您的情况,第一个选项应该可以。

于 2020-07-29T19:34:24.263 回答
0

我意识到 app.system.callSystem() 确实有效,但没有应用程序。

所以它看起来像这样:

system.callSystem("curl -o ~/Desktop/OLU474619.png https://static.www.nfl.com/image/private/h_100,f_auto,q_auto,c_fill,g_auto/league/jccqiejlzdigw2zwxx2n.png");

这使我可以简单地将 cloudinary 图像下载到特定目录。

于 2020-07-29T20:36:55.783 回答