无法从Python中的地图服务获取图像

时间:2015-08-27 21:30:14

标签: python google-maps python-3.x

我尝试用python获取地图服务的图像。 Google静态地图和mapquestapi.com无效。当我尝试从其他服务器检索静态图像时,一切正常,但在地图服务中,我收到此错误:

ERROR handlers: message: plugins.xxx._scan_for_triggers : coroutine
Traceback (most recent call last):
File "/xxx/handlers.py", line xxx, in run_pluggable_omnibus
yield from function(*_passed)
File "/xxx/plugins/xxx.py", line 54, in _scan_for_triggers
img_id = yield from xxx._client.upload_image(img_data, filename=filename)
File "/usr/local/lib/python3.4/site-packages/xxx/client.py", line 472, in upload_image
upload_url = (json.loads(res1.body.decode())['sessionStatus']
KeyError: 'sessionStatus'

这里是代码:

r = yield from aiohttp.request('get', img_link)
raw = yield from r.read()
img_data = io.BytesIO(raw)
filename = "xxx"
img_id = yield from xxx._client.upload_image(img_data, filename=filename)

0 个答案:

没有答案