Пример #1
0
    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
Пример #2
0
 def setUp(self):
     self.buffer = Buffer()
Пример #3
0
 def __init__(self, iterator):
     self.iterator = iterator
     self.buffer = Buffer()