diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2016-04-29 19:26:39 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2016-04-29 19:26:39 +0800 |
commit | 151d98130ba29ac7f242c67772d95842317fbe5e (patch) | |
tree | 28a0840745280afd4c2a67c5bb5b4d3e838cdd4c /youtube_dl/extractor/common.py | |
parent | 14638e291511c3305b70dce64e9bd97686e9da93 (diff) | |
parent | b24d6336a797b99339c12a0aa1b431755e22e8cf (diff) |
Merge branch 'vlive-hls' of https://github.com/Kagami/youtube-dl into Kagami-vlive-hls
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r-- | youtube_dl/extractor/common.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index a285ee7d8..2763d2ffe 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -1061,7 +1061,7 @@ class InfoExtractor(object): def _extract_m3u8_formats(self, m3u8_url, video_id, ext=None, entry_protocol='m3u8', preference=None, m3u8_id=None, note=None, errnote=None, - fatal=True): + fatal=True, live=False): formats = [{ 'format_id': '-'.join(filter(None, [m3u8_id, 'meta'])), @@ -1139,7 +1139,11 @@ class InfoExtractor(object): if m3u8_id: format_id.append(m3u8_id) last_media_name = last_media.get('NAME') if last_media and last_media.get('TYPE') != 'SUBTITLES' else None - format_id.append(last_media_name if last_media_name else '%d' % (tbr if tbr else len(formats))) + # Bandwidth of live streams may differ over time thus making + # format_id unpredictable. So it's better to keep provided + # format_id intact. + if last_media_name and not live: + format_id.append(last_media_name if last_media_name else '%d' % (tbr if tbr else len(formats))) f = { 'format_id': '-'.join(format_id), 'url': format_url(line.strip()), |