1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-04 12:04:46 -04:00

Improve HLS/DASH external downloader code (#162)

Authored by: shirt
This commit is contained in:
shirt-dev
2021-03-10 09:39:40 -05:00
committed by GitHub
parent 54759df586
commit d7009caa03
4 changed files with 34 additions and 32 deletions

View File

@@ -37,7 +37,7 @@ class DashSegmentsFD(FragmentFD):
fragment_retries = self.params.get('fragment_retries', 0)
skip_unavailable_fragments = self.params.get('skip_unavailable_fragments', True)
fragment_urls = []
fragments = []
frag_index = 0
for i, fragment in enumerate(fragments):
frag_index += 1
@@ -49,7 +49,9 @@ class DashSegmentsFD(FragmentFD):
fragment_url = urljoin(fragment_base_url, fragment['path'])
if real_downloader:
fragment_urls.append(fragment_url)
fragments.append({
'url': fragment_url,
})
continue
# In DASH, the first segment contains necessary headers to
@@ -90,7 +92,7 @@ class DashSegmentsFD(FragmentFD):
if real_downloader:
info_copy = info_dict.copy()
info_copy['url_list'] = fragment_urls
info_copy['fragments'] = fragments
fd = real_downloader(self.ydl, self.params)
# TODO: Make progress updates work without hooking twice
# for ph in self._progress_hooks: