projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fbf56be
)
[downloader/fragment] use the documented names for fragment progress_hooks fields
author
Remita Amine
<remitamine@gmail.com>
Sat, 22 Apr 2017 15:42:24 +0000
(16:42 +0100)
committer
Remita Amine
<remitamine@gmail.com>
Sat, 22 Apr 2017 15:42:24 +0000
(16:42 +0100)
youtube_dl/downloader/dash.py
patch
|
blob
|
history
youtube_dl/downloader/f4m.py
patch
|
blob
|
history
youtube_dl/downloader/fragment.py
patch
|
blob
|
history
youtube_dl/downloader/hls.py
patch
|
blob
|
history
youtube_dl/downloader/ism.py
patch
|
blob
|
history
diff --git
a/youtube_dl/downloader/dash.py
b/youtube_dl/downloader/dash.py
index 94a13a5433b7f948623e6a3bc3ccf2dd490b5bba..7491fdad857af2f36433b8991b6208fbd9cef99e 100644
(file)
--- a/
youtube_dl/downloader/dash.py
+++ b/
youtube_dl/downloader/dash.py
@@
-28,7
+28,7
@@
class DashSegmentsFD(FragmentFD):
frag_index = 0
for i, segment in enumerate(segments):
frag_index += 1
frag_index = 0
for i, segment in enumerate(segments):
frag_index += 1
- if frag_index <= ctx['frag_index']:
+ if frag_index <= ctx['frag
ment
_index']:
continue
# In DASH, the first segment contains necessary headers to
# generate a valid MP4 file, so always abort for the first segment
continue
# In DASH, the first segment contains necessary headers to
# generate a valid MP4 file, so always abort for the first segment
diff --git
a/youtube_dl/downloader/f4m.py
b/youtube_dl/downloader/f4m.py
index e456ed58f6928837fc88e430c4334e227f8529e3..c8fde9a89093393132262f7b7d5ec60d83de4b8d 100644
(file)
--- a/
youtube_dl/downloader/f4m.py
+++ b/
youtube_dl/downloader/f4m.py
@@
-376,7
+376,7
@@
class F4mFD(FragmentFD):
while fragments_list:
seg_i, frag_i = fragments_list.pop(0)
frag_index += 1
while fragments_list:
seg_i, frag_i = fragments_list.pop(0)
frag_index += 1
- if frag_index <= ctx['frag_index']:
+ if frag_index <= ctx['frag
ment
_index']:
continue
name = 'Seg%d-Frag%d' % (seg_i, frag_i)
query = []
continue
name = 'Seg%d-Frag%d' % (seg_i, frag_i)
query = []
diff --git
a/youtube_dl/downloader/fragment.py
b/youtube_dl/downloader/fragment.py
index 80bb14d61bc2d1413281dcecf2b10df2cbc9fa52..6c02cfc98204a7dcfe79540ec92060ee274e5501 100644
(file)
--- a/
youtube_dl/downloader/fragment.py
+++ b/
youtube_dl/downloader/fragment.py
@@
-66,7
+66,9
@@
class FragmentFD(FileDownloader):
if not (ctx.get('live') or ctx['tmpfilename'] == '-'):
frag_index_stream, _ = sanitize_open(self.ytdl_filename(ctx['filename']), 'w')
frag_index_stream.write(json.dumps({
if not (ctx.get('live') or ctx['tmpfilename'] == '-'):
frag_index_stream, _ = sanitize_open(self.ytdl_filename(ctx['filename']), 'w')
frag_index_stream.write(json.dumps({
- 'frag_index': ctx['frag_index']
+ 'download': {
+ 'last_fragment_index': ctx['fragment_index']
+ },
}))
frag_index_stream.close()
}))
frag_index_stream.close()
@@
-100,7
+102,7
@@
class FragmentFD(FileDownloader):
ytdl_filename = encodeFilename(self.ytdl_filename(ctx['filename']))
if os.path.isfile(ytdl_filename):
frag_index_stream, _ = sanitize_open(ytdl_filename, 'r')
ytdl_filename = encodeFilename(self.ytdl_filename(ctx['filename']))
if os.path.isfile(ytdl_filename):
frag_index_stream, _ = sanitize_open(ytdl_filename, 'r')
- frag_index = json.loads(frag_index_stream.read())['
frag
_index']
+ frag_index = json.loads(frag_index_stream.read())['
download']['last_fragment
_index']
frag_index_stream.close()
dest_stream, tmpfilename = sanitize_open(tmpfilename, open_mode)
frag_index_stream.close()
dest_stream, tmpfilename = sanitize_open(tmpfilename, open_mode)
@@
-108,7
+110,7
@@
class FragmentFD(FileDownloader):
'dl': dl,
'dest_stream': dest_stream,
'tmpfilename': tmpfilename,
'dl': dl,
'dest_stream': dest_stream,
'tmpfilename': tmpfilename,
- 'frag_index': frag_index,
+ 'frag
ment
_index': frag_index,
# Total complete fragments downloaded so far in bytes
'complete_frags_downloaded_bytes': resume_len,
})
# Total complete fragments downloaded so far in bytes
'complete_frags_downloaded_bytes': resume_len,
})
@@
-120,8
+122,8
@@
class FragmentFD(FileDownloader):
state = {
'status': 'downloading',
'downloaded_bytes': ctx['complete_frags_downloaded_bytes'],
state = {
'status': 'downloading',
'downloaded_bytes': ctx['complete_frags_downloaded_bytes'],
- 'frag
_index': ctx['frag
_index'],
- 'frag_count': total_frags,
+ 'frag
ment_index': ctx['fragment
_index'],
+ 'frag
ment
_count': total_frags,
'filename': ctx['filename'],
'tmpfilename': ctx['tmpfilename'],
}
'filename': ctx['filename'],
'tmpfilename': ctx['tmpfilename'],
}
@@
-144,12
+146,12
@@
class FragmentFD(FileDownloader):
if not ctx['live']:
estimated_size = (
(ctx['complete_frags_downloaded_bytes'] + frag_total_bytes) /
if not ctx['live']:
estimated_size = (
(ctx['complete_frags_downloaded_bytes'] + frag_total_bytes) /
- (state['frag_index'] + 1) * total_frags)
+ (state['frag
ment
_index'] + 1) * total_frags)
state['total_bytes_estimate'] = estimated_size
if s['status'] == 'finished':
state['total_bytes_estimate'] = estimated_size
if s['status'] == 'finished':
- state['frag_index'] += 1
- ctx['frag
_index'] = state['frag
_index']
+ state['frag
ment
_index'] += 1
+ ctx['frag
ment_index'] = state['fragment
_index']
state['downloaded_bytes'] += frag_total_bytes - ctx['prev_frag_downloaded_bytes']
ctx['complete_frags_downloaded_bytes'] = state['downloaded_bytes']
ctx['prev_frag_downloaded_bytes'] = 0
state['downloaded_bytes'] += frag_total_bytes - ctx['prev_frag_downloaded_bytes']
ctx['complete_frags_downloaded_bytes'] = state['downloaded_bytes']
ctx['prev_frag_downloaded_bytes'] = 0
diff --git
a/youtube_dl/downloader/hls.py
b/youtube_dl/downloader/hls.py
index 9a87d7ca8983a03cc608b9d19b2712f0f93ce6c4..0e29c8a2ad2559737d8c0210e9c6784310616ec6 100644
(file)
--- a/
youtube_dl/downloader/hls.py
+++ b/
youtube_dl/downloader/hls.py
@@
-106,7
+106,7
@@
class HlsFD(FragmentFD):
if line:
if not line.startswith('#'):
frag_index += 1
if line:
if not line.startswith('#'):
frag_index += 1
- if frag_index <= ctx['frag_index']:
+ if frag_index <= ctx['frag
ment
_index']:
continue
frag_url = (
line
continue
frag_url = (
line
diff --git
a/youtube_dl/downloader/ism.py
b/youtube_dl/downloader/ism.py
index 9f0fc36b394a910ad6b31eb21ad638af46808938..338820e71cf1aa956cddfc4d978d64f07e9ba2fe 100644
(file)
--- a/
youtube_dl/downloader/ism.py
+++ b/
youtube_dl/downloader/ism.py
@@
-227,7
+227,7
@@
class IsmFD(FragmentFD):
frag_index = 0
for i, segment in enumerate(segments):
frag_index += 1
frag_index = 0
for i, segment in enumerate(segments):
frag_index += 1
- if frag_index <= ctx['frag_index']:
+ if frag_index <= ctx['frag
ment
_index']:
continue
count = 0
while count <= fragment_retries:
continue
count = 0
while count <= fragment_retries: