def METHOD_NAME(self, spl_url, video):
    for ext, pref, streams in (
            ('ts', -1, video.get('http_stream', {}).get('qualities', {})),
            ('mp4', 1, video.get('mp4'))):
        for format_id, stream in streams.items():
            if not stream.get('url'):
                continue
            yield merge_dicts({
                'format_id': '-'.join((format_id, ext)),
                'ext': ext,
                'source_preference': pref,
                'url': urljoin(spl_url, stream['url']),
                'tbr': float_or_none(stream.get('bandwidth'), scale=1000),
                'duration': float_or_none(stream.get('duration'), scale=1000),
                'width': stream.get('resolution', 2 * [0])[0] or None,
                'height': stream.get('resolution', 2 * [0])[1] or int_or_none(format_id.replace('p', '')),
            }, parse_codecs(stream.get('codec')))