diff options
author | shirt <2660574+shirt-dev@users.noreply.github.com> | 2021-03-12 23:46:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-13 10:16:58 +0530 |
commit | 4cf1e5d2f9a145de9749e90a1d244350c82ef610 (patch) | |
tree | 93d59b346da0b2882057a8c4ea1ec8dc0b34b158 /yt_dlp/downloader/external.py | |
parent | 0a473f2f0fd2629f009edb8bf127c4eed1738bf6 (diff) | |
download | hypervideo-pre-4cf1e5d2f9a145de9749e90a1d244350c82ef610.tar.lz hypervideo-pre-4cf1e5d2f9a145de9749e90a1d244350c82ef610.tar.xz hypervideo-pre-4cf1e5d2f9a145de9749e90a1d244350c82ef610.zip |
Native concurrent downloading of fragments (#166)
* Option `--concurrent-fragments` (`-N`) to set the number of threads
Related: #165
Known issues:
* When receiving Ctrl+C, the process will exit only after finishing the currently downloading fragments
* The download progress shows the speed of only one thread
Authored by shirt-dev
Diffstat (limited to 'yt_dlp/downloader/external.py')
-rw-r--r-- | yt_dlp/downloader/external.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/yt_dlp/downloader/external.py b/yt_dlp/downloader/external.py index c315deb2e..7c2d56d9c 100644 --- a/yt_dlp/downloader/external.py +++ b/yt_dlp/downloader/external.py @@ -126,7 +126,7 @@ class ExternalFD(FileDownloader): file_list = [] dest, _ = sanitize_open(tmpfilename, 'wb') for i, fragment in enumerate(info_dict['fragments']): - file = '%s_%s.frag' % (tmpfilename, i) + file = '%s-Frag%d' % (tmpfilename, i) decrypt_info = fragment.get('decrypt_info') src, _ = sanitize_open(file, 'rb') if decrypt_info: @@ -274,7 +274,7 @@ class Aria2cFD(ExternalFD): url_list_file = '%s.frag.urls' % tmpfilename url_list = [] for i, fragment in enumerate(info_dict['fragments']): - tmpsegmentname = '%s_%s.frag' % (os.path.basename(tmpfilename), i) + tmpsegmentname = '%s-Frag%d' % (os.path.basename(tmpfilename), i) url_list.append('%s\n\tout=%s' % (fragment['url'], tmpsegmentname)) stream, _ = sanitize_open(url_list_file, 'wb') stream.write('\n'.join(url_list).encode('utf-8')) |