projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
41bf647
)
[extractor/common] Add durations for DASH fragments with bare SegmentURLs
author
Sergey M․
<dstftw@gmail.com>
Sat, 2 Dec 2017 14:10:35 +0000
(21:10 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 2 Dec 2017 14:21:01 +0000
(21:21 +0700)
youtube_dl/extractor/common.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/common.py
b/youtube_dl/extractor/common.py
index 15999411ba2e20bd48c6c2c0eaa3d60832e73bf4..3baf683d861111f2ee945282672921c9205274c7 100644
(file)
--- a/
youtube_dl/extractor/common.py
+++ b/
youtube_dl/extractor/common.py
@@
-1979,10
+1979,16
@@
class InfoExtractor(object):
# Segment URLs with no SegmentTimeline
# Example: https://www.seznam.cz/zpravy/clanek/cesko-zasahne-vitr-o-sile-vichrice-muze-byt-i-zivotu-nebezpecny-39091
fragments = []
# Segment URLs with no SegmentTimeline
# Example: https://www.seznam.cz/zpravy/clanek/cesko-zasahne-vitr-o-sile-vichrice-muze-byt-i-zivotu-nebezpecny-39091
fragments = []
+ segment_duration = float_or_none(
+ representation_ms_info['segment_duration'],
+ representation_ms_info['timescale']) if 'segment_duration' in representation_ms_info else None
for segment_url in representation_ms_info['segment_urls']:
for segment_url in representation_ms_info['segment_urls']:
- fragment
s.append(
{
+ fragment
=
{
location_key(segment_url): segment_url,
location_key(segment_url): segment_url,
- })
+ }
+ if segment_duration:
+ fragment['duration'] = segment_duration
+ fragments.append(fragment)
representation_ms_info['fragments'] = fragments
# NB: MPD manifest may contain direct URLs to unfragmented media.
# No fragments key is present in this case.
representation_ms_info['fragments'] = fragments
# NB: MPD manifest may contain direct URLs to unfragmented media.
# No fragments key is present in this case.