Python中文
首页
教程
问答
标签
搜索
登录
注册
在Python中使用googlepicasaapi
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我已经成功地使用了谷歌的PicasaAPI从过去的6个月左右。 今天我开始出错了</p> <pre><code> raise GooglePhotosException(e.args[0]) GooglePhotosException: (403, 'Forbidden', 'Authorization required') </code></pre> <p>我检查了我的证件。在</p> ^{pr2}$ <p>从昨天开始一切都很顺利。有人有线索吗?在</p> <h2>编辑</h2> <p>关于python的<code>Picasa</code>的示例也不起作用。 <a href="https://developers.google.com/picasa-web/docs/1.0/developers_guide_python#Example" rel="nofollow">URL</a></p> <pre><code>#!/usr/bin/python2.5 import gdata.photos.service import gdata.media import gdata.geo gd_client = gdata.photos.service.PhotosService() gd_client.email = '=change=' # Set your Picasaweb e-mail address... gd_client.password = '=change=' # ... and password gd_client.source = 'api-sample-google-com' gd_client.ProgrammaticLogin() albums = gd_client.GetUserFeed() for album in albums.entry: print 'Album: %s (%s)' % (album.title.text, album.numphotos.text) photos = gd_client.GetFeed('/data/feed/api/user/default/albumid/%s?kind=photo' % (album.gphoto_id.text)) for photo in photos.entry: print ' Photo:', photo.title.text tags = gd_client.GetFeed('/data/feed/api/user/default/albumid/%s/photoid/%s?kind=tag' % (album.gphoto_id.text, photo.gphoto_id.text)) for tag in tags.entry: print ' Tag:', tag.title.text comments = gd_client.GetFeed('/data/feed/api/user/default/albumid/%s/photoid/%s?kind=comment' % (album.gphoto_id.text, photo.gphoto_id.text)) for comment in comments.entry: print ' Comment:', comment.content.text </code></pre> <h2>编辑2</h2> <p>完全回溯</p> <pre><code>Traceback (most recent call last): File "/Users/mac/Picasa_API.py", line 158, in <module> check_api() File "/Users/mac/Picasa_API.py", line 140, in check_api albums = gd_client.GetUserFeed() File "/Users/mac/destipak/env/lib/python2.7/site-packages/gdata/photos/service.py", line 235, in GetUserFeed return self.GetFeed(uri, limit=limit) File "/Users/mac/destipak/env/lib/python2.7/site-packages/gdata/photos/service.py", line 180, in GetFeed raise GooglePhotosException(e.args[0]) gdata.photos.service.GooglePhotosException: (403, 'Forbidden', 'Authorization required') </code></pre>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>我也碰到过这个。电子邮件/密码验证似乎已关闭,我们需要切换到OAuth2。看到了吗 <a href="https://groups.google.com/forum/#!topic/Google-Picasa-Data-API/4meiAJ40l3E" rel="nofollow">https://groups.google.com/forum/#!topic/Google-Picasa-Data-API/4meiAJ40l3E</a></p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何添加虚拟方法
6 回答
如何添加表示整数的擦边字符串?
9 回答
如何添加要在Bokeh中使用的新font.ttf文件?
1 回答
如何添加要显示的矩阵XY轴编号和XY轴
10 回答
如何添加计数?
9 回答
如何添加计数器函数?
9 回答
如何添加计数器列来计算数据帧中另一列中的特定值?
5 回答
如何添加计数器来跟踪while循环中的月份和年份?
9 回答
如何添加计数并删除countplot的顶部和右侧脊椎?
7 回答
如何添加计时器wx.应用程序更新窗口对象的主循环?
9 回答
如何添加评论到帖子?PostDetailVew,Django 2.1.5
2 回答
如何添加评论拉梅尔亚姆
6 回答
如何添加诸如矩阵Python/Pandas之类的数据帧?
4 回答
如何添加谷歌地点自动完成到Flask?
3 回答
如何添加超时、python discord bot
6 回答
如何添加超过1dp的检查
8 回答
如何添加距离方法
5 回答
如何添加跟随游戏的敌人精灵
1 回答
如何添加路径以便python可以找到程序?
8 回答
如何添加身份验证/安全性以使用happybase访问HBase?
3 回答