def open(self): self.guid = cache_bust_string(12) self.islive = None self.sessionid = None self.flv = None self.buffer = Buffer() self.completed_handshake = False url = self.StreamURLFormat.format(host=self.host, streamname=self.streamname) params = self._create_params(seek=self.seek) log.debug(f"Opening host={self.host} streamname={self.streamname}") try: res = self.session.http.get(url, stream=True, params=params) self.fd = StreamIOIterWrapper(res.iter_content(8192)) except Exception as err: raise StreamError(str(err)) self.handshake(self.fd) return self
def setUp(self): self.buffer = Buffer()
def __init__(self, iterator): self.iterator = iterator self.buffer = Buffer()