无法从网址获得正确的回复

我正在使用库“请求”从url('http://any_login:any_password@10.10.9.2/ISAPI/Streaming/channels/101/picture?snapShotImageType=JPEG')获取图像,但是响应错误,代码为401。那是我的rtsp摄像机的url。

我尝试使用“ HTTPBasicAuth”,“ HTTPDigestAuth”和“ HTTPProxyAuth”。但这不起作用。

import requests
from requests.auth import HTTPBasicAuth

url = "http://any_login:any_password@10.10.9.2/ISAPI/Streaming/channels/101/picture?snapShotImageType=JPEG"
response = requests.get(url,auth=requests.auth.HTTPBasicAuth("any_login","any_password"))

if response.status_code == 200:
    with open("sample.jpg",'wb') as f:
        f.write(response.content)

我期望从rtsp流输出图像文件,但是我得到了错误代码401。

thinkphilo 回答:无法从网址获得正确的回复

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3166435.html

大家都在问