[英]Python check status of URL stream
I'm trying to use python to check if a MJPEG stream url is alive or not. 我正在尝试使用python检查MJPEG流url是否存在。
I've tried the following: 我尝试了以下方法:
connection = urlopen('http://localhost/videostream.cgi'), timeout=10)
response = connection.getcode()
connection.close()
With no luck, it just times out of gives an error. 没有运气,它只是超时给出一个错误。
If I view the status in a firebug or chrome dev toolbar, the status is always "Pending" instead of "200". 如果我在Firebug或chrome dev工具栏中查看状态,则状态始终为“待处理”,而不是“ 200”。
Is there a way to check to make sure it's not a 404 or other error? 有没有一种方法可以检查它是否不是404或其他错误?
Cheers, Ben 干杯本
原来是我的相机Web服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.