diff options
| author | Sergey M․ <dstftw@gmail.com> | 2015-04-11 18:52:41 +0600 | 
|---|---|---|
| committer | Sergey M․ <dstftw@gmail.com> | 2015-04-11 18:52:41 +0600 | 
| commit | 65939effb55087f584ecd5d4b304eadbdef875d1 (patch) | |
| tree | f87ceed46d2d5a6264286a0d8ed4534765abb5c8 | |
| parent | 66ee7b3234482ddcb24849d3ab64db382fff5bfd (diff) | |
[hitbox:live] Fix hls extration (Closes #5315)
| -rw-r--r-- | youtube_dl/extractor/hitbox.py | 24 | 
1 files changed, 20 insertions, 4 deletions
diff --git a/youtube_dl/extractor/hitbox.py b/youtube_dl/extractor/hitbox.py index 84bd7c080..d606429ca 100644 --- a/youtube_dl/extractor/hitbox.py +++ b/youtube_dl/extractor/hitbox.py @@ -10,6 +10,7 @@ from ..utils import (      float_or_none,      int_or_none,      compat_str, +    determine_ext,  ) @@ -147,12 +148,27 @@ class HitboxLiveIE(HitboxIE):                  servers.append(base_url)                  for stream in cdn.get('bitrates'):                      label = stream.get('label') -                    if label != 'Auto': +                    if label == 'Auto': +                        continue +                    stream_url = stream.get('url') +                    if not stream_url: +                        continue +                    bitrate = int_or_none(stream.get('bitrate')) +                    if stream.get('provider') == 'hls' or determine_ext(stream_url) == 'm3u8': +                        if not stream_url.startswith('http'): +                            continue                          formats.append({ -                            'url': '%s/%s' % (base_url, stream.get('url')), +                            'url': stream_url,                              'ext': 'mp4', -                            'vbr': stream.get('bitrate'), -                            'resolution': label, +                            'tbr': bitrate, +                            'format_note': label, +                            'rtmp_live': True, +                        }) +                    else: +                        formats.append({ +                            'url': '%s/%s' % (base_url, stream_url), +                            'ext': 'mp4', +                            'tbr': bitrate,                              'rtmp_live': True,                              'format_note': host,                              'page_url': url,  | 
