在批量应用程序中选择对google api进行身份验证
在查看针对 Google Data API(使用 Picasa 网络相册)进行身份验证的选项时,我获得了此处提到的选项: http://code.google.com/apis/accounts/docs/GettingStarted.html
但是,我正在使用的应用程序是批处理应用程序(批量上传照片),并且这些似乎都适合具有用户交互的应用程序(即,它们似乎仅限于通过重定向到网页)。
同样,在多次上传后,服务器 API 会提示验证码确认,并阻止进一步上传,直到获得确认为止。
我是否只是遇到了为了保护他们的带宽而施加的限制?
更新
这是执行插入的代码;为每个工作线程创建 com.google.gdata.client.photos.PicasawebService 的新实例。工作线程池限制为大约 10-20 个线程,每个线程被分配上传单个图像(或创建相册):
PicasawebService service = new PicasawebService(Constants.APPLICATION_AGENT);
try {
service.setUserCredentials(
credentials.username(),
credentials.password()
);
} catch (com.google.gdata.util.AuthenticationException e) {
throw new AuthenticationException(e);
}
In reviewing my options for authenticating against the Google Data API (using the Picasa Web Albums), I'm provided the options noted here:
http://code.google.com/apis/accounts/docs/GettingStarted.html
However, the application I'm working with is a batch application (bulk upload of photos), and these all seem geared toward applications with user-interactions (i.e. it seems they're restricted to obtaining a user's password via a redirect to a web page).
As well, after multiple uploads the server API prompts for a captcha confirmation, and blocks further upload until that is obtained.
Am I simply running up against imposed restrictions to protect their bandwidth?
Update
Here's the code that is doing the insert; a new instance of com.google.gdata.client.photos.PicasawebService is created for each worker thread. The pool of worker threads is constrained to about 10-20 threads, and each thread is assigned to upload a single image (or create an album):
PicasawebService service = new PicasawebService(Constants.APPLICATION_AGENT);
try {
service.setUserCredentials(
credentials.username(),
credentials.password()
);
} catch (com.google.gdata.util.AuthenticationException e) {
throw new AuthenticationException(e);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

你试过这个吗? http://code.google.com/apis/gdata/docs/batch .html#Batch_API
Have you tried this? http://code.google.com/apis/gdata/docs/batch.html#Batch_API