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