def open(self, url, options=None): PlayerSource.open(self, url, options) if url.startswith("mythstreamer://"): url = "http://" + url[len("mythstreamer://"):] d = urlparse.urlparse(url) params = {} for k, v in parse_qsl(d.query): t = params.setdefault(k, []) t.append(v) self.host = d.hostname try: self.control = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.control.settimeout(self.timeout) self.control.connect((d.hostname, d.port)) except Exception, e: self.close() msg = "Could not connect to GMythStreamer at %s:%s: %s" % \ (d.hostname, d.port, e) self._log_and_raise(msg) return False