projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6f41b2b
)
[extractor/common] Improve name extraction for m3u8 formats
author
Sergey M․
<dstftw@gmail.com>
Sat, 14 May 2016 21:34:35 +0000
(
03:34
+0600)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 14 May 2016 21:34:35 +0000
(
03:34
+0600)
youtube_dl/extractor/common.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/common.py
b/youtube_dl/extractor/common.py
index 0843d89af71f7b68f6b650c01a3f8edcffdc78b3..8a8c07226868abb79fb5fa51666507d7da5a81e8 100644
(file)
--- a/
youtube_dl/extractor/common.py
+++ b/
youtube_dl/extractor/common.py
@@
-1139,11
+1139,14
@@
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
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
+ # Despite specification does not mention NAME attribute for
+ # EXT-X-STREAM-INF it still sometimes may be present
+ stream_name = last_info.get('NAME') or last_media_name
# Bandwidth of live streams may differ over time thus making
# format_id unpredictable. So it's better to keep provided
# format_id intact.
if not live:
# Bandwidth of live streams may differ over time thus making
# format_id unpredictable. So it's better to keep provided
# format_id intact.
if not live:
- format_id.append(
last_media_name if last_media
_name else '%d' % (tbr if tbr else len(formats)))
+ format_id.append(
stream_name if stream
_name else '%d' % (tbr if tbr else len(formats)))
f = {
'format_id': '-'.join(format_id),
'url': format_url(line.strip()),
f = {
'format_id': '-'.join(format_id),
'url': format_url(line.strip()),