:param filename: str of the file name to stream the data to
        :return: None

def stream_to_file(self, filename):
        """
        :param filename: str of the file name to stream the data to
        :return: None
        """
        stream_size = 0
        try:
            partial_chunk = ''
            chunk_size = 1024
            m3u8_dir = None
            if filename[-5:].lower() == '.m3u8':
                self.repeat_needed = True
                m3u8_dir = self.get_ts_folder(filename)

            self.content_length = self.response.headers.get('Content-Length',
                                                            None)
            if not self.content_length:
                self.content_length = self.response.headers.get(
                    'x-een-svc-renderer-file-size', None)

            with open(filename, 'a') as fn:
                stream_size = self.download_chunks(
                    chunk_size, fn, m3u8_dir, partial_chunk, stream_size)
        except ZeroReturnError as e:
            pass
        except Exception as e:
            self._timestamps.setdefault('exception', time.time())
            self.error = ApiError(
                "Failed to Stream Data to file:%s" % filename,
                status_code=self.status_code,
                status_description=str(e),
                url=self.response.url)
            raise Exception(self.error)

        self.raw_data = self.data = self.filename + ' size = ' + str(
            self.content_length)
        self.content_length = self.content_length or stream_size