python实现onvif协议-2
2016-01-02 21:25
465 查看
from suds.client import Client
from suds.wsse import Security
from suds_passworddigest.token import UsernameDigestToken
url = 'file:///home/aphero/python/wsdl/media.wsdl'
xadd='http://1.1.1.1/onvif/Media'
client=Client(url,location=xadd)
security = Security()
token = UsernameDigestToken("admin", "12345")
security.tokens.append(token)
client.set_options(wsse=security)
profiles=client.service.GetProfiles()
for profile in profiles:
print profile._token,profile.Name
param={"StreamSetup":profile.Name,"ProfileToken":profile._token}
MediaUri=client.service.GetStreamUri(param)
print MediaUri.Uri
from suds.wsse import Security
from suds_passworddigest.token import UsernameDigestToken
url = 'file:///home/aphero/python/wsdl/media.wsdl'
xadd='http://1.1.1.1/onvif/Media'
client=Client(url,location=xadd)
security = Security()
token = UsernameDigestToken("admin", "12345")
security.tokens.append(token)
client.set_options(wsse=security)
profiles=client.service.GetProfiles()
for profile in profiles:
print profile._token,profile.Name
param={"StreamSetup":profile.Name,"ProfileToken":profile._token}
MediaUri=client.service.GetStreamUri(param)
print MediaUri.Uri
相关文章推荐
- 欢迎使用CSDN-markdown编辑器
- Python比较for循环、列表解析、迭代器、map之间运算时间关系
- Python的栈
- 为Eclipse安装Python开发插件
- leetcode之Spiral Matrix II
- python基础-面向对象
- Pyhton 2.5 高级特性
- Python3 字典使用上的一个小细节
- python爬取豆瓣电影信息
- Python解析配置文件模块:ConfigPhaser
- Tkinter 8.5 参考手册: a GUI for Python (四)
- Tkinter 8.5 参考手册: a GUI for Python (三)
- Tkinter 8.5 参考手册: a GUI for Python (二)
- Tkinter 8.5 参考手册: a GUI for Python(一)
- leetcode之Spiral Matrix
- Python中ConfigParser模块应用
- Tkinter 8.5 参考手册: a GUI for Python (五)11 窗口的名称
- Tkinter 8.5 参考手册: a GUI for Python (五)9图像
- Tkinter 8.5 参考手册: a GUI for Python (五)8(鼠标)指针
- Tkinter 8.5 参考手册: a GUI for Python (五)6