Skip to content

Instantly share code, notes, and snippets.

@games647
Created September 7, 2016 07:37
Show Gist options
  • Save games647/a1fb286c79a3f0ef9785c708129f31c5 to your computer and use it in GitHub Desktop.
Save games647/a1fb286c79a3f0ef9785c708129f31c5 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
from pysimplesoap.client import SoapClient
location = 'http://fritz.box:49000/igdupnp/control/WANCommonIFC1'
namespace = 'urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1'
action = 'urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1#'
debug = False # display http/soap requests and responses
client = SoapClient(location, action, namespace, trace=debug)
response = client.GetCommonLinkProperties()
upspeed = int(response.GetCommonLinkPropertiesResponse.NewLayer1UpstreamMaxBitRate)
downspeed = int(response.GetCommonLinkPropertiesResponse.NewLayer1DownstreamMaxBitRate)
response2 = client.GetAddonInfos()
newbytesendrate = int(response2.GetAddonInfosResponse.NewByteSendRate)
newbytereceiverate = int(response2.GetAddonInfosResponse.NewByteReceiveRate)
print(upspeed, downspeed, newbytesendrate, newbytereceiverate)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment