在批量应用程序中选择对google api进行身份验证

发布于 12-01 07:06 字数 892 浏览 4 评论 0原文

在查看针对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文