projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
66ee7b3
)
[hitbox:live] Fix hls extration (Closes #5315)
author
Sergey M․
<dstftw@gmail.com>
Sat, 11 Apr 2015 12:52:41 +0000
(18:52 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 11 Apr 2015 12:52:41 +0000
(18:52 +0600)
youtube_dl/extractor/hitbox.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/hitbox.py
b/youtube_dl/extractor/hitbox.py
index 84bd7c0804eb2966c7062288a1a190c8509f62fc..d606429ca88a51138f3108594e7933f74638de34 100644
(file)
--- 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,
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')
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({
formats.append({
- 'url':
'%s/%s' % (base_url, stream.get('url'))
,
+ 'url':
stream_url
,
'ext': 'mp4',
'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,
'rtmp_live': True,
'format_note': host,
'page_url': url,