简体   繁体   English

无法使用使用Google协议缓冲区的python应用程序

[英]Can't use a python application, which uses the google protocol buffer

I am trying to use an application I found on GitHub which records live updates for public transport positions, see the following link to the instructions and application: 我正在尝试使用在GitHub上找到的应用程序,该应用程序记录公共交通工具位置的实时更新,请参阅以下指向说明和应用程序的链接:

https://github.com/mattwigway/gtfsrdb https://github.com/mattwigway/gtfsrdb

When I modify the terminal commands to: 当我将终端命令修改为:

python gtfsrdb.py run -p https://gtfsrt.api.translink.com.au/Feed/SEQ.pb -d sqlite:///test.db -c

I get the following error: 我收到以下错误:

Exception occurred in iteration
(<class 'google.protobuf.message.DecodeError'>, 
DecodeError('Unexpected end-group tag.',), 
<traceback object at 0x107d21248>)

How do I get this application to record the live feeds from https://gtfsrt.api.translink.com.au 如何获取此应用程序以记录来自https://gtfsrt.api.translink.com.au的实时提要

You used the URL: 您使用了URL:

https://gtfsrt.api.translink.com.au/Feed/SEQ.pb

This URL doesn't exist -- it returns 404. You can see this by opening it in your browser. 该URL不存在-返回404。您可以通过在浏览器中打开它来查看。 The script you are running is probably trying to parse the 404 page HTML as a protobuf, which of course fails. 您正在运行的脚本可能正在尝试将404页HTML解析为protobuf,这当然会失败。

Perhaps you meant this url: 也许您的意思是这个网址:

https://gtfsrt.api.translink.com.au/Feed/SEQ

Note the lack of .pb at the end. 请注意,末尾缺少.pb I haven't tried gtfsrdb.py myself, but this URL appears on the site you linked and appears to return protobuf data. 我自己没有尝试过gtfsrdb.py ,但是此URL出现在您链接的站点上,并且似乎返回了protobuf数据。

This error appeared for me due to authentication errors. 由于身份验证错误,此错误对我显示。 Once I fixed this, the error went away. 一旦我解决了这个问题,错误就消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM