aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/downloader/fragment.py
diff options
context:
space:
mode:
authorMMM <flashdagger@googlemail.com>2022-06-07 14:44:08 +0200
committerGitHub <noreply@github.com>2022-06-07 05:44:08 -0700
commit36195c4461701ffe4245b126a222b784c7abd1ea (patch)
treef37305feda7c6e1078fe30e7b7fecbf3411b1db7 /yt_dlp/downloader/fragment.py
parent65141660aba62fefb1901804aeb0484992243af7 (diff)
[dash] Show fragment count with `--live-from-start` (#3493)
Authored by: flashdagger
Diffstat (limited to 'yt_dlp/downloader/fragment.py')
-rw-r--r--yt_dlp/downloader/fragment.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/yt_dlp/downloader/fragment.py b/yt_dlp/downloader/fragment.py
index d94cb4956..79161b809 100644
--- a/yt_dlp/downloader/fragment.py
+++ b/yt_dlp/downloader/fragment.py
@@ -242,6 +242,9 @@ class FragmentFD(FileDownloader):
if s['status'] not in ('downloading', 'finished'):
return
+ if not total_frags and ctx.get('fragment_count'):
+ state['fragment_count'] = ctx['fragment_count']
+
if ctx_id is not None and s.get('ctx_id') != ctx_id:
return
@@ -450,6 +453,7 @@ class FragmentFD(FileDownloader):
fatal, count = is_fatal(fragment.get('index') or (frag_index - 1)), 0
while count <= fragment_retries:
try:
+ ctx['fragment_count'] = fragment.get('fragment_count')
if self._download_fragment(ctx, fragment['url'], info_dict, headers):
break
return