def fromUPNP(cls, timeout=5): reLOC = re.compile('http://(?P<ip>[0-9\.]+):(?P<port>[0-9]+)/.*') msearch = MSearch() for res in msearch.searchMythFE(timeout): ip, port = reLOC.match(res['location']).group(1,2) port = 6546 yield cls(ip, port)
def fromUPNP(cls, timeout=5): reLOC = re.compile('http://(?P<ip>[0-9\.]+):(?P<port>[0-9]+)/.*') msearch = MSearch() for res in msearch.searchMythFE(timeout): ip, port = reLOC.match(res['location']).group(1, 2) port = 6546 try: yield cls(ip, port) except MythFEError: pass
def fromUPNP(cls, timeout=5.0): reLOC = re.compile('http://(?P<ip>[0-9\.]+):(?P<port>[0-9]+)/.*') msearch = MSearch() for res in msearch.searchMythBE(timeout): ip, port = reLOC.match(res['location']).group(1, 2) yield cls(ip, port)